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 #define _XFT_NO_COMPAT_ /* no Xft 1 API */
29 #include <X11/Xft/Xft.h>
34 typedef union _RrTextureData RrTextureData
;
35 typedef struct _RrAppearance RrAppearance
;
36 typedef struct _RrSurface RrSurface
;
37 typedef struct _RrFont RrFont
;
38 typedef struct _RrTexture RrTexture
;
39 typedef struct _RrTextureMask RrTextureMask
;
40 typedef struct _RrTextureRGBA RrTextureRGBA
;
41 typedef struct _RrTextureText RrTextureText
;
42 typedef struct _RrTextureLineArt RrTextureLineArt
;
43 typedef struct _RrPixmapMask RrPixmapMask
;
44 typedef struct _RrInstance RrInstance
;
45 typedef struct _RrColor RrColor
;
47 typedef guint32 RrPixel32
;
48 typedef guint16 RrPixel16
;
65 RR_SURFACE_SPLIT_VERTICAL
,
66 RR_SURFACE_HORIZONTAL
,
69 RR_SURFACE_CROSS_DIAGONAL
,
71 RR_SURFACE_MIRROR_HORIZONTAL
,
89 RrSurfaceColorType grad
;
94 RrColor
*border_color
;
97 RrColor
*interlace_color
;
100 RrAppearance
*parent
;
103 RrPixel32
*pixel_data
;
106 struct _RrTextureText
{
113 struct _RrPixmapMask
{
114 const RrInstance
*inst
;
121 struct _RrTextureMask
{
126 struct _RrTextureRGBA
{
130 /* cached scaled so we don't have to scale often */
136 struct _RrTextureLineArt
{
144 union _RrTextureData
{
148 RrTextureLineArt lineart
;
156 struct _RrAppearance
{
157 const RrInstance
*inst
;
165 /* cached for internal use */
169 /* these are the same on all endian machines because it seems to be dependant
170 on the endianness of the gfx card, not the cpu. */
171 #define RrDefaultAlphaOffset 24
172 #define RrDefaultRedOffset 16
173 #define RrDefaultGreenOffset 8
174 #define RrDefaultBlueOffset 0
176 RrInstance
* RrInstanceNew (Display
*display
, gint screen
);
177 void RrInstanceFree (RrInstance
*inst
);
179 Display
* RrDisplay (const RrInstance
*inst
);
180 gint
RrScreen (const RrInstance
*inst
);
181 Window
RrRootWindow (const RrInstance
*inst
);
182 Visual
* RrVisual (const RrInstance
*inst
);
183 gint
RrDepth (const RrInstance
*inst
);
184 Colormap
RrColormap (const RrInstance
*inst
);
185 gint
RrRedOffset (const RrInstance
*inst
);
186 gint
RrGreenOffset (const RrInstance
*inst
);
187 gint
RrBlueOffset (const RrInstance
*inst
);
188 gint
RrRedShift (const RrInstance
*inst
);
189 gint
RrGreenShift (const RrInstance
*inst
);
190 gint
RrBlueShift (const RrInstance
*inst
);
191 gint
RrRedMask (const RrInstance
*inst
);
192 gint
RrGreenMask (const RrInstance
*inst
);
193 gint
RrBlueMask (const RrInstance
*inst
);
195 RrColor
*RrColorNew (const RrInstance
*inst
, gint r
, gint g
, gint b
);
196 RrColor
*RrColorParse (const RrInstance
*inst
, gchar
*colorname
);
197 void RrColorFree (RrColor
*in
);
199 gint
RrColorRed (const RrColor
*c
);
200 gint
RrColorGreen (const RrColor
*c
);
201 gint
RrColorBlue (const RrColor
*c
);
202 gulong
RrColorPixel (const RrColor
*c
);
203 GC
RrColorGC (RrColor
*c
);
205 RrAppearance
*RrAppearanceNew (const RrInstance
*inst
, gint numtex
);
206 RrAppearance
*RrAppearanceCopy (RrAppearance
*a
);
207 void RrAppearanceFree (RrAppearance
*a
);
209 RrSize
*RrFontMeasureString (const RrFont
*f
, const gchar
*str
);
210 gint
RrFontHeight (const RrFont
*f
);
211 gint
RrFontMaxCharWidth (const RrFont
*f
);
213 void RrPaint (RrAppearance
*a
, Window win
, gint w
, gint h
);
214 void RrMinsize (RrAppearance
*a
, gint
*w
, gint
*h
);
215 void RrMargins (RrAppearance
*a
, gint
*l
, gint
*t
, gint
*r
, gint
*b
);
217 gboolean
RrPixmapToRGBA(const RrInstance
*inst
,
218 Pixmap pmap
, Pixmap mask
,
219 gint
*w
, gint
*h
, RrPixel32
**data
);
223 #endif /*__render_h*/