xcb: add xcb_init(): checks the x server + extensions, and caches atoms

This commit is contained in:
Daniel Eklöf 2018-11-17 11:47:34 +01:00
parent 8bf8a398b9
commit 7c468c20c0
5 changed files with 126 additions and 106 deletions

21
xcb.h
View file

@ -1,6 +1,25 @@
#pragma once
#include <stdbool.h>
#include <xcb/xcb.h>
bool xcb_init(void);
xcb_atom_t get_atom(xcb_connection_t *conn, const char *name);
char * get_atom_name(xcb_connection_t *conn, xcb_atom_t atom);
char *get_atom_name(xcb_connection_t *conn, xcb_atom_t atom);
/* Cached atoms */
xcb_atom_t UTF8_STRING;
xcb_atom_t _NET_WM_PID;
xcb_atom_t _NET_WM_WINDOW_TYPE;
xcb_atom_t _NET_WM_WINDOW_TYPE_DOCK;
xcb_atom_t _NET_WM_STATE;
xcb_atom_t _NET_WM_STATE_ABOVE;
xcb_atom_t _NET_WM_STATE_STICKY;
xcb_atom_t _NET_WM_DESKTOP;
xcb_atom_t _NET_WM_STRUT;
xcb_atom_t _NET_WM_STRUT_PARTIAL;
xcb_atom_t _NET_ACTIVE_WINDOW;
xcb_atom_t _NET_CURRENT_DESKTOP;
xcb_atom_t _NET_WM_VISIBLE_NAME;
xcb_atom_t _NET_WM_NAME;