diff options
author | okan <okan> | 2013-05-19 23:09:59 +0000 |
---|---|---|
committer | okan <okan> | 2013-05-19 23:09:59 +0000 |
commit | dac00a232f975967dec9ae8e838b069ec01e6c62 (patch) | |
tree | 8f27cc8716cdd65e644fb183c4bbe3cf89bc62e0 /xutil.c | |
parent | c84145661e14cc62032f30c6a8c744ba84b95601 (diff) | |
download | cwm-dac00a232f975967dec9ae8e838b069ec01e6c62.tar.gz cwm-dac00a232f975967dec9ae8e838b069ec01e6c62.tar.xz cwm-dac00a232f975967dec9ae8e838b069ec01e6c62.zip |
- switch border colors to Xft
- merge border/menu color structures/functions since they now both use Xft - switch xu_xorcolor to operating on XftColor instead of just XRenderColor (basically adding pixel) - if color name allocation fails, revert back to default (this, along with font validation should occur during config parse, but we don't have screens setup yet - likely to change at some point)
Diffstat (limited to 'xutil.c')
-rw-r--r-- | xutil.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/xutil.c b/xutil.c index d9f2106..bcc7366 100644 --- a/xutil.c +++ b/xutil.c @@ -420,24 +420,12 @@ xu_ewmh_net_wm_desktop(struct client_ctx *cc) XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&no, 1); } -unsigned long -xu_getcolor(struct screen_ctx *sc, char *name) -{ - XColor color, tmp; - - if (!XAllocNamedColor(X_Dpy, sc->colormap, name, &color, &tmp)) { - warnx("XAllocNamedColor error: '%s'", name); - return (0); - } - - return (color.pixel); -} - void -xu_xorcolor(XRenderColor a, XRenderColor b, XRenderColor *r) +xu_xorcolor(XftColor a, XftColor b, XftColor *r) { - r->red = a.red ^ b.red; - r->green = a.green ^ b.green; - r->blue = a.blue ^ b.blue; - r->alpha = 0xffff; + r->pixel = a.pixel ^ b.pixel; + r->color.red = a.color.red ^ b.color.red; + r->color.green = a.color.green ^ b.color.green; + r->color.blue = a.color.blue ^ b.color.blue; + r->color.alpha = 0xffff; } |