]>
Dogcows Code - chaz/openbox/blob - render/test.c
1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
3 test.c for the Openbox window manager
4 Copyright (c) 2003 Ben Jansens
5 Copyright (c) 2003 Derek Foreman
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 See the COPYING file for a copy of the GNU General Public License.
22 #include <X11/Xutil.h>
23 #include <X11/extensions/shape.h>
29 static int x_error_handler(Display
* disp
, XErrorEvent
* error
)
32 XGetErrorText(disp
, error
->error_code
, buf
, 1024);
51 ob_display
= XOpenDisplay(NULL
);
52 XSetErrorHandler(x_error_handler
);
53 ob_screen
= DefaultScreen(ob_display
);
54 ob_root
= RootWindow(ob_display
, ob_screen
);
56 XCreateWindow(ob_display
, RootWindow(ob_display
, 0),
58 CopyFromParent
, /* depth */
59 CopyFromParent
, /* class */
60 CopyFromParent
, /* visual */
63 XMapWindow(ob_display
, win
);
64 XSelectInput(ob_display
, win
, ExposureMask
| StructureNotifyMask
);
65 root
= RootWindow (ob_display
, DefaultScreen (ob_display
));
66 inst
= RrInstanceNew(ob_display
, ob_screen
);
68 look
= RrAppearanceNew(inst
, 0);
69 look
->surface
.grad
= RR_SURFACE_PYRAMID
;
70 look
->surface
.secondary
= RrColorParse(inst
, "Yellow");
71 look
->surface
.primary
= RrColorParse(inst
, "Blue");
72 look
->surface
.interlaced
= FALSE
;
73 if (ob_display
== NULL
) {
74 fprintf(stderr
, "couldn't connect to X server :0\n");
78 RrPaint(look
, win
, w
, h
);
80 XNextEvent(ob_display
, &report
);
81 switch (report
.type
) {
86 report
.xconfigure
.width
,
87 report
.xconfigure
.height
);
93 RrAppearanceFree (look
);
94 RrInstanceFree (inst
);
This page took 0.038981 seconds and 4 git commands to generate.