4 * Copyright (c) Tuomo Valkonen 1999-2007.
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.
12 #ifndef ION_DE_BRUSH_H
13 #define ION_DE_BRUSH_H
15 #include <libextl/extl.h>
17 #include <ioncore/common.h>
18 #include <ioncore/gr.h>
19 #include <ioncore/rectangle.h>
27 typedef void DEBrushExtrasFn(DEBrush *brush,
32 const GrStyleSpec *a1,
33 const GrStyleSpec *a2,
39 DEBrushExtrasFn *extras_fn;
44 GrStyleSpec current_attr;
47 extern DEBrush *de_get_brush(Window win, WRootWin *rootwin,
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);
56 extern DEBrush *debrush_get_slave(DEBrush *brush, WRootWin *rootwin,
59 extern void debrush_release(DEBrush *brush);
62 extern DEColourGroup *debrush_get_colour_group2(DEBrush *brush,
63 const GrStyleSpec *a1,
64 const GrStyleSpec *a2);
66 extern DEColourGroup *debrush_get_colour_group(DEBrush *brush,
67 const GrStyleSpec *attr);
69 extern DEColourGroup *debrush_get_current_colour_group(DEBrush *brush);
73 extern void debrush_begin(DEBrush *brush, const WRectangle *geom, int flags);
74 extern void debrush_end(DEBrush *brush);
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);
83 extern void debrush_get_border_widths(DEBrush *brush, GrBorderWidths *bdw);
84 extern bool debrush_get_extra(DEBrush *brush, const char *key, char type,
89 extern void debrush_draw_border(DEBrush *brush,
90 const WRectangle *geom);
91 extern void debrush_draw_borderline(DEBrush *brush, const WRectangle *geom,
94 extern void debrush_draw_textbox(DEBrush *brush, const WRectangle *geom,
95 const char *text, bool needfill);
97 extern void debrush_draw_textboxes(DEBrush *brush, const WRectangle *geom,
98 int n, const GrTextElem *elem,
101 extern DEBrushExtrasFn debrush_tab_extras;
102 extern DEBrushExtrasFn debrush_menuentry_extras;
106 extern void debrush_set_window_shape(DEBrush *brush, bool rough,
107 int n, const WRectangle *rects);
109 extern void debrush_enable_transparency(DEBrush *brush, GrTransparency mode);
111 extern void debrush_fill_area(DEBrush *brush, const WRectangle *geom);
112 extern void debrush_clear_area(DEBrush *brush, const WRectangle *geom);
115 #endif /* ION_DE_BRUSH_H */