summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
Diffstat (limited to 'render')
-rw-r--r--render/mask.c17
-rw-r--r--render/mask.h3
2 files changed, 20 insertions, 0 deletions
diff --git a/render/mask.c b/render/mask.c
index 7aa70295..37e506f3 100644
--- a/render/mask.c
+++ b/render/mask.c
@@ -1,3 +1,20 @@
#include "mask.h"
+#include "../kernel/openbox.h"
+
+pixmap_mask *pixmap_mask_new(int w, int h, char *data)
+{
+ pixmap_mask *m = g_new(pixmap_mask, 1);
+ m->w = w;
+ m->h = h;
+ m->mask = XCreateBitmapFromData(ob_display, ob_root, data, w, h);
+ return m;
+}
+
+void pixmap_mask_free(pixmap_mask *m)
+{
+ XFreePixmap(ob_display, m->mask);
+ g_free(m);
+}
+
/* DO YOUR MAGIC MANNY WOOT \m/ */
diff --git a/render/mask.h b/render/mask.h
index 2d507a63..103b33d0 100644
--- a/render/mask.h
+++ b/render/mask.h
@@ -9,4 +9,7 @@ typedef struct {
guint w, h;
} pixmap_mask;
+pixmap_mask *pixmap_mask_new(int w, int h, char *data);
+void pixmap_mask_free(pixmap_mask *m);
+
#endif