sorting includes in dwm.c
[azarus-dwm.git] / drw.h
blob1fed8247ec2fab2b458cdf8f0ce2b1387e687fe8
1 /* See LICENSE file for copyright and license details. */
2 #define DRW_FONT_CACHE_SIZE 32
4 typedef struct {
5 unsigned long pix;
6 XftColor rgb;
7 } Clr;
9 typedef struct {
10 Cursor cursor;
11 } Cur;
13 typedef struct {
14 Display *dpy;
15 int ascent;
16 int descent;
17 unsigned int h;
18 XftFont *xfont;
19 FcPattern *pattern;
20 } Fnt;
22 typedef struct {
23 Clr *fg;
24 Clr *bg;
25 Clr *border;
26 } ClrScheme;
28 typedef struct {
29 unsigned int w, h;
30 Display *dpy;
31 int screen;
32 Window root;
33 Visual *visual;
34 unsigned int depth;
35 Colormap cmap;
36 Drawable drawable;
37 GC gc;
38 ClrScheme *scheme;
39 size_t fontcount;
40 Fnt *fonts[DRW_FONT_CACHE_SIZE];
41 } Drw;
43 typedef struct {
44 unsigned int w;
45 unsigned int h;
46 } Extnts;
48 /* Drawable abstraction */
49 Drw *drw_create(Display *, int, Window, unsigned int, unsigned int, Visual*, unsigned int, Colormap);
50 void drw_resize(Drw *, unsigned int, unsigned int);
51 void drw_free(Drw *);
53 /* Fnt abstraction */
54 Fnt *drw_font_create(Drw *, const char *);
55 void drw_load_fonts(Drw *, const char *[], size_t);
56 void drw_font_free(Fnt *);
57 void drw_font_getexts(Fnt *, const char *, unsigned int, Extnts *);
58 unsigned int drw_font_getexts_width(Fnt *, const char *, unsigned int);
60 /* Colour abstraction */
61 Clr *drw_clr_create(Drw *, const char *, unsigned int);
62 void drw_clr_free(Clr *);
64 /* Cursor abstraction */
65 Cur *drw_cur_create(Drw *, int);
66 void drw_cur_free(Drw *, Cur *);
68 /* Drawing context manipulation */
69 void drw_setfont(Drw *, Fnt *);
70 void drw_setscheme(Drw *, ClrScheme *);
72 /* Drawing functions */
73 void drw_rect(Drw *, int, int, unsigned int, unsigned int, int, int, int);
74 int drw_text(Drw *, int, int, unsigned int, unsigned int, const char *, int);
76 /* Map functions */
77 void drw_map(Drw *, Window, int, int, unsigned int, unsigned int);