summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xorg/tests/randr/Makefile11
-rw-r--r--xorg/tests/randr/trandr.c60
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