]>
Dogcows Code - chaz/openbox/blob - render/test.c
3 #include <X11/extensions/shape.h>
9 static int x_error_handler(Display
* disp
, XErrorEvent
* error
)
12 XGetErrorText(disp
, error
->error_code
, buf
, 1024);
32 int h
= 500, w
= 500, tmp
;
36 ob_display
= XOpenDisplay(NULL
);
37 XSetErrorHandler(x_error_handler
);
38 ob_screen
= DefaultScreen(ob_display
);
39 ob_root
= RootWindow(ob_display
, ob_screen
);
41 XCreateWindow(ob_display
, RootWindow(ob_display
, 0)
43 CopyFromParent
, /* depth */
44 CopyFromParent
, /* class */
45 CopyFromParent
, /* visual */
48 XMapWindow(ob_display
, win
);
49 XSelectInput(ob_display
, win
, ExposureMask
| StructureNotifyMask
);
50 root
= RootWindow (ob_display
, DefaultScreen (ob_display
));
53 look
= appearance_new(Surface_Planar
, 0);
54 look
->surface
.data
.planar
.grad
= Background_Pyramid
;
55 look
->surface
.data
.planar
.secondary
= color_parse("Yellow");
56 look
->surface
.data
.planar
.primary
= color_parse("Blue");
57 look
->surface
.data
.planar
.interlaced
= FALSE
;
60 look
->area
.width
= 500;
61 look
->area
.height
= 500;
62 if (ob_display
== NULL
) {
63 fprintf(stderr
, "couldn't connect to X server :0\n");
69 XNextEvent(ob_display
, &report
);
70 switch (report
.type
) {
74 look
->area
.width
= report
.xconfigure
.width
;
75 look
->area
.height
= report
.xconfigure
.height
;
This page took 0.034564 seconds and 4 git commands to generate.