summaryrefslogtreecommitdiff
path: root/draw/drawtext.c
diff options
context:
space:
mode:
authorConnor Lane Smith <cls@lubutu.com>2010-06-28 06:09:34 +0100
committerConnor Lane Smith <cls@lubutu.com>2010-06-28 06:09:34 +0100
commit18dcf738967a45208e880b72ce273afdd93ee6c7 (patch)
tree750ef101f905125871cd63e6734cbbae25f4cb44 /draw/drawtext.c
parent9f3b0c6ea843340b87a045ea0afd2d1b33425eee (diff)
extended libdraw
Diffstat (limited to 'draw/drawtext.c')
-rw-r--r--draw/drawtext.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/draw/drawtext.c b/draw/drawtext.c
index cf7b015..d347b36 100644
--- a/draw/drawtext.c
+++ b/draw/drawtext.c
@@ -6,12 +6,12 @@
#define MIN(a, b) ((a) < (b) ? (a) : (b))
void
-drawtext(DC *dc, const char *text, unsigned long col[ColLast]) {
+drawtext(DC *dc, const char *text, unsigned long col[ColLast], Bool invert) {
char buf[256];
int i, x, y, h, len, olen;
XRectangle r = { dc->x, dc->y, dc->w, dc->h };
- XSetForeground(dc->dpy, dc->gc, col[ColBG]);
+ XSetForeground(dc->dpy, dc->gc, col[invert ? ColFG : ColBG]);
XFillRectangles(dc->dpy, dc->drawable, dc->gc, &r, 1);
if(!text)
return;
@@ -26,7 +26,7 @@ drawtext(DC *dc, const char *text, unsigned long col[ColLast]) {
memcpy(buf, text, len);
if(len < olen)
for(i = len; i && i > len - 3; buf[--i] = '.');
- XSetForeground(dc->dpy, dc->gc, col[ColFG]);
+ XSetForeground(dc->dpy, dc->gc, col[invert ? ColBG : ColFG]);
if(dc->font.set)
XmbDrawString(dc->dpy, dc->drawable, dc->font.set, dc->gc, x, y, buf, len);
else