cleaned up
[dmenu.git] / draw.h
1 /* See LICENSE file for copyright and license details. */
2
3 /* enums */
4 enum { ColFG, ColBG, ColLast };
5
6 /* typedefs */
7 typedef struct {
8         int x, y, w, h;
9         unsigned long norm[ColLast];
10         unsigned long sel[ColLast];
11         Drawable drawable;
12         GC gc;
13         struct {
14                 XFontStruct *xfont;
15                 XFontSet set;
16                 int ascent;
17                 int descent;
18                 int height;
19         } font;
20 } DC; /* draw context */
21
22 /* forward declarations */
23 void drawcleanup(void);
24 void drawsetup(void);
25 void drawtext(const char *text, unsigned long col[ColLast]);
26 void eprint(const char *errstr, ...);
27 unsigned long getcolor(const char *colstr);
28 void initfont(const char *fontstr);
29 int textnw(const char *text, unsigned int len);
30 int textw(const char *text);
31
32 /* variables */
33 extern Display *dpy;
34 extern DC dc;
35 extern int screen;
36 extern unsigned int mw, mh;
37 extern Window parent;
38
39 /* style */
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;