diff options
author | Vito Caputo <vcaputo@gnugeneration.com> | 2017-02-24 19:43:51 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@gnugeneration.com> | 2017-03-14 19:41:48 -0700 |
commit | 4dc9319239a172eb9f36ca57ea539a4a28edb50f (patch) | |
tree | 98956690d4876f7643760ebad544123fb365ae53 /src/xserver.h | |
parent | a14269b154750450a947af4e8b2ac5b4470f35ed (diff) |
xserver: introduce isolated core xserver api
In preparation for monitoring overlays being shared across vwm and vmon,
adding a common xserver abstraction for both to use and overlay to depend
on.
Diffstat (limited to 'src/xserver.h')
-rw-r--r-- | src/xserver.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/xserver.h b/src/xserver.h new file mode 100644 index 0000000..694513a --- /dev/null +++ b/src/xserver.h @@ -0,0 +1,21 @@ +#ifndef _XSERVER_H +#define _XSERVER_H + +#include <X11/Xlib.h> + +#define XSERVER_XROOT(_xserver) RootWindow((_xserver)->display, (_xserver)->screen_num) +#define XSERVER_XVISUAL(_xserver) DefaultVisual((_xserver)->display, (_xserver)->screen_num) +#define XSERVER_XDEPTH(_xserver) DefaultDepth((_xserver)->display, (_xserver)->screen_num) + +/* bare xserver context, split out for vmon's shared monitoring overlay use sake */ +typedef struct vwm_xserver_t { + Display *display; + Colormap cmap; + int screen_num; + GC gc; +} vwm_xserver_t; + +vwm_xserver_t * vwm_xserver_open(void); +void vwm_xserver_close(vwm_xserver_t *); + +#endif |