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 | |
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')
-rw-r--r-- | src/bookmarks/ephy-bookmark-action.c | 40 | ||||
-rw-r--r-- | src/bookmarks/ephy-bookmark-factory-action.c | 40 | ||||
-rw-r--r-- | src/bookmarks/ephy-bookmark-properties.c | 37 | ||||
-rw-r--r-- | src/bookmarks/ephy-bookmarks-editor.c | 42 | ||||
-rw-r--r-- | src/bookmarks/ephy-related-action.c | 45 | ||||
-rw-r--r-- | src/bookmarks/ephy-topic-action.c | 44 | ||||
-rw-r--r-- | src/bookmarks/ephy-topic-factory-action.c | 40 | ||||
-rw-r--r-- | src/bookmarks/ephy-topics-entry.c | 41 | ||||
-rw-r--r-- | src/bookmarks/ephy-topics-palette.c | 37 |
9 files changed, 59 insertions, 307 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) 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; diff --git a/src/bookmarks/ephy-bookmark-properties.c b/src/bookmarks/ephy-bookmark-properties.c index 3dc7e1bb6..dd61e0d93 100644 --- a/src/bookmarks/ephy-bookmark-properties.c +++ b/src/bookmarks/ephy-bookmark-properties.c @@ -80,7 +80,7 @@ enum PROP_CREATING }; -static GObjectClass *parent_class; +G_DEFINE_TYPE (EphyBookmarkProperties, ephy_bookmark_properties, GTK_TYPE_DIALOG) static gboolean update_warning (EphyBookmarkProperties *properties) @@ -506,8 +506,9 @@ ephy_bookmark_properties_constructor (GType type, const char *tmp; char *text; - object = parent_class->constructor (type, n_construct_properties, - construct_params); + object = G_OBJECT_CLASS (ephy_bookmark_properties_parent_class)->constructor (type, + n_construct_properties, + construct_params); widget = GTK_WIDGET (object); window = GTK_WINDOW (object); @@ -731,8 +732,6 @@ ephy_bookmark_properties_class_init (EphyBookmarkPropertiesClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - parent_class = g_type_class_peek_parent (klass); - object_class->constructor = ephy_bookmark_properties_constructor; object_class->set_property = ephy_bookmark_properties_set_property; object_class->get_property = ephy_bookmark_properties_get_property; @@ -765,34 +764,6 @@ ephy_bookmark_properties_class_init (EphyBookmarkPropertiesClass *klass) /* public API */ -GType -ephy_bookmark_properties_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) - { - const GTypeInfo our_info = - { - sizeof (EphyBookmarkPropertiesClass), - NULL, - NULL, - (GClassInitFunc) ephy_bookmark_properties_class_init, - NULL, - NULL, - sizeof (EphyBookmarkProperties), - 0, - (GInstanceInitFunc) ephy_bookmark_properties_init - }; - - type = g_type_register_static (GTK_TYPE_DIALOG, - "EphyBookmarkProperties", - &our_info, 0); - } - - return type; -} - GtkWidget * ephy_bookmark_properties_new (EphyBookmarks *bookmarks, EphyNode *bookmark, diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c index 0ebe927ab..615e550f7 100644 --- a/src/bookmarks/ephy-bookmarks-editor.c +++ b/src/bookmarks/ephy-bookmarks-editor.c @@ -174,8 +174,6 @@ enum PROP_BOOKMARKS }; -static GObjectClass *parent_class = NULL; - static const GtkActionEntry ephy_bookmark_popup_entries [] = { /* Toplevel */ { "File", NULL, N_("_File") }, @@ -257,6 +255,8 @@ static const GtkRadioActionEntry ephy_bookmark_radio_entries [] = VIEW_TITLE_AND_ADDRESS } }; +G_DEFINE_TYPE (EphyBookmarksEditor, ephy_bookmarks_editor, GTK_TYPE_WINDOW) + static void entry_selection_changed_cb (GtkWidget *widget, GParamSpec *pspec, EphyBookmarksEditor *editor) { @@ -1179,34 +1179,6 @@ cmd_view_columns (GtkAction *action, g_slist_free (svalues); } -GType -ephy_bookmarks_editor_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) - { - const GTypeInfo our_info = - { - sizeof (EphyBookmarksEditorClass), - NULL, - NULL, - (GClassInitFunc) ephy_bookmarks_editor_class_init, - NULL, - NULL, - sizeof (EphyBookmarksEditor), - 0, - (GInstanceInitFunc) ephy_bookmarks_editor_init - }; - - type = g_type_register_static (GTK_TYPE_WINDOW, - "EphyBookmarksEditor", - &our_info, 0); - } - - return type; -} - static void ephy_bookmarks_editor_show (GtkWidget *widget) { @@ -1214,7 +1186,7 @@ ephy_bookmarks_editor_show (GtkWidget *widget) gtk_widget_grab_focus (editor->priv->search_entry); - GTK_WIDGET_CLASS (parent_class)->show (widget); + GTK_WIDGET_CLASS (ephy_bookmarks_editor_parent_class)->show (widget); } static void @@ -1223,8 +1195,6 @@ ephy_bookmarks_editor_class_init (EphyBookmarksEditorClass *klass) GObjectClass *object_class = G_OBJECT_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); - parent_class = g_type_class_peek_parent (klass); - object_class->finalize = ephy_bookmarks_editor_finalize; object_class->dispose = ephy_bookmarks_editor_dispose; @@ -1262,7 +1232,7 @@ ephy_bookmarks_editor_finalize (GObject *object) (gpointer *)window); } - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (ephy_bookmarks_editor_parent_class)->finalize (object); } static void @@ -1517,7 +1487,7 @@ ephy_bookmarks_editor_dispose (GObject *object) if (selection == NULL || selection->data == NULL) { editor->priv->key_view = NULL; - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (ephy_bookmarks_editor_parent_class)->dispose (object); return; } @@ -1526,7 +1496,7 @@ ephy_bookmarks_editor_dispose (GObject *object) editor->priv->key_view = NULL; } - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (ephy_bookmarks_editor_parent_class)->dispose (object); } static void diff --git a/src/bookmarks/ephy-related-action.c b/src/bookmarks/ephy-related-action.c index 778a0fda9..5f3ee9959 100644 --- a/src/bookmarks/ephy-related-action.c +++ b/src/bookmarks/ephy-related-action.c @@ -121,43 +121,22 @@ iface_init (EphyLinkIface *iface) iface->open_link = open_link; } -GType -ephy_related_action_get_type (void) +static void +ephy_related_action_class_init (EphyRelatedActionClass *klass) { - static GType type = 0; - - if (G_UNLIKELY (type == 0)) - { - const GTypeInfo our_info = - { - sizeof (EphyRelatedActionClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - NULL, /* class_init */ - NULL, - NULL, /* class_data */ - sizeof (EphyRelatedAction), - 0, /* n_preallocs */ - NULL /* instance_init */ - }; - const GInterfaceInfo link_info = - { - (GInterfaceInitFunc) iface_init, - NULL, - NULL - }; - - type = g_type_register_static (EPHY_TYPE_TOPIC_ACTION, - "EphyRelatedAction", - &our_info, 0); - g_type_add_interface_static (type, - EPHY_TYPE_LINK, - &link_info); - } + /* Empty, needed for G_DEFINE_TYPE macro */ +} - return type; +static void +ephy_related_action_init (EphyRelatedAction *action) +{ + /* Empty, needed for G_DEFINE_TYPE macro */ } +G_DEFINE_TYPE_WITH_CODE (EphyRelatedAction, ephy_related_action, EPHY_TYPE_TOPIC_ACTION, + G_IMPLEMENT_INTERFACE (EPHY_TYPE_LINK, + iface_init)) + GtkAction * ephy_related_action_new (EphyLink *link, GtkUIManager *manager, diff --git a/src/bookmarks/ephy-topic-action.c b/src/bookmarks/ephy-topic-action.c index 34c9fc843..5a10c021c 100644 --- a/src/bookmarks/ephy-topic-action.c +++ b/src/bookmarks/ephy-topic-action.c @@ -72,7 +72,7 @@ enum PROP_MANAGER }; -static GObjectClass *parent_class; +G_DEFINE_TYPE (EphyTopicAction, ephy_topic_action, GTK_TYPE_ACTION) static void drag_data_received_cb (GtkWidget *widget, @@ -130,7 +130,7 @@ create_tool_item (GtkAction *action) GtkWidget *hbox; GtkWidget *label; - item = GTK_ACTION_CLASS (parent_class)->create_tool_item (action); + item = GTK_ACTION_CLASS (ephy_topic_action_parent_class)->create_tool_item (action); button = gtk_toggle_button_new (); gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); @@ -402,7 +402,7 @@ static void connect_proxy (GtkAction *action, GtkWidget *proxy) { - GTK_ACTION_CLASS (parent_class)->connect_proxy (action, proxy); + GTK_ACTION_CLASS (ephy_topic_action_parent_class)->connect_proxy (action, proxy); ephy_topic_action_sync_label (action, NULL, proxy); g_signal_connect_object (action, "notify::label", @@ -561,13 +561,7 @@ ephy_topic_action_get_property (GObject *object, static void ephy_topic_action_init (EphyTopicAction *action) { - EphyTopicActionPrivate *priv; - - priv = action->priv = EPHY_TOPIC_ACTION_GET_PRIVATE (action); - - priv->merge_id = 0; - priv->node = NULL; - priv->manager = NULL; + action->priv = EPHY_TOPIC_ACTION_GET_PRIVATE (action); } static void @@ -576,8 +570,6 @@ ephy_topic_action_class_init (EphyTopicActionClass *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->connect_proxy = connect_proxy; @@ -605,34 +597,6 @@ ephy_topic_action_class_init (EphyTopicActionClass *class) g_type_class_add_private (object_class, sizeof(EphyTopicActionPrivate)); } -GType -ephy_topic_action_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) - { - const GTypeInfo type_info = - { - sizeof (EphyTopicActionClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) ephy_topic_action_class_init, - (GClassFinalizeFunc) NULL, - NULL, - sizeof (EphyTopicAction), - 0, /* n_preallocs */ - (GInstanceInitFunc) ephy_topic_action_init, - }; - - type = g_type_register_static (GTK_TYPE_ACTION, - "EphyTopicAction", - &type_info, 0); - } - - return type; -} - GtkAction * ephy_topic_action_new (EphyNode *node, GtkUIManager *manager, 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; diff --git a/src/bookmarks/ephy-topics-entry.c b/src/bookmarks/ephy-topics-entry.c index 42b3bc436..a7cbed62c 100644 --- a/src/bookmarks/ephy-topics-entry.c +++ b/src/bookmarks/ephy-topics-entry.c @@ -32,7 +32,7 @@ #include <string.h> static void ephy_topics_entry_class_init (EphyTopicsEntryClass *klass); -static void ephy_topics_entry_init (EphyTopicsEntry *editor); +static void ephy_topics_entry_init (EphyTopicsEntry *editor); #define EPHY_TOPICS_ENTRY_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_TOPICS_ENTRY, EphyTopicsEntryPrivate)) @@ -62,35 +62,7 @@ enum COLUMNS }; -static GObjectClass *parent_class = NULL; - -GType -ephy_topics_entry_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) - { - const GTypeInfo our_info = - { - sizeof (EphyTopicsEntryClass), - NULL, - NULL, - (GClassInitFunc) ephy_topics_entry_class_init, - NULL, - NULL, - sizeof (EphyTopicsEntry), - 0, - (GInstanceInitFunc) ephy_topics_entry_init - }; - - type = g_type_register_static (GTK_TYPE_ENTRY, - "EphyTopicsEntry", - &our_info, 0); - } - - return type; -} +G_DEFINE_TYPE (EphyTopicsEntry, ephy_topics_entry, GTK_TYPE_ENTRY) static EphyNode * find_topic (EphyTopicsEntry *entry, @@ -569,8 +541,9 @@ ephy_topics_entry_constructor (GType type, EphyTopicsEntry *entry; EphyTopicsEntryPrivate *priv; - object = parent_class->constructor (type, n_construct_properties, - construct_params); + object = G_OBJECT_CLASS (ephy_topics_entry_parent_class)->constructor (type, + n_construct_properties, + construct_params); entry = EPHY_TOPICS_ENTRY (object); priv = EPHY_TOPICS_ENTRY_GET_PRIVATE (object); @@ -622,7 +595,7 @@ ephy_topics_entry_finalize (GObject *object) g_free (entry->priv->create); g_free (entry->priv->key); - parent_class->finalize (object); + G_OBJECT_CLASS (ephy_topics_entry_parent_class)->finalize (object); } GtkWidget * @@ -647,8 +620,6 @@ ephy_topics_entry_class_init (EphyTopicsEntryClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - parent_class = g_type_class_peek_parent (klass); - object_class->set_property = ephy_topics_entry_set_property; object_class->constructor = ephy_topics_entry_constructor; object_class->finalize = ephy_topics_entry_finalize; diff --git a/src/bookmarks/ephy-topics-palette.c b/src/bookmarks/ephy-topics-palette.c index 3fb2fc142..4c8b3837e 100644 --- a/src/bookmarks/ephy-topics-palette.c +++ b/src/bookmarks/ephy-topics-palette.c @@ -68,35 +68,7 @@ enum MODES }; -static GObjectClass *parent_class = NULL; - -GType -ephy_topics_palette_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) - { - const GTypeInfo our_info = - { - sizeof (EphyTopicsPaletteClass), - NULL, - NULL, - (GClassInitFunc) ephy_topics_palette_class_init, - NULL, - NULL, - sizeof (EphyTopicsPalette), - 0, - (GInstanceInitFunc) ephy_topics_palette_init - }; - - type = g_type_register_static (GTK_TYPE_TREE_VIEW, - "EphyTopicsPalette", - &our_info, 0); - } - - return type; -} +G_DEFINE_TYPE (EphyTopicsPalette, ephy_topics_palette, GTK_TYPE_TREE_VIEW) static void append_topics (EphyTopicsPalette *palette, @@ -394,8 +366,9 @@ ephy_topics_palette_constructor (GType type, EphyTopicsPalettePrivate *priv; GtkCellRenderer *renderer; - object = parent_class->constructor (type, n_construct_properties, - construct_params); + object = G_OBJECT_CLASS (ephy_topics_palette_parent_class)->constructor (type, + n_construct_properties, + construct_params); palette = EPHY_TOPICS_PALETTE (object); priv = EPHY_TOPICS_PALETTE_GET_PRIVATE (object); @@ -456,8 +429,6 @@ ephy_topics_palette_class_init (EphyTopicsPaletteClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - parent_class = g_type_class_peek_parent (klass); - object_class->set_property = ephy_topics_palette_set_property; object_class->constructor = ephy_topics_palette_constructor; |