[gtk+/rendering-cleanup-next: 66/199] viewport: Merge gtk_viewport_paint() into expose function



commit 51a276b2122483fe7338a78bdc31d7624f915feb
Author: Benjamin Otte <otte redhat com>
Date:   Tue Sep 7 16:41:57 2010 +0200

    viewport: Merge gtk_viewport_paint() into expose function

 gtk/gtkviewport.c |   34 ++++++++++------------------------
 1 files changed, 10 insertions(+), 24 deletions(-)
---
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index 8a971ae..8e92c41 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -87,8 +87,6 @@ static void gtk_viewport_set_scroll_adjustments	  (GtkViewport	    *viewport,
 						   GtkAdjustment    *vadjustment);
 static void gtk_viewport_realize                  (GtkWidget        *widget);
 static void gtk_viewport_unrealize                (GtkWidget        *widget);
-static void gtk_viewport_paint                    (GtkWidget        *widget,
-						   GdkRectangle     *area);
 static gint gtk_viewport_expose                   (GtkWidget        *widget,
 						   GdkEventExpose   *event);
 static void gtk_viewport_add                      (GtkContainer     *container,
@@ -771,37 +769,25 @@ gtk_viewport_unrealize (GtkWidget *widget)
   GTK_WIDGET_CLASS (gtk_viewport_parent_class)->unrealize (widget);
 }
 
-static void
-gtk_viewport_paint (GtkWidget    *widget,
-		    GdkRectangle *area)
-{
-  if (gtk_widget_is_drawable (widget))
-    {
-      GtkViewport *viewport = GTK_VIEWPORT (widget);
-      GtkViewportPrivate *priv = viewport->priv;
-
-      gtk_paint_shadow (gtk_widget_get_style (widget),
-                        gtk_widget_get_window (widget),
-			GTK_STATE_NORMAL, priv->shadow_type,
-			area, widget, "viewport",
-			0, 0, -1, -1);
-    }
-}
-
 static gint
 gtk_viewport_expose (GtkWidget      *widget,
 		     GdkEventExpose *event)
 {
-  GtkViewport *viewport;
-
   if (gtk_widget_is_drawable (widget))
     {
-      viewport = GTK_VIEWPORT (widget);
+      GtkViewport *viewport = GTK_VIEWPORT (widget);
       GtkViewportPrivate *priv = viewport->priv;
 
       if (event->window == gtk_widget_get_window (widget))
-	gtk_viewport_paint (widget, &event->area);
-      else if (event->window == priv->bin_window)
+        {
+          gtk_paint_shadow (gtk_widget_get_style (widget),
+                            gtk_widget_get_window (widget),
+                            GTK_STATE_NORMAL, priv->shadow_type,
+                            &event->area, widget, "viewport",
+                            0, 0, -1, -1);
+        }
+      
+      if (event->window == priv->bin_window)
 	{
           gtk_paint_flat_box(gtk_widget_get_style (widget), priv->bin_window,
 			     GTK_STATE_NORMAL, GTK_SHADOW_NONE,



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