[sapwood] remove the GtkWidget from the ThemePixbuf's API



commit b08527085ea6c3c0e59e69523947d61d668c2a12
Author: Sven Herzberg <herzi gnome-de org>
Date:   Wed Jul 28 16:49:25 2010 +0200

    remove the GtkWidget from the ThemePixbuf's API
    
    For the reason outlined in the last commit already, get rid of GtkWidget
    from the actual rendering code.
    
    * engine/sapwood-style.c: updated
    * engine/theme-pixbuf.c,
    * engine/theme-pixbuf.h: update the API for compatibility with
      GtkThemingEngine

 engine/sapwood-style.c |   18 ++++++++++--------
 engine/theme-pixbuf.c  |    6 +++---
 engine/theme-pixbuf.h  |    4 ++--
 3 files changed, 15 insertions(+), 13 deletions(-)
---
diff --git a/engine/sapwood-style.c b/engine/sapwood-style.c
index 9cbb2bb..1cf2ee3 100644
--- a/engine/sapwood-style.c
+++ b/engine/sapwood-style.c
@@ -320,7 +320,7 @@ draw_simple_image (GtkStyle       *style,
 	  if (maskwin)
 	    mask = gdk_pixmap_new (maskwin, width, height, 1);
 
-	  valid = theme_pixbuf_render (image->background, widget,
+          valid = theme_pixbuf_render (image->background, G_OBJECT_TYPE (widget),
 				       window, mask, area,
 				       draw_center ? COMPONENT_ALL : COMPONENT_ALL | COMPONENT_CENTER,
 				       FALSE,
@@ -335,7 +335,7 @@ draw_simple_image (GtkStyle       *style,
 	}
 
       if (image->overlay && draw_center)
-	theme_pixbuf_render (image->overlay, widget,
+        theme_pixbuf_render (image->overlay, G_OBJECT_TYPE (widget),
 			     window, NULL, area, COMPONENT_ALL,
 			     TRUE, 
 			     x, y, width, height);
@@ -475,19 +475,19 @@ draw_gap_image (GtkStyle       *style,
 	}
 
       if (image->background)
-	theme_pixbuf_render (image->background, widget,
+        theme_pixbuf_render (image->background, G_OBJECT_TYPE (widget),
 			     window, NULL, area, components, FALSE,
 			     x, y, width, height);
       if (image->gap_start)
-	theme_pixbuf_render (image->gap_start, widget,
+        theme_pixbuf_render (image->gap_start, G_OBJECT_TYPE (widget),
 			     window, NULL, area, COMPONENT_ALL, FALSE,
 			     r1.x, r1.y, r1.width, r1.height);
       if (image->gap)
-	theme_pixbuf_render (image->gap, widget,
+        theme_pixbuf_render (image->gap, G_OBJECT_TYPE (widget),
 			     window, NULL, area, COMPONENT_ALL, FALSE,
 			     r2.x, r2.y, r2.width, r2.height);
       if (image->gap_end)
-	theme_pixbuf_render (image->gap_end, widget,
+        theme_pixbuf_render (image->gap_end, G_OBJECT_TYPE (widget),
 			     window, NULL, area, COMPONENT_ALL, FALSE,
 			     r3.x, r3.y, r3.width, r3.height);
 
@@ -531,7 +531,7 @@ draw_hline (GtkStyle     *style,
   if (image)
     {
       if (image->background)
-	theme_pixbuf_render (image->background, widget,
+        theme_pixbuf_render (image->background, G_OBJECT_TYPE (widget),
 			     window, NULL, area, COMPONENT_ALL, FALSE,
 			     x1, y, (x2 - x1) + 1, 2);
     }
@@ -574,7 +574,7 @@ draw_vline (GtkStyle     *style,
   if (image)
     {
       if (image->background)
-	theme_pixbuf_render (image->background, widget,
+        theme_pixbuf_render (image->background, G_OBJECT_TYPE (widget),
 			     window, NULL, area, COMPONENT_ALL, FALSE,
 			     x, y1, 2, (y2 - y1) + 1);
     }
@@ -1694,3 +1694,5 @@ static void
 sapwood_style_class_finalize (SapwoodStyleClass *klass)
 {
 }
+
+/* vim:set et sw=2 cino=t0,f0,(0,{s,>2s,n-1s,^-1s,e2s: */
diff --git a/engine/theme-pixbuf.c b/engine/theme-pixbuf.c
index b183a24..d8b1555 100644
--- a/engine/theme-pixbuf.c
+++ b/engine/theme-pixbuf.c
@@ -275,7 +275,7 @@ theme_pixbuf_get_geometry (ThemePixbuf *theme_pb,
  */
 gboolean
 theme_pixbuf_render (ThemePixbuf  *theme_pb,
-		     GtkWidget    *widget,
+		     GType         widget_type,
 		     GdkWindow    *window,
 		     GdkBitmap    *mask,
 		     GdkRectangle *clip_rect,
@@ -409,7 +409,7 @@ theme_pixbuf_render (ThemePixbuf  *theme_pb,
 	  mask_required = TRUE;
 	}
 
-      sapwood_pixmap_render_rects (pixmap, G_OBJECT_TYPE (widget),
+      sapwood_pixmap_render_rects (pixmap, widget_type,
                                    window, x, y, width, height,
                                    mask, mask_x, mask_y, mask_required,
                                    clip_rect, n_rect, rect);
@@ -444,7 +444,7 @@ theme_pixbuf_render (ThemePixbuf  *theme_pb,
       else if (mask)
 	g_object_ref (mask);
 
-      sapwood_pixmap_render_rects (pixmap, G_OBJECT_TYPE (widget),
+      sapwood_pixmap_render_rects (pixmap, widget_type,
                                    window, x, y, draw_width, draw_height,
                                    mask, mask_x, mask_y, FALSE,
                                    clip_rect, 1, rect);
diff --git a/engine/theme-pixbuf.h b/engine/theme-pixbuf.h
index bd79f39..64e0ec7 100644
--- a/engine/theme-pixbuf.h
+++ b/engine/theme-pixbuf.h
@@ -194,8 +194,8 @@ void         theme_pixbuf_set_border   (ThemePixbuf  *theme_pb,
 					gint          bottom) G_GNUC_INTERNAL;
 void         theme_pixbuf_set_stretch  (ThemePixbuf  *theme_pb,
 					gboolean      stretch) G_GNUC_INTERNAL;
-gboolean     theme_pixbuf_render       (ThemePixbuf  *theme_pb,
-					GtkWidget    *widget,
+gboolean     theme_pixbuf_render       (ThemePixbuf * theme_pb,
+                                        GType         widget_type,
 					GdkWindow    *window,
 					GdkBitmap    *mask,
 					GdkRectangle *clip_rect,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]