Xinqi Bao's Git
eed5689b54b7c20088f7f87640530186c0edf26f
2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3 * See LICENSE file for license details.
8 #include <X11/Xlocale.h>
10 #define SPACE 30 /* px */
13 enum { ColFG
, ColBG
, ColLast
};
16 typedef struct Fnt Fnt
;
28 unsigned long norm
[ColLast
];
29 unsigned long sel
[ColLast
];
37 extern DC dc
; /* global drawing context */
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 */
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 */