]> git.decadent.org.uk Git - ion3.git/blob - de/brush.h
d9a040a50f80b970c1d3838c15492f0835f3c478
[ion3.git] / de / brush.h
1 /*
2  * ion/de/brush.h
3  *
4  * Copyright (c) Tuomo Valkonen 1999-2007. 
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, 
29                              DEColourGroup *cg,
30                              GrBorderWidths *bdw,
31                              GrFontExtents *fnte,
32                              const GrStyleSpec *a1,
33                              const GrStyleSpec *a2,
34                              bool pre);
35
36 DECLCLASS(DEBrush){
37     GrBrush grbrush;
38     DEStyle *d;
39     DEBrushExtrasFn *extras_fn;
40     int indicator_w;
41     Window win;
42     bool clip_set;
43     
44     GrStyleSpec current_attr;
45 };
46
47 extern DEBrush *de_get_brush(Window win, WRootWin *rootwin,
48                              const char *style);
49
50 extern DEBrush *create_debrush(Window win, 
51                                const GrStyleSpec *spec, DEStyle *style);
52 extern bool debrush_init(DEBrush *brush, Window win,
53                          const GrStyleSpec *spec, DEStyle *style);
54 extern void debrush_deinit(DEBrush *brush);
55
56 extern DEBrush *debrush_get_slave(DEBrush *brush, WRootWin *rootwin, 
57                                   const char *style);
58
59 extern void debrush_release(DEBrush *brush);
60
61
62 extern DEColourGroup *debrush_get_colour_group2(DEBrush *brush, 
63                                                 const GrStyleSpec *a1,
64                                                 const GrStyleSpec *a2);
65
66 extern DEColourGroup *debrush_get_colour_group(DEBrush *brush, 
67                                                const GrStyleSpec *attr);
68
69 extern DEColourGroup *debrush_get_current_colour_group(DEBrush *brush);
70
71 /* Begin/end */
72
73 extern void debrush_begin(DEBrush *brush, const WRectangle *geom, int flags);
74 extern void debrush_end(DEBrush *brush);
75
76 extern void debrush_init_attr(DEBrush *brush, const GrStyleSpec *spec);
77 extern void debrush_set_attr(DEBrush *brush, GrAttr attr);
78 extern void debrush_unset_attr(DEBrush *brush, GrAttr attr);
79 extern GrStyleSpec *debrush_get_current_attr(DEBrush *brush);
80
81 /* Information */
82
83 extern void debrush_get_border_widths(DEBrush *brush, GrBorderWidths *bdw);
84 extern bool debrush_get_extra(DEBrush *brush, const char *key, char type, 
85                               void *data);
86
87 /* Borders & boxes */
88
89 extern void debrush_draw_border(DEBrush *brush, 
90                                 const WRectangle *geom);
91 extern void debrush_draw_borderline(DEBrush *brush, const WRectangle *geom,
92                                     GrBorderLine line);
93
94 extern void debrush_draw_textbox(DEBrush *brush, const WRectangle *geom,
95                                  const char *text, bool needfill);
96
97 extern void debrush_draw_textboxes(DEBrush *brush, const WRectangle *geom, 
98                                    int n, const GrTextElem *elem, 
99                                    bool needfill);
100
101 extern DEBrushExtrasFn debrush_tab_extras;
102 extern DEBrushExtrasFn debrush_menuentry_extras;
103
104 /* Misc */
105
106 extern void debrush_set_window_shape(DEBrush *brush, bool rough,
107                                      int n, const WRectangle *rects);
108
109 extern void debrush_enable_transparency(DEBrush *brush, GrTransparency mode);
110
111 extern void debrush_fill_area(DEBrush *brush, const WRectangle *geom);
112 extern void debrush_clear_area(DEBrush *brush, const WRectangle *geom);
113
114
115 #endif /* ION_DE_BRUSH_H */