diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-08-24 23:21:41 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-08-25 02:37:02 +0800 |
commit | ecf3434da05b1f39f793c24b38bfd278e10b5786 (patch) | |
tree | 485ed2399920ecb10dbee2b4db4c437c22574a20 /composer/e-composer-text-header.c | |
parent | f1d2541c487fbf7433a1b9aad8e8982ef08b85f5 (diff) | |
download | gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.gz gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.zst gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.zip |
GObject boilerplate cleanup.
Prefer thread-safe G_DEFINE_TYPE and G_DEFINE_INTERFACE macros over
manual GType registration.
This is just a start... lots more to do.
Diffstat (limited to 'composer/e-composer-text-header.c')
-rw-r--r-- | composer/e-composer-text-header.c | 37 |
1 files changed, 6 insertions, 31 deletions
diff --git a/composer/e-composer-text-header.c b/composer/e-composer-text-header.c index efbf141cea..d92901d55e 100644 --- a/composer/e-composer-text-header.c +++ b/composer/e-composer-text-header.c @@ -30,7 +30,10 @@ struct _EComposerTextHeaderPrivate { guint destination_index; }; -static gpointer parent_class; +G_DEFINE_TYPE ( + EComposerTextHeader, + e_composer_text_header, + E_TYPE_COMPOSER_HEADER) static void composer_text_header_changed_cb (GtkEntry *entry, @@ -59,13 +62,12 @@ composer_text_header_query_tooltip_cb (GtkEntry *entry, } static void -composer_text_header_class_init (EComposerTextHeaderClass *class) +e_composer_text_header_class_init (EComposerTextHeaderClass *class) { - parent_class = g_type_class_peek_parent (class); } static void -composer_text_header_init (EComposerTextHeader *header) +e_composer_text_header_init (EComposerTextHeader *header) { GtkWidget *widget; @@ -80,33 +82,6 @@ composer_text_header_init (EComposerTextHeader *header) E_COMPOSER_HEADER (header)->input_widget = widget; } -GType -e_composer_text_header_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) { - static const GTypeInfo type_info = { - sizeof (EComposerTextHeaderClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) composer_text_header_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (EComposerTextHeader), - 0, /* n_preallocs */ - (GInstanceInitFunc) composer_text_header_init, - NULL /* value_table */ - }; - - type = g_type_register_static ( - E_TYPE_COMPOSER_HEADER, "EComposerTextHeader", - &type_info, 0); - } - - return type; -} - EComposerHeader * e_composer_text_header_new_label (const gchar *label) { |