11 /*! Returns a struct to be used when calling members of the library.
12 If the library fails to initialize, NULL is returned.
13 @param display The X Display to use.
14 @param screen The number of the screen to use.
16 struct RrInstance *RrInstanceNew(Display *display,
19 /*! Destroys an instance of the library. The instance should not be used after
20 calling this function.
21 @param inst The instance to destroy.
23 void RrInstanceFree(struct RrInstance *inst);
25 int RrInstanceDepth(struct RrInstance *inst);
26 Colormap RrInstanceColormap(struct RrInstance *inst);
27 Visual *RrInstanceVisual(struct RrInstance *inst);
31 /*! A Color (including alpha component) for the Render library. This should be
32 treated as an opaque data type, and be accessed only via the available
35 /*! The red component. */
37 /*! The green component. */
39 /*! The blue component. */
41 /*! The alpha component. */
45 /*! Sets the values of all components for an RrColor */
46 #define RrColorSet(c, w, x, y, z) (c)->r = (w), (c)->g = (x), \
47 (c)->b = (y), (c)->a = z
50 /*! Gets color values from a colorname.
51 @param inst An instance of the library
52 @param colorname The name of the color.
53 @param ret The RrColor to set the colorvalues in.
54 @return nonzero if the colorname could be parsed; on error, it returns zero.
56 int RrColorParse(struct RrInstance *inst, const char *colorname,
63 struct RrFont *RrFontOpen(struct RrInstance *inst, const char *fontstring);
64 void RrFontClose(struct RrFont *font);
66 int RrFontMeasureString(struct RrFont *font, const char *string);
67 int RrFontHeight(struct RrFont *font);
68 int RrFontMaxCharWidth(struct RrFont *font);
80 /*! Create a new RrSurface prototype that can't render. A prototype can be
81 copied to a new RrSurface that can render. */
82 struct RrSurface *RrSurfaceNewProto(enum RrSurfaceType type,
84 /*! Create a new top-level RrSurface for a Window. The new RrSurface defaults
85 to a non-visible state.*/
86 struct RrSurface *RrSurfaceNew(struct RrInstance *inst,
87 enum RrSurfaceType type,
90 /*! Create a new RrSurface which is a child of another. The new RrSurface
91 defaults to a visible state. */
92 struct RrSurface *RrSurfaceNewChild(enum RrSurfaceType type,
93 struct RrSurface *parent,
95 /*! Destroys an RrSurface. */
96 void RrSurfaceFree(struct RrSurface *sur);
98 /*! Copy an RrSurface, setting the dest surface to be identical to the source
100 void RrSurfaceCopy(struct RrSurface *dest,
101 struct RrSurface *src);
103 void RrSurfaceSetArea(struct RrSurface *sur,
108 void RrSurfaceSetPos(struct RrSurface *sur,
111 void RrSurfaceSetSize(struct RrSurface *sur,
115 Window RrSurfaceWindow(struct RrSurface *sur);
117 void RrSurfaceShow(struct RrSurface *sur);
118 void RrSurfaceHide(struct RrSurface *sur);
119 int RrSurfaceVisible(struct RrSurface *sur);
121 void RrSurfaceMinSize(struct RrSurface *sur,
125 /*! Shape a surface to its children. This is not done implicitly inside the
126 library at *any* time. You must call this for each surface you want to
127 shape, when you want to update it. This means when you resize the surface
128 or change its base shape, or move/resize any of its children, you will need
129 to call this explicitly. Also, please note that you must call it on the
130 children surfaces first and work your way up to the top level surface for it
131 to function properly.
133 void RrSurfaceShape(struct RrSurface *sur);
135 /*! Set the base shape for a surface. To clear the base, pass 0 for all
136 of the arguments (except for the surface of course!)
138 void RrSurfaceShapeSetBase(struct RrSurface *sur,
143 /* planar surfaces */
145 /*! The options available for the background of an RrSurface */
146 enum RrSurfaceColorType {
147 /*! No rendering on the surface background, its contents will be
150 /*! Solid color fill. */
152 /*! Horizontal gradient. */
153 RR_PLANAR_HORIZONTAL,
154 /*! Vertical gradient. */
156 /*! Diagonal (TL->BR) gradient. */
158 /*! Cross-Diagonal (TR->BL) gradient. */
159 RR_PLANAR_CROSSDIAGONAL,
160 /*! Pipecross gradient. */
162 /*! Rectangle gradient. */
164 /*! Pyramid gradient. */
169 RR_SUNKEN_OUTER = -2,
170 RR_SUNKEN_INNER = -1,
176 void RrPlanarSet(struct RrSurface *sur,
177 enum RrSurfaceColorType type,
178 enum RrBevelType bevel,
179 struct RrColor *primary,
180 struct RrColor *secondary,
182 struct RrColor *border);
199 typedef long RrData32;
201 typedef int RrData32;
204 void RrTextureSetRGBA(struct RrSurface *sur,
211 void RrTextureSetText(struct RrSurface *sur,
214 enum RrLayout layout,
215 struct RrColor *color,
217 void RrTextureSetNone(struct RrSurface *sur,
222 /*! Paints the surface, and optionally all its children */
223 void RrPaint(struct RrSurface *sur, int recurse_always);
225 void RrExpose(struct RrInstance *inst, XExposeEvent *e);