xcbutils.h (1459B)
1 /* 2 * kbgwm, a sucklessy floating window manager 3 * Copyright (c) 2020-2021, Kebigon <git@kebigon.xyz> 4 * 5 * Permission to use, copy, modify, and/or distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 */ 17 18 #pragma once 19 20 #define LENGTH(X) (sizeof X / sizeof X[0]) 21 22 #include <xcb/xcb.h> 23 #include <xcb/xcb_keysyms.h> 24 25 #include "client.h" 26 #include "types.h" 27 28 #define BUTTON_EVENT_MASK XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE 29 30 void *emalloc(size_t size); 31 32 /* 33 * registering events 34 */ 35 void xcb_register_key_events(struct Key key); 36 37 xcb_keycode_t *xcb_get_keycodes(xcb_keysym_t); 38 xcb_keysym_t xcb_get_keysym(xcb_keycode_t); 39 40 /* 41 * Atoms 42 */ 43 44 #define WM_DELETE_WINDOW "WM_DELETE_WINDOW" 45 #define WM_PROTOCOLS "WM_PROTOCOLS" 46 47 xcb_atom_t xcb_get_atom(const char *); 48 bool xcb_send_atom(struct client *, xcb_atom_t);