1 /* See LICENSE file for copyright and license details. */
3 typedef struct _DDC DDC;
5 /* X11 types - begin */
6 typedef struct _XDraw Draw;
20 typedef struct _XCol Col;
29 typedef struct _XFont Fnt;
50 /* Drawable abstraction */
51 Draw *draw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h);
52 void draw_resize(Draw *draw, unsigned int w, unsigned int h);
53 void draw_free(Draw *draw);
55 /* Drawing context abstraction */
56 DDC *dc_create(Draw *draw);
57 void dc_free(DDC *dc);
60 Fnt *font_create(const char *fontname);
61 void font_free(Fnt *font);
63 /* Colour abstraction */
64 Col *col_create(const char *colname);
65 void col_free(Col *col);
67 /* Drawing context manipulation */
68 void dc_setfont(DDC *dc, Fnt *font);
69 void dc_setfg(DDC *dc, Col *col);
70 void dc_setbg(DDC *dc, Col *col);
71 void dc_setfill(DDC *dc, Bool fill);
73 /* Drawing functions */
74 void dc_drawrect(DDC *dc, int x, int y, unsigned int w, unsigned int h);
75 void dc_drawtext(DDC *dc, int x, int y, const char *text);
78 void dc_map(DDC *dc, int x, int y, unsigned int w, unsigned int h);
81 void dc_getextents(DDC *dc, const char *text, TextExtents *extents);