summary refs log tree commit diff
path: root/calmwm.h
diff options
context:
space:
mode:
authorokan <okan>2009-12-08 16:52:17 +0000
committerokan <okan>2009-12-08 16:52:17 +0000
commitee7df6a95f80bebc9ec2d8571c1ff8ff2f53cfd0 (patch)
tree72d45dd2b4f7a08e9fa71bd138354cd9741f33b5 /calmwm.h
parentaa88d5848e0b3ee3ea7c64c7582eddd963dcecb2 (diff)
downloadcwm-ee7df6a95f80bebc9ec2d8571c1ff8ff2f53cfd0.tar.gz
cwm-ee7df6a95f80bebc9ec2d8571c1ff8ff2f53cfd0.tar.xz
cwm-ee7df6a95f80bebc9ec2d8571c1ff8ff2f53cfd0.zip
start fixing screen_ctx usage, for it is utterly broken. bring font
into screen_ctx and start passing screen_ctx around to in order get rid
of Curscreen; fixup per-screen config colors the same way.

diff mostly from oga@, with a bit harsher reaction to the state of screen_ctx.

"please commit" oga@
Diffstat (limited to 'calmwm.h')
-rw-r--r--calmwm.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/calmwm.h b/calmwm.h
index 4201968..0dc1ffe 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -79,6 +79,8 @@ struct screen_ctx {
 
 	XftDraw		*xftdraw;
 	XftColor	 xftcolor;
+	XftFont		*font;
+	u_int		 fontheight;
 
 	int		 xinerama_no;
 	XineramaScreenInfo *xinerama;
@@ -284,8 +286,6 @@ struct conf {
 
 #define	DEFAULTFONTNAME		 "sans-serif:pixelsize=14:bold"
 	char			*DefaultFontName;
-	XftFont			*DefaultFont;
-	u_int			 FontHeight;
 	int			 gap_top, gap_bottom, gap_left, gap_right;
 };
 
@@ -410,8 +410,8 @@ void			 conf_bindname(struct conf *, char *, char *);
 void			 conf_mousebind(struct conf *, char *, char *);
 void			 conf_grab_mouse(struct client_ctx *);
 void			 conf_reload(struct conf *);
-void			 conf_font(struct conf *);
-void			 conf_color(struct conf *);
+void			 conf_font(struct conf *, struct screen_ctx *);
+void			 conf_color(struct conf *, struct screen_ctx *);
 void			 conf_init(struct conf *);
 void			 conf_clear(struct conf *);
 void			 conf_cmd_add(struct conf *, char *, char *, int);
@@ -485,14 +485,14 @@ void			 group_autogroup(struct client_ctx *);
 void			 group_movetogroup(struct client_ctx *, int);
 
 void			 font_init(struct screen_ctx *);
-int			 font_width(const char *, int);
+int			 font_width(struct screen_ctx *, const char *, int);
 void			 font_draw(struct screen_ctx *, const char *, int,
 			     Drawable, int, int);
 XftFont			*font_make(struct screen_ctx *, const char *);
 
-#define font_ascent()	Conf.DefaultFont->ascent
-#define font_descent()	Conf.DefaultFont->descent
-#define	font_height()	Conf.FontHeight
+#define	font_ascent(sc)		sc->font->ascent
+#define	font_descent(sc)	sc->font->descent
+#define	font_height(sc)		sc->fontheight
 
 /* Externs */