1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
3 render.h for the Openbox window manager
4 Copyright (c) 2006 Mikael Magnusson
5 Copyright (c) 2003 Ben Jansens
6 Copyright (c) 2003 Derek Foreman
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 See the COPYING file for a copy of the GNU General Public License.
27 #include <X11/Xlib.h> /* some platforms dont include this as needed for Xft */
28 #include <pango/pangoxft.h>
33 typedef union _RrTextureData RrTextureData;
34 typedef struct _RrAppearance RrAppearance;
35 typedef struct _RrSurface RrSurface;
36 typedef struct _RrFont RrFont;
37 typedef struct _RrTexture RrTexture;
38 typedef struct _RrTextureMask RrTextureMask;
39 typedef struct _RrTextureRGBA RrTextureRGBA;
40 typedef struct _RrTextureText RrTextureText;
41 typedef struct _RrTextureLineArt RrTextureLineArt;
42 typedef struct _RrPixmapMask RrPixmapMask;
43 typedef struct _RrInstance RrInstance;
44 typedef struct _RrColor RrColor;
46 typedef guint32 RrPixel32;
47 typedef guint16 RrPixel16;
64 RR_SURFACE_SPLIT_VERTICAL,
65 RR_SURFACE_HORIZONTAL,
68 RR_SURFACE_CROSS_DIAGONAL,
70 RR_SURFACE_MIRROR_HORIZONTAL
90 RR_FONTWEIGHT_SEMIBOLD,
92 RR_FONTWEIGHT_ULTRABOLD
102 RrSurfaceColorType grad;
107 RrColor *border_color;
109 RrColor *bevel_light;
110 RrColor *interlace_color;
113 RrAppearance *parent;
116 RrPixel32 *pixel_data;
119 struct _RrTextureText {
126 struct _RrPixmapMask {
127 const RrInstance *inst;
134 struct _RrTextureMask {
139 struct _RrTextureRGBA {
143 /* cached scaled so we don't have to scale often */
149 struct _RrTextureLineArt {
157 union _RrTextureData {
161 RrTextureLineArt lineart;
169 struct _RrAppearance {
170 const RrInstance *inst;
178 /* cached for internal use */
182 /* these are the same on all endian machines because it seems to be dependant
183 on the endianness of the gfx card, not the cpu. */
184 #define RrDefaultAlphaOffset 24
185 #define RrDefaultRedOffset 16
186 #define RrDefaultGreenOffset 8
187 #define RrDefaultBlueOffset 0
189 #define RrDefaultFontFamily "arial,sans"
190 #define RrDefaultFontSize 8
191 #define RrDefaultFontWeight RR_FONTWEIGHT_NORMAL
192 #define RrDefaultFontSlant RR_FONTSLANT_NORMAL
193 #define RrDefaultFontShadow FALSE
194 #define RrDefaultFontShadowOffset 1
195 #define RrDefaultFontShadowTint 50
197 RrInstance* RrInstanceNew (Display *display, gint screen);
198 void RrInstanceFree (RrInstance *inst);
200 Display* RrDisplay (const RrInstance *inst);
201 gint RrScreen (const RrInstance *inst);
202 Window RrRootWindow (const RrInstance *inst);
203 Visual* RrVisual (const RrInstance *inst);
204 gint RrDepth (const RrInstance *inst);
205 Colormap RrColormap (const RrInstance *inst);
206 gint RrRedOffset (const RrInstance *inst);
207 gint RrGreenOffset (const RrInstance *inst);
208 gint RrBlueOffset (const RrInstance *inst);
209 gint RrRedShift (const RrInstance *inst);
210 gint RrGreenShift (const RrInstance *inst);
211 gint RrBlueShift (const RrInstance *inst);
212 gint RrRedMask (const RrInstance *inst);
213 gint RrGreenMask (const RrInstance *inst);
214 gint RrBlueMask (const RrInstance *inst);
216 RrColor *RrColorNew (const RrInstance *inst, gint r, gint g, gint b);
217 RrColor *RrColorParse (const RrInstance *inst, gchar *colorname);
218 void RrColorFree (RrColor *in);
220 gint RrColorRed (const RrColor *c);
221 gint RrColorGreen (const RrColor *c);
222 gint RrColorBlue (const RrColor *c);
223 gulong RrColorPixel (const RrColor *c);
224 GC RrColorGC (RrColor *c);
226 RrAppearance *RrAppearanceNew (const RrInstance *inst, gint numtex);
227 RrAppearance *RrAppearanceCopy (RrAppearance *a);
228 void RrAppearanceFree (RrAppearance *a);
230 RrFont *RrFontOpenByString (const RrInstance *inst, gchar *fontstring);
231 RrFont *RrFontOpen (const RrInstance *inst, gchar *name, gint size,
232 RrFontWeight weight, RrFontSlant slant,
233 gboolean shadow, gint shadowoffset,
235 RrFont *RrFontOpenDefault (const RrInstance *inst);
236 void RrFontClose (RrFont *f);
237 RrSize *RrFontMeasureString (const RrFont *f, const gchar *str);
238 gint RrFontHeight (const RrFont *f);
239 gint RrFontMaxCharWidth (const RrFont *f);
241 void RrPaint (RrAppearance *a, Window win, gint w, gint h);
242 void RrMinsize (RrAppearance *a, gint *w, gint *h);
243 void RrMargins (RrAppearance *a, gint *l, gint *t, gint *r, gint *b);
245 gboolean RrPixmapToRGBA(const RrInstance *inst,
246 Pixmap pmap, Pixmap mask,
247 gint *w, gint *h, RrPixel32 **data);
251 #endif /*__render_h*/