From f14407d198897d57447ae6643dc6563769c3dcdd Mon Sep 17 00:00:00 2001 From: joncruz Date: Sun, 3 Aug 2008 05:08:35 +0000 Subject: [PATCH] Replaced deprecated GtkType creation with GType --- src/display/sp-ctrlline.cpp | 23 ++++++++++++----------- src/display/sp-ctrlline.h | 2 +- src/display/sp-ctrlquadr.cpp | 23 ++++++++++++----------- src/display/sp-ctrlquadr.h | 2 +- 4 files changed, 26 insertions(+), 24 deletions(-) diff --git a/src/display/sp-ctrlline.cpp b/src/display/sp-ctrlline.cpp index 95dd98f11..8f71a0cc0 100644 --- a/src/display/sp-ctrlline.cpp +++ b/src/display/sp-ctrlline.cpp @@ -39,21 +39,22 @@ static void sp_ctrlline_render (SPCanvasItem *item, SPCanvasBuf *buf); static SPCanvasItemClass *parent_class; -GtkType +GType sp_ctrlline_get_type (void) { - static GtkType type = 0; - + static GType type = 0; if (!type) { - GtkTypeInfo info = { - "SPCtrlLine", - sizeof (SPCtrlLine), - sizeof (SPCtrlLineClass), - (GtkClassInitFunc) sp_ctrlline_class_init, - (GtkObjectInitFunc) sp_ctrlline_init, - NULL, NULL, NULL + GTypeInfo info = { + sizeof(SPCtrlLineClass), + NULL, NULL, + (GClassInitFunc) sp_ctrlline_class_init, + NULL, NULL, + sizeof(SPCtrlLine), + 0, + (GInstanceInitFunc) sp_ctrlline_init, + NULL }; - type = gtk_type_unique (SP_TYPE_CANVAS_ITEM, &info); + type = g_type_register_static(SP_TYPE_CANVAS_ITEM, "SPCtrlLine", &info, (GTypeFlags)0); } return type; } diff --git a/src/display/sp-ctrlline.h b/src/display/sp-ctrlline.h index 53d0d6ba0..88bebe601 100644 --- a/src/display/sp-ctrlline.h +++ b/src/display/sp-ctrlline.h @@ -30,7 +30,7 @@ struct SPCtrlLine : public SPCanvasItem{ }; struct SPCtrlLineClass : public SPCanvasItemClass{}; -GtkType sp_ctrlline_get_type (void); +GType sp_ctrlline_get_type (void); void sp_ctrlline_set_rgba32 (SPCtrlLine *cl, guint32 rgba); void sp_ctrlline_set_coords (SPCtrlLine *cl, gdouble x0, gdouble y0, gdouble x1, gdouble y1); diff --git a/src/display/sp-ctrlquadr.cpp b/src/display/sp-ctrlquadr.cpp index 6c271b2de..c8a71512d 100644 --- a/src/display/sp-ctrlquadr.cpp +++ b/src/display/sp-ctrlquadr.cpp @@ -38,21 +38,22 @@ static void sp_ctrlquadr_render (SPCanvasItem *item, SPCanvasBuf *buf); static SPCanvasItemClass *parent_class; -GtkType +GType sp_ctrlquadr_get_type (void) { - static GtkType type = 0; - + static GType type = 0; if (!type) { - GtkTypeInfo info = { - "SPCtrlQuadr", - sizeof (SPCtrlQuadr), - sizeof (SPCtrlQuadrClass), - (GtkClassInitFunc) sp_ctrlquadr_class_init, - (GtkObjectInitFunc) sp_ctrlquadr_init, - NULL, NULL, NULL + GTypeInfo info = { + sizeof(SPCtrlQuadrClass), + NULL, NULL, + (GClassInitFunc) sp_ctrlquadr_class_init, + NULL, NULL, + sizeof(SPCtrlQuadr), + 0, + (GInstanceInitFunc) sp_ctrlquadr_init, + NULL }; - type = gtk_type_unique (SP_TYPE_CANVAS_ITEM, &info); + type = g_type_register_static(SP_TYPE_CANVAS_ITEM, "SPCtrlQuadr", &info, (GTypeFlags)0); } return type; } diff --git a/src/display/sp-ctrlquadr.h b/src/display/sp-ctrlquadr.h index 38951448c..c32d2c376 100644 --- a/src/display/sp-ctrlquadr.h +++ b/src/display/sp-ctrlquadr.h @@ -23,7 +23,7 @@ struct SPCtrlQuadr; struct SPCtrlQuadrClass; -GtkType sp_ctrlquadr_get_type (void); +GType sp_ctrlquadr_get_type (void); void sp_ctrlquadr_set_rgba32 (SPCtrlQuadr *cl, guint32 rgba); void sp_ctrlquadr_set_coords (SPCtrlQuadr *cl, const NR::Point p1, const NR::Point p2, const NR::Point p3, const NR::Point p4); -- 2.30.2