diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2006-05-02 23:56:43 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2006-05-02 23:56:43 +0000 |
commit | f26aad1916445d25c99878138dfc384de67a2060 (patch) | |
tree | b72263ecb326e82a49f1e8d1871ec4288b8aa299 /gtk/gtkprogress.c | |
parent | 33cddd12d78abb2efe6facba9c859017f8df9819 (diff) | |
download | gtk+-f26aad1916445d25c99878138dfc384de67a2060.tar.gz |
Boilerplate reduction
Diffstat (limited to 'gtk/gtkprogress.c')
-rw-r--r-- | gtk/gtkprogress.c | 39 |
1 files changed, 3 insertions, 36 deletions
diff --git a/gtk/gtkprogress.c b/gtk/gtkprogress.c index 3aae0fa69b..2cc166acae 100644 --- a/gtk/gtkprogress.c +++ b/gtk/gtkprogress.c @@ -45,8 +45,6 @@ enum { }; -static void gtk_progress_class_init (GtkProgressClass *klass); -static void gtk_progress_init (GtkProgress *progress); static void gtk_progress_set_property (GObject *object, guint prop_id, const GValue *value, @@ -68,36 +66,7 @@ static void gtk_progress_value_changed (GtkAdjustment *adjustment, static void gtk_progress_changed (GtkAdjustment *adjustment, GtkProgress *progress); - -static GtkWidgetClass *parent_class = NULL; - - -GType -gtk_progress_get_type (void) -{ - static GType progress_type = 0; - - if (!progress_type) - { - static const GTypeInfo progress_info = - { - sizeof (GtkProgressClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) gtk_progress_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (GtkProgress), - 0, /* n_preallocs */ - (GInstanceInitFunc) gtk_progress_init, - }; - - progress_type = g_type_register_static (GTK_TYPE_WIDGET, I_("GtkProgress"), - &progress_info, 0); - } - - return progress_type; -} +G_DEFINE_TYPE (GtkProgress, gtk_progress, GTK_TYPE_WIDGET); static void gtk_progress_class_init (GtkProgressClass *class) @@ -109,8 +78,6 @@ gtk_progress_class_init (GtkProgressClass *class) object_class = (GtkObjectClass *) class; widget_class = (GtkWidgetClass *) class; - parent_class = gtk_type_class (GTK_TYPE_WIDGET); - gobject_class->finalize = gtk_progress_finalize; gobject_class->set_property = gtk_progress_set_property; @@ -295,7 +262,7 @@ gtk_progress_destroy (GtkObject *object) progress->adjustment = NULL; } - GTK_OBJECT_CLASS (parent_class)->destroy (object); + GTK_OBJECT_CLASS (gtk_progress_parent_class)->destroy (object); } static void @@ -313,7 +280,7 @@ gtk_progress_finalize (GObject *object) if (progress->format) g_free (progress->format); - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (gtk_progress_parent_class)->finalize (object); } static gint |