aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-go-action.c
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2008-02-11 02:26:22 +0800
committerXan Lopez <xan@src.gnome.org>2008-02-11 02:26:22 +0800
commita6753733856e098e2500487fee87620f72dea530 (patch)
tree1f5a7d8ae16bd2e3070bbdc31791eef96952a233 /src/ephy-go-action.c
parent9a3e4ebc55e11c3b00b0e7464b11ecec121bc6f2 (diff)
downloadgsoc2013-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-go-action.c')
-rw-r--r--src/ephy-go-action.c43
1 files changed, 10 insertions, 33 deletions
diff --git a/src/ephy-go-action.c b/src/ephy-go-action.c
index 8a6079182..d67ad962d 100644
--- a/src/ephy-go-action.c
+++ b/src/ephy-go-action.c
@@ -30,35 +30,7 @@
static void ephy_go_action_class_init (EphyGoActionClass *class);
-static GObjectClass *parent_class = NULL;
-
-GType
-ephy_go_action_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0))
- {
- const GTypeInfo type_info =
- {
- sizeof (EphyGoActionClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ephy_go_action_class_init,
- (GClassFinalizeFunc) NULL,
- NULL,
- sizeof (EphyGoAction),
- 0, /* n_preallocs */
- (GInstanceInitFunc) NULL,
- };
-
- type = g_type_register_static (EPHY_TYPE_LINK_ACTION,
- "EphyGoAction",
- &type_info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (EphyGoAction, ephy_go_action, EPHY_TYPE_LINK_ACTION)
static GtkWidget *
create_tool_item (GtkAction *action)
@@ -93,7 +65,7 @@ static void
connect_proxy (GtkAction *action,
GtkWidget *proxy)
{
- GTK_ACTION_CLASS (parent_class)->connect_proxy (action, proxy);
+ GTK_ACTION_CLASS (ephy_go_action_parent_class)->connect_proxy (action, proxy);
if (GTK_IS_TOOL_ITEM (proxy))
{
@@ -110,7 +82,7 @@ disconnect_proxy (GtkAction *action,
g_signal_handlers_disconnect_by_func
(proxy, G_CALLBACK (gtk_action_activate), action);
- GTK_ACTION_CLASS (parent_class)->disconnect_proxy (action, proxy);
+ GTK_ACTION_CLASS (ephy_go_action_parent_class)->disconnect_proxy (action, proxy);
}
static void
@@ -118,9 +90,14 @@ ephy_go_action_class_init (EphyGoActionClass *class)
{
GtkActionClass *action_class = GTK_ACTION_CLASS (class);
- parent_class = g_type_class_peek_parent (class);
-
action_class->create_tool_item = create_tool_item;
action_class->connect_proxy = connect_proxy;
action_class->disconnect_proxy = disconnect_proxy;
}
+
+static void
+ephy_go_action_init (EphyGoAction *action)
+{
+ /* Empty, needed for G_DEFINE_TYPE macro */
+}
+