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