draw window frame
[windtk] / src / wtimpl.h
1 #ifndef WTIMPL_H_
2 #define WTIMPL_H_
3
4 #include <stdlib.h>
5 #include "windtk.h"
6 #include "widget.h"
7
8 enum {
9         COL_FG,
10         COL_BG,
11         COL_BGHI,
12         COL_BGLO,
13         COL_FRM,
14         COL_FRMHI,
15         COL_FRMLO,
16         COL_FFRM,
17         COL_FFRMHI,
18         COL_FFRMLO,
19
20         NUM_COLORS
21 };
22
23 enum { FRM_OUT, FRM_IN, FRM_NOFILL = 0x8000 };
24 #define FRMSTYLE(x)     ((x) & 0xff)
25
26 struct wt_context {
27         struct wt_graphics gfx;
28         struct wt_rect vp;
29         wt_widget *root;
30         struct wt_theme *theme;
31
32         int colors[NUM_COLORS];
33
34         wt_widget *focuswin;
35 };
36
37 extern struct wt_context *wt_curctx_;
38 #define wt      wt_curctx_
39
40 extern void *(*wt_alloc)(size_t sz);
41 extern void (*wt_free)(void *p);
42
43 void *wt_zalloc(size_t sz);
44
45 void wt_gfx_color(int cidx);
46 void wt_gfx_fillrect(struct wt_rect *r);
47 void wt_gfx_frame(struct wt_rect *r, int style, int basecol);
48 void wt_gfx_line(int x0, int y0, int x1, int y1);
49
50 #endif  /* WTIMPL_H_ */