diff options
Diffstat (limited to 'src/widgets/sp-widget.cpp')
| -rw-r--r-- | src/widgets/sp-widget.cpp | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/widgets/sp-widget.cpp b/src/widgets/sp-widget.cpp index d5877db99..ef8a6c03c 100644 --- a/src/widgets/sp-widget.cpp +++ b/src/widgets/sp-widget.cpp @@ -43,24 +43,25 @@ static void sp_widget_set_selection (Inkscape::Application *inkscape, Inkscape:: static GtkBinClass *parent_class; static guint signals[LAST_SIGNAL] = {0}; -GtkType +GType sp_widget_get_type (void) { - //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 GtkType type = 0; + static GType type = 0; if (!type) { - static const GtkTypeInfo info = { - (gchar*) "SPWidget", - sizeof (SPWidget), + static const GTypeInfo info = { sizeof (SPWidgetClass), - (GtkClassInitFunc) sp_widget_class_init, - (GtkObjectInitFunc) sp_widget_init, - NULL, NULL, NULL + NULL, NULL, + (GClassInitFunc) sp_widget_class_init, + NULL, NULL, + sizeof (SPWidget), + 0, + (GInstanceInitFunc) sp_widget_init, + NULL }; - type = gtk_type_unique (GTK_TYPE_BIN, &info); + type = g_type_register_static (GTK_TYPE_BIN, + "SPWidget", + &info, + (GTypeFlags)0); } return type; } @@ -74,7 +75,7 @@ sp_widget_class_init (SPWidgetClass *klass) object_class = (GtkObjectClass *) klass; widget_class = (GtkWidgetClass *) klass; - parent_class = (GtkBinClass*)gtk_type_class (GTK_TYPE_BIN); + parent_class = (GtkBinClass*)g_type_class_peek_parent (klass); object_class->destroy = sp_widget_destroy; @@ -221,7 +222,7 @@ sp_widget_new_global (Inkscape::Application *inkscape) { SPWidget *spw; - spw = (SPWidget*)gtk_type_new (SP_TYPE_WIDGET); + spw = (SPWidget*)g_object_new (SP_TYPE_WIDGET, NULL); if (!sp_widget_construct_global (spw, inkscape)) { gtk_object_unref (GTK_OBJECT (spw)); |
