1 /* See LICENSE file for copyright and license details. */
6 typedef struct _XCol Col;
15 typedef struct _XFont Fnt;
28 /* X11 types - begin */
29 typedef struct _XDraw Draw;
42 /* Drawable abstraction */
43 Draw *draw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h);
44 void draw_resize(Draw *draw, unsigned int w, unsigned int h);
45 void draw_free(Draw *draw);
48 Fnt *font_create(const char *fontname);
49 void font_free(Fnt *font);
51 /* Colour abstraction */
52 Col *col_create(const char *colname);
53 void col_free(Col *col);
55 /* Drawing context manipulation */
56 void draw_setfont(Draw *draw, Fnt *font);
57 void draw_setfg(Draw *draw, Col *col);
58 void draw_setbg(Draw *draw, Col *col);
60 /* Drawing functions */
61 void draw_rect(Draw *draw, int x, int y, unsigned int w, unsigned int h);
62 void draw_text(Draw *draw, int x, int y, const char *text);
65 void draw_map(Draw *draw, int x, int y, unsigned int w, unsigned int h);
68 void draw_getextents(Draw *draw, const char *text, TextExtents *extents);