aboutsummaryrefslogtreecommitdiff
path: root/dmenu.h
diff options
context:
space:
mode:
Diffstat (limited to 'dmenu.h')
-rw-r--r--dmenu.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/dmenu.h b/dmenu.h
index 337e094..eed5689 100644
--- a/dmenu.h
+++ b/dmenu.h
@@ -23,26 +23,27 @@ struct Fnt {
23 int height; 23 int height;
24}; 24};
25 25
26struct DC { /* draw context */ 26struct DC {
27 int x, y, w, h; 27 int x, y, w, h;
28 unsigned long norm[ColLast]; 28 unsigned long norm[ColLast];
29 unsigned long sel[ColLast]; 29 unsigned long sel[ColLast];
30 Drawable drawable; 30 Drawable drawable;
31 Fnt font; 31 Fnt font;
32 GC gc; 32 GC gc;
33}; 33}; /* draw context */
34 34
35extern int screen; 35extern int screen;
36extern Display *dpy; 36extern Display *dpy;
37extern DC dc; 37extern DC dc; /* global drawing context */
38 38
39/* draw.c */ 39/* draw.c */
40extern void drawtext(const char *text, unsigned long col[ColLast]); 40extern void drawtext(const char *text,
41extern unsigned long getcolor(const char *colstr); 41 unsigned long col[ColLast]); /* draws text with the defined color tuple */
42extern void setfont(const char *fontstr); 42extern unsigned long getcolor(const char *colstr); /* returns color of colstr */
43extern unsigned int textw(const char *text); 43extern void setfont(const char *fontstr); /* sets global font */
44extern unsigned int textw(const char *text); /* returns width of text in px */
44 45
45/* util.c */ 46/* util.c */
46extern void *emalloc(unsigned int size); 47extern void *emalloc(unsigned int size); /* allocates memory, exits on error */
47extern void eprint(const char *errstr, ...); 48extern void eprint(const char *errstr, ...); /* prints errstr and exits with 1 */
48extern char *estrdup(const char *str); 49extern char *estrdup(const char *str); /* duplicates str, exits on allocation error */