aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-plugin-ui.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-08-24 23:21:41 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-08-25 02:37:02 +0800
commitecf3434da05b1f39f793c24b38bfd278e10b5786 (patch)
tree485ed2399920ecb10dbee2b4db4c437c22574a20 /e-util/e-plugin-ui.c
parentf1d2541c487fbf7433a1b9aad8e8982ef08b85f5 (diff)
downloadgsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.gz
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.bz2
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.lz
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.xz
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 'e-util/e-plugin-ui.c')
-rw-r--r--e-util/e-plugin-ui.c41
1 files changed, 9 insertions, 32 deletions
diff --git a/e-util/e-plugin-ui.c b/e-util/e-plugin-ui.c
index 999b1e82d2..a03c6193ef 100644
--- a/e-util/e-plugin-ui.c
+++ b/e-util/e-plugin-ui.c
@@ -163,7 +163,10 @@ struct _EPluginUIHookPrivate {
GHashTable *registry;
};
-static gpointer parent_class;
+G_DEFINE_TYPE (
+ EPluginUIHook,
+ e_plugin_ui_hook,
+ E_TYPE_PLUGIN_HOOK)
static void
plugin_ui_hook_unregister_manager (EPluginUIHook *hook,
@@ -408,7 +411,7 @@ plugin_ui_hook_finalize (GObject *object)
g_hash_table_destroy (priv->registry);
/* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ G_OBJECT_CLASS (e_plugin_ui_hook_parent_class)->dispose (object);
}
static gint
@@ -425,7 +428,8 @@ plugin_ui_hook_construct (EPluginHook *hook,
* we wouldn't have to chain up here. */
/* Chain up to parent's construct() method. */
- E_PLUGIN_HOOK_CLASS (parent_class)->construct (hook, plugin, node);
+ E_PLUGIN_HOOK_CLASS (e_plugin_ui_hook_parent_class)->
+ construct (hook, plugin, node);
for (node = xmlFirstElementChild (node); node != NULL;
node = xmlNextElementSibling (node)) {
@@ -483,12 +487,11 @@ plugin_ui_hook_enable (EPluginHook *hook,
}
static void
-plugin_ui_hook_class_init (EPluginUIHookClass *class)
+e_plugin_ui_hook_class_init (EPluginUIHookClass *class)
{
GObjectClass *object_class;
EPluginHookClass *plugin_hook_class;
- parent_class = g_type_class_peek_parent (class);
g_type_class_add_private (class, sizeof (EPluginUIHookPrivate));
object_class = G_OBJECT_CLASS (class);
@@ -501,7 +504,7 @@ plugin_ui_hook_class_init (EPluginUIHookClass *class)
}
static void
-plugin_ui_hook_init (EPluginUIHook *hook)
+e_plugin_ui_hook_init (EPluginUIHook *hook)
{
GHashTable *ui_definitions;
GHashTable *callbacks;
@@ -525,32 +528,6 @@ plugin_ui_hook_init (EPluginUIHook *hook)
hook->priv->registry = registry;
}
-GType
-e_plugin_ui_hook_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- static const GTypeInfo type_info = {
- sizeof (EPluginUIHookClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) plugin_ui_hook_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EPluginUIHook),
- 0, /* n_preallocs */
- (GInstanceInitFunc) plugin_ui_hook_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- E_TYPE_PLUGIN_HOOK, "EPluginUIHook", &type_info, 0);
- }
-
- return type;
-}
-
void
e_plugin_ui_register_manager (GtkUIManager *ui_manager,
const gchar *id,