]>
Dogcows Code - chaz/openbox/blob - render/test.c
4 #include <X11/extensions/shape.h>
10 static int x_error_handler(Display
* disp
, XErrorEvent
* error
)
13 XGetErrorText(disp
, error
->error_code
, buf
, 1024);
32 ob_display
= XOpenDisplay(NULL
);
33 XSetErrorHandler(x_error_handler
);
34 ob_screen
= DefaultScreen(ob_display
);
35 ob_root
= RootWindow(ob_display
, ob_screen
);
37 XCreateWindow(ob_display
, RootWindow(ob_display
, 0),
39 CopyFromParent
, /* depth */
40 CopyFromParent
, /* class */
41 CopyFromParent
, /* visual */
44 XMapWindow(ob_display
, win
);
45 XSelectInput(ob_display
, win
, ExposureMask
| StructureNotifyMask
);
46 root
= RootWindow (ob_display
, DefaultScreen (ob_display
));
47 inst
= RrInstanceNew(ob_display
, ob_screen
);
49 look
= RrAppearanceNew(inst
, 0);
50 look
->surface
.grad
= RR_SURFACE_PYRAMID
;
51 look
->surface
.secondary
= RrColorParse(inst
, "Yellow");
52 look
->surface
.primary
= RrColorParse(inst
, "Blue");
53 look
->surface
.interlaced
= FALSE
;
54 if (ob_display
== NULL
) {
55 fprintf(stderr
, "couldn't connect to X server :0\n");
59 RrPaint(look
, win
, w
, h
);
61 XNextEvent(ob_display
, &report
);
62 switch (report
.type
) {
67 report
.xconfigure
.width
,
68 report
.xconfigure
.height
);
74 RrAppearanceFree (look
);
75 RrInstanceFree (inst
);
This page took 0.042151 seconds and 4 git commands to generate.