summaryrefslogtreecommitdiffstats
path: root/draw.h
diff options
context:
space:
mode:
authorAnselm R Garbe <anselm@garbe.us>2013-04-17 21:21:47 +0200
committerAnselm R Garbe <anselm@garbe.us>2013-04-17 21:21:47 +0200
commitf2544a331845ad80655c1f79c9dc61922fe3441c (patch)
tree759d6c9be0fee0c3c334c4653c6633cce90b3be4 /draw.h
parentcontinued with draw.c and draw.h implementation, now the integration begins (diff)
downloaddwm-f2544a331845ad80655c1f79c9dc61922fe3441c.tar.gz
dwm-f2544a331845ad80655c1f79c9dc61922fe3441c.zip
renamed draw into drw
Diffstat (limited to 'draw.h')
-rw-r--r--draw.h64
1 files changed, 0 insertions, 64 deletions
diff --git a/draw.h b/draw.h
deleted file mode 100644
index 17d2c89..0000000
--- a/draw.h
+++ /dev/null
@@ -1,64 +0,0 @@
1/* See LICENSE file for copyright and license details. */
2
3struct _XCol {
4 unsigned long rgb;
5};
6typedef struct _XCol Col;
7
8struct _XFont {
9 int ascent;
10 int descent;
11 unsigned int h;
12 XFontSet set;
13 XFontStruct *xfont;
14};
15typedef struct _XFont Fnt;
16
17typedef struct _XDraw Draw;
18struct _XDraw {
19 unsigned int w, h;
20 Display *dpy;
21 int screen;
22 Window win;
23 Drawable drawable;
24 GC gc;
25 Col *fg;
26 Col *bg;
27 Fnt *font;
28};
29
30typedef struct {
31 unsigned int w;
32 unsigned int h;
33 int xOff;
34 int yOff;
35} TextExtents;
36
37/* Drawable abstraction */
38Draw *draw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h);
39void draw_resize(Draw *draw, unsigned int w, unsigned int h);
40void draw_free(Draw *draw);
41
42/* Fnt abstraction */
43Fnt *draw_font_create(Draw *draw, const char *fontname);
44void draw_font_free(Draw *draw, Fnt *font);
45
46/* Colour abstraction */
47Col *draw_col_create(Draw *draw, const char *colname);
48void draw_col_free(Draw *draw, Col *col);
49
50/* Drawing context manipulation */
51void draw_setfont(Draw *draw, Fnt *font);
52void draw_setfg(Draw *draw, Col *col);
53void draw_setbg(Draw *draw, Col *col);
54
55/* Drawing functions */
56void draw_rect(Draw *draw, int x, int y, unsigned int w, unsigned int h, Bool filled, Bool empty, Bool invert);
57void draw_text(Draw *draw, int x, int y, unsigned int w, unsigned int h, const char *text, Bool invert);
58
59/* Map functions */
60void draw_map(Draw *draw, int x, int y, unsigned int w, unsigned int h);
61
62/* Text functions */
63void draw_getextents(Draw *draw, const char *text, unsigned int len, TextExtents *extents);
64