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@gmail.com>
Sat, 11 Oct 2014 00:17:17 +0000 (02:17 +0200)
obrender/test.c
tests/icons.c
tests/showhide.c
tests/urgent.c

index 7290c22..f8c5bf1 100644 (file)
@@ -67,10 +67,10 @@ gint main()
 
     look = RrAppearanceNew(inst, 0);
     look->surface.grad = RR_SURFACE_MIRROR_HORIZONTAL;
-    look->surface.secondary = RrColorParse(inst, "Yellow");
     look->surface.split_secondary = RrColorParse(inst, "Red");
     look->surface.split_primary = RrColorParse(inst, "Green");
-    look->surface.primary = RrColorParse(inst, "Blue");
+    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");
@@ -96,6 +96,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 e2477c2..dfadefe 100644 (file)
@@ -24,6 +24,9 @@
 #include <stdio.h>
 #include <assert.h>
 #include <glib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
 
 Window findClient(Display *d, Window win)
 {
@@ -236,6 +239,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 d1a63e2..133a89a 100644 (file)
@@ -46,8 +46,8 @@ int main () {
       XDestroyWindow(display, win);
       XSync(display, False);
 
-      break;
-      sleep(2);
+      //break;
+      usleep(200000);
   }
 
   return 1;
index c29e300..37b533e 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);