diff options
author | okan | 2013-05-19 23:09:59 +0000 |
---|---|---|
committer | okan | 2013-05-19 23:09:59 +0000 |
commit | ddd89ea5ae03ad42e2aebd4e614e16bc4dd36c19 (patch) | |
tree | c78917d5a1bf167f676505945bde884fba9bbc39 /font.c | |
parent | 9b2707d7772bceae892c022721d1f1857984432d (diff) | |
download | cwm-ddd89ea5ae03ad42e2aebd4e614e16bc4dd36c19.tar.gz |
- 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 | 24 |
1 files changed, 2 insertions, 22 deletions
@@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: font.c,v 1.26 2013/05/14 12:35:56 okan Exp $ + * $OpenBSD: font.c,v 1.27 2013/05/19 23:09:59 okan Exp $ */ #include <sys/param.h> @@ -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 |