diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2013-02-17 17:47:24 -0800 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2013-02-17 17:47:24 -0800 |
commit | f8b851855dc4bdcb3ffbbf9274798510cf53513d (patch) | |
tree | d79444533fb4b6ba00cbaceb4b10f7579999b752 /xorg | |
parent | 898b8efdf2b70b424a01554276553f30cba6cc83 (diff) | |
download | xrdp-proprietary-f8b851855dc4bdcb3ffbbf9274798510cf53513d.tar.gz xrdp-proprietary-f8b851855dc4bdcb3ffbbf9274798510cf53513d.zip |
add randr test
Diffstat (limited to 'xorg')
-rw-r--r-- | xorg/tests/randr/Makefile | 11 | ||||
-rw-r--r-- | xorg/tests/randr/trandr.c | 60 |
2 files changed, 71 insertions, 0 deletions
diff --git a/xorg/tests/randr/Makefile b/xorg/tests/randr/Makefile new file mode 100644 index 00000000..add3e04f --- /dev/null +++ b/xorg/tests/randr/Makefile @@ -0,0 +1,11 @@ + +CFLAGS = -Werror -Wall + +all: test-randr + +xdemo: trandr.c + gcc $(CFLAGS) trandr.c -o test-randr -lX11 + +.PHONY clean: + rm -f *.o test-randr + diff --git a/xorg/tests/randr/trandr.c b/xorg/tests/randr/trandr.c new file mode 100644 index 00000000..60eed507 --- /dev/null +++ b/xorg/tests/randr/trandr.c @@ -0,0 +1,60 @@ +/** + * xrdp: A Remote Desktop Protocol server. + * + * Copyright (C) Jay Sorg 2013 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <fcntl.h> +#include <time.h> +#include <stdint.h> +#include <string.h> +#include <sys/types.h> +#include <sys/time.h> +#include <signal.h> +#include <X11/Xlib.h> +#include <X11/Xutil.h> + +Display *g_disp = 0; +Window g_win = 0; +int g_winWidth = 50; +int g_winHeight = 50; + +int +main(int argc, char **argv) +{ + XEvent ev; + int screenNumber; + int white; + int black; + + g_disp = XOpenDisplay(0); + + screenNumber = DefaultScreen(g_disp); + white = WhitePixel(g_disp, screenNumber); + black = BlackPixel(g_disp, screenNumber); + + g_win = XCreateSimpleWindow(g_disp, DefaultRootWindow(g_disp), + 50, 50, g_winWidth, g_winHeight, + 0, black, white); + while (1) + { + XNextEvent(g_disp, &ev) + } + + return 0; +}
\ No newline at end of file |