]>
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);
31 ob_display
= XOpenDisplay(NULL
);
32 XSetErrorHandler(x_error_handler
);
33 ob_screen
= DefaultScreen(ob_display
);
34 ob_root
= RootWindow(ob_display
, ob_screen
);
36 XCreateWindow(ob_display
, RootWindow(ob_display
, 0),
38 CopyFromParent
, /* depth */
39 CopyFromParent
, /* class */
40 CopyFromParent
, /* visual */
43 XMapWindow(ob_display
, win
);
44 XSelectInput(ob_display
, win
, ExposureMask
| StructureNotifyMask
);
45 root
= RootWindow (ob_display
, DefaultScreen (ob_display
));
46 inst
= RrInstanceNew(ob_display
, ob_screen
);
48 look
= RrAppearanceNew(inst
, 0);
49 look
->surface
.grad
= RR_SURFACE_PYRAMID
;
50 look
->surface
.secondary
= RrColorParse(inst
, "Yellow");
51 look
->surface
.primary
= RrColorParse(inst
, "Blue");
52 look
->surface
.interlaced
= FALSE
;
53 if (ob_display
== NULL
) {
54 fprintf(stderr
, "couldn't connect to X server :0\n");
58 RrPaint(look
, win
, w
, h
);
60 XNextEvent(ob_display
, &report
);
61 switch (report
.type
) {
66 report
.xconfigure
.width
,
67 report
.xconfigure
.height
);
73 RrAppearanceFree (look
);
74 RrInstanceFree (inst
);
This page took 0.036167 seconds and 4 git commands to generate.