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/view-widget.cpp') 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 From 32cbae2ea15712efd9a36f43f7690268c1767e52 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Sun, 3 Jul 2011 11:43:53 +0100 Subject: GTK+ cleanup: gtk_type_class (bzr r10407) --- src/ui/view/view-widget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui/view/view-widget.cpp') diff --git a/src/ui/view/view-widget.cpp b/src/ui/view/view-widget.cpp index f87bc8edd..d43877569 100644 --- a/src/ui/view/view-widget.cpp +++ b/src/ui/view/view-widget.cpp @@ -54,7 +54,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; } -- cgit v1.2.3 From 2633767789e4264b13ef91a684accf734fb4e94f Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Wed, 26 Oct 2011 21:55:51 -0700 Subject: Fixing more broken and split doc comments. (bzr r10697) --- src/ui/view/view-widget.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/ui/view/view-widget.cpp') diff --git a/src/ui/view/view-widget.cpp b/src/ui/view/view-widget.cpp index d43877569..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 * Ralf Stephan @@ -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,9 +22,6 @@ static void sp_view_widget_destroy(GtkObject *object); static GtkEventBoxClass *widget_parent_class; -/** - * Registers the SPViewWidget class with Glib and returns its type number. - */ GType sp_view_widget_get_type(void) { static GType type = 0; @@ -89,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); @@ -109,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); -- cgit v1.2.3