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 /font.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 'font.c')
-rw-r--r-- | font.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/font.c b/font.c index e2b68c0..f4251d9 100644 --- a/font.c +++ b/font.c @@ -31,11 +31,8 @@ #include "calmwm.h" void -font_init(struct screen_ctx *sc, const char *name, const char **color) +font_init(struct screen_ctx *sc, const char *name) { - int i; - XRenderColor c; - sc->xftdraw = XftDrawCreate(X_Dpy, sc->rootwin, sc->visual, sc->colormap); if (sc->xftdraw == NULL) @@ -44,23 +41,6 @@ font_init(struct screen_ctx *sc, const char *name, const char **color) sc->xftfont = XftFontOpenName(X_Dpy, sc->which, name); if (sc->xftfont == NULL) errx(1, "XftFontOpenName"); - - for (i = 0; i < CWM_COLOR_MENU_MAX; i++) { - if (*color[i] == '\0') - break; - if (!XftColorAllocName(X_Dpy, sc->visual, sc->colormap, - color[i], &sc->xftcolor[i])) - errx(1, "XftColorAllocName"); - } - if (i == CWM_COLOR_MENU_MAX) - return; - - xu_xorcolor(sc->xftcolor[CWM_COLOR_MENU_BG].color, - sc->xftcolor[CWM_COLOR_MENU_FG].color, &c); - xu_xorcolor(sc->xftcolor[CWM_COLOR_MENU_FONT].color, c, &c); - if (!XftColorAllocValue(X_Dpy, sc->visual, sc->colormap, - &c, &sc->xftcolor[CWM_COLOR_MENU_FONT_SEL])) - errx(1, "XftColorAllocValue"); } int |