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 *RrInit(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 RrDestroy(struct RrInstance *inst);
28 /*! A Color (including alpha component) for the Render library. This should be
29 treated as an opaque data type, and be accessed only via the available
32 /*! The red component. */
34 /*! The green component. */
36 /*! The blue component. */
38 /*! The alpha component. */
42 /*! Returns the red component for an RrColor */
43 #define RrColorRed(c) (c)->r
44 /*! Returns the green component for an RrColor */
45 #define RrColorGreen(c) (c)->g
46 /*! Returns the blue component for an RrColor */
47 #define RrColorBlue(c) (c)->b
48 /*! Returns the alpha component for an RrColor */
49 #define RrColorAlpha(c) (c)->a
51 /*! Sets the values of all components for an RrColor */
52 #define RrColorSet(c, w, x, y, z) (c)->r = (w), (c)->g = (x), \
53 (c)->b = (y), (c)->a = z
56 /*! Gets color values from a colorname.
57 @param inst An instance of the library
58 @param colorname The name of the color.
59 @param ret The RrColor to set the colorvalues in.
60 @return nonzero if the colorname could be parsed; on error, it returns zero.
62 int RrColorParse(struct RrInstance *inst, const char *colorname,
69 struct RrFont *RrFontOpen(struct RrInstance *inst, const char *fontstring);
70 void RrFontClose(struct RrFont *font);
72 int RrFontMeasureString(struct RrFont *font, const char *string);
73 int RrFontHeight(struct RrFont *font);
74 int RrFontMaxCharWidth(struct RrFont *font);
85 /*! The options available for the background of an RrSurface */
86 enum RrSurfaceColorType {
87 /*! No rendering on the surface background, its contents will be
90 /*! Solid color fill. */
92 /*! Horizontal gradient. */
93 RR_SURFACE_HORIZONTAL,
94 /*! Vertical gradient. */
96 /*! Diagonal (TL->BR) gradient. */
98 /*! Cross-Diagonal (TR->BL) gradient. */
99 RR_SURFACE_CROSSDIAGONAL,
100 /*! Pipecross gradient. */
101 RR_SURFACE_PIPECROSS,
102 /*! Rectangle gradient. */
103 RR_SURFACE_RECTANGLE,
104 /*! Pyramid gradient. */
108 /*! Create a new RrSurface prototype that can't render. A prototype can be
109 copied to a new RrSurface that can render. */
110 struct RrSurface *RrSurfaceNewProto(enum RrSurfaceType type,
112 /*! Create a new top-level RrSurface for a Window. */
113 struct RrSurface *RrSurfaceNew(struct RrInstance *inst,
114 enum RrSurfaceType type,
117 /*! Create a new RrSurface which is a child of another. */
118 struct RrSurface *RrSurfaceNewChild(enum RrSurfaceType type,
119 struct RrSurface *parent,
121 /*! Copy an RrSurface, creating a new top-level RrSurface for a Window. */
122 struct RrSurface *RrSurfaceCopy(struct RrInstance *inst,
123 struct RrSurface *sur,
125 /*! Copy an RrSurface, creating a nwe RrSurface which is a child of another. */
126 struct RrSurface *RrSurfaceCopyChild(struct RrSurface *sur,
127 struct RrSurface *parent);
128 void RrSurfaceFree(struct RrSurface *sur);
130 Window RrSurfaceWindow(struct RrSurface *sur);
147 typedef long RrData32;
149 typedef int RrData32;
152 void RrTextureSetRGBA(struct RrSurface *sur,
159 void RrTextureSetText(struct RrSurface *sur,
162 enum RrLayout layout,