Various uninteresting changes to the test programs.
[mikachu/openbox.git] / tests / icons.c
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]);
     }