aboutsummaryrefslogtreecommitdiff
path: root/dmenu.h
diff options
context:
space:
mode:
Diffstat (limited to 'dmenu.h')
-rw-r--r--dmenu.h29
1 files changed, 9 insertions, 20 deletions
diff --git a/dmenu.h b/dmenu.h
index 8d630ba..75b6266 100644
--- a/dmenu.h
+++ b/dmenu.h
@@ -7,6 +7,8 @@
7#include <X11/Xlib.h> 7#include <X11/Xlib.h>
8#include <X11/Xlocale.h> 8#include <X11/Xlocale.h>
9 9
10#define SPACE 30 /* px */
11
10typedef struct Brush Brush; 12typedef struct Brush Brush;
11typedef struct DC DC; 13typedef struct DC DC;
12typedef struct Fnt Fnt; 14typedef struct Fnt Fnt;
@@ -29,30 +31,17 @@ struct DC { /* draw context */
29 GC gc; 31 GC gc;
30}; 32};
31 33
32struct Brush { 34extern int screen;
33 GC gc; 35extern Display *dpy;
34 Drawable drawable; 36extern DC dc;
35 int x, y, w, h;
36 Fnt font;
37 unsigned long bg;
38 unsigned long fg;
39 unsigned long border;
40};
41
42
43 37
44/* draw.c */ 38/* draw.c */
45extern void draw(Display *dpy, Brush *b, Bool border, const char *text); 39extern void drawtext(const char *text, Bool invert, Bool border);
46extern void loadcolors(Display *dpy, int screen, Brush *b, 40extern unsigned long getcolor(const char *colstr);
47 const char *bg, const char *fg, const char *bo); 41extern void setfont(const char *fontstr);
48extern void loadfont(Display *dpy, Fnt *font, const char *fontstr); 42extern unsigned int textw(const char *text);
49extern unsigned int textnw(Fnt *font, char *text, unsigned int len);
50extern unsigned int textw(Fnt *font, char *text);
51extern unsigned int texth(Fnt *font);
52 43
53/* util.c */ 44/* util.c */
54extern void *emalloc(unsigned int size); 45extern void *emalloc(unsigned int size);
55extern void *emallocz(unsigned int size);
56extern void eprint(const char *errstr, ...); 46extern void eprint(const char *errstr, ...);
57extern char *estrdup(const char *str); 47extern char *estrdup(const char *str);
58extern void swap(void **p1, void **p2);