]> Dogcows Code - chaz/openbox/blobdiff - obrender/render.h
Adding RrButton to libobrender, ref counted appearances.
[chaz/openbox] / obrender / render.h
index 64c2f6a114a1d2aa17aa8b700c103e9c13f0f5ce..a8a8fe369a988719dfa4cbca183abc869a06ffdf 100644 (file)
@@ -46,6 +46,7 @@ typedef struct _RrColor            RrColor;
 typedef struct _RrImage            RrImage;
 typedef struct _RrImagePic         RrImagePic;
 typedef struct _RrImageCache       RrImageCache;
+typedef struct _RrButton           RrButton;
 
 typedef guint32 RrPixel32;
 typedef guint16 RrPixel16;
@@ -54,12 +55,14 @@ typedef guchar  RrPixel8;
 typedef enum {
     RR_RELIEF_FLAT,
     RR_RELIEF_RAISED,
-    RR_RELIEF_SUNKEN
+    RR_RELIEF_SUNKEN,
+    RR_RELIEF_NUM_TYPES
 } RrReliefType;
 
 typedef enum {
     RR_BEVEL_1,
-    RR_BEVEL_2
+    RR_BEVEL_2,
+    RR_BEVEL_NUM_TYPES
 } RrBevelType;
 
 typedef enum {
@@ -72,7 +75,8 @@ typedef enum {
     RR_SURFACE_DIAGONAL,
     RR_SURFACE_CROSS_DIAGONAL,
     RR_SURFACE_PYRAMID,
-    RR_SURFACE_MIRROR_HORIZONTAL
+    RR_SURFACE_MIRROR_HORIZONTAL,
+    RR_SURFACE_NUM_TYPES
 } RrSurfaceColorType;
 
 typedef enum {
@@ -81,13 +85,15 @@ typedef enum {
     RR_TEXTURE_TEXT,
     RR_TEXTURE_LINE_ART,
     RR_TEXTURE_RGBA,
-    RR_TEXTURE_IMAGE
+    RR_TEXTURE_IMAGE,
+    RR_TEXTURE_NUM_TYPES
 } RrTextureType;
 
 typedef enum {
     RR_JUSTIFY_LEFT,
     RR_JUSTIFY_CENTER,
-    RR_JUSTIFY_RIGHT
+    RR_JUSTIFY_RIGHT,
+    RR_JUSTIFY_NUM_TYPES
 } RrJustify;
 
 /* Put middle first so it's the default */
@@ -95,7 +101,8 @@ typedef enum {
     RR_ELLIPSIZE_MIDDLE,
     RR_ELLIPSIZE_NONE,
     RR_ELLIPSIZE_START,
-    RR_ELLIPSIZE_END
+    RR_ELLIPSIZE_END,
+    RR_ELLIPSIZE_NUM_TYPES
 } RrEllipsizeMode;
 
 typedef enum {
@@ -103,13 +110,15 @@ typedef enum {
     RR_FONTWEIGHT_NORMAL,
     RR_FONTWEIGHT_SEMIBOLD,
     RR_FONTWEIGHT_BOLD,
-    RR_FONTWEIGHT_ULTRABOLD
+    RR_FONTWEIGHT_ULTRABOLD,
+    RR_FONTWEIGHT_NUM_TYPES
 } RrFontWeight;
 
 typedef enum {
     RR_FONTSLANT_NORMAL,
     RR_FONTSLANT_ITALIC,
-    RR_FONTSLANT_OBLIQUE
+    RR_FONTSLANT_OBLIQUE,
+    RR_FONTSLANT_NUM_TYPES
 } RrFontSlant;
 
 struct _RrSurface {
@@ -212,6 +221,8 @@ struct _RrTexture {
 
 struct _RrAppearance {
     const RrInstance *inst;
+    
+    gint ref;
 
     RrSurface surface;
     gint textures;
@@ -295,6 +306,7 @@ gint     RrGreenMask    (const RrInstance *inst);
 gint     RrBlueMask     (const RrInstance *inst);
 
 RrColor *RrColorNew   (const RrInstance *inst, gint r, gint g, gint b);
+RrColor *RrColorCopy  (RrColor *c);
 RrColor *RrColorParse (const RrInstance *inst, gchar *colorname);
 void     RrColorFree  (RrColor *in);
 
@@ -305,6 +317,7 @@ gulong   RrColorPixel (const RrColor *c);
 GC       RrColorGC    (RrColor *c);
 
 RrAppearance *RrAppearanceNew  (const RrInstance *inst, gint numtex);
+RrAppearance *RrAppearanceCopyShallow (RrAppearance *a);
 RrAppearance *RrAppearanceCopy (RrAppearance *a);
 void          RrAppearanceFree (RrAppearance *a);
 void          RrAppearanceRemoveTextures(RrAppearance *a);
@@ -312,10 +325,15 @@ void          RrAppearanceAddTextures(RrAppearance *a, gint numtex);
 /*! Always call this when changing the type of a texture in an appearance */
 void          RrAppearanceClearTextures(RrAppearance *a);
 
+RrButton *RrButtonNew (const RrInstance *inst);
+void      RrButtonFree(RrButton *b);
+
 RrFont *RrFontOpen          (const RrInstance *inst, const gchar *name,
                              gint size, RrFontWeight weight, RrFontSlant slant);
 RrFont *RrFontOpenDefault   (const RrInstance *inst);
 void    RrFontClose         (RrFont *f);
+/*! Returns an RrSize, that was allocated with g_slice_new().  Use g_slice_free() to
+  free it. */
 RrSize *RrFontMeasureString (const RrFont *f, const gchar *str,
                              gint shadow_offset_x, gint shadow_offset_y,
                              gboolean flow, gint maxwidth);
This page took 0.025302 seconds and 4 git commands to generate.