aboutsummaryrefslogtreecommitdiff
path: root/aux.c
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2014-09-10 22:15:03 +0000
committerDimitri Sokolyuk <demon@dim13.org>2014-09-10 22:15:03 +0000
commit86360e3dbaa774b4f4fcd787007b198c4df3b60e (patch)
tree8790475f17f6272244e3c4c68cc184ac7d483af6 /aux.c
parenta12f2434dc9811fcd4c05025b1836951e711548f (diff)
split and simplify code
Diffstat (limited to 'aux.c')
-rw-r--r--aux.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/aux.c b/aux.c
index 736e903..1f9ed0e 100644
--- a/aux.c
+++ b/aux.c
@@ -94,3 +94,24 @@ restrictsize(Display *d, Window win, int minw, int minh, int maxw, int maxh)
XSetWMSizeHints(d, win, hints, nhints);
XFree(hints);
}
+
+void
+blit(Display *d, Drawable p, GC gc, XRectangle r)
+{
+ XCopyArea(d, p, p, gc, 0, 0, r.width, r.height - 1, 0, 1);
+}
+
+void
+clear(Display *d, Drawable p, GC gc, XRectangle r)
+{
+ XSetForeground(d, gc, BlackPixel(d, DefaultScreen(d)));
+ XFillRectangle(d, p, gc, 0, 0, r.width, r.height);
+}
+
+void
+copy(Display *d, Drawable from, Drawable to, GC gc, XRectangle r, Drawable mask)
+{
+ XSetClipMask(d, gc, mask);
+ XCopyArea(d, from, to, gc, 0, 0, r.width, r.height, 0, 0);
+ XSetClipMask(d, gc, None);
+}