Xinqi Bao's Git

f2823929bbfbfea7c01175ebc5767dd24678cfd0
[dmenu.git] / draw / draw.h
1 /* See LICENSE file for copyright and license details. */
2 #include <X11/Xlib.h>
3
4 /* enums */
5 enum { ColBorder, ColFG, ColBG, ColLast };
6
7 /* typedefs */
8 typedef struct {
9 int x, y, w, h;
10 Drawable drawable;
11 Display *dpy;
12 GC gc;
13 struct {
14 XFontStruct *xfont;
15 XFontSet set;
16 int ascent;
17 int descent;
18 int height;
19 } font;
20 } DC; /* draw context */
21
22 /* forward declarations */
23 void cleanupdraw(DC *dc);
24 void drawsquare(DC *dc, Bool filled, unsigned long col[ColLast], Bool invert);
25 void drawtext(DC *dc, const char *text, unsigned long col[ColLast], Bool invert);
26 void eprint(const char *fmt, ...);
27 unsigned long getcolor(DC *dc, const char *colstr);
28 void initfont(DC *dc, const char *fontstr);
29 void setupdraw(DC *dc, Window w);
30 int textnw(DC *dc, const char *text, unsigned int len);
31 int textw(DC *dc, const char *text);
32
33 /* variables */
34 extern const char *progname;