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/gtktextmark.c | |
parent | 33cddd12d78abb2efe6facba9c859017f8df9819 (diff) | |
download | gtk+-f26aad1916445d25c99878138dfc384de67a2060.tar.gz |
Boilerplate reduction
Diffstat (limited to 'gtk/gtktextmark.c')
-rw-r--r-- | gtk/gtktextmark.c | 38 |
1 files changed, 3 insertions, 35 deletions
diff --git a/gtk/gtktextmark.c b/gtk/gtktextmark.c index 4961b8d50b..dd6b543113 100644 --- a/gtk/gtktextmark.c +++ b/gtk/gtktextmark.c @@ -53,39 +53,9 @@ #include "gtkintl.h" #include "gtkalias.h" -static void gtk_text_mark_init (GtkTextMark *mark); -static void gtk_text_mark_class_init (GtkTextMarkClass *klass); -static void gtk_text_mark_finalize (GObject *obj); +static void gtk_text_mark_finalize (GObject *obj); - -static gpointer parent_class = NULL; - -GType -gtk_text_mark_get_type (void) -{ - static GType object_type = 0; - - if (!object_type) - { - static const GTypeInfo object_info = - { - sizeof (GtkTextMarkClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) gtk_text_mark_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (GtkTextMark), - 0, /* n_preallocs */ - (GInstanceInitFunc) gtk_text_mark_init, - }; - - object_type = g_type_register_static (G_TYPE_OBJECT, I_("GtkTextMark"), - &object_info, 0); - } - - return object_type; -} +G_DEFINE_TYPE (GtkTextMark, gtk_text_mark, G_TYPE_OBJECT); static void gtk_text_mark_init (GtkTextMark *mark) @@ -98,8 +68,6 @@ gtk_text_mark_class_init (GtkTextMarkClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - parent_class = g_type_class_peek_parent (klass); - object_class->finalize = gtk_text_mark_finalize; } @@ -127,7 +95,7 @@ gtk_text_mark_finalize (GObject *obj) } /* chain parent_class' handler */ - G_OBJECT_CLASS (parent_class)->finalize (obj); + G_OBJECT_CLASS (gtk_text_mark_parent_class)->finalize (obj); } /** |