diff options
Diffstat (limited to 'draw.h')
-rw-r--r-- | draw.h | 30 |
1 files changed, 10 insertions, 20 deletions
@@ -9,6 +9,7 @@ typedef struct { | |||
9 | unsigned long norm[ColLast]; | 9 | unsigned long norm[ColLast]; |
10 | unsigned long sel[ColLast]; | 10 | unsigned long sel[ColLast]; |
11 | Drawable drawable; | 11 | Drawable drawable; |
12 | Display *dpy; | ||
12 | GC gc; | 13 | GC gc; |
13 | struct { | 14 | struct { |
14 | XFontStruct *xfont; | 15 | XFontStruct *xfont; |
@@ -20,25 +21,14 @@ typedef struct { | |||
20 | } DC; /* draw context */ | 21 | } DC; /* draw context */ |
21 | 22 | ||
22 | /* forward declarations */ | 23 | /* forward declarations */ |
23 | void drawcleanup(void); | 24 | void cleanupdraw(DC *dc); |
24 | void drawsetup(void); | 25 | void setupdraw(DC *dc, Window w); |
25 | void drawtext(const char *text, unsigned long col[ColLast]); | 26 | void drawtext(DC *dc, const char *text, unsigned long col[ColLast]); |
26 | void eprint(const char *errstr, ...); | 27 | void eprint(const char *fmt, ...); |
27 | unsigned long getcolor(const char *colstr); | 28 | unsigned long getcolor(DC *dc, const char *colstr); |
28 | void initfont(const char *fontstr); | 29 | void initfont(DC *dc, const char *fontstr); |
29 | int textnw(const char *text, unsigned int len); | 30 | int textnw(DC *dc, const char *text, unsigned int len); |
30 | int textw(const char *text); | 31 | int textw(DC *dc, const char *text); |
31 | 32 | ||
32 | /* variables */ | 33 | /* variables */ |
33 | extern char *progname; | 34 | extern const char *progname; |
34 | extern Display *dpy; | ||
35 | extern DC dc; | ||
36 | extern int screen; | ||
37 | extern unsigned int mw, mh; | ||
38 | extern Window parent; | ||
39 | |||
40 | extern const char *font; | ||
41 | extern const char *normbgcolor; | ||
42 | extern const char *normfgcolor; | ||
43 | extern const char *selbgcolor; | ||
44 | extern const char *selfgcolor; | ||