[gtk+] Add customary args to gtk_style_paint_spinner()



commit 0567ea1c1834609821460abb91bd4144da565c7a
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Nov 27 01:23:55 2009 -0500

    Add customary args to gtk_style_paint_spinner()
    
    ...and adjust all callers.

 gtk/gtkcellrendererspinner.c |    3 ++
 gtk/gtkspinner.c             |    6 +++-
 gtk/gtkstyle.c               |   57 +++++++++++++++++++++++++----------------
 gtk/gtkstyle.h               |   22 ++++++++++------
 4 files changed, 57 insertions(+), 31 deletions(-)
---
diff --git a/gtk/gtkcellrendererspinner.c b/gtk/gtkcellrendererspinner.c
index 70614d3..2524aca 100644
--- a/gtk/gtkcellrendererspinner.c
+++ b/gtk/gtkcellrendererspinner.c
@@ -380,6 +380,9 @@ gtk_cell_renderer_spinner_render (GtkCellRenderer *cellr,
   gtk_paint_spinner (widget->style,
                      window,
                      state,
+                     expose_area,
+                     widget,
+                     "cell",
                      priv->pulse,
                      draw_rect.x, draw_rect.y,
                      draw_rect.width, draw_rect.height);
diff --git a/gtk/gtkspinner.c b/gtk/gtkspinner.c
index 0c341b8..59b25ea 100644
--- a/gtk/gtkspinner.c
+++ b/gtk/gtkspinner.c
@@ -215,7 +215,8 @@ gtk_spinner_init (GtkSpinner *spinner)
 }
 
 static gboolean
-gtk_spinner_expose (GtkWidget *widget, GdkEventExpose *event)
+gtk_spinner_expose (GtkWidget      *widget,
+                    GdkEventExpose *event)
 {
   GtkStateType state_type;
   GtkSpinnerPrivate *priv;
@@ -236,6 +237,9 @@ gtk_spinner_expose (GtkWidget *widget, GdkEventExpose *event)
   gtk_paint_spinner (widget->style,
                      widget->window,
                      state_type,
+                     &event->area,
+                     widget,
+                     "spinner",
                      priv->current,
                      event->area.x, event->area.y,
                      event->area.width, event->area.height);
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c
index 01f8ff0..20e14a6 100644
--- a/gtk/gtkstyle.c
+++ b/gtk/gtkstyle.c
@@ -313,14 +313,17 @@ static void gtk_default_draw_resize_grip (GtkStyle       *style,
                                           gint            y,
                                           gint            width,
                                           gint            height);
-static void gtk_default_draw_spinner     (GtkStyle     *style,
-					  GdkWindow    *window,
-					  GtkStateType  state_type,
-					  guint         step,
-					  gint           x,
-					  gint           y,
-					  gint           width,
-					  gint           height);
+static void gtk_default_draw_spinner     (GtkStyle       *style,
+					  GdkWindow      *window,
+					  GtkStateType    state_type,
+                                          GdkRectangle   *area,
+                                          GtkWidget      *widget,
+                                          const gchar    *detail,
+					  guint           step,
+					  gint            x,
+					  gint            y,
+					  gint            width,
+					  gint            height);
 
 static void rgb_to_hls			(gdouble	 *r,
 					 gdouble	 *g,
@@ -5612,6 +5615,9 @@ static void
 gtk_default_draw_spinner (GtkStyle     *style,
                           GdkWindow    *window,
                           GtkStateType  state_type,
+                          GdkRectangle *area,
+                          GtkWidget    *widget,
+                          const gchar  *detail,
                           guint         step,
                           gint          x,
                           gint          y,
@@ -6720,30 +6726,37 @@ gtk_paint_resize_grip (GtkStyle           *style,
  * @style: a #GtkStyle
  * @window: a #GdkWindow
  * @state_type: a state
- * @widget: the widget
- * @step: the nth step, a value between 0 and GtkSpinner::num-steps
- * @x: the x origin of the rectangle in which to draw the resize grip
- * @y: the y origin of the rectangle in which to draw the resize grip
- * @width: the width of the rectangle in which to draw the resize grip
- * @height: the height of the rectangle in which to draw the resize grip
+ * @area: clip rectangle, or %NULL if the
+ *        output should not be clipped
+ * @widget: the widget (may be %NULL)
+ * @detail: a style detail (may be %NULL)
+ * @step: the nth step, a value between 0 and #GtkSpinner:num-steps
+ * @x: the x origin of the rectangle in which to draw the spinner
+ * @y: the y origin of the rectangle in which to draw the spinner
+ * @width: the width of the rectangle in which to draw the spinner
+ * @height: the height of the rectangle in which to draw the spinner
  *
  * Draws a spinner on @window using the given parameters.
  */
 void
-gtk_paint_spinner (GtkStyle     *style,
-		   GdkWindow    *window,
-		   GtkStateType  state_type,
-		   guint         step,
-		   gint          x,
-		   gint          y,
-		   gint          width,
-		   gint          height)
+gtk_paint_spinner (GtkStyle           *style,
+		   GdkWindow          *window,
+		   GtkStateType        state_type,
+                   const GdkRectangle *area,
+                   GtkWidget          *widget,
+                   const gchar        *detail,
+		   guint               step,
+		   gint                x,
+		   gint                y,
+		   gint                width,
+		   gint                height)
 {
   g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_spinner != NULL);
   g_return_if_fail (style->depth == gdk_drawable_get_depth (window));
 
   GTK_STYLE_GET_CLASS (style)->draw_spinner (style, window, state_type,
+                                             (GdkRectangle *)area, widget, detail,
 					     step, x, y, width, height);
 }
 
diff --git a/gtk/gtkstyle.h b/gtk/gtkstyle.h
index 3e1401b..75dc109 100644
--- a/gtk/gtkstyle.h
+++ b/gtk/gtkstyle.h
@@ -406,6 +406,9 @@ struct _GtkStyleClass
   void (*draw_spinner)          (GtkStyle		*style,
 				 GdkWindow		*window,
 				 GtkStateType		 state_type,
+				 GdkRectangle		*area,
+				 GtkWidget		*widget,
+				 const gchar		*detail,
 				 guint                   step,
 				 gint			 x,
 				 gint			 y,
@@ -863,14 +866,17 @@ void gtk_paint_resize_grip (GtkStyle           *style,
                             gint                y,
                             gint                width,
                             gint                height);
-void gtk_paint_spinner     (GtkStyle     *style,
-			    GdkWindow    *window,
-			    GtkStateType  state_type,
-			    guint         step,
-			    gint          x,
-			    gint          y,
-			    gint          width,
-			    gint          height);
+void gtk_paint_spinner     (GtkStyle           *style,
+			    GdkWindow          *window,
+			    GtkStateType        state_type,
+                            const GdkRectangle *area,
+                            GtkWidget          *widget,
+                            const gchar        *detail,
+			    guint               step,
+			    gint                x,
+			    gint                y,
+			    gint                width,
+			    gint                height);
 
 GType      gtk_border_get_type (void) G_GNUC_CONST;
 GtkBorder *gtk_border_new      (void) G_GNUC_MALLOC;



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