2a8796f23a7424f2ffcc3631bb142aa415e8b7fd
[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 typedef struct DC DC;
13 typedef struct Fnt Fnt;
14
15 struct Fnt {
16         XFontStruct *xfont;
17         XFontSet set;
18         int ascent;
19         int descent;
20         int height;
21 };
22
23 struct DC { /* draw context */
24         int x, y, w, h;
25         unsigned long bg;
26         unsigned long fg;
27         unsigned long border;
28         Drawable drawable;
29         Fnt font;
30         GC gc;
31 };
32
33 extern int screen;
34 extern Display *dpy;
35 extern DC dc;
36
37 /* draw.c */
38 extern void drawtext(const char *text, Bool invert, Bool border);
39 extern unsigned long getcolor(const char *colstr);
40 extern void setfont(const char *fontstr);
41 extern unsigned int textw(const char *text);
42
43 /* util.c */
44 extern void *emalloc(unsigned int size);
45 extern void eprint(const char *errstr, ...);
46 extern char *estrdup(const char *str);