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-bookmark-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-bookmark-factory-action.c')
-rw-r--r-- | src/bookmarks/ephy-bookmark-factory-action.c | 40 |
1 files changed, 9 insertions, 31 deletions
diff --git a/src/bookmarks/ephy-bookmark-factory-action.c b/src/bookmarks/ephy-bookmark-factory-action.c index 56a44c807..350311ce8 100644 --- a/src/bookmarks/ephy-bookmark-factory-action.c +++ b/src/bookmarks/ephy-bookmark-factory-action.c @@ -31,39 +31,13 @@ #include "ephy-stock-icons.h" #include "egg-editable-toolbar.h" +static void ephy_bookmark_factory_action_init (EphyBookmarkFactoryAction *action); static void ephy_bookmark_factory_action_class_init (EphyBookmarkFactoryActionClass *class); #define EPHY_BOOKMARK_FACTORY_ACTION_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_BOOKMARK_FACTORY_ACTION, EphyBookmarkActionPrivate)) #define EGG_TOOLBARS_MODEL_DATA "ephy-bookmark-factory-menu" -static GObjectClass *parent_class = NULL; - -GType -ephy_bookmark_factory_action_get_type (void) -{ - static GType type = 0; - - if (!type) - { - const GTypeInfo type_info = - { - sizeof (EphyBookmarkFactoryActionClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) ephy_bookmark_factory_action_class_init, - (GClassFinalizeFunc) NULL, - NULL, - sizeof (EphyBookmarkFactoryAction), - 0, /* n_preallocs */ - NULL - }; - - type = g_type_register_static (GTK_TYPE_ACTION, - "EphyBookmarkFactoryAction", - &type_info, 0); - } - return type; -} +G_DEFINE_TYPE (EphyBookmarkFactoryAction, ephy_bookmark_factory_action, GTK_TYPE_ACTION) static void activate_item_cb (GtkWidget *menuitem, GtkWidget *placeholder) @@ -289,7 +263,7 @@ connect_proxy (GtkAction *action, GtkWidget *proxy) { GtkWidget *widget; - (* GTK_ACTION_CLASS (parent_class)->connect_proxy) (action, proxy); + GTK_ACTION_CLASS (ephy_bookmark_factory_action_parent_class)->connect_proxy (action, proxy); g_return_if_fail (GTK_IS_TOOL_ITEM (proxy)); @@ -304,12 +278,16 @@ connect_proxy (GtkAction *action, GtkWidget *proxy) } static void +ephy_bookmark_factory_action_init (EphyBookmarkFactoryAction *action) +{ + /* Empty, needed for G_DEFINE_TYPE macro */ +} + +static void ephy_bookmark_factory_action_class_init (EphyBookmarkFactoryActionClass *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; |