summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2013-05-19 23:16:29 +0000
committerokan <okan>2013-05-19 23:16:29 +0000
commite41c84c752c46b78c0996489e150515751ae8ac8 (patch)
tree4fbfc4f0281ec977fd5a258d160ae5ee69602b05
parentdac00a232f975967dec9ae8e838b069ec01e6c62 (diff)
downloadcwm-e41c84c752c46b78c0996489e150515751ae8ac8.tar.gz
cwm-e41c84c752c46b78c0996489e150515751ae8ac8.tar.xz
cwm-e41c84c752c46b78c0996489e150515751ae8ac8.zip
move the rest of xft init into screen_conf, since most of it is based on
config parameters.
-rw-r--r--calmwm.h1
-rw-r--r--conf.c9
-rw-r--r--font.c13
3 files changed, 8 insertions, 15 deletions
diff --git a/calmwm.h b/calmwm.h
index ebc5bd0..a18f92f 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -446,7 +446,6 @@ void			 conf_ungrab(struct conf *, struct keybinding *);
 
 void			 font_draw(struct screen_ctx *, const char *,
 			     Drawable, int, int, int);
-void			 font_init(struct screen_ctx *, const char *);
 int			 font_width(XftFont *, const char *, int);
 
 void			 xev_loop(void);
diff --git a/conf.c b/conf.c
index 657c686..b4d5d9d 100644
--- a/conf.c
+++ b/conf.c
@@ -103,7 +103,14 @@ conf_screen(struct screen_ctx *sc)
 
 	sc->gap = Conf.gap;
 
-	font_init(sc, Conf.font);
+	sc->xftdraw = XftDrawCreate(X_Dpy, sc->rootwin,
+	    sc->visual, sc->colormap);
+	if (sc->xftdraw == NULL)
+		errx(1, "XftDrawCreate");
+
+	sc->xftfont = XftFontOpenName(X_Dpy, sc->which, Conf.font);
+	if (sc->xftfont == NULL)
+		errx(1, "XftFontOpenName");
 
 	for (i = 0; i < CWM_COLOR_MAX; i++) {
 		if (*Conf.color[i] == '\0')
diff --git a/font.c b/font.c
index f4251d9..fc4f3c1 100644
--- a/font.c
+++ b/font.c
@@ -30,19 +30,6 @@
 
 #include "calmwm.h"
 
-void
-font_init(struct screen_ctx *sc, const char *name)
-{
-	sc->xftdraw = XftDrawCreate(X_Dpy, sc->rootwin,
-	    sc->visual, sc->colormap);
-	if (sc->xftdraw == NULL)
-		errx(1, "XftDrawCreate");
-
-	sc->xftfont = XftFontOpenName(X_Dpy, sc->which, name);
-	if (sc->xftfont == NULL)
-		errx(1, "XftFontOpenName");
-}
-
 int
 font_width(XftFont *xftfont, const char *text, int len)
 {