From 4dc9319239a172eb9f36ca57ea539a4a28edb50f Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 24 Feb 2017 19:43:51 -0800 Subject: 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. --- src/xserver.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/xserver.h (limited to 'src/xserver.h') 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 + +#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 -- cgit v1.2.3