From ddd89ea5ae03ad42e2aebd4e614e16bc4dd36c19 Mon Sep 17 00:00:00 2001 From: okan Date: Sun, 19 May 2013 23:09:59 +0000 Subject: - 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) --- parse.y | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index b0d7395..d088b69 100644 --- a/parse.y +++ b/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.41 2013/05/06 19:09:19 okan Exp $ */ +/* $OpenBSD: parse.y,v 1.42 2013/05/19 23:09:59 okan Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer @@ -198,20 +198,20 @@ colors : ACTIVEBORDER STRING { conf->color[CWM_COLOR_BORDER_UNGROUP] = $2; } | MENUBG STRING { - free(conf->menucolor[CWM_COLOR_MENU_BG]); - conf->menucolor[CWM_COLOR_MENU_BG] = $2; + free(conf->color[CWM_COLOR_MENU_BG]); + conf->color[CWM_COLOR_MENU_BG] = $2; } | MENUFG STRING { - free(conf->menucolor[CWM_COLOR_MENU_FG]); - conf->menucolor[CWM_COLOR_MENU_FG] = $2; + free(conf->color[CWM_COLOR_MENU_FG]); + conf->color[CWM_COLOR_MENU_FG] = $2; } | FONTCOLOR STRING { - free(conf->menucolor[CWM_COLOR_MENU_FONT]); - conf->menucolor[CWM_COLOR_MENU_FONT] = $2; + free(conf->color[CWM_COLOR_MENU_FONT]); + conf->color[CWM_COLOR_MENU_FONT] = $2; } | FONTSELCOLOR STRING { - free(conf->menucolor[CWM_COLOR_MENU_FONT_SEL]); - conf->menucolor[CWM_COLOR_MENU_FONT_SEL] = $2; + free(conf->color[CWM_COLOR_MENU_FONT_SEL]); + conf->color[CWM_COLOR_MENU_FONT_SEL] = $2; } ; %% @@ -589,12 +589,9 @@ parse_config(const char *filename, struct conf *xconf) (void)strlcpy(xconf->lockpath, conf->lockpath, sizeof(xconf->lockpath)); - for (i = 0; i < CWM_COLOR_BORDER_MAX; i++) + for (i = 0; i < CWM_COLOR_MAX; i++) xconf->color[i] = conf->color[i]; - for (i = 0; i < CWM_COLOR_MENU_MAX; i++) - xconf->menucolor[i] = conf->menucolor[i]; - xconf->font = conf->font; } -- cgit v1.2.3-2-gb3c3