Xinqi Bao's Git
955067df54f0b7315905e373ed722af367ee0e00
1 /* See LICENSE file for copyright and license details. */
3 /* X11 types - begin */
10 typedef struct _XDraw Draw
;
15 typedef struct _XCol Col
;
24 typedef struct _XFont Fnt
;
44 /* Drawable abstraction */
45 Draw
*draw_create(Display
*dpy
, Window win
, unsigned int w
, unsigned int h
);
46 void draw_resize(Draw
*draw
, unsigned int w
, unsigned int h
);
47 void draw_free(Draw
*draw
);
49 /* Drawing context abstraction */
50 DDC
*dc_create(Draw
*draw
);
51 void dc_free(DDC
*dc
);
54 Fnt
*font_create(const char *fontname
);
55 void font_free(Fnt
*font
);
57 /* Colour abstraction */
58 Col
*col_create(const char *colname
);
59 void col_free(Col
*col
);
61 /* Drawing context manipulation */
62 void dc_setfont(DDC
*dc
, Fnt
*font
);
63 void dc_setfg(DDC
*dc
, Col col
);
64 void dc_setbg(DDC
*dc
, Col col
);
65 void dc_setfill(DDC
*dc
, Bool fill
);
67 /* Drawing functions */
68 void dc_drawrect(DDC
*dc
, int x
, int y
, unsigned int w
, unsigned int h
);
69 void dc_drawtext(DDC
*dc
, int x
, int y
, const char *text
);
72 void dc_map(DDC
*dc
, int x
, int y
, unsigned int w
, unsigned int h
);
75 void dc_getextents(DDC
*dc
, const char *text
, TextExtents
*extents
);