]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkstyle.c
Adapt to uscore-ification of gtktextiterprivate
[~andy/gtk] / gtk / gtkstyle.c
index a7c1b6880d1cf20c27f9b684b4ae8d3e854d0f3e..d86986e525fa365b118ab9c7e291b8eb4b4b7db5 100644 (file)
@@ -31,7 +31,7 @@
 #include "gtkstyle.h"
 #include "gtkwidget.h"
 #include "gtkthemes.h"
-
+#include "gtkiconfactory.h"
 
 #define LIGHTNESS_MULT  1.3
 #define DARKNESS_MULT   0.7
@@ -56,7 +56,16 @@ static void      gtk_style_real_set_background (GtkStyle     *style,
                                                GtkStateType  state_type);
 static GtkStyle *gtk_style_real_clone          (GtkStyle     *style);
 static void      gtk_style_real_init_from_rc   (GtkStyle     *style,
-                                               GtkRcStyle   *rc_style);
+                                                GtkRcStyle   *rc_style);
+
+
+static GdkPixbuf *gtk_default_render_icon      (GtkStyle            *style,
+                                                const GtkIconSource *source,
+                                                GtkTextDirection     direction,
+                                                GtkStateType         state,
+                                                const gchar         *size,
+                                                GtkWidget           *widget,
+                                                const gchar         *detail);
 
 static void gtk_default_draw_hline      (GtkStyle        *style,
                                         GdkWindow       *window,
@@ -132,17 +141,6 @@ static void gtk_default_draw_diamond    (GtkStyle        *style,
                                         gint             y,
                                         gint             width,
                                         gint             height);
-static void gtk_default_draw_oval       (GtkStyle        *style,
-                                        GdkWindow       *window,
-                                        GtkStateType     state_type,
-                                        GtkShadowType    shadow_type,
-                                        GdkRectangle    *area,
-                                        GtkWidget       *widget,
-                                        const gchar     *detail,
-                                        gint             x,
-                                        gint             y,
-                                        gint             width,
-                                        gint             height);
 static void gtk_default_draw_string     (GtkStyle        *style,
                                         GdkWindow       *window,
                                         GtkStateType     state_type,
@@ -196,29 +194,6 @@ static void gtk_default_draw_option     (GtkStyle        *style,
                                         gint             y,
                                         gint             width,
                                         gint             height);
-static void gtk_default_draw_cross      (GtkStyle        *style,
-                                        GdkWindow       *window,
-                                        GtkStateType     state_type,
-                                        GtkShadowType    shadow_type,
-                                        GdkRectangle    *area,
-                                        GtkWidget       *widget,
-                                        const gchar     *detail,
-                                        gint             x,
-                                        gint             y,
-                                        gint             width,
-                                        gint             height);
-static void gtk_default_draw_ramp       (GtkStyle        *style,
-                                        GdkWindow       *window,
-                                        GtkStateType     state_type,
-                                        GtkShadowType    shadow_type,
-                                        GdkRectangle    *area,
-                                        GtkWidget       *widget,
-                                        const gchar     *detail,
-                                        GtkArrowType     arrow_type,
-                                        gint             x,
-                                        gint             y,
-                                        gint             width,
-                                        gint             height);
 static void gtk_default_draw_tab        (GtkStyle        *style,
                                         GdkWindow       *window,
                                         GtkStateType     state_type,
@@ -303,6 +278,24 @@ static void gtk_default_draw_handle     (GtkStyle        *style,
                                         gint             width,
                                         gint             height,
                                         GtkOrientation   orientation);
+static void gtk_default_draw_expander   (GtkStyle        *style,
+                                         GdkWindow       *window,
+                                         GtkStateType     state_type,
+                                         GdkRectangle    *area,
+                                         GtkWidget       *widget,
+                                         const gchar     *detail,
+                                         gint             x,
+                                         gint             y,
+                                         gboolean         is_open);
+static void gtk_default_draw_layout     (GtkStyle        *style,
+                                         GdkWindow       *window,
+                                         GtkStateType     state_type,
+                                         GdkRectangle    *area,
+                                         GtkWidget       *widget,
+                                         const gchar     *detail,
+                                         gint             x,
+                                         gint             y,
+                                         PangoLayout     *layout);
 
 static void gtk_style_shade (GdkColor *a, GdkColor *b, gdouble k);
 static void rgb_to_hls (gdouble *r, gdouble *g, gdouble *b);
@@ -350,7 +343,7 @@ gtk_style_get_type (void)
       
       object_type = g_type_register_static (G_TYPE_OBJECT,
                                             "GtkStyle",
-                                            &object_info);
+                                            &object_info, 0);
     }
   
   return object_type;
@@ -367,8 +360,11 @@ gtk_style_init (GtkStyle *style)
     {
       default_font = gdk_font_from_description (style->font_desc);
 
-      if (!default_font)
-       g_error ("Unable to load default font.");
+      if (!default_font) 
+       default_font = gdk_font_load ("fixed");
+
+      if (!default_font) 
+       g_error ("Unable to load \"fixed\" font!");
     }
   
   style->font = default_font;
@@ -445,21 +441,19 @@ gtk_style_class_init (GtkStyleClass *klass)
   klass->realize = gtk_style_real_realize;
   klass->unrealize = gtk_style_real_unrealize;
   klass->set_background = gtk_style_real_set_background;
-  
+  klass->render_icon = gtk_default_render_icon;
+
   klass->draw_hline = gtk_default_draw_hline;
   klass->draw_vline = gtk_default_draw_vline;
   klass->draw_shadow = gtk_default_draw_shadow;
   klass->draw_polygon = gtk_default_draw_polygon;
   klass->draw_arrow = gtk_default_draw_arrow;
   klass->draw_diamond = gtk_default_draw_diamond;
-  klass->draw_oval = gtk_default_draw_oval;
   klass->draw_string = gtk_default_draw_string;
   klass->draw_box = gtk_default_draw_box;
   klass->draw_flat_box = gtk_default_draw_flat_box;
   klass->draw_check = gtk_default_draw_check;
   klass->draw_option = gtk_default_draw_option;
-  klass->draw_cross = gtk_default_draw_cross;
-  klass->draw_ramp = gtk_default_draw_ramp;
   klass->draw_tab = gtk_default_draw_tab;
   klass->draw_shadow_gap = gtk_default_draw_shadow_gap;
   klass->draw_box_gap = gtk_default_draw_box_gap;
@@ -467,6 +461,8 @@ gtk_style_class_init (GtkStyleClass *klass)
   klass->draw_focus = gtk_default_draw_focus;
   klass->draw_slider = gtk_default_draw_slider;
   klass->draw_handle = gtk_default_draw_handle;
+  klass->draw_expander = gtk_default_draw_expander;
+  klass->draw_layout = gtk_default_draw_layout;
 }
 
 static void
