Releasing version 3-2014010501
[notion/jeffpc.git] / de / brush.h
blob523fcc7158da2e148ebecfcc93ee3d3e8d5c6358
1 /*
2 * ion/de/brush.h
4 * Copyright (c) Tuomo Valkonen 1999-2009.
6 * See the included file LICENSE for details.
7 */
9 #ifndef ION_DE_BRUSH_H
10 #define ION_DE_BRUSH_H
12 #include <libextl/extl.h>
14 #include <ioncore/common.h>
15 #include <ioncore/gr.h>
16 #include <ioncore/rectangle.h>
18 INTRCLASS(DEBrush);
20 #include "style.h"
21 #include "colour.h"
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);
33 DECLCLASS(DEBrush){
34 GrBrush grbrush;
35 DEStyle *d;
36 DEBrushExtrasFn *extras_fn;
37 int indicator_w;
38 Window win;
39 bool clip_set;
41 GrStyleSpec current_attr;
44 extern DEBrush *de_get_brush(Window win, WRootWin *rootwin,
45 const char *style);
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);
53 extern DEBrush *debrush_get_slave(DEBrush *brush, WRootWin *rootwin,
54 const char *style);
56 extern void debrush_release(DEBrush *brush);
59 extern DEColourGroup *debrush_get_colour_group2(DEBrush *brush,
60 const GrStyleSpec *a1,
61 const GrStyleSpec *a2);
63 extern DEColourGroup *debrush_get_colour_group(DEBrush *brush,
64 const GrStyleSpec *attr);
66 extern DEColourGroup *debrush_get_current_colour_group(DEBrush *brush);
68 /* Begin/end */
70 extern void debrush_begin(DEBrush *brush, const WRectangle *geom, int flags);
71 extern void debrush_end(DEBrush *brush);
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);
78 /* Information */
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);
84 /* Borders & boxes */
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);
91 extern void debrush_draw_textbox(DEBrush *brush, const WRectangle *geom,
92 const char *text, bool needfill);
94 extern void debrush_draw_textboxes(DEBrush *brush, const WRectangle *geom,
95 int n, const GrTextElem *elem,
96 bool needfill);
98 extern DEBrushExtrasFn debrush_tab_extras;
99 extern DEBrushExtrasFn debrush_menuentry_extras;
101 /* Misc */
103 extern void debrush_set_window_shape(DEBrush *brush, bool rough,
104 int n, const WRectangle *rects);
106 extern void debrush_enable_transparency(DEBrush *brush, GrTransparency mode);
108 extern void debrush_fill_area(DEBrush *brush, const WRectangle *geom);
109 extern void debrush_clear_area(DEBrush *brush, const WRectangle *geom);
112 #endif /* ION_DE_BRUSH_H */