diff options
Diffstat (limited to 'src/ui/view/view-widget.cpp')
| -rw-r--r-- | src/ui/view/view-widget.cpp | 43 |
1 files changed, 15 insertions, 28 deletions
diff --git a/src/ui/view/view-widget.cpp b/src/ui/view/view-widget.cpp index cf0f55f2c..7876928f7 100644 --- a/src/ui/view/view-widget.cpp +++ b/src/ui/view/view-widget.cpp @@ -1,6 +1,4 @@ -/** \file - * SPViewWidget implementation. - * +/* * Authors: * Lauris Kaplinski <lauris@kaplinski.com> * Ralf Stephan <ralf@ark.in-berlin.de> @@ -16,7 +14,7 @@ //using namespace Inkscape::UI::View; -/* SPViewWidget */ +// SPViewWidget static void sp_view_widget_class_init(SPViewWidgetClass *vwc); static void sp_view_widget_init(SPViewWidget *widget); @@ -24,25 +22,21 @@ static void sp_view_widget_destroy(GtkObject *object); 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; @@ -55,7 +49,7 @@ static void sp_view_widget_class_init(SPViewWidgetClass *vwc) { GtkObjectClass *object_class = GTK_OBJECT_CLASS(vwc); - widget_parent_class = (GtkEventBoxClass*) gtk_type_class(GTK_TYPE_EVENT_BOX); + widget_parent_class = (GtkEventBoxClass*) g_type_class_peek_parent(vwc); object_class->destroy = sp_view_widget_destroy; } @@ -90,10 +84,6 @@ static void sp_view_widget_destroy(GtkObject *object) Inkscape::GC::request_early_collection(); } -/** - * Connects widget to view's 'resized' signal and calls virtual set_view() - * function. - */ void sp_view_widget_set_view(SPViewWidget *vw, Inkscape::UI::View::View *view) { g_return_if_fail(vw != NULL); @@ -110,9 +100,6 @@ void sp_view_widget_set_view(SPViewWidget *vw, Inkscape::UI::View::View *view) } } -/** - * Calls the virtual shutdown() function of the SPViewWidget. - */ bool sp_view_widget_shutdown(SPViewWidget *vw) { g_return_val_if_fail(vw != NULL, TRUE); |
