]> git.decadent.org.uk Git - ion3.git/blob - de/brush.h
Imported Upstream version 20090110
[ion3.git] / de / brush.h
1 /*
2  * ion/de/brush.h
3  *
4  * Copyright (c) Tuomo Valkonen 1999-2009. 
5  *
6  * See the included file LICENSE for details.
7  */
8
9 #ifndef ION_DE_BRUSH_H
10 #define ION_DE_BRUSH_H
11
12 #include <libextl/extl.h>
13
14 #include <ioncore/common.h>
15 #include <ioncore/gr.h>
16 #include <ioncore/rectangle.h>
17
18 INTRCLASS(DEBrush);
19
20 #include "style.h"
21 #include "colour.h"
22
23
24 typedef void DEBrushExtrasFn(DEBrush *brush, 
25                              const WRectangle *g, 
26                              DEColourGroup *cg,
27                              const GrBorderWidths *bdw,
28                              const GrFontExtents *fnte,
29                              const GrStyleSpec *a1,
30                              const GrStyleSpec *a2,
31                              bool pre, int index);
32
33 DECLCLASS(DEBrush){
34     GrBrush grbrush;
35     DEStyle *d;
36     DEBrushExtrasFn *extras_fn;
37     int indicator_w;
38     Window win;
39     bool clip_set;
40     
41     GrStyleSpec current_attr;
42 };
43
44 extern DEBrush *de_get_brush(Window win, WRootWin *rootwin,
45                              const char *style);
46
47 extern DEBrush *create_debrush(Window win, 
48                                const GrStyleSpec *spec, DEStyle *style);
49 extern bool debrush_init(DEBrush *brush, Window win,
50                          const GrStyleSpec *spec, DEStyle *style);
51 extern void debrush_deinit(DEBrush *brush);
52
53 extern DEBrush *debrush_get_slave(DEBrush *brush, WRootWin *rootwin, 
54                                   const char *style);
55
56 extern void debrush_release(DEBrush *brush);
57
58
59 extern DEColourGroup *debrush_get_colour_group2(DEBrush *brush, 
60                                                 const GrStyleSpec *a1,
61                                                 const GrStyleSpec *a2);
62
63 extern DEColourGroup *debrush_get_colour_group(DEBrush *brush, 
64                                                const GrStyleSpec *attr);
65
66 extern DEColourGroup *debrush_get_current_colour_group(DEBrush *brush);
67
68 /* Begin/end */
69
70 extern void debrush_begin(DEBrush *brush, const WRectangle *geom, int flags);
71 extern void debrush_end(DEBrush *brush);
72
73 extern void debrush_init_attr(DEBrush *brush, const GrStyleSpec *spec);
74 extern void debrush_set_attr(DEBrush *brush, GrAttr attr);
75 extern void debrush_unset_attr(DEBrush *brush, GrAttr attr);
76 extern GrStyleSpec *debrush_get_current_attr(DEBrush *brush);
77
78 /* Information */
79
80 extern void debrush_get_border_widths(DEBrush *brush, GrBorderWidths *bdw);
81 extern bool debrush_get_extra(DEBrush *brush, const char *key, char type, 
82                               void *data);
83
84 /* Borders & boxes */
85
86 extern void debrush_draw_border(DEBrush *brush, 
87                                 const WRectangle *geom);
88 extern void debrush_draw_borderline(DEBrush *brush, const WRectangle *geom,
89                                     GrBorderLine line);
90
91 extern void debrush_draw_textbox(DEBrush *brush, const WRectangle *geom,
92                                  const char *text, bool needfill);
93
94 extern void debrush_draw_textboxes(DEBrush *brush, const WRectangle *geom, 
95                                    int n, const GrTextElem *elem, 
96                                    bool needfill);
97
98 extern DEBrushExtrasFn debrush_tab_extras;
99 extern DEBrushExtrasFn debrush_menuentry_extras;
100
101 /* Misc */
102
103 extern void debrush_set_window_shape(DEBrush *brush, bool rough,
104                                      int n, const WRectangle *rects);
105
106 extern void debrush_enable_transparency(DEBrush *brush, GrTransparency mode);
107
108 extern void debrush_fill_area(DEBrush *brush, const WRectangle *geom);
109 extern void debrush_clear_area(DEBrush *brush, const WRectangle *geom);
110
111
112 #endif /* ION_DE_BRUSH_H */