[gtk+/rendering-cleanup-next: 55/155] paned: Port to draw vfunc
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/rendering-cleanup-next: 55/155] paned: Port to draw vfunc
- Date: Wed, 15 Sep 2010 03:01:32 +0000 (UTC)
commit 994894df8bb9e7c2a0f2e6bd1f80d4069d5226d4
Author: Benjamin Otte <otte redhat com>
Date: Mon Sep 6 20:00:13 2010 +0200
paned: Port to draw vfunc
gtk/gtkpaned.c | 27 ++++++++++++++++-----------
1 files changed, 16 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index 9b2f312..fbaccd8 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -130,8 +130,8 @@ static void gtk_paned_map (GtkWidget *widget);
static void gtk_paned_unmap (GtkWidget *widget);
static void gtk_paned_state_changed (GtkWidget *widget,
GtkStateType previous_state);
-static gboolean gtk_paned_expose (GtkWidget *widget,
- GdkEventExpose *event);
+static gboolean gtk_paned_draw (GtkWidget *widget,
+ cairo_t *cr);
static gboolean gtk_paned_enter (GtkWidget *widget,
GdkEventCrossing *event);
static gboolean gtk_paned_leave (GtkWidget *widget,
@@ -235,7 +235,7 @@ gtk_paned_class_init (GtkPanedClass *class)
widget_class->unrealize = gtk_paned_unrealize;
widget_class->map = gtk_paned_map;
widget_class->unmap = gtk_paned_unmap;
- widget_class->expose_event = gtk_paned_expose;
+ widget_class->draw = gtk_paned_draw;
widget_class->focus = gtk_paned_focus;
widget_class->enter_notify_event = gtk_paned_enter;
widget_class->leave_notify_event = gtk_paned_leave;
@@ -1123,8 +1123,8 @@ gtk_paned_unmap (GtkWidget *widget)
}
static gboolean
-gtk_paned_expose (GtkWidget *widget,
- GdkEventExpose *event)
+gtk_paned_draw (GtkWidget *widget,
+ cairo_t *cr)
{
GtkPaned *paned = GTK_PANED (widget);
GtkPanedPrivate *priv = paned->priv;
@@ -1134,6 +1134,9 @@ gtk_paned_expose (GtkWidget *widget,
priv->child2 && gtk_widget_get_visible (priv->child2))
{
GtkStateType state;
+ GtkAllocation allocation;
+
+ gtk_widget_get_allocation (widget, &allocation);
if (gtk_widget_is_focus (widget))
state = GTK_STATE_SELECTED;
@@ -1142,17 +1145,19 @@ gtk_paned_expose (GtkWidget *widget,
else
state = gtk_widget_get_state (widget);
- gtk_paint_handle (gtk_widget_get_style (widget),
- gtk_widget_get_window (widget),
+ gtk_cairo_paint_handle (gtk_widget_get_style (widget),
+ cr,
state, GTK_SHADOW_NONE,
- &priv->handle_pos, widget, "paned",
- priv->handle_pos.x, priv->handle_pos.y,
- priv->handle_pos.width, priv->handle_pos.height,
+ widget, "paned",
+ priv->handle_pos.x - allocation.x,
+ priv->handle_pos.y - allocation.y,
+ priv->handle_pos.width,
+ priv->handle_pos.height,
!priv->orientation);
}
/* Chain up to draw children */
- GTK_WIDGET_CLASS (gtk_paned_parent_class)->expose_event (widget, event);
+ GTK_WIDGET_CLASS (gtk_paned_parent_class)->draw (widget, cr);
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]