diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2011-07-06 01:59:32 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2011-07-06 01:59:32 +0000 |
| commit | e65a02ed32b78534739aba24929ece7c44dd967f (patch) | |
| tree | 13cf022f18f6b5bae46aad4bc339e512f069a514 /src/widgets/gradient-image.cpp | |
| parent | Pull 2Geom revision 2013 (extra constructors for Rect). (diff) | |
| parent | Text edit dialog: Apply button should grab default only after adding to window (diff) | |
| download | inkscape-e65a02ed32b78534739aba24929ece7c44dd967f.tar.gz inkscape-e65a02ed32b78534739aba24929ece7c44dd967f.zip | |
Merge from trunk
(bzr r10347.1.5)
Diffstat (limited to 'src/widgets/gradient-image.cpp')
| -rw-r--r-- | src/widgets/gradient-image.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/widgets/gradient-image.cpp b/src/widgets/gradient-image.cpp index 115935f50..1aeb43c91 100644 --- a/src/widgets/gradient-image.cpp +++ b/src/widgets/gradient-image.cpp @@ -36,24 +36,22 @@ static void sp_gradient_image_update (SPGradientImage *img); static GtkWidgetClass *parent_class; -GtkType +GType sp_gradient_image_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) { - GtkTypeInfo info = { - (gchar*) "SPGradientImage", - sizeof (SPGradientImage), + GTypeInfo info = { sizeof (SPGradientImageClass), - (GtkClassInitFunc) sp_gradient_image_class_init, - (GtkObjectInitFunc) sp_gradient_image_init, - NULL, NULL, NULL + NULL, NULL, + (GClassInitFunc) sp_gradient_image_class_init, + NULL, NULL, + sizeof (SPGradientImage), + 0, + (GInstanceInitFunc) sp_gradient_image_init, + NULL }; - type = gtk_type_unique (GTK_TYPE_WIDGET, &info); + type = g_type_register_static (GTK_TYPE_WIDGET, "SPGradientImage", &info, (GTypeFlags)0); } return type; } @@ -67,7 +65,7 @@ sp_gradient_image_class_init (SPGradientImageClass *klass) object_class = (GtkObjectClass *) klass; widget_class = (GtkWidgetClass *) klass; - parent_class = (GtkWidgetClass*)gtk_type_class (GTK_TYPE_WIDGET); + parent_class = (GtkWidgetClass*)g_type_class_peek_parent (klass); object_class->destroy = sp_gradient_image_destroy; @@ -146,7 +144,7 @@ sp_gradient_image_new (SPGradient *gradient) { SPGradientImage *image; - image = (SPGradientImage*)gtk_type_new (SP_TYPE_GRADIENT_IMAGE); + image = (SPGradientImage*)g_object_new (SP_TYPE_GRADIENT_IMAGE, NULL); sp_gradient_image_set_gradient (image, gradient); |
