-} Appearance;
-
-extern Visual *render_visual;
-extern int render_depth;
-extern Colormap render_colormap;
-
-void (*paint)(Window win, Appearance *l);
-
-void render_startup(void);
-void init_appearance(Appearance *l);
-void x_paint(Window win, Appearance *l);
-void render_shutdown(void);
-Appearance *appearance_new(SurfaceType type, int numtex);
-Appearance *appearance_copy(Appearance *a);
-void appearance_free(Appearance *a);
-void truecolor_startup(void);
-void pseudocolor_startup(void);
-void pixel32_to_pixmap(pixel32 *in, Pixmap out, int x, int y, int w, int h);
+
+ /* cached for internal use */
+ gint w, h;
+};
+
+/* these are the same on all endian machines because it seems to be dependant
+ on the endianness of the gfx card, not the cpu. */
+#define RrDefaultAlphaOffset 24
+#define RrDefaultRedOffset 16
+#define RrDefaultGreenOffset 8
+#define RrDefaultBlueOffset 0
+
+RrInstance* RrInstanceNew (Display *display, gint screen);
+void RrInstanceFree (RrInstance *inst);
+
+Display* RrDisplay (const RrInstance *inst);
+gint RrScreen (const RrInstance *inst);
+Window RrRootWindow (const RrInstance *inst);
+Visual* RrVisual (const RrInstance *inst);
+gint RrDepth (const RrInstance *inst);
+Colormap RrColormap (const RrInstance *inst);
+gint RrRedOffset (const RrInstance *inst);
+gint RrGreenOffset (const RrInstance *inst);
+gint RrBlueOffset (const RrInstance *inst);
+gint RrRedShift (const RrInstance *inst);
+gint RrGreenShift (const RrInstance *inst);
+gint RrBlueShift (const RrInstance *inst);
+gint RrRedMask (const RrInstance *inst);
+gint RrGreenMask (const RrInstance *inst);
+gint RrBlueMask (const RrInstance *inst);
+guint RrPseudoBPC (const RrInstance *inst);
+XColor* RrPseudoColors (const RrInstance *inst);
+
+RrColor *RrColorNew (const RrInstance *inst, gint r, gint g, gint b);
+RrColor *RrColorParse (const RrInstance *inst, gchar *colorname);
+void RrColorFree (RrColor *in);
+
+gint RrColorRed (const RrColor *c);
+gint RrColorGreen (const RrColor *c);
+gint RrColorBlue (const RrColor *c);
+gulong RrColorPixel (const RrColor *c);
+
+RrAppearance *RrAppearanceNew (const RrInstance *inst, gint numtex);
+RrAppearance *RrAppearanceCopy (RrAppearance *a);
+void RrAppearanceFree (RrAppearance *a);
+
+int RrFontMeasureString (const RrFont *f, const gchar *str);
+int RrFontHeight (const RrFont *f);
+int RrFontMaxCharWidth (const RrFont *f);
+
+void RrPaint (RrAppearance *l, Window win, gint w, gint h);
+void RrMinsize (RrAppearance *l, gint *w, gint *h);
+
+gboolean RrPixmapToRGBA(const RrInstance *inst,
+ Pixmap pmap, Pixmap mask,
+ gint *w, gint *h, RrPixel32 **data);