commented dmenu
0e5f467a
2 file(s) · +12 −11
| 1 | 1 | # dmenu version |
|
| 2 | - | VERSION = 0.9 |
|
| 2 | + | VERSION = 1.0 |
|
| 3 | 3 | ||
| 4 | 4 | # Customize below to fit your system |
|
| 5 | 5 |
| 23 | 23 | int height; |
|
| 24 | 24 | }; |
|
| 25 | 25 | ||
| 26 | - | struct DC { /* draw context */ |
|
| 26 | + | struct DC { |
|
| 27 | 27 | int x, y, w, h; |
|
| 28 | 28 | unsigned long norm[ColLast]; |
|
| 29 | 29 | unsigned long sel[ColLast]; |
|
| 30 | 30 | Drawable drawable; |
|
| 31 | 31 | Fnt font; |
|
| 32 | 32 | GC gc; |
|
| 33 | - | }; |
|
| 33 | + | }; /* draw context */ |
|
| 34 | 34 | ||
| 35 | 35 | extern int screen; |
|
| 36 | 36 | extern Display *dpy; |
|
| 37 | - | extern DC dc; |
|
| 37 | + | extern DC dc; /* global drawing context */ |
|
| 38 | 38 | ||
| 39 | 39 | /* draw.c */ |
|
| 40 | - | extern void drawtext(const char *text, unsigned long col[ColLast]); |
|
| 41 | - | extern unsigned long getcolor(const char *colstr); |
|
| 42 | - | extern void setfont(const char *fontstr); |
|
| 43 | - | extern unsigned int textw(const char *text); |
|
| 40 | + | extern void drawtext(const char *text, |
|
| 41 | + | unsigned long col[ColLast]); /* draws text with the defined color tuple */ |
|
| 42 | + | extern unsigned long getcolor(const char *colstr); /* returns color of colstr */ |
|
| 43 | + | extern void setfont(const char *fontstr); /* sets global font */ |
|
| 44 | + | extern unsigned int textw(const char *text); /* returns width of text in px */ |
|
| 44 | 45 | ||
| 45 | 46 | /* util.c */ |
|
| 46 | - | extern void *emalloc(unsigned int size); |
|
| 47 | - | extern void eprint(const char *errstr, ...); |
|
| 48 | - | extern char *estrdup(const char *str); |
|
| 47 | + | extern void *emalloc(unsigned int size); /* allocates memory, exits on error */ |
|
| 48 | + | extern void eprint(const char *errstr, ...); /* prints errstr and exits with 1 */ |
|
| 49 | + | extern char *estrdup(const char *str); /* duplicates str, exits on allocation error */ |