[gtk+/rendering-cleanup-next: 51/153] layout: Port to draw vfunc
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/rendering-cleanup-next: 51/153] layout: Port to draw vfunc
- Date: Sat, 11 Sep 2010 04:55:43 +0000 (UTC)
commit 6a11c07b21ea3aab16b9ce2059b17adfeb21bea3
Author: Benjamin Otte <otte redhat com>
Date: Mon Sep 6 19:30:22 2010 +0200
layout: Port to draw vfunc
gtk/gtklayout.c | 22 ++++++++++++----------
1 files changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c
index 660c799..5228eaf 100644
--- a/gtk/gtklayout.c
+++ b/gtk/gtklayout.c
@@ -99,8 +99,10 @@ 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,
+ int width,
+ int height);
static void gtk_layout_add (GtkContainer *container,
GtkWidget *widget);
static void gtk_layout_remove (GtkContainer *container,
@@ -656,7 +658,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;
@@ -1037,17 +1039,17 @@ 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,
+ int width,
+ int height)
{
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, width, height);
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]