[gtk+/rendering-cleanup-next: 52/154] layout: Port to draw vfunc



commit da2f641849f8a1ff67d449ea697c95407aceba1b
Author: Benjamin Otte <otte redhat com>
Date:   Mon Sep 6 19:30:22 2010 +0200

    layout: Port to draw vfunc

 gtk/gtklayout.c |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c
index 8431f21..a783fad 100644
--- a/gtk/gtklayout.c
+++ b/gtk/gtklayout.c
@@ -103,8 +103,8 @@ static void gtk_layout_size_request       (GtkWidget      *widget,
                                            GtkRequisition *requisition);
 static void gtk_layout_size_allocate      (GtkWidget      *widget,
                                            GtkAllocation  *allocation);
-static gint gtk_layout_expose             (GtkWidget      *widget,
-                                           GdkEventExpose *event);
+static gint gtk_layout_draw               (GtkWidget      *widget,
+                                           cairo_t        *cr);
 static void gtk_layout_add                (GtkContainer   *container,
 					   GtkWidget      *widget);
 static void gtk_layout_remove             (GtkContainer   *container,
@@ -660,7 +660,7 @@ gtk_layout_class_init (GtkLayoutClass *class)
   widget_class->map = gtk_layout_map;
   widget_class->size_request = gtk_layout_size_request;
   widget_class->size_allocate = gtk_layout_size_allocate;
-  widget_class->expose_event = gtk_layout_expose;
+  widget_class->draw = gtk_layout_draw;
   widget_class->style_set = gtk_layout_style_set;
 
   container_class->add = gtk_layout_add;
@@ -1041,17 +1041,15 @@ gtk_layout_size_allocate (GtkWidget     *widget,
   gtk_layout_set_adjustment_upper (priv->vadjustment, MAX (allocation->height, priv->height), TRUE);
 }
 
-static gint 
-gtk_layout_expose (GtkWidget      *widget,
-                   GdkEventExpose *event)
+static gboolean
+gtk_layout_draw (GtkWidget *widget,
+                 cairo_t   *cr)
 {
   GtkLayout *layout = GTK_LAYOUT (widget);
   GtkLayoutPrivate *priv = layout->priv;
 
-  if (event->window != priv->bin_window)
-    return FALSE;
-
-  GTK_WIDGET_CLASS (gtk_layout_parent_class)->expose_event (widget, event);
+  if (gtk_cairo_should_draw_window (cr, priv->bin_window))
+    GTK_WIDGET_CLASS (gtk_layout_parent_class)->draw (widget, cr);
 
   return FALSE;
 }



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