@@ -521,7 +517,7 @@ gtk_style_duplicate (GtkStyle *style)
 {
   GtkStyle *new_style;
   
-  g_return_val_if_fail (style != NULL, NULL);
+  g_return_val_if_fail (GTK_IS_STYLE (style), NULL);
   
   new_style = gtk_style_copy (style);
   
@@ -582,7 +578,7 @@ gtk_style_attach (GtkStyle  *style,
   GtkStyle *new_style = NULL;
   GdkColormap *colormap;
   
-  g_return_val_if_fail (style != NULL, NULL);
+  g_return_val_if_fail (GTK_IS_STYLE (style), NULL);
   g_return_val_if_fail (window != NULL, NULL);
   
   colormap = gdk_window_get_colormap (window);
@@ -632,7 +628,7 @@ gtk_style_attach (GtkStyle  *style,
 void
 gtk_style_detach (GtkStyle *style)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   
   style->attach_count -= 1;
   if (style->attach_count == 0)
@@ -659,7 +655,7 @@ static void
 gtk_style_realize (GtkStyle    *style,
                    GdkColormap *colormap)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   
   style->colormap = colormap;
   style->depth = gdk_colormap_get_visual (colormap)->depth;
@@ -667,6 +663,31 @@ gtk_style_realize (GtkStyle    *style,
   GTK_STYLE_GET_CLASS (style)->realize (style);
 }
 
+GtkIconSet*
+gtk_style_lookup_icon_set (GtkStyle   *style,
+                           const char *stock_id)
+{
+  GSList *iter;
+
+  g_return_val_if_fail (GTK_IS_STYLE (style), NULL);
+  g_return_val_if_fail (stock_id != NULL, NULL);
+  
+  iter = style->icon_factories;
+  while (iter != NULL)
+    {
+      GtkIconSet *icon_set =
+        gtk_icon_factory_lookup (GTK_ICON_FACTORY (iter->data),
+                                 stock_id);
+
+      if (icon_set)
+        return icon_set;
+      
+      iter = g_slist_next (iter);
+    }
+
+  return gtk_icon_factory_lookup_default (stock_id);
+}
+
 void
 gtk_draw_hline (GtkStyle     *style,
                 GdkWindow    *window,
@@ -675,7 +696,7 @@ gtk_draw_hline (GtkStyle     *style,
                 gint          x2,
                 gint          y)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_hline != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_hline (style, window, state_type, NULL, NULL, NULL, x1, x2, y);
@@ -690,7 +711,7 @@ gtk_draw_vline (GtkStyle     *style,
                 gint          y2,
                 gint          x)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_vline != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_vline (style, window, state_type, NULL, NULL, NULL, y1, y2, x);
@@ -707,7 +728,7 @@ gtk_draw_shadow (GtkStyle      *style,
                  gint           width,
                  gint           height)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_shadow != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_shadow (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
@@ -722,7 +743,7 @@ gtk_draw_polygon (GtkStyle      *style,
                   gint           npoints,
                   gboolean       fill)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_polygon != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_polygon (style, window, state_type, shadow_type, NULL, NULL, NULL, points, npoints, fill);
@@ -740,7 +761,7 @@ gtk_draw_arrow (GtkStyle      *style,
                 gint           width,
                 gint           height)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_arrow != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_arrow (style, window, state_type, shadow_type, NULL, NULL, NULL, arrow_type, fill, x, y, width, height);
@@ -757,29 +778,13 @@ gtk_draw_diamond (GtkStyle      *style,
                   gint           width,
                   gint           height)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_diamond != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_diamond (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
 }
 
 
-void
-gtk_draw_oval (GtkStyle      *style,
-               GdkWindow     *window,
-               GtkStateType   state_type,
-               GtkShadowType  shadow_type,
-               gint           x,
-               gint           y,
-               gint           width,
-               gint           height)
-{
-  g_return_if_fail (style != NULL);
-  g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_oval != NULL);
-  
-  GTK_STYLE_GET_CLASS (style)->draw_oval (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
-}
-
 void
 gtk_draw_string (GtkStyle      *style,
                  GdkWindow     *window,
@@ -788,7 +793,7 @@ gtk_draw_string (GtkStyle      *style,
                  gint           y,
                  const gchar   *string)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_string != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_string (style, window, state_type, NULL, NULL, NULL, x, y, string);
@@ -804,7 +809,7 @@ gtk_draw_box (GtkStyle      *style,
               gint           width,
               gint           height)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_box != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_box (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
@@ -820,7 +825,7 @@ gtk_draw_flat_box (GtkStyle      *style,
                    gint           width,
                    gint           height)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_flat_box != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_flat_box (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
@@ -836,7 +841,7 @@ gtk_draw_check (GtkStyle      *style,
                 gint           width,
                 gint           height)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_check != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_check (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
@@ -852,45 +857,12 @@ gtk_draw_option (GtkStyle      *style,
                 gint           width,
                 gint           height)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_option != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_option (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
 }
 
-void
-gtk_draw_cross (GtkStyle      *style,
-               GdkWindow     *window,
-               GtkStateType   state_type,
-               GtkShadowType  shadow_type,
-               gint           x,
-               gint           y,
-               gint           width,
-               gint           height)
-{
-  g_return_if_fail (style != NULL);
-  g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_cross != NULL);
-  
-  GTK_STYLE_GET_CLASS (style)->draw_cross (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
-}
-
-void
-gtk_draw_ramp (GtkStyle      *style,
-              GdkWindow     *window,
-              GtkStateType   state_type,
-              GtkShadowType  shadow_type,
-              GtkArrowType   arrow_type,
-              gint           x,
-              gint           y,
-              gint           width,
-              gint           height)
-{
-  g_return_if_fail (style != NULL);
-  g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_ramp != NULL);
-  
-  GTK_STYLE_GET_CLASS (style)->draw_ramp (style, window, state_type, shadow_type, NULL, NULL, NULL, arrow_type, x, y, width, height);
-}
-
 void
 gtk_draw_tab (GtkStyle      *style,
              GdkWindow     *window,
@@ -901,7 +873,7 @@ gtk_draw_tab (GtkStyle      *style,
              gint           width,
              gint           height)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_tab != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_tab (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
@@ -920,7 +892,7 @@ gtk_draw_shadow_gap (GtkStyle       *style,
                      gint            gap_x,
                      gint            gap_width)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_shadow_gap != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_shadow_gap (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, gap_side, gap_x, gap_width);
@@ -939,7 +911,7 @@ gtk_draw_box_gap (GtkStyle       *style,
                   gint            gap_x,
                   gint            gap_width)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_box_gap != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_box_gap (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, gap_side, gap_x, gap_width);
@@ -956,7 +928,7 @@ gtk_draw_extension (GtkStyle       *style,
                     gint            height,
                     GtkPositionType gap_side)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_extension != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_extension (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, gap_side);
@@ -970,7 +942,7 @@ gtk_draw_focus (GtkStyle      *style,
                gint           width,
                gint           height)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_focus != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_focus (style, window, NULL, NULL, NULL, x, y, width, height);
@@ -987,7 +959,7 @@ gtk_draw_slider (GtkStyle      *style,
                 gint           height,
                 GtkOrientation orientation)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_slider != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_slider (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, orientation);
@@ -1004,18 +976,50 @@ gtk_draw_handle (GtkStyle      *style,
                 gint           height,
                 GtkOrientation orientation)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_handle != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_handle (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, orientation);
 }
 
+void
+gtk_draw_expander (GtkStyle        *style,
+                   GdkWindow       *window,
+                   GtkStateType     state_type,
+                   gint             x,
+                   gint             y,
+                   gboolean         is_open)
+{
+  g_return_if_fail (GTK_IS_STYLE (style));
+  g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_expander != NULL);
+  
+  GTK_STYLE_GET_CLASS (style)->draw_expander (style, window, state_type,
+                                              NULL, NULL, NULL,
+                                              x, y, is_open);
+}
+
+void
+gtk_draw_layout (GtkStyle        *style,
+                 GdkWindow       *window,
+                 GtkStateType     state_type,
+                 gint             x,
+                 gint             y,
+                 PangoLayout     *layout)
+{
+  g_return_if_fail (GTK_IS_STYLE (style));
+  g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_layout != NULL);
+  
+  GTK_STYLE_GET_CLASS (style)->draw_layout (style, window, state_type,
+                                            NULL, NULL, NULL,
+                                            x, y, layout);
+}
+
 void
 gtk_style_set_background (GtkStyle    *style,
                           GdkWindow   *window,
                           GtkStateType state_type)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (window != NULL);
   
   GTK_STYLE_GET_CLASS (style)->set_background (style, window, state_type);
@@ -1103,6 +1107,22 @@ gtk_style_real_init_from_rc (GtkStyle   *style,
     style->xthickness = rc_style->xthickness;
   if (rc_style->ythickness >= 0)
     style->ythickness = rc_style->ythickness;
+
+  
+  if (rc_style->icon_factories)
+    {
+      GSList *iter;
+
+      style->icon_factories = g_slist_copy (rc_style->icon_factories);
+      
+      iter = style->icon_factories;
+      while (iter != NULL)
+        {
+          g_object_ref (G_OBJECT (iter->data));
+          
+          iter = g_slist_next (iter);
+        }
+    }
 }
 
 static void
@@ -1241,6 +1261,29 @@ gtk_style_real_set_background (GtkStyle    *style,
     gdk_window_set_background (window, &style->bg[state_type]);
 }
 
+GdkPixbuf *
+gtk_style_render_icon (GtkStyle            *style,
+                       const GtkIconSource *source,
+                       GtkTextDirection     direction,
+                       GtkStateType         state,
+                       const gchar         *size,
+                       GtkWidget           *widget,
+                       const gchar         *detail)
+{
+  GdkPixbuf *pixbuf;
+  
+  g_return_val_if_fail (GTK_IS_STYLE (style), NULL);
+  g_return_val_if_fail (GTK_STYLE_GET_CLASS (style)->render_icon != NULL, NULL);
+  
+  pixbuf = GTK_STYLE_GET_CLASS (style)->render_icon (style, source, direction, state,
+                                                     size, widget, detail);
+
+  g_return_val_if_fail (pixbuf != NULL, NULL);
+
+  return pixbuf;
+}
+
+/* Default functions */
 void
 gtk_style_apply_default_background (GtkStyle     *style,
                                     GdkWindow    *window,
@@ -1305,6 +1348,92 @@ gtk_style_apply_default_background (GtkStyle     *style,
     }
 }
 
+static GdkPixbuf*
+scale_or_ref (GdkPixbuf *src,
+              gint width,
+              gint height)
+{
+  if (width == gdk_pixbuf_get_width (src) &&
+      height == gdk_pixbuf_get_height (src))
+    {
+      gdk_pixbuf_ref (src);
+      return src;
+    }
+  else
+    {
+      return gdk_pixbuf_scale_simple (src,
+                                      width, height,
+                                      GDK_INTERP_BILINEAR);
+    }
+}
+
+static GdkPixbuf *
+gtk_default_render_icon (GtkStyle            *style,
+                          const GtkIconSource *source,
+                          GtkTextDirection     direction,
+                          GtkStateType         state,
+                          const gchar         *size,
+                          GtkWidget           *widget,
+                          const gchar         *detail)
+{
+  gint width = 1;
+  gint height = 1;
+  GdkPixbuf *scaled;
+  GdkPixbuf *stated;
+
+  /* Oddly, style can be NULL in this function, because
+   * GtkIconSet can be used without a style and if so
+   * it uses this function.
+   */
+  
+  g_return_val_if_fail (source->pixbuf != NULL, NULL);
+  
+  if (!gtk_icon_size_lookup (size, &width, &height))
+    {
+      g_warning ("Bad icon size '%s' passed to render_icon", size);
+      return NULL;
+    }
+
+  /* If the size was wildcarded, then scale; otherwise, leave it
+   * alone.
+   */
+  if (source->any_size)
+    scaled = scale_or_ref (source->pixbuf, width, height);
+  else
+    scaled = GDK_PIXBUF (g_object_ref (G_OBJECT (source->pixbuf)));
+
+  /* If the state was wildcarded, then generate a state. */
+  if (source->any_state)
+    {
+      if (state == GTK_STATE_INSENSITIVE)
+        {
+          stated = gdk_pixbuf_copy (scaled);      
+          
+          gdk_pixbuf_saturate_and_pixelate (scaled, stated,
+                                            0.8, TRUE);
+          
+          gdk_pixbuf_unref (scaled);
+        }
+      else if (state == GTK_STATE_PRELIGHT)
+        {
+          stated = gdk_pixbuf_copy (scaled);      
+          
+          gdk_pixbuf_saturate_and_pixelate (scaled, stated,
+                                            1.2, FALSE);
+          
+          gdk_pixbuf_unref (scaled);
+        }
+      else
+        {
+          stated = scaled;
+        }
+    }
+  else
+    stated = scaled;
+  
+  return stated;
+}
+
 static void
 gtk_default_draw_hline (GtkStyle     *style,
                         GdkWindow    *window,
@@ -1320,7 +1449,7 @@ gtk_default_draw_hline (GtkStyle     *style,
   gint thickness_dark;
   gint i;
   
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (window != NULL);
   
   thickness_light = style->ythickness / 2;
@@ -1377,7 +1506,7 @@ gtk_default_draw_vline (GtkStyle     *style,
   gint thickness_dark;
   gint i;
   
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (window != NULL);
   
   thickness_light = style->xthickness / 2;
@@ -1427,7 +1556,7 @@ gtk_default_draw_shadow (GtkStyle      *style,
   gint thickness_dark;
   gint i;
   
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (window != NULL);
   
   if ((width == -1) && (height == -1))
@@ -1606,7 +1735,7 @@ gtk_default_draw_polygon (GtkStyle      *style,
   gint yadjust;
   gint i;
   
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (window != NULL);
   g_return_if_fail (points != NULL);
   
@@ -1740,7 +1869,7 @@ gtk_default_draw_arrow (GtkStyle      *style,
   gint half_height;
   GdkPoint points[3];
   
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (window != NULL);
   
   switch (shadow_type)
@@ -2086,7 +2215,7 @@ gtk_default_draw_diamond (GtkStyle      *style,
   gint half_width;
   gint half_height;
   
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (window != NULL);
   
   if ((width == -1) && (height == -1))
@@ -2198,25 +2327,6 @@ gtk_default_draw_diamond (GtkStyle      *style,
     }
 }
 
-static void
-gtk_default_draw_oval (GtkStyle      *style,
-                       GdkWindow     *window,
-                       GtkStateType   state_type,
-                       GtkShadowType  shadow_type,
-                       GdkRectangle  *area,
-                       GtkWidget     *widget,
-                       const gchar   *detail,
-                       gint           x,
-                       gint           y,
-                       gint           width,
-                       gint           height)
-{
-  g_return_if_fail (style != NULL);
-  g_return_if_fail (window != NULL);
-
-  g_warning ("gtk_default_draw_oval(): FIXME, this function is currently unimplemented");
-}
-
 static void
 gtk_default_draw_string (GtkStyle      *style,
                          GdkWindow     *window,
@@ -2228,7 +2338,7 @@ gtk_default_draw_string (GtkStyle      *style,
                          gint           y,
                          const gchar   *string)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (window != NULL);
   
   if (area)
@@ -2262,7 +2372,7 @@ gtk_default_draw_box (GtkStyle      *style,
                      gint           width,
                      gint           height)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (window != NULL);
   
   if (width == -1 && height == -1)
@@ -2307,7 +2417,7 @@ gtk_default_draw_flat_box (GtkStyle      *style,
 {
   GdkGC *gc1;
   
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (window != NULL);
   
   if (width == -1 && height == -1)
@@ -2387,45 +2497,6 @@ gtk_default_draw_option (GtkStyle      *style,
                      detail, x, y, width, height);
 }
 
-static void 
-gtk_default_draw_cross (GtkStyle      *style,
-                       GdkWindow     *window,
-                       GtkStateType   state_type,
-                       GtkShadowType  shadow_type,
-                       GdkRectangle  *area,
-                       GtkWidget     *widget,
-                       const gchar   *detail,
-                       gint           x,
-                       gint           y,
-                       gint           width,
-                       gint           height)
-{
-  g_return_if_fail (style != NULL);
-  g_return_if_fail (window != NULL);
-
-  g_warning ("gtk_default_draw_cross(): FIXME, this function is currently unimplemented");
-}
-
-static void 
-gtk_default_draw_ramp    (GtkStyle      *style,
-                          GdkWindow     *window,
-                          GtkStateType   state_type,
-                          GtkShadowType  shadow_type,
-                          GdkRectangle  *area,
-                          GtkWidget     *widget,
-                          const gchar   *detail,
-                          GtkArrowType   arrow_type,
-                          gint           x,
-                          gint           y,
-                          gint           width,
-                          gint           height)
-{
-  g_return_if_fail (style != NULL);
-  g_return_if_fail (window != NULL);
-
-  g_warning ("gtk_default_draw_ramp(): FIXME, this function is currently unimplemented");
-}
-
 static void
 gtk_default_draw_tab (GtkStyle      *style,
                      GdkWindow     *window,
@@ -2439,7 +2510,7 @@ gtk_default_draw_tab (GtkStyle      *style,
                      gint           width,
                      gint           height)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (window != NULL);
   
   gtk_paint_box (style, window, state_type, shadow_type, area, widget, detail,
@@ -2467,7 +2538,7 @@ gtk_default_draw_shadow_gap (GtkStyle       *style,
   GdkGC *gc3 = NULL;
   GdkGC *gc4 = NULL;
   
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (window != NULL);
   
   if (width == -1 && height == -1)
@@ -2688,7 +2759,7 @@ gtk_default_draw_box_gap (GtkStyle       *style,
   GdkGC *gc3 = NULL;
   GdkGC *gc4 = NULL;
   
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (window != NULL);
   
   gtk_style_apply_default_background (style, window,
@@ -2912,7 +2983,7 @@ gtk_default_draw_extension (GtkStyle       *style,
   GdkGC *gc3 = NULL;
   GdkGC *gc4 = NULL;
   
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (window != NULL);
   
   gtk_style_apply_default_background (style, window,
@@ -3084,7 +3155,7 @@ gtk_default_draw_focus (GtkStyle      *style,
                         gint           width,
                         gint           height)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (window != NULL);
   
   if (width == -1 && height == -1)
@@ -3143,7 +3214,7 @@ gtk_default_draw_slider (GtkStyle      *style,
                          gint           height,
                          GtkOrientation orientation)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (window != NULL);
   
   if (width == -1 && height == -1)
@@ -3214,7 +3285,7 @@ gtk_default_draw_handle (GtkStyle      *style,
   GdkRectangle dest;
   gint intersect;
   
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (window != NULL);
   
   if (width == -1 && height == -1)
@@ -3293,6 +3364,97 @@ gtk_default_draw_handle (GtkStyle      *style,
   gdk_gc_set_clip_rectangle (dark_gc, NULL);
 }
 
+static void
+gtk_default_draw_expander (GtkStyle        *style,
+                           GdkWindow       *window,
+                           GtkStateType     state_type,
+                           GdkRectangle    *area,
+                           GtkWidget       *widget,
+                           const gchar     *detail,
+                           gint             x,
+                           gint             y,
+                           gboolean         is_open)
+{
+  /* FIXME replace macro with a style property */
+#define PM_SIZE 8
+  
+  GdkPoint points[3];
+
+  if (area)
+    {
+      gdk_gc_set_clip_rectangle (style->fg_gc[GTK_STATE_NORMAL], area);
+      gdk_gc_set_clip_rectangle (style->base_gc[GTK_STATE_NORMAL], area);
+    }
+
+  if (is_open)
+    {
+      points[0].x = x;
+      points[0].y = y + (PM_SIZE + 2) / 6;
+      points[1].x = points[0].x + 1 * (PM_SIZE + 2);
+      points[1].y = points[0].y;
+      points[2].x = (points[0].x + 1 * (PM_SIZE + 2) / 2);
+      points[2].y = y + 2 * (PM_SIZE + 2) / 3;
+    }
+  else
+    {
+      points[0].x = x + 1 * ((PM_SIZE + 2) / 6 + 2);
+      points[0].y = y - 1;
+      points[1].x = points[0].x;
+      points[1].y = points[0].y + (PM_SIZE + 2);
+      points[2].x = (points[0].x + 1 * (2 * (PM_SIZE + 2) / 3 - 1));
+      points[2].y = points[0].y + (PM_SIZE + 2) / 2;
+    }
+
+  gdk_draw_polygon (window, style->base_gc[GTK_STATE_NORMAL],
+                    TRUE, points, 3);
+  gdk_draw_polygon (window, style->fg_gc[GTK_STATE_NORMAL],
+                    FALSE, points, 3);
+  
+
+  if (area)
+    {
+      gdk_gc_set_clip_rectangle (style->fg_gc[GTK_STATE_NORMAL], NULL);
+      gdk_gc_set_clip_rectangle (style->base_gc[GTK_STATE_NORMAL], NULL);
+    }
+  
+#undef PM_SIZE
+}
+
+static void
+gtk_default_draw_layout (GtkStyle        *style,
+                         GdkWindow       *window,
+                         GtkStateType     state_type,
+                         GdkRectangle    *area,
+                         GtkWidget       *widget,
+                         const gchar     *detail,
+                         gint             x,
+                         gint             y,
+                         PangoLayout     *layout)
+{
+  g_return_if_fail (GTK_IS_STYLE (style));
+  g_return_if_fail (window != NULL);
+  
+  if (area)
+    {
+      gdk_gc_set_clip_rectangle (style->white_gc, area);
+      gdk_gc_set_clip_rectangle (style->fg_gc[state_type], area);
+    }
+
+  /* FIXME this is frickin' ugly with any kind of attributes set on the
+   * text being rendered
+   */
+  if (state_type == GTK_STATE_INSENSITIVE)
+    gdk_draw_layout (window, style->white_gc, x + 1, y + 1, layout);
+
+  gdk_draw_layout (window, style->fg_gc[state_type], x, y, layout);
+
+  if (area)
+    {
+      gdk_gc_set_clip_rectangle (style->white_gc, NULL);
+      gdk_gc_set_clip_rectangle (style->fg_gc[state_type], NULL);
+    }
+}
+
 static void
 gtk_style_shade (GdkColor *a,
                  GdkColor *b,
@@ -3488,7 +3650,7 @@ gtk_paint_hline (GtkStyle      *style,
                  gint          x2,
                  gint          y)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_hline != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_hline (style, window, state_type, area, widget, detail, x1, x2, y);
@@ -3505,7 +3667,7 @@ gtk_paint_vline (GtkStyle      *style,
                  gint          y2,
                  gint          x)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_vline != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_vline (style, window, state_type, area, widget, detail, y1, y2, x);
@@ -3524,7 +3686,7 @@ gtk_paint_shadow (GtkStyle     *style,
                   gint          width,
                   gint          height)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_shadow != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_shadow (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
@@ -3542,7 +3704,7 @@ gtk_paint_polygon (GtkStyle      *style,
                    gint           npoints,
                    gboolean       fill)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_shadow != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_polygon (style, window, state_type, shadow_type, area, widget, detail, points, npoints, fill);
@@ -3563,7 +3725,7 @@ gtk_paint_arrow (GtkStyle      *style,
                  gint           width,
                  gint           height)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_arrow != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_arrow (style, window, state_type, shadow_type, area, widget, detail, arrow_type, fill, x, y, width, height);
@@ -3582,31 +3744,12 @@ gtk_paint_diamond (GtkStyle      *style,
                    gint        width,
                    gint        height)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_diamond != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_diamond (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
 }
 
-void
-gtk_paint_oval (GtkStyle      *style,
-                GdkWindow     *window,
-                GtkStateType   state_type,
-                GtkShadowType  shadow_type,
-                GdkRectangle  *area,
-                GtkWidget     *widget,
-                const gchar   *detail,
-                gint           x,
-                gint           y,
-                gint           width,
-                gint           height)
-{
-  g_return_if_fail (style != NULL);
-  g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_oval != NULL);
-  
-  GTK_STYLE_GET_CLASS (style)->draw_oval (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
-}
-
 void
 gtk_paint_string (GtkStyle      *style,
                   GdkWindow     *window,
@@ -3618,7 +3761,7 @@ gtk_paint_string (GtkStyle      *style,
                   gint           y,
                   const gchar   *string)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_string != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_string (style, window, state_type, area, widget, detail, x, y, string);
@@ -3637,7 +3780,7 @@ gtk_paint_box (GtkStyle      *style,
                gint           width,
                gint           height)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_box != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
@@ -3656,7 +3799,7 @@ gtk_paint_flat_box (GtkStyle      *style,
                     gint           width,
                     gint           height)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_flat_box != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_flat_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
@@ -3675,7 +3818,7 @@ gtk_paint_check (GtkStyle      *style,
                  gint           width,
                  gint           height)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_check != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_check (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
@@ -3694,51 +3837,12 @@ gtk_paint_option (GtkStyle      *style,
                   gint           width,
                   gint           height)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_option != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_option (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
 }
 
-void
-gtk_paint_cross (GtkStyle      *style,
-                 GdkWindow     *window,
-                 GtkStateType   state_type,
-                 GtkShadowType  shadow_type,
-                 GdkRectangle  *area,
-                 GtkWidget     *widget,
-                 const gchar   *detail,
-                 gint           x,
-                 gint           y,
-                 gint           width,
-                 gint           height)
-{
-  g_return_if_fail (style != NULL);
-  g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_cross != NULL);
-  
-  GTK_STYLE_GET_CLASS (style)->draw_cross (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
-}
-
-void
-gtk_paint_ramp (GtkStyle      *style,
-                GdkWindow     *window,
-                GtkStateType   state_type,
-                GtkShadowType  shadow_type,
-                GdkRectangle  *area,
-                GtkWidget     *widget,
-                const gchar   *detail,
-                GtkArrowType   arrow_type,
-                gint           x,
-                gint           y,
-                gint           width,
-                gint           height)
-{
-  g_return_if_fail (style != NULL);
-  g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_ramp != NULL);
-  
-  GTK_STYLE_GET_CLASS (style)->draw_ramp (style, window, state_type, shadow_type, area, widget, detail, arrow_type, x, y, width, height);
-}
-
 void
 gtk_paint_tab (GtkStyle      *style,
                GdkWindow     *window,
@@ -3752,7 +3856,7 @@ gtk_paint_tab (GtkStyle      *style,
                gint           width,
                gint           height)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_tab != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_tab (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
@@ -3774,7 +3878,7 @@ gtk_paint_shadow_gap (GtkStyle       *style,
                       gint            gap_x,
                       gint            gap_width)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_shadow_gap != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_shadow_gap (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, gap_side, gap_x, gap_width);
@@ -3797,7 +3901,7 @@ gtk_paint_box_gap (GtkStyle       *style,
                    gint            gap_x,
                    gint            gap_width)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_box_gap != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_box_gap (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, gap_side, gap_x, gap_width);
@@ -3817,7 +3921,7 @@ gtk_paint_extension (GtkStyle       *style,
                      gint            height,
                      GtkPositionType gap_side)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_extension != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_extension (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, gap_side);
@@ -3834,7 +3938,7 @@ gtk_paint_focus (GtkStyle      *style,
                  gint           width,
                  gint           height)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_focus != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_focus (style, window, area, widget, detail, x, y, width, height);
@@ -3854,7 +3958,7 @@ gtk_paint_slider (GtkStyle      *style,
                   gint           height,
                   GtkOrientation orientation)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_slider != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_slider (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, orientation);
@@ -3874,8 +3978,46 @@ gtk_paint_handle (GtkStyle      *style,
                   gint           height,
                   GtkOrientation orientation)
 {
-  g_return_if_fail (style != NULL);
+  g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_handle != NULL);
   
   GTK_STYLE_GET_CLASS (style)->draw_handle (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, orientation);
 }
+
+void
+gtk_paint_expander (GtkStyle        *style,
+                    GdkWindow       *window,
+                    GtkStateType     state_type,
+                    GdkRectangle    *area,
+                    GtkWidget       *widget,
+                    const gchar     *detail,
+                    gint             x,
+                    gint             y,
+                    gboolean         is_open)
+{
+  g_return_if_fail (GTK_IS_STYLE (style));
+  g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_expander != NULL);
+  
+  GTK_STYLE_GET_CLASS (style)->draw_expander (style, window, state_type, area,
+                                              widget, detail, x, y, is_open);
+}
+
+void
+gtk_paint_layout (GtkStyle        *style,
+                  GdkWindow       *window,
+                  GtkStateType     state_type,
+                  GdkRectangle    *area,
+                  GtkWidget       *widget,
+                  const gchar     *detail,
+                  gint             x,
+                  gint             y,
+                  PangoLayout     *layout)
+{
+  g_return_if_fail (GTK_IS_STYLE (style));
+  g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_layout != NULL);
+  
+  GTK_STYLE_GET_CLASS (style)->draw_layout (style, window, state_type, area,
+                                            widget, detail, x, y, layout);
+}
+
+