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