From 96c65400ccdcb76cf20ec7721920f944e6b490ec Mon Sep 17 00:00:00 2001 From: Connor Lane Smith Date: Thu, 24 Jun 2010 16:18:18 +0100 Subject: decoupled draw.c from dmenu & dinput --- draw.h | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) (limited to 'draw.h') diff --git a/draw.h b/draw.h index d1f1a7c..e4f937a 100644 --- a/draw.h +++ b/draw.h @@ -9,6 +9,7 @@ typedef struct { unsigned long norm[ColLast]; unsigned long sel[ColLast]; Drawable drawable; + Display *dpy; GC gc; struct { XFontStruct *xfont; @@ -20,25 +21,14 @@ typedef struct { } DC; /* draw context */ /* forward declarations */ -void drawcleanup(void); -void drawsetup(void); -void drawtext(const char *text, unsigned long col[ColLast]); -void eprint(const char *errstr, ...); -unsigned long getcolor(const char *colstr); -void initfont(const char *fontstr); -int textnw(const char *text, unsigned int len); -int textw(const char *text); +void cleanupdraw(DC *dc); +void setupdraw(DC *dc, Window w); +void drawtext(DC *dc, const char *text, unsigned long col[ColLast]); +void eprint(const char *fmt, ...); +unsigned long getcolor(DC *dc, const char *colstr); +void initfont(DC *dc, const char *fontstr); +int textnw(DC *dc, const char *text, unsigned int len); +int textw(DC *dc, const char *text); /* variables */ -extern char *progname; -extern Display *dpy; -extern DC dc; -extern int screen; -extern unsigned int mw, mh; -extern Window parent; - -extern const char *font; -extern const char *normbgcolor; -extern const char *normfgcolor; -extern const char *selbgcolor; -extern const char *selfgcolor; +extern const char *progname; -- cgit v1.2.3-13-gbd6f