diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2013-05-19 23:16:30 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2013-05-19 23:16:30 +0000 |
commit | 2291a00b932fdcd8ee8a729c319e4a38b4caf561 (patch) | |
tree | a0f76341afea9976ec2d8fae5b8ebf06984a67d8 | |
parent | 47b51f4aa53cd9c60aa71b894dccdab177241d58 (diff) |
move the rest of xft init into screen_conf, since most of it is based on
config parameters.
-rw-r--r-- | app/cwm/calmwm.h | 3 | ||||
-rw-r--r-- | app/cwm/conf.c | 11 | ||||
-rw-r--r-- | app/cwm/font.c | 15 |
3 files changed, 11 insertions, 18 deletions
diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h index 844c9575f..529d46307 100644 --- a/app/cwm/calmwm.h +++ b/app/cwm/calmwm.h @@ -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: calmwm.h,v 1.203 2013/05/19 23:09:59 okan Exp $ + * $OpenBSD: calmwm.h,v 1.204 2013/05/19 23:16:29 okan Exp $ */ #ifndef _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/app/cwm/conf.c b/app/cwm/conf.c index 128bcd97e..1f0e2dae8 100644 --- a/app/cwm/conf.c +++ b/app/cwm/conf.c @@ -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: conf.c,v 1.127 2013/05/19 23:09:59 okan Exp $ + * $OpenBSD: conf.c,v 1.128 2013/05/19 23:16:29 okan Exp $ */ #include <sys/param.h> @@ -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/app/cwm/font.c b/app/cwm/font.c index eb61d0607..de1f10f9b 100644 --- a/app/cwm/font.c +++ b/app/cwm/font.c @@ -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.27 2013/05/19 23:09:59 okan Exp $ + * $OpenBSD: font.c,v 1.28 2013/05/19 23:16:29 okan Exp $ */ #include <sys/param.h> @@ -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) { |