diff options
author | Xan Lopez <xan@src.gnome.org> | 2008-02-11 02:26:22 +0800 |
---|---|---|
committer | Xan Lopez <xan@src.gnome.org> | 2008-02-11 02:26:22 +0800 |
commit | a6753733856e098e2500487fee87620f72dea530 (patch) | |
tree | 1f5a7d8ae16bd2e3070bbdc31791eef96952a233 /src/ephy-lockdown.c | |
parent | 9a3e4ebc55e11c3b00b0e7464b11ecec121bc6f2 (diff) | |
download | gsoc2013-epiphany-a6753733856e098e2500487fee87620f72dea530.tar gsoc2013-epiphany-a6753733856e098e2500487fee87620f72dea530.tar.gz gsoc2013-epiphany-a6753733856e098e2500487fee87620f72dea530.tar.bz2 gsoc2013-epiphany-a6753733856e098e2500487fee87620f72dea530.tar.lz gsoc2013-epiphany-a6753733856e098e2500487fee87620f72dea530.tar.xz gsoc2013-epiphany-a6753733856e098e2500487fee87620f72dea530.tar.zst gsoc2013-epiphany-a6753733856e098e2500487fee87620f72dea530.zip |
Use G_DEFINE_TYPE* when possible in src/ (#515601)
svn path=/trunk/; revision=7927
Diffstat (limited to 'src/ephy-lockdown.c')
-rw-r--r-- | src/ephy-lockdown.c | 48 |
1 files changed, 7 insertions, 41 deletions
diff --git a/src/ephy-lockdown.c b/src/ephy-lockdown.c index 8229aea23..ba09a6dc0 100644 --- a/src/ephy-lockdown.c +++ b/src/ephy-lockdown.c @@ -36,6 +36,8 @@ #include <string.h> +static void ephy_lockdown_iface_init (EphyExtensionIface *iface); + /* Make sure these don't overlap with those in ephy-window.c and ephy-toolbar.c */ enum { @@ -63,8 +65,6 @@ struct _EphyLockdownPrivate GList *windows; }; -static GObjectClass *parent_class = NULL; - static int find_name (GtkActionGroup *action_group, const char *name) @@ -255,6 +255,10 @@ ephy_lockdown_init (EphyLockdown *lockdown) eel_gconf_monitor_add ("/desktop/gnome/lockdown"); } +G_DEFINE_TYPE_WITH_CODE (EphyLockdown, ephy_lockdown, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (EPHY_TYPE_EXTENSION, + ephy_lockdown_iface_init)) + static void ephy_lockdown_finalize (GObject *object) { @@ -272,7 +276,7 @@ ephy_lockdown_finalize (GObject *object) eel_gconf_notification_remove (priv->notifier_id[i]); } - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (ephy_lockdown_parent_class)->finalize (object); } static void @@ -313,46 +317,8 @@ ephy_lockdown_class_init (EphyLockdownClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - parent_class = (GObjectClass *) g_type_class_peek_parent (klass); - object_class->finalize = ephy_lockdown_finalize; g_type_class_add_private (object_class, sizeof (EphyLockdownPrivate)); } -GType -ephy_lockdown_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) - { - const GTypeInfo our_info = - { - sizeof (EphyLockdownClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) ephy_lockdown_class_init, - NULL, - NULL, /* class_data */ - sizeof (EphyLockdown), - 0, /* n_preallocs */ - (GInstanceInitFunc) ephy_lockdown_init - }; - const GInterfaceInfo extension_info = - { - (GInterfaceInitFunc) ephy_lockdown_iface_init, - NULL, - NULL - }; - - type = g_type_register_static (G_TYPE_OBJECT, - "EphyLockdown", - &our_info, 0); - g_type_add_interface_static (type, - EPHY_TYPE_EXTENSION, - &extension_info); - } - - return type; -} |