changeset 11752:0b4923aee31d

[gaim-migrate @ 14043] Hey, Look! it's a GtkExpander that both compiles AND works with Gtk 2.2 Yay! committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sun, 23 Oct 2005 13:30:41 +0000
parents 5d1dd575d0f4
children 59ae71ae0b7c
files src/gtkexpander.c
diffstat 1 files changed, 18 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkexpander.c	Sun Oct 23 13:17:10 2005 +0000
+++ b/src/gtkexpander.c	Sun Oct 23 13:30:41 2005 +0000
@@ -31,14 +31,12 @@
 
 #include <gtk/gtklabel.h>
 #include <gtk/gtkcontainer.h>
-#include <gtk/gtkmarshalers.h>
+#include <gtk/gtkmarshal.h>
 #include <gtk/gtkmain.h>
-#include <gtk/gtkintl.h>
 #include <gtk/gtkprivate.h>
 #include <gdk/gdkkeysyms.h>
-#include <gtk/gtkalias.h>
 
-#define GTK_EXPANDER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTK_TYPE_EXPANDER, GtkExpanderPrivate))
+#define P_(x) (x)
 
 #define DEFAULT_EXPANDER_SIZE 10
 #define DEFAULT_EXPANDER_SPACING 2
@@ -82,6 +80,8 @@
 				       GValue           *value,
 				       GParamSpec       *pspec);
 
+static void gtk_expander_finalize (GObject *object);
+
 static void gtk_expander_destroy (GtkObject *object);
 
 static void     gtk_expander_realize        (GtkWidget        *widget);
@@ -170,6 +170,7 @@
 
   gobject_class->set_property = gtk_expander_set_property;
   gobject_class->get_property = gtk_expander_get_property;
+  gobject_class->finalize     = gtk_expander_finalize;
 
   object_class->destroy = gtk_expander_destroy;
 
@@ -194,8 +195,6 @@
 
   klass->activate = gtk_expander_activate;
 
-  g_type_class_add_private (klass, sizeof (GtkExpanderPrivate));
-
   g_object_class_install_property (gobject_class,
 				   PROP_EXPANDED,
 				   g_param_spec_boolean ("expanded",
@@ -270,16 +269,26 @@
 		  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
 		  G_STRUCT_OFFSET (GtkExpanderClass, activate),
 		  NULL, NULL,
-		  _gtk_marshal_VOID__VOID,
+		  gtk_marshal_VOID__VOID,
 		  G_TYPE_NONE, 0);
 }
 
 static void
+gtk_expander_finalize (GObject *obj)
+{
+	GtkExpander *self = (GtkExpander *)obj;
+
+	g_free(self->priv);
+
+	G_OBJECT_CLASS(parent_class)->finalize (obj);
+}
+
+static void
 gtk_expander_init (GtkExpander *expander)
 {
   GtkExpanderPrivate *priv;
 
-  expander->priv = priv = GTK_EXPANDER_GET_PRIVATE (expander);
+  expander->priv = priv = g_new0(GtkExpanderPrivate, 1);
 
   GTK_WIDGET_SET_FLAGS (expander, GTK_CAN_FOCUS);
   GTK_WIDGET_SET_FLAGS (expander, GTK_NO_WINDOW);
@@ -379,7 +388,7 @@
       g_source_remove (priv->animation_timeout);
       priv->animation_timeout = 0;
     }
-  
+
   GTK_OBJECT_CLASS (parent_class)->destroy (object);
 }
 
@@ -1646,6 +1655,5 @@
 }
 
 #define __GTK_EXPANDER_C__
-#include <gtk/gtkaliasdef.c>
 
 #endif /* Gtk 2.4 */