]> Dogcows Code - chaz/openbox/blob - render/render.h
put group members above the window when lowering it
[chaz/openbox] / render / render.h
1 #ifndef __render_h
2 #define __render_h
3
4 #define _XFT_NO_COMPAT_ /* no Xft 1 API */
5 #include <X11/Xft/Xft.h>
6 #include <X11/Xlib.h>
7 #include <glib.h>
8
9 typedef union _RrTextureData RrTextureData;
10 typedef struct _RrAppearance RrAppearance;
11 typedef struct _RrSurface RrSurface;
12 typedef struct _RrFont RrFont;
13 typedef struct _RrTexture RrTexture;
14 typedef struct _RrTextureMask RrTextureMask;
15 typedef struct _RrTextureRGBA RrTextureRGBA;
16 typedef struct _RrTextureText RrTextureText;
17 typedef struct _RrPixmapMask RrPixmapMask;
18 typedef struct _RrInstance RrInstance;
19 typedef struct _RrColor RrColor;
20
21 typedef guint32 RrPixel32;
22 typedef guint16 RrPixel16;
23
24 typedef enum {
25 RR_RELIEF_FLAT,
26 RR_RELIEF_RAISED,
27 RR_RELIEF_SUNKEN
28 } RrReliefType;
29
30 typedef enum {
31 RR_BEVEL_1,
32 RR_BEVEL_2
33 } RrBevelType;
34
35 typedef enum {
36 RR_SURFACE_NONE,
37 RR_SURFACE_PARENTREL,
38 RR_SURFACE_SOLID,
39 RR_SURFACE_HORIZONTAL,
40 RR_SURFACE_VERTICAL,
41 RR_SURFACE_DIAGONAL,
42 RR_SURFACE_CROSS_DIAGONAL,
43 RR_SURFACE_PYRAMID
44 } RrSurfaceColorType;
45
46 typedef enum {
47 RR_TEXTURE_NONE,
48 RR_TEXTURE_MASK,
49 RR_TEXTURE_TEXT,
50 RR_TEXTURE_RGBA
51 } RrTextureType;
52
53 typedef enum {
54 RR_JUSTIFY_LEFT,
55 RR_JUSTIFY_CENTER,
56 RR_JUSTIFY_RIGHT
57 } RrJustify;
58
59 struct _RrSurface {
60 RrSurfaceColorType grad;
61 RrReliefType relief;
62 RrBevelType bevel;
63 RrColor *primary;
64 RrColor *secondary;
65 RrColor *border_color;
66 RrColor *bevel_dark;
67 RrColor *bevel_light;
68 gboolean interlaced;
69 gboolean border;
70 RrAppearance *parent;
71 gint parentx;
72 gint parenty;
73 RrPixel32 *RrPixel_data;
74 };
75
76 struct _RrTextureText {
77 RrFont *font;
78 RrJustify justify;
79 RrColor *color;
80 gchar *string;
81 };
82
83 struct _RrPixmapMask {
84 const RrInstance *inst;
85 Pixmap mask;
86 gint width;
87 gint height;
88 gchar *data;
89 };
90
91 struct _RrTextureMask {
92 RrColor *color;
93 RrPixmapMask *mask;
94 };
95
96 struct _RrTextureRGBA {
97 gint width;
98 gint height;
99 RrPixel32 *data;
100 /* cached scaled so we don't have to scale often */
101 gint cwidth;
102 gint cheight;
103 RrPixel32 *cache;
104 };
105
106 union _RrTextureData {
107 RrTextureRGBA rgba;
108 RrTextureText text;
109 RrTextureMask mask;
110 };
111
112 struct _RrTexture {
113 RrTextureType type;
114 RrTextureData data;
115 };
116
117 struct _RrAppearance {
118 const RrInstance *inst;
119
120 RrSurface surface;
121 gint textures;
122 RrTexture *texture;
123 Pixmap pixmap;
124 XftDraw *xftdraw;
125
126 /* cached for internal use */
127 gint w, h;
128 };
129
130 #if (G_BYTE_ORDER == G_BIG_ENDIAN)
131 #define RrDefaultRedOffset 0
132 #define RrDefaultGreenOffset 8
133 #define RrDefaultBlueOffset 16
134 #define RrDefaultAlphaOffset 24
135 #define RrEndian MSBFirst
136 #else
137 #define RrDefaultAlphaOffset 24
138 #define RrDefaultRedOffset 16
139 #define RrDefaultGreenOffset 8
140 #define RrDefaultBlueOffset 0
141 #define RrEndian LSBFirst
142 #endif /* G_BYTE_ORDER == G_BIG_ENDIAN */
143
144 RrInstance* RrInstanceNew (Display *display, gint screen);
145 void RrInstanceFree (RrInstance *inst);
146
147 Display* RrDisplay (const RrInstance *inst);
148 gint RrScreen (const RrInstance *inst);
149 Window RrRootWindow (const RrInstance *inst);
150 Visual* RrVisual (const RrInstance *inst);
151 gint RrDepth (const RrInstance *inst);
152 Colormap RrColormap (const RrInstance *inst);
153 gint RrRedOffset (const RrInstance *inst);
154 gint RrGreenOffset (const RrInstance *inst);
155 gint RrBlueOffset (const RrInstance *inst);
156 gint RrRedShift (const RrInstance *inst);
157 gint RrGreenShift (const RrInstance *inst);
158 gint RrBlueShift (const RrInstance *inst);
159 gint RrRedMask (const RrInstance *inst);
160 gint RrGreenMask (const RrInstance *inst);
161 gint RrBlueMask (const RrInstance *inst);
162 guint RrPseudoBPC (const RrInstance *inst);
163 XColor* RrPseudoColors (const RrInstance *inst);
164
165 RrColor *RrColorNew (const RrInstance *inst, gint r, gint g, gint b);
166 RrColor *RrColorParse (const RrInstance *inst, gchar *colorname);
167 void RrColorFree (RrColor *in);
168
169 RrAppearance *RrAppearanceNew (const RrInstance *inst, gint numtex);
170 RrAppearance *RrAppearanceCopy (RrAppearance *a);
171 void RrAppearanceFree (RrAppearance *a);
172
173 int RrFontMeasureString (const RrFont *f, const gchar *str);
174 int RrFontHeight (const RrFont *f);
175 int RrFontMaxCharWidth (const RrFont *f);
176
177 void RrPaint (RrAppearance *l, Window win, gint w, gint h);
178 void RrMinsize (RrAppearance *l, gint *w, gint *h);
179
180 gboolean RrPixmapToRGBA(const RrInstance *inst,
181 Pixmap pmap, Pixmap mask,
182 gint *w, gint *h, RrPixel32 **data);
183
184 #endif /*__render_h*/
This page took 0.03907 seconds and 4 git commands to generate.