diff options
Diffstat (limited to 'dmenu.h')
| -rw-r--r-- | dmenu.h | 29 |
1 files changed, 9 insertions, 20 deletions
| @@ -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 | |||
| 10 | typedef struct Brush Brush; | 12 | typedef struct Brush Brush; |
| 11 | typedef struct DC DC; | 13 | typedef struct DC DC; |
| 12 | typedef struct Fnt Fnt; | 14 | typedef struct Fnt Fnt; |
| @@ -29,30 +31,17 @@ struct DC { /* draw context */ | |||
| 29 | GC gc; | 31 | GC gc; |
| 30 | }; | 32 | }; |
| 31 | 33 | ||
| 32 | struct Brush { | 34 | extern int screen; |
| 33 | GC gc; | 35 | extern Display *dpy; |
| 34 | Drawable drawable; | 36 | extern 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 */ |
| 45 | extern void draw(Display *dpy, Brush *b, Bool border, const char *text); | 39 | extern void drawtext(const char *text, Bool invert, Bool border); |
| 46 | extern void loadcolors(Display *dpy, int screen, Brush *b, | 40 | extern unsigned long getcolor(const char *colstr); |
| 47 | const char *bg, const char *fg, const char *bo); | 41 | extern void setfont(const char *fontstr); |
| 48 | extern void loadfont(Display *dpy, Fnt *font, const char *fontstr); | 42 | extern unsigned int textw(const char *text); |
| 49 | extern unsigned int textnw(Fnt *font, char *text, unsigned int len); | ||
| 50 | extern unsigned int textw(Fnt *font, char *text); | ||
| 51 | extern unsigned int texth(Fnt *font); | ||
| 52 | 43 | ||
| 53 | /* util.c */ | 44 | /* util.c */ |
| 54 | extern void *emalloc(unsigned int size); | 45 | extern void *emalloc(unsigned int size); |
| 55 | extern void *emallocz(unsigned int size); | ||
| 56 | extern void eprint(const char *errstr, ...); | 46 | extern void eprint(const char *errstr, ...); |
| 57 | extern char *estrdup(const char *str); | 47 | extern char *estrdup(const char *str); |
| 58 | extern void swap(void **p1, void **p2); | ||
