6 #include <xcb/xcb_event.h>
10 void die(const char *errstr, ...) {
13 vfprintf(stderr, errstr, ap);
18 uint32_t get_color(char *col)
20 xcb_colormap_t map = screen->default_colormap;
24 unsigned int red, green, blue;
25 if (sscanf(col + 1, "%02x%02x%02x", &red, &green, &blue) == 3) {
26 /* 2**16 - 1 == 0xffff and 0x101 * 0xij == 0xijij */
30 xcb_alloc_color_reply_t *reply = xcb_alloc_color_reply(dpy, xcb_alloc_color(dpy, map, red, green, blue), NULL);
37 xcb_alloc_named_color_reply_t *reply = xcb_alloc_named_color_reply(dpy, xcb_alloc_named_color(dpy, map, strlen(col), col), NULL);
47 void transfer_rectangle(xcb_rectangle_t rect, uint32_t *a)