1 /* See LICENSE file for copyright and license details. */
3 typedef struct _DDC DDC;
5 /* X11 types - begin */
6 typedef struct _XDraw Draw;
18 typedef struct _XCol Col;
27 typedef struct _XFont Fnt;
48 /* Drawable abstraction */
49 Draw *draw_create(Display *dpy, Window win, unsigned int w, unsigned int h);
50 void draw_resize(Draw *draw, unsigned int w, unsigned int h);
51 void draw_free(Draw *draw);
53 /* Drawing context abstraction */
54 DDC *dc_create(Draw *draw);
55 void dc_free(DDC *dc);
58 Fnt *font_create(const char *fontname);
59 void font_free(Fnt *font);
61 /* Colour abstraction */
62 Col *col_create(const char *colname);
63 void col_free(Col *col);
65 /* Drawing context manipulation */
66 void dc_setfont(DDC *dc, Fnt *font);
67 void dc_setfg(DDC *dc, Col *col);
68 void dc_setbg(DDC *dc, Col *col);
69 void dc_setfill(DDC *dc, Bool fill);
71 /* Drawing functions */
72 void dc_drawrect(DDC *dc, int x, int y, unsigned int w, unsigned int h);
73 void dc_drawtext(DDC *dc, int x, int y, const char *text);
76 void dc_map(DDC *dc, int x, int y, unsigned int w, unsigned int h);
79 void dc_getextents(DDC *dc, const char *text, TextExtents *extents);