diff options
author | Benjamin Otte <otte@redhat.com> | 2010-09-06 19:30:22 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-09-26 15:11:37 +0200 |
commit | 782af63273831b59df02fef0edf062d636c86928 (patch) | |
tree | a9e0acd934d72a2aa40e33a79b0480f42d52abe9 /gtk/gtklayout.c | |
parent | 8fc35150a24f15b038bbfddaef87b373393bf7ee (diff) | |
download | gtk+-782af63273831b59df02fef0edf062d636c86928.tar.gz |
layout: Port to draw vfunc
Diffstat (limited to 'gtk/gtklayout.c')
-rw-r--r-- | gtk/gtklayout.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c index f73bfb9fd4..c16d345a03 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; @@ -1042,17 +1042,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; } |