Various uninteresting changes to the test programs.
authorMikael Magnusson <mikachu@comhem.se>
Mon, 23 Jul 2007 23:49:23 +0000 (01:49 +0200)
committerMikael Magnusson <mikachu@comhem.se>
Wed, 16 Jan 2008 06:19:59 +0000 (07:19 +0100)
render/test.c
tests/icons.c
tests/showhide.c
tests/urgent.c

index 307e2629838fc52f7d4ce90030e8ec1e70963b4e..b0840b751b47a93be6a06fb653a3125e224ba199 100644 (file)
@@ -67,9 +67,9 @@ gint main()
     inst = RrInstanceNew(ob_display, ob_screen);
 
     look = RrAppearanceNew(inst, 0);
-    look->surface.grad = RR_SURFACE_PYRAMID;
-    look->surface.secondary = RrColorParse(inst, "Yellow");
-    look->surface.primary = RrColorParse(inst, "Blue");
+    look->surface.grad = RR_SURFACE_MIRROR_HORIZONTAL;
+    look->surface.secondary = RrColorParse(inst, "Dark Orange");
+    look->surface.primary = RrColorParse(inst, "Dark Blue");
     look->surface.interlaced = FALSE;
     if (ob_display == NULL) {
         fprintf(stderr, "couldn't connect to X server :0\n");
@@ -83,6 +83,9 @@ gint main()
         case Expose:
             break;
         case ConfigureNotify:
+            look->surface.grad += 1;
+            if (look->surface.grad > RR_SURFACE_MIRROR_HORIZONTAL)
+                look->surface.grad = RR_SURFACE_SPLIT_VERTICAL;
             RrPaint(look, win,
                     report.xconfigure.width,
                     report.xconfigure.height);
index 315a10fb23d2b1012ffcebff7768838df4c2e0e4..a3aa3da14cb64dbf08e7910b602fe725e192eaba 100644 (file)
@@ -23,6 +23,9 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <assert.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
 
 Window findClient(Display *d, Window win)
 {
@@ -170,6 +173,10 @@ int main(int argc, char **argv)
         XPutImage(d, p, DefaultGC(d, s), i[j], 0, 0, x, 0,
                   i[j]->width, i[j]->height);
         x += i[j]->width;
+        char *filename;
+        asprintf(&filename, "icon%i.raw", j);
+        int fd = open(filename, O_CREAT | O_RDWR);
+        write(fd, i[j]->data, i[j]->width * i[j]->height * i[j]->depth);
         XDestroyImage(i[j]);
     }
 
index d1a63e2fccbe82f891a7fc2d51c691ef3e39dab9..133a89ad3e4180d95d3e72c88f385271c2b133d8 100644 (file)
@@ -46,8 +46,8 @@ int main () {
       XDestroyWindow(display, win);
       XSync(display, False);
 
-      break;
-      sleep(2);
+      //break;
+      usleep(200000);
   }
 
   return 1;
index c29e3005e302e04f7392945637c148774856dfce..37b533ef197b744a243ad5d81cb706282208b28b 100644 (file)
@@ -25,7 +25,6 @@ int main () {
   Display   *display;
   Window     win;
   XEvent     report;
-  Atom       _net_fs, _net_state;
   XEvent     msg;
   int        x=50,y=50,h=100,w=400;
   XWMHints   hint;
@@ -37,9 +36,6 @@ int main () {
     return 0;
   }
 
-  _net_state = XInternAtom(display, "_NET_WM_STATE", False);
-  _net_fs = XInternAtom(display, "_NET_WM_STATE_FULLSCREEN", False);
-
   win = XCreateWindow(display, RootWindow(display, 0),
                      x, y, w, h, 10, CopyFromParent, CopyFromParent,
                      CopyFromParent, 0, NULL);