summaryrefslogtreecommitdiffstats
path: root/src/widgets/sp-widget.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2011-07-06 01:59:32 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2011-07-06 01:59:32 +0000
commite65a02ed32b78534739aba24929ece7c44dd967f (patch)
tree13cf022f18f6b5bae46aad4bc339e512f069a514 /src/widgets/sp-widget.cpp
parentPull 2Geom revision 2013 (extra constructors for Rect). (diff)
parentText edit dialog: Apply button should grab default only after adding to window (diff)
downloadinkscape-e65a02ed32b78534739aba24929ece7c44dd967f.tar.gz
inkscape-e65a02ed32b78534739aba24929ece7c44dd967f.zip
Merge from trunk
(bzr r10347.1.5)
Diffstat (limited to '')
-rw-r--r--src/widgets/sp-widget.cpp31
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));