From 9d51279acef224bb3087d8e0148ff4b8e9363303 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Sun, 26 Jan 2003 04:04:52 +0000 Subject: GObjectify this. 2003-01-25 Chris Toshok * e-pilot-settings.[ch]: GObjectify this. svn path=/trunk/; revision=19629 --- e-util/e-pilot-settings.c | 53 ++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 28 deletions(-) (limited to 'e-util/e-pilot-settings.c') diff --git a/e-util/e-pilot-settings.c b/e-util/e-pilot-settings.c index 4b5c55ebca..9eed8a9f79 100644 --- a/e-util/e-pilot-settings.c +++ b/e-util/e-pilot-settings.c @@ -25,7 +25,8 @@ #include #endif -#include +#include +#include #include "e-pilot-settings.h" struct _EPilotSettingsPrivate @@ -39,43 +40,39 @@ struct _EPilotSettingsPrivate static void class_init (EPilotSettingsClass *klass); static void init (EPilotSettings *ps); -static GtkObjectClass *parent_class = NULL; +static GObjectClass *parent_class = NULL; -GtkType +GType e_pilot_settings_get_type (void) { - static GtkType type = 0; - - if (type == 0) - { - static const GtkTypeInfo info = - { - "EPilotSettings", - sizeof (EPilotSettings), - sizeof (EPilotSettingsClass), - (GtkClassInitFunc) class_init, - (GtkObjectInitFunc) init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - type = gtk_type_unique (gtk_table_get_type (), &info); - } - - return type; + static GType type = 0; + + if (!type) { + static GTypeInfo info = { + sizeof (EPilotSettingsClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) class_init, + NULL, NULL, + sizeof (EPilotSettings), + 0, + (GInstanceInitFunc) init + }; + type = g_type_register_static (GTK_TYPE_TABLE, "EPilotSettings", &info, 0); + } + + return type; } static void class_init (EPilotSettingsClass *klass) { - GtkObjectClass *object_class; + GObjectClass *object_class; - object_class = GTK_OBJECT_CLASS (klass); - - parent_class = gtk_type_class (gtk_table_get_type ()); + object_class = G_OBJECT_CLASS (klass); + parent_class = g_type_class_ref (GTK_TYPE_TABLE); } @@ -117,7 +114,7 @@ init (EPilotSettings *ps) GtkWidget * e_pilot_settings_new (void) { - return gtk_type_new (E_TYPE_PILOT_SETTINGS); + return g_object_new (E_TYPE_PILOT_SETTINGS, NULL); } gboolean -- cgit