1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
3 render.h for the Openbox window manager
4 Copyright (c) 2003 Ben Jansens
5 Copyright (c) 2003 Derek Foreman
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 See the COPYING file for a copy of the GNU General Public License.
26 #include <X11/Xlib.h> /* some platforms dont include this as needed for Xft */
27 #define _XFT_NO_COMPAT_ /* no Xft 1 API */
28 #include <X11/Xft/Xft.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;
65 RR_SURFACE_HORIZONTAL,
68 RR_SURFACE_CROSS_DIAGONAL,
88 RrSurfaceColorType grad;
93 RrColor *border_color;
96 RrColor *interlace_color;
102 RrPixel32 *pixel_data;
105 struct _RrTextureText {
112 struct _RrPixmapMask {
113 const RrInstance *inst;
120 struct _RrTextureMask {
125 struct _RrTextureRGBA {
129 /* cached scaled so we don't have to scale often */
135 struct _RrTextureLineArt {
143 union _RrTextureData {
147 RrTextureLineArt lineart;
155 struct _RrAppearance {
156 const RrInstance *inst;
164 /* cached for internal use */
168 /* these are the same on all endian machines because it seems to be dependant
169 on the endianness of the gfx card, not the cpu. */
170 #define RrDefaultAlphaOffset 24
171 #define RrDefaultRedOffset 16
172 #define RrDefaultGreenOffset 8
173 #define RrDefaultBlueOffset 0
175 RrInstance* RrInstanceNew (Display *display, gint screen);
176 void RrInstanceFree (RrInstance *inst);
178 Display* RrDisplay (const RrInstance *inst);
179 gint RrScreen (const RrInstance *inst);
180 Window RrRootWindow (const RrInstance *inst);
181 Visual* RrVisual (const RrInstance *inst);
182 gint RrDepth (const RrInstance *inst);
183 Colormap RrColormap (const RrInstance *inst);
184 gint RrRedOffset (const RrInstance *inst);
185 gint RrGreenOffset (const RrInstance *inst);
186 gint RrBlueOffset (const RrInstance *inst);
187 gint RrRedShift (const RrInstance *inst);
188 gint RrGreenShift (const RrInstance *inst);
189 gint RrBlueShift (const RrInstance *inst);
190 gint RrRedMask (const RrInstance *inst);
191 gint RrGreenMask (const RrInstance *inst);
192 gint RrBlueMask (const RrInstance *inst);
194 RrColor *RrColorNew (const RrInstance *inst, gint r, gint g, gint b);
195 RrColor *RrColorParse (const RrInstance *inst, gchar *colorname);
196 void RrColorFree (RrColor *in);
198 gint RrColorRed (const RrColor *c);
199 gint RrColorGreen (const RrColor *c);
200 gint RrColorBlue (const RrColor *c);
201 gulong RrColorPixel (const RrColor *c);
202 GC RrColorGC (RrColor *c);
204 RrAppearance *RrAppearanceNew (const RrInstance *inst, gint numtex);
205 RrAppearance *RrAppearanceCopy (RrAppearance *a);
206 void RrAppearanceFree (RrAppearance *a);
208 RrSize *RrFontMeasureString (const RrFont *f, const gchar *str);
209 gint RrFontHeight (const RrFont *f);
210 gint RrFontMaxCharWidth (const RrFont *f);
212 void RrPaint (RrAppearance *a, Window win, gint w, gint h);
213 void RrMinsize (RrAppearance *a, gint *w, gint *h);
214 void RrMargins (RrAppearance *a, gint *l, gint *t, gint *r, gint *b);
216 gboolean RrPixmapToRGBA(const RrInstance *inst,
217 Pixmap pmap, Pixmap mask,
218 gint *w, gint *h, RrPixel32 **data);
222 #endif /*__render_h*/