diff options
| author | Anselm R Garbe <anselm@garbe.us> | 2012-12-09 19:11:11 +0100 |
|---|---|---|
| committer | Anselm R Garbe <anselm@garbe.us> | 2012-12-09 19:11:11 +0100 |
| commit | aafeaf731701e528f4ae9d7c7432b3e92fee4392 (patch) | |
| tree | 5e47eacfcecae118e738558ee7355cde769c1157 /draw.h | |
| parent | continued with draw.c abstraction, also started util.{h,c} implementation, th... (diff) | |
| download | dwm-aafeaf731701e528f4ae9d7c7432b3e92fee4392.tar.gz dwm-aafeaf731701e528f4ae9d7c7432b3e92fee4392.zip | |
continued with draw.c and draw.h implementation, now the integration begins
Diffstat (limited to '')
| -rw-r--r-- | draw.h | 25 |
1 files changed, 10 insertions, 15 deletions
| @@ -13,19 +13,7 @@ struct _XFont { | |||
| 13 | XFontStruct *xfont; | 13 | XFontStruct *xfont; |
| 14 | }; | 14 | }; |
| 15 | typedef struct _XFont Fnt; | 15 | typedef struct _XFont Fnt; |
| 16 | /* X11 types - end */ | ||
| 17 | 16 | ||
| 18 | typedef struct { | ||
| 19 | unsigned int w; | ||
| 20 | unsigned int h; | ||
| 21 | int x; | ||
| 22 | int y; | ||
| 23 | int xOff; | ||
| 24 | int yOff; | ||
| 25 | } TextExtents; | ||
| 26 | |||
| 27 | |||
| 28 | /* X11 types - begin */ | ||
| 29 | typedef struct _XDraw Draw; | 17 | typedef struct _XDraw Draw; |
| 30 | struct _XDraw { | 18 | struct _XDraw { |
| 31 | unsigned int w, h; | 19 | unsigned int w, h; |
| @@ -39,6 +27,13 @@ struct _XDraw { | |||
| 39 | Fnt *font; | 27 | Fnt *font; |
| 40 | }; | 28 | }; |
| 41 | 29 | ||
| 30 | typedef struct { | ||
| 31 | unsigned int w; | ||
| 32 | unsigned int h; | ||
| 33 | int xOff; | ||
| 34 | int yOff; | ||
| 35 | } TextExtents; | ||
| 36 | |||
| 42 | /* Drawable abstraction */ | 37 | /* Drawable abstraction */ |
| 43 | Draw *draw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h); | 38 | 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); | 39 | void draw_resize(Draw *draw, unsigned int w, unsigned int h); |
| @@ -58,12 +53,12 @@ void draw_setfg(Draw *draw, Col *col); | |||
| 58 | void draw_setbg(Draw *draw, Col *col); | 53 | void draw_setbg(Draw *draw, Col *col); |
| 59 | 54 | ||
| 60 | /* Drawing functions */ | 55 | /* Drawing functions */ |
| 61 | void draw_rect(Draw *draw, int x, int y, unsigned int w, unsigned int h); | 56 | void draw_rect(Draw *draw, int x, int y, unsigned int w, unsigned int h, Bool filled, Bool empty, Bool invert); |
| 62 | void draw_text(Draw *draw, int x, int y, const char *text); | 57 | void draw_text(Draw *draw, int x, int y, unsigned int w, unsigned int h, const char *text, Bool invert); |
| 63 | 58 | ||
| 64 | /* Map functions */ | 59 | /* Map functions */ |
| 65 | void draw_map(Draw *draw, int x, int y, unsigned int w, unsigned int h); | 60 | void draw_map(Draw *draw, int x, int y, unsigned int w, unsigned int h); |
| 66 | 61 | ||
| 67 | /* Text functions */ | 62 | /* Text functions */ |
| 68 | void draw_getextents(Draw *draw, const char *text, TextExtents *extents); | 63 | void draw_getextents(Draw *draw, const char *text, unsigned int len, TextExtents *extents); |
| 69 | 64 | ||
