1705909324e648487d4681d36170d24b64a6301e
[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         Drawable drawable;
10         Display *dpy;
11         GC gc;
12         struct {
13                 XFontStruct *xfont;
14                 XFontSet set;
15                 int ascent;
16                 int descent;
17                 int height;
18         } font;
19 } DC; /* draw context */
20
21 /* forward declarations */
22 void cleanupdraw(DC *dc);
23 void setupdraw(DC *dc, Window w);
24 void drawtext(DC *dc, const char *text, unsigned long col[ColLast]);
25 void eprint(const char *fmt, ...);
26 unsigned long getcolor(DC *dc, const char *colstr);
27 void initfont(DC *dc, const char *fontstr);
28 int textnw(DC *dc, const char *text, unsigned int len);
29 int textw(DC *dc, const char *text);
30
31 /* variables */
32 extern const char *progname;