- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
#define curs_windows_width 11
#define curs_windows_height 19
static unsigned char curs_windows_bits[] = {
#define curs_windows_width 11
#define curs_windows_height 19
static unsigned char curs_windows_bits[] = {
- 0xfe, 0x07, 0xfc, 0x07, 0xfa, 0x07, 0xf6, 0x07, 0xee, 0x07, 0xde, 0x07,
- 0xbe, 0x07, 0x7e, 0x07, 0xfe, 0x06, 0xfe, 0x05, 0x3e, 0x00, 0xb6, 0x07,
- 0x6a, 0x07, 0x6c, 0x07, 0xde, 0x06, 0xdf, 0x06, 0xbf, 0x05, 0xbf, 0x05,
- 0x7f, 0x06 };
+ 0xfe, 0x07, 0xfc, 0x07, 0xfa, 0x07, 0xf6, 0x07, 0xee, 0x07, 0xde, 0x07,
+ 0xbe, 0x07, 0x7e, 0x07, 0xfe, 0x06, 0xfe, 0x05, 0x3e, 0x00, 0xb6, 0x07,
+ 0x6a, 0x07, 0x6c, 0x07, 0xde, 0x06, 0xdf, 0x06, 0xbf, 0x05, 0xbf, 0x05,
+ 0x7f, 0x06};
#define mask_windows_width 11
#define mask_windows_height 19
static unsigned char mask_windows_bits[] = {
#define mask_windows_width 11
#define mask_windows_height 19
static unsigned char mask_windows_bits[] = {
- 0x01, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0f, 0x00, 0x1f, 0x00, 0x3f, 0x00,
- 0x7f, 0x00, 0xff, 0x00, 0xff, 0x01, 0xff, 0x03, 0xff, 0x07, 0x7f, 0x00,
- 0xf7, 0x00, 0xf3, 0x00, 0xe1, 0x01, 0xe0, 0x01, 0xc0, 0x03, 0xc0, 0x03,
- 0x80, 0x01 };
+ 0x01, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0f, 0x00, 0x1f, 0x00, 0x3f, 0x00,
+ 0x7f, 0x00, 0xff, 0x00, 0xff, 0x01, 0xff, 0x03, 0xff, 0x07, 0x7f, 0x00,
+ 0xf7, 0x00, 0xf3, 0x00, 0xe1, 0x01, 0xe0, 0x01, 0xc0, 0x03, 0xc0, 0x03,
+ 0x80, 0x01};
static uint32_t get_colorpixel(char *hex) {
char strgroups[3][3] = {{hex[0], hex[1], '\0'},
static uint32_t get_colorpixel(char *hex) {
char strgroups[3][3] = {{hex[0], hex[1], '\0'},
-xcb_pixmap_t create_bg_pixmap(xcb_connection_t *conn, xcb_screen_t *scr, u_int32_t* resolution, char *color) {
+xcb_pixmap_t create_bg_pixmap(xcb_connection_t *conn, xcb_screen_t *scr, u_int32_t *resolution, char *color) {
xcb_pixmap_t bg_pixmap = xcb_generate_id(conn);
xcb_create_pixmap(conn, scr->root_depth, bg_pixmap, scr->root,
resolution[0], resolution[1]);
xcb_pixmap_t bg_pixmap = xcb_generate_id(conn);
xcb_create_pixmap(conn, scr->root_depth, bg_pixmap, scr->root,
resolution[0], resolution[1]);
/* Generate a Graphics Context and fill the pixmap with background color
* (for images that are smaller than your screen) */
xcb_gcontext_t gc = xcb_generate_id(conn);
/* Generate a Graphics Context and fill the pixmap with background color
* (for images that are smaller than your screen) */
xcb_gcontext_t gc = xcb_generate_id(conn);
xcb_create_gc(conn, gc, bg_pixmap, XCB_GC_FOREGROUND, values);
xcb_create_gc(conn, gc, bg_pixmap, XCB_GC_FOREGROUND, values);
- xcb_rectangle_t rect = { 0, 0, resolution[0], resolution[1] };
+ xcb_rectangle_t rect = {0, 0, resolution[0], resolution[1]};
xcb_poly_fill_rectangle(conn, bg_pixmap, gc, 1, &rect);
xcb_free_gc(conn, gc);
xcb_poly_fill_rectangle(conn, bg_pixmap, gc, 1, &rect);
xcb_free_gc(conn, gc);
scr->root, /* parent == root */
0, 0,
scr->width_in_pixels,
scr->height_in_pixels, /* dimensions */
scr->root, /* parent == root */
0, 0,
scr->width_in_pixels,
scr->height_in_pixels, /* dimensions */
XCB_WINDOW_CLASS_INPUT_OUTPUT,
XCB_WINDOW_CLASS_COPY_FROM_PARENT, /* copy visual from parent */
mask,
XCB_WINDOW_CLASS_INPUT_OUTPUT,
XCB_WINDOW_CLASS_COPY_FROM_PARENT, /* copy visual from parent */
mask,
XCB_GRAB_MODE_ASYNC, /* keyboard mode */
XCB_NONE, /* confine_to = in which window should the cursor stay */
cursor, /* we change the cursor to whatever the user wanted */
XCB_GRAB_MODE_ASYNC, /* keyboard mode */
XCB_NONE, /* confine_to = in which window should the cursor stay */
cursor, /* we change the cursor to whatever the user wanted */
if ((preply = xcb_grab_pointer_reply(conn, pcookie, NULL)) &&
preply->status == XCB_GRAB_STATUS_SUCCESS) {
if ((preply = xcb_grab_pointer_reply(conn, pcookie, NULL)) &&
preply->status == XCB_GRAB_STATUS_SUCCESS) {
- true, /* report events */
- screen->root, /* grab the root window */
+ true, /* report events */
+ screen->root, /* grab the root window */
if ((kreply = xcb_grab_keyboard_reply(conn, kcookie, NULL)) &&
kreply->status == XCB_GRAB_STATUS_SUCCESS) {
if ((kreply = xcb_grab_keyboard_reply(conn, kcookie, NULL)) &&
kreply->status == XCB_GRAB_STATUS_SUCCESS) {
xcb_free_pixmap(conn, bitmap);
xcb_free_pixmap(conn, mask);
xcb_free_pixmap(conn, bitmap);
xcb_free_pixmap(conn, mask);