diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-11-12 15:01:36 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-11-12 15:01:36 -0600 |
commit | d74fed9b65e4c5e742a3fe81a05b83201ccf591a (patch) | |
tree | 679088bca9ef010b9785605cdda841b64929e69b /xrescheck.h | |
parent | b0c4ab328e98e611c61ce2b34b4535e0120781bd (diff) | |
parent | 325fb4c2983cb3211138078bff9cbec749be21c8 (diff) | |
download | tdebase-d74fed9b65e4c5e742a3fe81a05b83201ccf591a.tar.gz tdebase-d74fed9b65e4c5e742a3fe81a05b83201ccf591a.zip |
Merge remote-tracking branch 'compton-update/master'
Conflicts:
twin/compton-tde/common.h
twin/compton-tde/compton.c
twin/compton-tde/opengl.c
Diffstat (limited to 'xrescheck.h')
-rw-r--r-- | xrescheck.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/xrescheck.h b/xrescheck.h new file mode 100644 index 000000000..48f254b20 --- /dev/null +++ b/xrescheck.h @@ -0,0 +1,70 @@ +#ifndef COMPTON_XRESCHECK_H +#define COMPTON_XRESCHECK_H + +#include "common.h" +#include <uthash.h> + +typedef struct { + XID xid; + const char *type; + const char *file; + const char *func; + int line; + UT_hash_handle hh; +} xrc_xid_record_t; + +#define M_POS_DATA_PARAMS const char *file, int line, const char *func +#define M_POS_DATA_PASSTHROUGH file, line, func +#define M_POS_DATA __FILE__, __LINE__, __func__ + +void +xrc_add_xid_(XID xid, const char *type, M_POS_DATA_PARAMS); + +#define xrc_add_xid(xid, type) xrc_add_xid_(xid, type, M_POS_DATA) + +void +xrc_delete_xid_(XID xid, M_POS_DATA_PARAMS); + +#define xrc_delete_xid(xid) xrc_delete_xid_(xid, M_POS_DATA) + +void +xrc_report_xid(void); + +void +xrc_clear_xid(void); + +// Pixmap + +static inline Pixmap +XCreatePixmap_(Display *dpy, Drawable drawable, + unsigned int width, unsigned int height, unsigned int depth, + M_POS_DATA_PARAMS) { + Pixmap ret = XCreatePixmap(dpy, drawable, width, height, depth); + if (ret) + xrc_add_xid_(ret, "Pixmap", M_POS_DATA_PASSTHROUGH); + return ret; +} + +#define XCreatePixmap(dpy, drawable, width, height, depth) \ + XCreatePixmap_(dpy, drawable, width, height, depth, M_POS_DATA) + +static inline Pixmap +XCompositeNameWindowPixmap_(Display *dpy, Window window, M_POS_DATA_PARAMS) { + Pixmap ret = XCompositeNameWindowPixmap(dpy, window); + if (ret) + xrc_add_xid_(ret, "PixmapC", M_POS_DATA_PASSTHROUGH); + return ret; +} + +#define XCompositeNameWindowPixmap(dpy, window) \ + XCompositeNameWindowPixmap_(dpy, window, M_POS_DATA) + +static inline void +XFreePixmap_(Display *dpy, Pixmap pixmap, M_POS_DATA_PARAMS) { + XFreePixmap(dpy, pixmap); + xrc_delete_xid_(pixmap, M_POS_DATA_PASSTHROUGH); +} + +#define XFreePixmap(dpy, pixmap) XFreePixmap_(dpy, pixmap, M_POS_DATA); + +#endif |