updated dmenu to borderless drawing as well
[dmenu.git] / dmenu.h
1 /*
2  * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3  * See LICENSE file for license details.
4  */
5
6 #include "config.h"
7 #include <X11/Xlib.h>
8 #include <X11/Xlocale.h>
9
10 #define SPACE           30 /* px */
11
12 /* color */
13 enum { ColFG, ColBG, ColLast };
14
15 typedef struct DC DC;
16 typedef struct Fnt Fnt;
17
18 struct Fnt {
19         XFontStruct *xfont;
20         XFontSet set;
21         int ascent;
22         int descent;
23         int height;
24 };
25
26 struct DC { /* draw context */
27         int x, y, w, h;
28         unsigned long norm[ColLast];
29         unsigned long sel[ColLast];
30         Drawable drawable;
31         Fnt font;
32         GC gc;
33 };
34
35 extern int screen;
36 extern Display *dpy;
37 extern DC dc;
38
39 /* draw.c */
40 extern void drawtext(const char *text, unsigned long col[ColLast]);
41 extern unsigned long getcolor(const char *colstr);
42 extern void setfont(const char *fontstr);
43 extern unsigned int textw(const char *text);
44
45 /* util.c */
46 extern void *emalloc(unsigned int size);
47 extern void eprint(const char *errstr, ...);
48 extern char *estrdup(const char *str);