]> git.decadent.org.uk Git - ion3.git/blob - de/brush.h
a1a6b3fd7de2be784b28976f658992f61a6fc431
[ion3.git] / de / brush.h
1 /*
2  * ion/de/brush.h
3  *
4  * Copyright (c) Tuomo Valkonen 1999-2006. 
5  *
6  * Ion is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2.1 of the License, or
9  * (at your option) any later version.
10  */
11
12 #ifndef ION_DE_BRUSH_H
13 #define ION_DE_BRUSH_H
14
15 #include <libextl/extl.h>
16
17 #include <ioncore/common.h>
18 #include <ioncore/gr.h>
19 #include <ioncore/rectangle.h>
20
21 INTRCLASS(DEBrush);
22
23 #include "style.h"
24 #include "colour.h"
25
26
27 typedef void DEBrushExtrasFn(DEBrush *brush, 
28                              const WRectangle *g, DEColourGroup *cg,
29                              GrBorderWidths *bdw,
30                              GrFontExtents *fnte,
31                              const char *a1, const char *a2,
32                              bool pre);
33
34 DECLCLASS(DEBrush){
35     GrBrush grbrush;
36     DEStyle *d;
37     DEBrushExtrasFn *extras_fn;
38     int indicator_w;
39     Window win;
40     bool clip_set;
41 };
42
43 extern DEBrush *de_get_brush(Window win, WRootWin *rootwin,
44                              const char *style);
45
46 extern DEBrush *create_debrush(Window win, 
47                                const char *stylename, DEStyle *style);
48 extern bool debrush_init(DEBrush *brush, Window win,
49                          const char *stylename, DEStyle *style);
50 extern void debrush_deinit(DEBrush *brush);
51
52 extern DEBrush *debrush_get_slave(DEBrush *brush, WRootWin *rootwin, 
53                                   const char *style);
54
55 extern void debrush_release(DEBrush *brush);
56
57
58 extern DEColourGroup *debrush_get_colour_group2(DEBrush *brush, 
59                                                 const char *attr_p1,
60                                                 const char *attr_p2);
61
62 extern DEColourGroup *debrush_get_colour_group(DEBrush *brush, 
63                                                const char *attr);
64
65
66 /* Begin/end */
67
68 extern void debrush_begin(DEBrush *brush, const WRectangle *geom, int flags);
69 extern void debrush_end(DEBrush *brush);
70
71 /* Information */
72
73 extern void debrush_get_border_widths(DEBrush *brush, GrBorderWidths *bdw);
74 extern bool debrush_get_extra(DEBrush *brush, const char *key, char type, 
75                               void *data);
76
77 /* Borders & boxes */
78
79 extern void debrush_draw_border(DEBrush *brush, 
80                                 const WRectangle *geom,
81                                 const char *attrib);
82 extern void debrush_draw_borderline(DEBrush *brush, const WRectangle *geom,
83                                     const char *attrib, GrBorderLine line);
84
85 extern void debrush_draw_textbox(DEBrush *brush, const WRectangle *geom,
86                                  const char *text, const char *attr,
87                                  bool needfill);
88
89 extern void debrush_draw_textboxes(DEBrush *brush, const WRectangle *geom, 
90                                    int n, const GrTextElem *elem, 
91                                    bool needfill, const char *common_attrib);
92
93 extern DEBrushExtrasFn debrush_tab_extras;
94 extern DEBrushExtrasFn debrush_menuentry_extras;
95
96 /* Misc */
97
98 extern void debrush_set_window_shape(DEBrush *brush, bool rough,
99                                      int n, const WRectangle *rects);
100
101 extern void debrush_enable_transparency(DEBrush *brush, GrTransparency mode);
102
103 extern void debrush_fill_area(DEBrush *brush, const WRectangle *geom, 
104                               const char *attr);
105 extern void debrush_clear_area(DEBrush *brush, const WRectangle *geom);
106
107
108 #endif /* ION_DE_BRUSH_H */