From 0278fb06f7c1c74ab5c4f083c3921879d40e814c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 10 Jan 2006 17:56:27 +0000 Subject: [PATCH] Convert to use instance private data. 2006-01-10 Matthias Clasen * gtk/gtkpaned.c: Convert to use instance private data. --- ChangeLog | 4 ++++ ChangeLog.pre-2-10 | 4 ++++ gtk/gtkpaned.c | 10 +++++----- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 711d382a3f..04353a8794 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-01-10 Matthias Clasen + + * gtk/gtkpaned.c: Convert to use instance private data. + 2006-01-10 Michael Natterer * gdk/gdkpango.c (on_renderer_display_closed): disconnect from the diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 711d382a3f..04353a8794 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,7 @@ +2006-01-10 Matthias Clasen + + * gtk/gtkpaned.c: Convert to use instance private data. + 2006-01-10 Michael Natterer * gdk/gdkpango.c (on_renderer_display_closed): disconnect from the diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c index 4bc20add00..a7f87f17a2 100644 --- a/gtk/gtkpaned.c +++ b/gtk/gtkpaned.c @@ -138,8 +138,8 @@ static GtkContainerClass *parent_class = NULL; struct _GtkPanedPrivate { GtkWidget *saved_focus; - GtkPaned *first_paned; - guint32 grab_time; + GtkPaned *first_paned; + guint32 grab_time; }; GType @@ -467,6 +467,8 @@ gtk_paned_class_init (GtkPanedClass *class) add_move_binding (binding_set, GDK_KP_Home, 0, GTK_SCROLL_START); add_move_binding (binding_set, GDK_End, 0, GTK_SCROLL_END); add_move_binding (binding_set, GDK_KP_End, 0, GTK_SCROLL_END); + + g_type_class_add_private (object_class, sizeof (GtkPanedPrivate)); } static GType @@ -495,7 +497,7 @@ gtk_paned_init (GtkPaned *paned) paned->last_allocation = -1; paned->in_drag = FALSE; - paned->priv = g_new0 (GtkPanedPrivate, 1); + paned->priv = G_TYPE_INSTANCE_GET_PRIVATE (paned, GTK_TYPE_PANED, GtkPanedPrivate); paned->last_child1_focus = NULL; paned->last_child2_focus = NULL; paned->in_recursion = FALSE; @@ -646,8 +648,6 @@ gtk_paned_finalize (GObject *object) gtk_paned_set_saved_focus (paned, NULL); gtk_paned_set_first_paned (paned, NULL); - g_free (paned->priv); - G_OBJECT_CLASS (parent_class)->finalize (object); }