[gtk+/rendering-cleanup-next: 22/155] spinner: Port to draw vfunc



commit 2d91a66f2b396c93d236b1eb5f8b4cdfb3cb0293
Author: Benjamin Otte <otte redhat com>
Date:   Fri Sep 3 18:30:30 2010 +0200

    spinner: Port to draw vfunc

 gtk/gtkspinner.c |   26 ++++++++++----------------
 1 files changed, 10 insertions(+), 16 deletions(-)
---
diff --git a/gtk/gtkspinner.c b/gtk/gtkspinner.c
index 344fb1f..e706b2e 100644
--- a/gtk/gtkspinner.c
+++ b/gtk/gtkspinner.c
@@ -73,8 +73,8 @@ struct _GtkSpinnerPrivate
 static void gtk_spinner_dispose        (GObject         *gobject);
 static void gtk_spinner_realize        (GtkWidget       *widget);
 static void gtk_spinner_unrealize      (GtkWidget       *widget);
-static gboolean gtk_spinner_expose     (GtkWidget       *widget,
-                                        GdkEventExpose  *event);
+static gboolean gtk_spinner_draw       (GtkWidget       *widget,
+                                        cairo_t         *cr);
 static void gtk_spinner_style_set      (GtkWidget       *widget,
                                         GtkStyle        *prev_style);
 static void gtk_spinner_get_property   (GObject         *object,
@@ -108,7 +108,7 @@ gtk_spinner_class_init (GtkSpinnerClass *klass)
   gobject_class->set_property = gtk_spinner_set_property;
 
   widget_class = GTK_WIDGET_CLASS(klass);
-  widget_class->expose_event = gtk_spinner_expose;
+  widget_class->draw = gtk_spinner_draw;
   widget_class->realize = gtk_spinner_realize;
   widget_class->unrealize = gtk_spinner_unrealize;
   widget_class->style_set = gtk_spinner_style_set;
@@ -247,33 +247,27 @@ gtk_spinner_size_request_init (GtkSizeRequestIface *iface)
 
 
 static gboolean
-gtk_spinner_expose (GtkWidget      *widget,
-                    GdkEventExpose *event)
+gtk_spinner_draw (GtkWidget *widget,
+                  cairo_t   *cr)
 {
-  GtkAllocation allocation;
   GtkStateType state_type;
   GtkSpinnerPrivate *priv;
-  int width, height;
 
   priv = GTK_SPINNER (widget)->priv;
 
-  gtk_widget_get_allocation (widget, &allocation);
-  width = allocation.width;
-  height = allocation.height;
-
   state_type = GTK_STATE_NORMAL;
   if (!gtk_widget_is_sensitive (widget))
    state_type = GTK_STATE_INSENSITIVE;
 
-  gtk_paint_spinner (gtk_widget_get_style (widget),
-                     gtk_widget_get_window (widget),
+  gtk_cairo_paint_spinner (gtk_widget_get_style (widget),
+                     cr,
                      state_type,
-                     &event->area,
                      widget,
                      "spinner",
                      priv->current,
-                     event->area.x, event->area.y,
-                     event->area.width, event->area.height);
+                     0, 0,
+                     gtk_widget_get_allocated_width (widget),
+                     gtk_widget_get_allocated_height (widget));
 
   return FALSE;
 }



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