aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-bookmark-action.c
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2008-02-13 07:07:11 +0800
committerXan Lopez <xan@src.gnome.org>2008-02-13 07:07:11 +0800
commitdf50ed8d9cb314b1f9cefbfeee0c6717430f579c (patch)
tree88682e6816ac205b83dcdf912b9eeb514b548dc8 /src/bookmarks/ephy-bookmark-action.c
parente8202438b62f78e58e8c95c65214b1ea1678c1f0 (diff)
downloadgsoc2013-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-action.c')
-rw-r--r--src/bookmarks/ephy-bookmark-action.c40
1 files changed, 5 insertions, 35 deletions
diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c
index 242cd00aa..39a9833e7 100644
--- a/src/bookmarks/ephy-bookmark-action.c
+++ b/src/bookmarks/ephy-bookmark-action.c
@@ -78,8 +78,6 @@ enum
PROP_ICON
};
-static GObjectClass *parent_class;
-
typedef struct
{
GObject *weak_ptr;
@@ -87,6 +85,8 @@ typedef struct
EphyLinkFlags flags;
} ClipboardCtx;
+G_DEFINE_TYPE (EphyBookmarkAction, ephy_bookmark_action, EPHY_TYPE_LINK_ACTION)
+
static void
clipboard_text_received_cb (GtkClipboard *clipboard,
const char *text,
@@ -154,7 +154,7 @@ create_tool_item (GtkAction *action)
LOG ("Creating tool item for action %p", action);
- item = GTK_ACTION_CLASS (parent_class)->create_tool_item (action);
+ item = GTK_ACTION_CLASS (ephy_bookmark_action_parent_class)->create_tool_item (action);
hbox = gtk_hbox_new (FALSE, 0);
gtk_widget_show (hbox);
@@ -561,7 +561,7 @@ connect_proxy (GtkAction *action,
LOG ("Connecting action %p to proxy %p", action, proxy);
- GTK_ACTION_CLASS (parent_class)->connect_proxy (action, proxy);
+ GTK_ACTION_CLASS (ephy_bookmark_action_parent_class)->connect_proxy (action, proxy);
ephy_bookmark_action_sync_icon (action, NULL, proxy);
g_signal_connect_object (action, "notify::icon",
@@ -756,7 +756,7 @@ ephy_bookmark_action_dispose (GObject *object)
priv->cache_handler = 0;
}
- parent_class->dispose (object);
+ G_OBJECT_CLASS (ephy_bookmark_action_parent_class)->dispose (object);
}
static void
@@ -765,8 +765,6 @@ ephy_bookmark_action_class_init (EphyBookmarkActionClass *class)
GObjectClass *object_class = G_OBJECT_CLASS (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->create_tool_item = create_tool_item;
action_class->menu_item_type = GTK_TYPE_IMAGE_MENU_ITEM;
@@ -808,34 +806,6 @@ ephy_bookmark_action_class_init (EphyBookmarkActionClass *class)
g_type_class_add_private (object_class, sizeof(EphyBookmarkActionPrivate));
}
-GType
-ephy_bookmark_action_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0))
- {
- const GTypeInfo type_info =
- {
- sizeof (EphyBookmarkActionClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) ephy_bookmark_action_class_init,
- (GClassFinalizeFunc) NULL,
- NULL,
- sizeof (EphyBookmarkAction),
- 0, /* n_preallocs */
- (GInstanceInitFunc) ephy_bookmark_action_init,
- };
-
- type = g_type_register_static (EPHY_TYPE_LINK_ACTION,
- "EphyBookmarkAction",
- &type_info, 0);
- }
-
- return type;
-}
-
GtkAction *
ephy_bookmark_action_new (EphyNode *node,
const char *name)