From 4d8bf28dbebbc70325c75c0501ed192ae330c63b Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Fri, 24 Jun 2011 11:23:41 +0100 Subject: Switch to GObject (bzr r10350.1.3) --- src/ui/view/view-widget.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'src/ui/view') diff --git a/src/ui/view/view-widget.cpp b/src/ui/view/view-widget.cpp index cf0f55f2c..f87bc8edd 100644 --- a/src/ui/view/view-widget.cpp +++ b/src/ui/view/view-widget.cpp @@ -27,22 +27,21 @@ static GtkEventBoxClass *widget_parent_class; /** * Registers the SPViewWidget class with Glib and returns its type number. */ -GtkType sp_view_widget_get_type(void) +GType sp_view_widget_get_type(void) { - static GtkType type = 0; - //TODO: switch to GObject - // GtkType and such calls were deprecated a while back with the - // introduction of GObject as a separate layer, with GType instead. --JonCruz + static GType type = 0; if (!type) { - GtkTypeInfo info = { - (gchar*) "SPViewWidget", - sizeof(SPViewWidget), + GTypeInfo info = { sizeof(SPViewWidgetClass), - (GtkClassInitFunc) sp_view_widget_class_init, - (GtkObjectInitFunc) sp_view_widget_init, - NULL, NULL, NULL - }; - type = gtk_type_unique(GTK_TYPE_EVENT_BOX, &info); + NULL, NULL, + (GClassInitFunc) sp_view_widget_class_init, + NULL, NULL, + sizeof(SPViewWidget), + 0, + (GInstanceInitFunc) sp_view_widget_init, + NULL + }; + type = g_type_register_static (GTK_TYPE_EVENT_BOX, "SPViewWidget", &info, (GTypeFlags)0); } return type; -- cgit v1.2.3