diff options
author | Xan Lopez <xan@src.gnome.org> | 2008-02-13 07:07:11 +0800 |
---|---|---|
committer | Xan Lopez <xan@src.gnome.org> | 2008-02-13 07:07:11 +0800 |
commit | df50ed8d9cb314b1f9cefbfeee0c6717430f579c (patch) | |
tree | 88682e6816ac205b83dcdf912b9eeb514b548dc8 /src/bookmarks/ephy-topic-factory-action.c | |
parent | e8202438b62f78e58e8c95c65214b1ea1678c1f0 (diff) | |
download | gsoc2013-epiphany-df50ed8d9cb314b1f9cefbfeee0c6717430f579c.tar gsoc2013-epiphany-df50ed8d9cb314b1f9cefbfeee0c6717430f579c.tar.gz gsoc2013-epiphany-df50ed8d9cb314b1f9cefbfeee0c6717430f579c.tar.bz2 gsoc2013-epiphany-df50ed8d9cb314b1f9cefbfeee0c6717430f579c.tar.lz gsoc2013-epiphany-df50ed8d9cb314b1f9cefbfeee0c6717430f579c.tar.xz gsoc2013-epiphany-df50ed8d9cb314b1f9cefbfeee0c6717430f579c.tar.zst gsoc2013-epiphany-df50ed8d9cb314b1f9cefbfeee0c6717430f579c.zip |
Use G_DEFINE_TYPE* macros in src/bookmarks/ when possible. (#516138)
svn path=/trunk/; revision=7932
Diffstat (limited to 'src/bookmarks/ephy-topic-factory-action.c')
-rw-r--r-- | src/bookmarks/ephy-topic-factory-action.c | 40 |
1 files changed, 9 insertions, 31 deletions
diff --git a/src/bookmarks/ephy-topic-factory-action.c b/src/bookmarks/ephy-topic-factory-action.c index 347738b25..1322b9926 100644 --- a/src/bookmarks/ephy-topic-factory-action.c +++ b/src/bookmarks/ephy-topic-factory-action.c @@ -32,39 +32,13 @@ #include "ephy-stock-icons.h" #include "egg-editable-toolbar.h" +static void ephy_topic_factory_action_init (EphyTopicFactoryAction *factory); static void ephy_topic_factory_action_class_init (EphyTopicFactoryActionClass *class); #define EPHY_TOPIC_FACTORY_ACTION_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_TOPIC_FACTORY_ACTION, EphyTopicActionPrivate)) #define EGG_TOOLBARS_MODEL_DATA "ephy-topic-factory-menu" -static GObjectClass *parent_class = NULL; - -GType -ephy_topic_factory_action_get_type (void) -{ - static GType type = 0; - - if (!type) - { - const GTypeInfo type_info = - { - sizeof (EphyTopicFactoryActionClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) ephy_topic_factory_action_class_init, - (GClassFinalizeFunc) NULL, - NULL, - sizeof (EphyTopicFactoryAction), - 0, /* n_preallocs */ - NULL - }; - - type = g_type_register_static (GTK_TYPE_ACTION, - "EphyTopicFactoryAction", - &type_info, 0); - } - return type; -} +G_DEFINE_TYPE (EphyTopicFactoryAction, ephy_topic_factory_action, GTK_TYPE_ACTION) static int sort_topics (gconstpointer a, gconstpointer b) @@ -288,7 +262,7 @@ connect_proxy (GtkAction *action, GtkWidget *proxy) { GtkWidget *widget; - (* GTK_ACTION_CLASS (parent_class)->connect_proxy) (action, proxy); + GTK_ACTION_CLASS (ephy_topic_factory_action_parent_class)->connect_proxy (action, proxy); g_return_if_fail (GTK_IS_TOOL_ITEM (proxy)); @@ -303,12 +277,16 @@ connect_proxy (GtkAction *action, GtkWidget *proxy) } static void +ephy_topic_factory_action_init (EphyTopicFactoryAction *factory) +{ + /* Empty, needed for G_DEFINE_TYPE macro */ +} + +static void ephy_topic_factory_action_class_init (EphyTopicFactoryActionClass *class) { GtkActionClass *action_class = GTK_ACTION_CLASS (class); - parent_class = g_type_class_peek_parent (class); - action_class->toolbar_item_type = GTK_TYPE_TOOL_ITEM; action_class->connect_proxy = connect_proxy; action_class->create_tool_item = create_tool_item; |