diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2011-06-24 10:23:41 +0000 |
|---|---|---|
| committer | Alex Valavanis <valavanisalex@gmail.com> | 2011-06-24 10:23:41 +0000 |
| commit | 4d8bf28dbebbc70325c75c0501ed192ae330c63b (patch) | |
| tree | bc31b7781d12de480edee237a1d419a8555718d1 /src | |
| parent | Remove/replace deprecated gtk_window_set_policy symbol (diff) | |
| download | inkscape-4d8bf28dbebbc70325c75c0501ed192ae330c63b.tar.gz inkscape-4d8bf28dbebbc70325c75c0501ed192ae330c63b.zip | |
Switch to GObject
(bzr r10350.1.3)
Diffstat (limited to 'src')
64 files changed, 202 insertions, 208 deletions
diff --git a/src/arc-context.cpp b/src/arc-context.cpp index 76b064f06..6e5b935f1 100644 --- a/src/arc-context.cpp +++ b/src/arc-context.cpp @@ -63,7 +63,7 @@ static void sp_arc_cancel(SPArcContext *ec); static SPEventContextClass *parent_class; -GtkType sp_arc_context_get_type() +GType sp_arc_context_get_type() { static GType type = 0; if (!type) { diff --git a/src/arc-context.h b/src/arc-context.h index ddce10801..46a6e1dce 100644 --- a/src/arc-context.h +++ b/src/arc-context.h @@ -45,7 +45,7 @@ struct SPArcContextClass { /* Standard Gtk function */ -GtkType sp_arc_context_get_type(void); +GType sp_arc_context_get_type(void); #endif /* !SEEN_ARC_CONTEXT_H */ diff --git a/src/box3d-context.cpp b/src/box3d-context.cpp index 90f1707b9..8bba30eb9 100644 --- a/src/box3d-context.cpp +++ b/src/box3d-context.cpp @@ -66,7 +66,7 @@ static void sp_box3d_finish(Box3DContext *bc); static SPEventContextClass *parent_class; -GtkType sp_box3d_context_get_type() +GType sp_box3d_context_get_type() { static GType type = 0; if (!type) { diff --git a/src/box3d-context.h b/src/box3d-context.h index 74d244423..ccf0ef712 100644 --- a/src/box3d-context.h +++ b/src/box3d-context.h @@ -66,7 +66,7 @@ struct Box3DContextClass { /* Standard Gtk function */ -GtkType sp_box3d_context_get_type (void); +GType sp_box3d_context_get_type (void); void sp_box3d_context_update_lines(SPEventContext *ec); diff --git a/src/desktop.cpp b/src/desktop.cpp index f12f83ca6..d05c94790 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -648,7 +648,7 @@ SPDesktop::change_document (SPDocument *theDocument) * Make desktop switch event contexts. */ void -SPDesktop::set_event_context (GtkType type, const gchar *config) +SPDesktop::set_event_context (GType type, const gchar *config) { SPEventContext *ec; while (event_context) { @@ -679,7 +679,7 @@ SPDesktop::set_event_context (GtkType type, const gchar *config) * Push event context onto desktop's context stack. */ void -SPDesktop::push_event_context (GtkType type, const gchar *config, unsigned int key) +SPDesktop::push_event_context (GType type, const gchar *config, unsigned int key) { SPEventContext *ref, *ec; diff --git a/src/desktop.h b/src/desktop.h index 2581f2859..ed0a99dea 100644 --- a/src/desktop.h +++ b/src/desktop.h @@ -240,8 +240,8 @@ public: void activate_guides (bool activate); void change_document (SPDocument *document); - void set_event_context (GtkType type, const gchar *config); - void push_event_context (GtkType type, const gchar *config, unsigned int key); + void set_event_context (GType type, const gchar *config); + void push_event_context (GType type, const gchar *config, unsigned int key); void set_coordinate_status (Geom::Point p); SPItem *getItemFromListAtPointBottom(const GSList *list, Geom::Point const p) const; diff --git a/src/display/canvas-arena.cpp b/src/display/canvas-arena.cpp index 72062ce99..5f3d961f7 100644 --- a/src/display/canvas-arena.cpp +++ b/src/display/canvas-arena.cpp @@ -48,20 +48,22 @@ NRArenaEventVector carenaev = { static SPCanvasItemClass *parent_class; static guint signals[LAST_SIGNAL] = {0}; -GtkType +GType sp_canvas_arena_get_type (void) { - static GtkType type = 0; + static GType type = 0; if (!type) { - GtkTypeInfo info = { - (gchar *)"SPCanvasArena", - sizeof (SPCanvasArena), + GTypeInfo info = { sizeof (SPCanvasArenaClass), - (GtkClassInitFunc) sp_canvas_arena_class_init, - (GtkObjectInitFunc) sp_canvas_arena_init, - NULL, NULL, NULL - }; - type = gtk_type_unique (SP_TYPE_CANVAS_ITEM, &info); + NULL, NULL, + (GClassInitFunc) sp_canvas_arena_class_init, + NULL, NULL, + sizeof (SPCanvasArena), + 0, + (GInstanceInitFunc) sp_canvas_arena_init, + NULL + }; + type = g_type_register_static (SP_TYPE_CANVAS_ITEM, "SPCanvasArena", &info, (GTypeFlags)0); } return type; } diff --git a/src/display/canvas-arena.h b/src/display/canvas-arena.h index ef065a03b..4cfeccb5a 100644 --- a/src/display/canvas-arena.h +++ b/src/display/canvas-arena.h @@ -53,7 +53,7 @@ struct _SPCanvasArenaClass { gint (* arena_event) (SPCanvasArena *carena, NRArenaItem *item, GdkEvent *event); }; -GtkType sp_canvas_arena_get_type (void); +GType sp_canvas_arena_get_type (void); void sp_canvas_arena_set_pick_delta (SPCanvasArena *ca, gdouble delta); void sp_canvas_arena_set_sticky (SPCanvasArena *ca, gboolean sticky); diff --git a/src/display/canvas-bpath.cpp b/src/display/canvas-bpath.cpp index f86743744..815892878 100644 --- a/src/display/canvas-bpath.cpp +++ b/src/display/canvas-bpath.cpp @@ -38,20 +38,22 @@ static double sp_canvas_bpath_point (SPCanvasItem *item, Geom::Point p, SPCanvas static SPCanvasItemClass *parent_class; -GtkType +GType sp_canvas_bpath_get_type (void) { - static GtkType type = 0; + static GType type = 0; if (!type) { - GtkTypeInfo info = { - (gchar *)"SPCanvasBPath", - sizeof (SPCanvasBPath), + GTypeInfo info = { sizeof (SPCanvasBPathClass), - (GtkClassInitFunc) sp_canvas_bpath_class_init, - (GtkObjectInitFunc) sp_canvas_bpath_init, - NULL, NULL, NULL - }; - type = gtk_type_unique (SP_TYPE_CANVAS_ITEM, &info); + NULL, NULL, + (GClassInitFunc) sp_canvas_bpath_class_init, + NULL, NULL, + sizeof (SPCanvasBPath), + 0, + (GInstanceInitFunc) sp_canvas_bpath_init, + NULL + }; + type = g_type_register_static (SP_TYPE_CANVAS_ITEM, "SPCanvasBPath", &info, (GTypeFlags)0); } return type; } diff --git a/src/display/canvas-bpath.h b/src/display/canvas-bpath.h index ad19797c2..752ed73ea 100644 --- a/src/display/canvas-bpath.h +++ b/src/display/canvas-bpath.h @@ -90,7 +90,7 @@ struct SPCanvasBPathClass { SPCanvasItemClass parent_class; }; -GtkType sp_canvas_bpath_get_type (void); +GType sp_canvas_bpath_get_type (void); SPCanvasItem *sp_canvas_bpath_new (SPCanvasGroup *parent, SPCurve *curve); diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp index 82ea036f6..9a12a1d90 100644 --- a/src/display/canvas-grid.cpp +++ b/src/display/canvas-grid.cpp @@ -58,22 +58,24 @@ static void grid_canvasitem_render (SPCanvasItem *item, SPCanvasBuf *buf); static SPCanvasItemClass * parent_class; -GtkType +GType grid_canvasitem_get_type (void) { - static GtkType grid_canvasitem_type = 0; + static GType grid_canvasitem_type = 0; if (!grid_canvasitem_type) { - GtkTypeInfo grid_canvasitem_info = { - (gchar *)"GridCanvasItem", - sizeof (GridCanvasItem), + GTypeInfo grid_canvasitem_info = { sizeof (GridCanvasItemClass), - (GtkClassInitFunc) grid_canvasitem_class_init, - (GtkObjectInitFunc) grid_canvasitem_init, - NULL, NULL, - (GtkClassInitFunc) NULL - }; - grid_canvasitem_type = gtk_type_unique (sp_canvas_item_get_type (), &grid_canvasitem_info); + NULL, NULL, + (GClassInitFunc) grid_canvasitem_class_init, + NULL, NULL, + sizeof (GridCanvasItem), + 0, + (GInstanceInitFunc) grid_canvasitem_init, + NULL + }; + + grid_canvasitem_type = g_type_register_static (sp_canvas_item_get_type (), "GridCanvasItem", &grid_canvasitem_info, (GTypeFlags)0); } return grid_canvasitem_type; } diff --git a/src/display/canvas-grid.h b/src/display/canvas-grid.h index f42fecad7..160e4a4e2 100644 --- a/src/display/canvas-grid.h +++ b/src/display/canvas-grid.h @@ -57,7 +57,7 @@ struct GridCanvasItemClass { }; /* Standard Gtk function */ -GtkType grid_canvasitem_get_type (void); +GType grid_canvasitem_get_type (void); diff --git a/src/display/canvas-text.cpp b/src/display/canvas-text.cpp index 842425f50..690015ecd 100644 --- a/src/display/canvas-text.cpp +++ b/src/display/canvas-text.cpp @@ -36,21 +36,23 @@ static void sp_canvastext_render (SPCanvasItem *item, SPCanvasBuf *buf); static SPCanvasItemClass *parent_class_ct; -GtkType +GType sp_canvastext_get_type (void) { - static GtkType type = 0; + static GType type = 0; if (!type) { - GtkTypeInfo info = { - (gchar *)"SPCanvasText", - sizeof (SPCanvasText), + GTypeInfo info = { sizeof (SPCanvasTextClass), - (GtkClassInitFunc) sp_canvastext_class_init, - (GtkObjectInitFunc) sp_canvastext_init, - NULL, NULL, NULL - }; - type = gtk_type_unique (SP_TYPE_CANVAS_ITEM, &info); + NULL, NULL, + (GClassInitFunc) sp_canvastext_class_init, + NULL, NULL, + sizeof (SPCanvasText), + 0, + (GInstanceInitFunc) sp_canvastext_init, + NULL + }; + type = g_type_register_static (SP_TYPE_CANVAS_ITEM, "SPCanvasText", &info, (GTypeFlags)0); } return type; } diff --git a/src/display/canvas-text.h b/src/display/canvas-text.h index 30ddc1557..85333d84e 100644 --- a/src/display/canvas-text.h +++ b/src/display/canvas-text.h @@ -52,7 +52,7 @@ struct SPCanvasText : public SPCanvasItem { }; struct SPCanvasTextClass : public SPCanvasItemClass{}; -GtkType sp_canvastext_get_type (void); +GType sp_canvastext_get_type (void); SPCanvasItem *sp_canvastext_new(SPCanvasGroup *parent, SPDesktop *desktop, Geom::Point pos, gchar const *text); diff --git a/src/display/gnome-canvas-acetate.cpp b/src/display/gnome-canvas-acetate.cpp index b86892e32..67cc66950 100644 --- a/src/display/gnome-canvas-acetate.cpp +++ b/src/display/gnome-canvas-acetate.cpp @@ -25,20 +25,22 @@ static double sp_canvas_acetate_point (SPCanvasItem *item, Geom::Point p, SPCanv static SPCanvasItemClass *parent_class; -GtkType +GType sp_canvas_acetate_get_type (void) { - static GtkType acetate_type = 0; + static GType acetate_type = 0; if (!acetate_type) { - GtkTypeInfo acetate_info = { - (gchar *)"SPCanvasAcetate", - sizeof (SPCanvasAcetate), + GTypeInfo acetate_info = { sizeof (SPCanvasAcetateClass), - (GtkClassInitFunc) sp_canvas_acetate_class_init, - (GtkObjectInitFunc) sp_canvas_acetate_init, - NULL, NULL, NULL + NULL, NULL, + (GClassInitFunc) sp_canvas_acetate_class_init, + NULL, NULL, + sizeof (SPCanvasAcetate), + 0, + (GInstanceInitFunc) sp_canvas_acetate_init, + NULL }; - acetate_type = gtk_type_unique (sp_canvas_item_get_type (), &acetate_info); + acetate_type = g_type_register_static (sp_canvas_item_get_type (), "SPCanvasAcetate", &acetate_info, (GTypeFlags)0); } return acetate_type; } diff --git a/src/display/gnome-canvas-acetate.h b/src/display/gnome-canvas-acetate.h index 756c663ca..ed6c99811 100644 --- a/src/display/gnome-canvas-acetate.h +++ b/src/display/gnome-canvas-acetate.h @@ -34,7 +34,7 @@ struct SPCanvasAcetateClass { SPCanvasItemClass parent_class; }; -GtkType sp_canvas_acetate_get_type (void); +GType sp_canvas_acetate_get_type (void); diff --git a/src/display/sodipodi-ctrl.cpp b/src/display/sodipodi-ctrl.cpp index 5e939ffee..fe2a78a8f 100644 --- a/src/display/sodipodi-ctrl.cpp +++ b/src/display/sodipodi-ctrl.cpp @@ -40,10 +40,10 @@ static double sp_ctrl_point (SPCanvasItem *item, Geom::Point p, SPCanvasItem **a static SPCanvasItemClass *parent_class; -GtkType +GType sp_ctrl_get_type (void) { - static GtkType ctrl_type = 0; + static GType ctrl_type = 0; if (!ctrl_type) { static GTypeInfo const ctrl_info = { sizeof (SPCtrlClass), diff --git a/src/display/sodipodi-ctrl.h b/src/display/sodipodi-ctrl.h index 3bf0889c7..4f114eac6 100644 --- a/src/display/sodipodi-ctrl.h +++ b/src/display/sodipodi-ctrl.h @@ -62,7 +62,7 @@ struct SPCtrlClass : public SPCanvasItemClass{ /* Standard Gtk function */ -GtkType sp_ctrl_get_type (void); +GType sp_ctrl_get_type (void); #endif /* !INKSCAPE_CTRL_H */ diff --git a/src/display/sodipodi-ctrlrect.h b/src/display/sodipodi-ctrlrect.h index 945deabc4..e69b6ba68 100644 --- a/src/display/sodipodi-ctrlrect.h +++ b/src/display/sodipodi-ctrlrect.h @@ -57,7 +57,7 @@ private: struct SPCtrlRectClass : public SPCanvasItemClass {}; -GtkType sp_ctrlrect_get_type(); +GType sp_ctrlrect_get_type(); #endif // SEEN_RUBBERBAND_H diff --git a/src/display/sp-canvas-item.h b/src/display/sp-canvas-item.h index f62dc34a7..51e9a740e 100644 --- a/src/display/sp-canvas-item.h +++ b/src/display/sp-canvas-item.h @@ -67,7 +67,7 @@ struct _SPCanvasItemClass : public GtkObjectClass { int (* event) (SPCanvasItem *item, GdkEvent *event); }; -SPCanvasItem *sp_canvas_item_new(SPCanvasGroup *parent, GtkType type, const gchar *first_arg_name, ...); +SPCanvasItem *sp_canvas_item_new(SPCanvasGroup *parent, GType type, const gchar *first_arg_name, ...); G_END_DECLS diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp index 472c9ada5..0d56b0175 100644 --- a/src/display/sp-canvas.cpp +++ b/src/display/sp-canvas.cpp @@ -169,7 +169,7 @@ sp_canvas_item_init (SPCanvasItem *item) * Constructs new SPCanvasItem on SPCanvasGroup. */ SPCanvasItem * -sp_canvas_item_new (SPCanvasGroup *parent, GtkType type, gchar const *first_arg_name, ...) +sp_canvas_item_new (SPCanvasGroup *parent, GType type, gchar const *first_arg_name, ...) { va_list args; diff --git a/src/flood-context.cpp b/src/flood-context.cpp index 73e82607a..90278ac95 100644 --- a/src/flood-context.cpp +++ b/src/flood-context.cpp @@ -84,7 +84,7 @@ static void sp_flood_finish(SPFloodContext *rc); static SPEventContextClass *parent_class; -GtkType sp_flood_context_get_type() +GType sp_flood_context_get_type() { static GType type = 0; if (!type) { diff --git a/src/flood-context.h b/src/flood-context.h index 6847c19be..0cab0f7c5 100644 --- a/src/flood-context.h +++ b/src/flood-context.h @@ -46,7 +46,7 @@ struct SPFloodContextClass { /* Standard Gtk function */ -GtkType sp_flood_context_get_type (void); +GType sp_flood_context_get_type (void); GList* flood_channels_dropdown_items_list (void); GList* flood_autogap_dropdown_items_list (void); diff --git a/src/gradient-context.cpp b/src/gradient-context.cpp index 922a9b16e..a237bb3c6 100644 --- a/src/gradient-context.cpp +++ b/src/gradient-context.cpp @@ -63,7 +63,7 @@ static void sp_gradient_drag(SPGradientContext &rc, Geom::Point const pt, guint static SPEventContextClass *parent_class; -GtkType sp_gradient_context_get_type() +GType sp_gradient_context_get_type() { static GType type = 0; if (!type) { diff --git a/src/gradient-context.h b/src/gradient-context.h index 1ed14cf3f..bdd7208b6 100644 --- a/src/gradient-context.h +++ b/src/gradient-context.h @@ -49,7 +49,7 @@ struct SPGradientContextClass { }; /* Standard Gtk function */ -GtkType sp_gradient_context_get_type(); +GType sp_gradient_context_get_type(); void sp_gradient_context_select_next (SPEventContext *event_context); void sp_gradient_context_select_prev (SPEventContext *event_context); diff --git a/src/libgdl/gdl-dock-item-grip.c b/src/libgdl/gdl-dock-item-grip.c index c51b782b3..089eeb685 100644 --- a/src/libgdl/gdl-dock-item-grip.c +++ b/src/libgdl/gdl-dock-item-grip.c @@ -653,7 +653,7 @@ gdl_dock_item_grip_forall (GtkContainer *container, } } -static GtkType +static GType gdl_dock_item_grip_child_type (GtkContainer *container) { return G_TYPE_NONE; diff --git a/src/libgdl/gdl-dock-item.c b/src/libgdl/gdl-dock-item.c index b0d97a06d..3d746fa7c 100644 --- a/src/libgdl/gdl-dock-item.c +++ b/src/libgdl/gdl-dock-item.c @@ -79,7 +79,7 @@ static void gdl_dock_item_forall (GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data); -static GtkType gdl_dock_item_child_type (GtkContainer *container); +static GType gdl_dock_item_child_type (GtkContainer *container); static void gdl_dock_item_set_focus_child (GtkContainer *container, GtkWidget *widget, @@ -684,7 +684,7 @@ gdl_dock_item_forall (GtkContainer *container, (* callback) (item->child, callback_data); } -static GtkType +static GType gdl_dock_item_child_type (GtkContainer *container) { g_return_val_if_fail (GDL_IS_DOCK_ITEM (container), G_TYPE_NONE); diff --git a/src/libgdl/gdl-dock.c b/src/libgdl/gdl-dock.c index c366ed69b..5f0d7c66d 100644 --- a/src/libgdl/gdl-dock.c +++ b/src/libgdl/gdl-dock.c @@ -79,7 +79,7 @@ static void gdl_dock_forall (GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data); -static GtkType gdl_dock_child_type (GtkContainer *container); +static GType gdl_dock_child_type (GtkContainer *container); static void gdl_dock_detach (GdlDockObject *object, gboolean recursive); @@ -750,7 +750,7 @@ gdl_dock_forall (GtkContainer *container, (*callback) (GTK_WIDGET (dock->root), callback_data); } -static GtkType +static GType gdl_dock_child_type (GtkContainer *container) { return GDL_TYPE_DOCK_ITEM; diff --git a/src/rect-context.cpp b/src/rect-context.cpp index bcb1bf734..7f32e09fa 100644 --- a/src/rect-context.cpp +++ b/src/rect-context.cpp @@ -65,7 +65,7 @@ static void sp_rect_cancel(SPRectContext *rc); static SPEventContextClass *parent_class; -GtkType sp_rect_context_get_type() +GType sp_rect_context_get_type() { static GType type = 0; if (!type) { diff --git a/src/rect-context.h b/src/rect-context.h index db7cd605b..e5d160788 100644 --- a/src/rect-context.h +++ b/src/rect-context.h @@ -46,6 +46,6 @@ struct SPRectContextClass { /* Standard Gtk function */ -GtkType sp_rect_context_get_type (void); +GType sp_rect_context_get_type (void); #endif diff --git a/src/select-context.cpp b/src/select-context.cpp index 640aae9ee..143fb1ae2 100644 --- a/src/select-context.cpp +++ b/src/select-context.cpp @@ -69,7 +69,7 @@ static gint xp = 0, yp = 0; // where drag started static gint tolerance = 0; static bool within_tolerance = false; -GtkType +GType sp_select_context_get_type(void) { static GType type = 0; diff --git a/src/select-context.h b/src/select-context.h index 934892d40..d579f7ebc 100644 --- a/src/select-context.h +++ b/src/select-context.h @@ -55,6 +55,6 @@ struct SPSelectContextClass { /* Standard Gtk function */ -GtkType sp_select_context_get_type (void); +GType sp_select_context_get_type (void); #endif diff --git a/src/spiral-context.cpp b/src/spiral-context.cpp index 754885192..cbe7166c5 100644 --- a/src/spiral-context.cpp +++ b/src/spiral-context.cpp @@ -59,7 +59,7 @@ static void sp_spiral_cancel(SPSpiralContext *sc); static SPEventContextClass *parent_class; -GtkType +GType sp_spiral_context_get_type() { static GType type = 0; diff --git a/src/spiral-context.h b/src/spiral-context.h index 6d689c49c..dd447dbfe 100644 --- a/src/spiral-context.h +++ b/src/spiral-context.h @@ -48,6 +48,6 @@ struct SPSpiralContextClass { /* Standard Gtk function */ -GtkType sp_spiral_context_get_type (void); +GType sp_spiral_context_get_type (void); #endif diff --git a/src/spray-context.cpp b/src/spray-context.cpp index 36c135924..be0cb627f 100644 --- a/src/spray-context.cpp +++ b/src/spray-context.cpp @@ -98,7 +98,7 @@ inline double NormalDistribution(double mu, double sigma) return mu + sigma * sqrt( -2.0 * log(g_random_double_range(0, 1)) ) * cos( 2.0*M_PI*g_random_double_range(0, 1) ); } -GtkType sp_spray_context_get_type(void) +GType sp_spray_context_get_type(void) { static GType type = 0; if (!type) { diff --git a/src/spray-context.h b/src/spray-context.h index f6d9a9c0b..247c07130 100644 --- a/src/spray-context.h +++ b/src/spray-context.h @@ -99,7 +99,7 @@ struct SPSprayContextClass SPEventContextClass parent_class; }; -GtkType sp_spray_context_get_type(void); +GType sp_spray_context_get_type(void); #endif diff --git a/src/star-context.cpp b/src/star-context.cpp index 9f4afb94c..17a8e915f 100644 --- a/src/star-context.cpp +++ b/src/star-context.cpp @@ -64,7 +64,7 @@ static void sp_star_cancel(SPStarContext * sc); static SPEventContextClass * parent_class; -GtkType +GType sp_star_context_get_type (void) { static GType type = 0; diff --git a/src/star-context.h b/src/star-context.h index b66e2dd15..d9ab8ce8f 100644 --- a/src/star-context.h +++ b/src/star-context.h @@ -52,6 +52,6 @@ struct SPStarContextClass { SPEventContextClass parent_class; }; -GtkType sp_star_context_get_type (void); +GType sp_star_context_get_type (void); #endif diff --git a/src/svg-view-widget.h b/src/svg-view-widget.h index 1a8697fdf..46def687b 100644 --- a/src/svg-view-widget.h +++ b/src/svg-view-widget.h @@ -27,7 +27,7 @@ class SPSVGSPViewWidgetClass; #define SP_IS_SVG_VIEW_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_SVG_VIEW_WIDGET)) #define SP_IS_SVG_VIEW_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_SVG_VIEW_WIDGET)) -GtkType sp_svg_view_widget_get_type (void); +GType sp_svg_view_widget_get_type (void); GtkWidget *sp_svg_view_widget_new (SPDocument *doc); diff --git a/src/text-context.h b/src/text-context.h index 0d7a93ef0..a140c2f08 100644 --- a/src/text-context.h +++ b/src/text-context.h @@ -80,7 +80,7 @@ struct SPTextContextClass { }; /* Standard Gtk function */ -GtkType sp_text_context_get_type (void); +GType sp_text_context_get_type (void); bool sp_text_paste_inline(SPEventContext *ec); Glib::ustring sp_text_get_selected_text(SPEventContext const *ec); diff --git a/src/tweak-context.cpp b/src/tweak-context.cpp index faa08ee91..b4f13d16f 100644 --- a/src/tweak-context.cpp +++ b/src/tweak-context.cpp @@ -90,7 +90,7 @@ static gint sp_tweak_context_root_handler(SPEventContext *ec, GdkEvent *event); static SPEventContextClass *parent_class; -GtkType +GType sp_tweak_context_get_type(void) { static GType type = 0; diff --git a/src/tweak-context.h b/src/tweak-context.h index 5fbd078ef..f7f1fcf7d 100644 --- a/src/tweak-context.h +++ b/src/tweak-context.h @@ -86,7 +86,7 @@ struct SPTweakContextClass SPEventContextClass parent_class; }; -GtkType sp_tweak_context_get_type(void); +GType sp_tweak_context_get_type(void); #endif 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; diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 0d890fa86..3c2d60638 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -254,7 +254,7 @@ static GTimer *overallTimer = 0; */ GType SPDesktopWidget::getType(void) { - static GtkType type = 0; + static GType type = 0; if (!type) { GTypeInfo info = { sizeof(SPDesktopWidgetClass), diff --git a/src/widgets/desktop-widget.h b/src/widgets/desktop-widget.h index 6c5af0aac..fdf651287 100644 --- a/src/widgets/desktop-widget.h +++ b/src/widgets/desktop-widget.h @@ -238,7 +238,7 @@ struct SPDesktopWidget { Inkscape::UI::Widget::Dock* getDock(); - static GtkType getType(); + static GType getType(); static SPDesktopWidget* createInstance(SPNamedView *namedview); void updateNamedview(); diff --git a/src/widgets/font-selector.h b/src/widgets/font-selector.h index febd4a34a..3fc425f65 100644 --- a/src/widgets/font-selector.h +++ b/src/widgets/font-selector.h @@ -27,7 +27,7 @@ struct SPFontSelector; /* SPFontSelector */ -GtkType sp_font_selector_get_type (void); +GType sp_font_selector_get_type (void); GtkWidget *sp_font_selector_new (void); diff --git a/src/widgets/gradient-image.cpp b/src/widgets/gradient-image.cpp index 115935f50..eb4ab789d 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; } diff --git a/src/widgets/gradient-image.h b/src/widgets/gradient-image.h index ae5d40f56..0fbed879f 100644 --- a/src/widgets/gradient-image.h +++ b/src/widgets/gradient-image.h @@ -40,7 +40,7 @@ struct SPGradientImageClass { GtkWidgetClass parent_class; }; -GtkType sp_gradient_image_get_type (void); +GType sp_gradient_image_get_type (void); GtkWidget *sp_gradient_image_new (SPGradient *gradient); void sp_gradient_image_set_gradient (SPGradientImage *gi, SPGradient *gr); diff --git a/src/widgets/paint-selector.cpp b/src/widgets/paint-selector.cpp index f9ec4208f..6b3e0c4b5 100644 --- a/src/widgets/paint-selector.cpp +++ b/src/widgets/paint-selector.cpp @@ -134,7 +134,7 @@ static SPGradientSelector *getGradientFromData(SPPaintSelector const *psel) GType sp_paint_selector_get_type(void) { - static GtkType type = 0; + static GType type = 0; if (!type) { GTypeInfo info = { sizeof(SPPaintSelectorClass), diff --git a/src/widgets/paint-selector.h b/src/widgets/paint-selector.h index c0e44683b..ebcac380f 100644 --- a/src/widgets/paint-selector.h +++ b/src/widgets/paint-selector.h @@ -114,7 +114,7 @@ struct SPPaintSelectorClass { void (* fillrule_changed) (SPPaintSelector *psel, SPPaintSelector::FillRule fillrule); }; -GtkType sp_paint_selector_get_type (void); +GType sp_paint_selector_get_type (void); SPPaintSelector *sp_paint_selector_new(FillOrStroke kind); diff --git a/src/widgets/ruler.cpp b/src/widgets/ruler.cpp index 704d395f7..f3f4164a5 100644 --- a/src/widgets/ruler.cpp +++ b/src/widgets/ruler.cpp @@ -37,30 +37,25 @@ static gint sp_hruler_motion_notify (GtkWidget *widget, GdkEventMotion *eve static GtkWidgetClass *hruler_parent_class; -GtkType +GType sp_hruler_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 hruler_type = 0; + static GType hruler_type = 0; if (!hruler_type) { - static const GtkTypeInfo hruler_info = - { - (gchar*) "SPHRuler", - sizeof (SPHRuler), + static const GTypeInfo hruler_info = { sizeof (SPHRulerClass), - (GtkClassInitFunc) sp_hruler_class_init, - (GtkObjectInitFunc) sp_hruler_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, + NULL, NULL, + (GClassInitFunc) sp_hruler_class_init, + NULL, NULL, + sizeof (SPHRuler), + 0, + (GInstanceInitFunc) sp_hruler_init, + NULL }; - hruler_type = gtk_type_unique (gtk_ruler_get_type (), &hruler_info); + hruler_type = g_type_register_static (gtk_ruler_get_type (), "SPHRuler", &hruler_info, (GTypeFlags)0); } return hruler_type; @@ -128,30 +123,25 @@ static void sp_vruler_size_request (GtkWidget *widget, GtkRequisition *requisiti static GtkWidgetClass *vruler_parent_class; -GtkType +GType sp_vruler_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 vruler_type = 0; + static GType vruler_type = 0; if (!vruler_type) { - static const GtkTypeInfo vruler_info = - { - (gchar*) "SPVRuler", - sizeof (SPVRuler), + static const GTypeInfo vruler_info = { sizeof (SPVRulerClass), - (GtkClassInitFunc) sp_vruler_class_init, - (GtkObjectInitFunc) sp_vruler_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, + NULL, NULL, + (GClassInitFunc) sp_vruler_class_init, + NULL, NULL, + sizeof (SPVRuler), + 0, + (GInstanceInitFunc) sp_vruler_init, + NULL }; - vruler_type = gtk_type_unique (gtk_ruler_get_type (), &vruler_info); + vruler_type = g_type_register_static (gtk_ruler_get_type (), "SPVRuler", &vruler_info, (GTypeFlags)0); } return vruler_type; diff --git a/src/widgets/ruler.h b/src/widgets/ruler.h index 3c55b39c4..a774f12ef 100644 --- a/src/widgets/ruler.h +++ b/src/widgets/ruler.h @@ -38,7 +38,7 @@ struct SPHRulerClass }; -GtkType sp_hruler_get_type (void); +GType sp_hruler_get_type (void); GtkWidget* sp_hruler_new (void); @@ -63,7 +63,7 @@ struct SPVRulerClass }; -GtkType sp_vruler_get_type (void); +GType sp_vruler_get_type (void); GtkWidget* sp_vruler_new (void); diff --git a/src/widgets/sp-attribute-widget.cpp b/src/widgets/sp-attribute-widget.cpp index 66ccb27f2..61863f31b 100644 --- a/src/widgets/sp-attribute-widget.cpp +++ b/src/widgets/sp-attribute-widget.cpp @@ -42,7 +42,7 @@ static GtkEntryClass *parent_class; GType sp_attribute_widget_get_type(void) { - static GtkType type = 0; + static GType type = 0; if (!type) { GTypeInfo info = { sizeof(SPAttributeWidgetClass), @@ -361,7 +361,7 @@ static GtkVBoxClass *table_parent_class; GType sp_attribute_table_get_type(void) { - static GtkType type = 0; + static GType type = 0; if (!type) { GTypeInfo info = { sizeof(SPAttributeTableClass), diff --git a/src/widgets/sp-attribute-widget.h b/src/widgets/sp-attribute-widget.h index 5d23e6754..d5445c8bb 100644 --- a/src/widgets/sp-attribute-widget.h +++ b/src/widgets/sp-attribute-widget.h @@ -64,7 +64,7 @@ struct SPAttributeWidgetClass { GtkEntryClass entry_class; }; -GtkType sp_attribute_widget_get_type (void); +GType sp_attribute_widget_get_type (void); GtkWidget *sp_attribute_widget_new (SPObject *object, const gchar *attribute); GtkWidget *sp_attribute_widget_new_repr (Inkscape::XML::Node *repr, const gchar *attribute); @@ -99,7 +99,7 @@ struct SPAttributeTableClass { GtkEntryClass entry_class; }; -GtkType sp_attribute_table_get_type (void); +GType sp_attribute_table_get_type (void); GtkWidget *sp_attribute_table_new ( SPObject *object, gint num_attr, const gchar **labels, diff --git a/src/widgets/sp-color-notebook.cpp b/src/widgets/sp-color-notebook.cpp index 06e990dfb..e3e28979d 100644 --- a/src/widgets/sp-color-notebook.cpp +++ b/src/widgets/sp-color-notebook.cpp @@ -62,7 +62,7 @@ static SPColorSelectorClass *parent_class; GType sp_color_notebook_get_type(void) { - static GtkType type = 0; + static GType type = 0; if (!type) { GTypeInfo info = { sizeof(SPColorNotebookClass), diff --git a/src/widgets/sp-color-slider.cpp b/src/widgets/sp-color-slider.cpp index 7b365bc73..152f81324 100644 --- a/src/widgets/sp-color-slider.cpp +++ b/src/widgets/sp-color-slider.cpp @@ -54,24 +54,22 @@ static const guchar *sp_color_slider_render_map (gint x0, gint y0, gint width, g static GtkWidgetClass *parent_class; static guint slider_signals[LAST_SIGNAL] = {0}; -GtkType +GType sp_color_slider_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*) "SPColorSlider", - sizeof (SPColorSlider), + GTypeInfo info = { sizeof (SPColorSliderClass), - (GtkClassInitFunc) sp_color_slider_class_init, - (GtkObjectInitFunc) sp_color_slider_init, - NULL, NULL, NULL + NULL, NULL, + (GClassInitFunc) sp_color_slider_class_init, + NULL, NULL, + sizeof (SPColorSlider), + 0, + (GInstanceInitFunc) sp_color_slider_init, + NULL }; - type = gtk_type_unique (GTK_TYPE_WIDGET, &info); + type = g_type_register_static (GTK_TYPE_WIDGET, "SPColorSlider", &info, (GTypeFlags)0); } return type; } diff --git a/src/widgets/sp-color-slider.h b/src/widgets/sp-color-slider.h index b8cfaf869..591d8368a 100644 --- a/src/widgets/sp-color-slider.h +++ b/src/widgets/sp-color-slider.h @@ -53,7 +53,7 @@ struct SPColorSliderClass { void (* changed) (SPColorSlider *slider); }; -GtkType sp_color_slider_get_type (void); +GType sp_color_slider_get_type (void); GtkWidget *sp_color_slider_new (GtkAdjustment *adjustment); diff --git a/src/widgets/sp-widget.cpp b/src/widgets/sp-widget.cpp index d5877db99..141f4afc1 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; } diff --git a/src/widgets/sp-widget.h b/src/widgets/sp-widget.h index decd9c056..66320cd4d 100644 --- a/src/widgets/sp-widget.h +++ b/src/widgets/sp-widget.h @@ -42,7 +42,7 @@ struct SPWidgetClass { void (* set_selection) (SPWidget *spw, Inkscape::Selection *selection); }; -GtkType sp_widget_get_type (void); +GType sp_widget_get_type (void); /* fixme: Think (Lauris) */ /* Generic constructor for global widget */ diff --git a/src/widgets/sp-xmlview-attr-list.h b/src/widgets/sp-xmlview-attr-list.h index de79c7a37..9479dd77a 100644 --- a/src/widgets/sp-xmlview-attr-list.h +++ b/src/widgets/sp-xmlview-attr-list.h @@ -38,7 +38,7 @@ struct SPXMLViewAttrListClass void (* row_changed) (SPXMLViewAttrList *list, gint row); }; -GtkType sp_xmlview_attr_list_get_type (void); +GType sp_xmlview_attr_list_get_type (void); GtkWidget * sp_xmlview_attr_list_new (Inkscape::XML::Node * repr); #define SP_XMLVIEW_ATTR_LIST_GET_REPR(list) (SP_XMLVIEW_ATTR_LIST (list)->repr) diff --git a/src/widgets/sp-xmlview-content.cpp b/src/widgets/sp-xmlview-content.cpp index 75d68d25c..804bc1737 100644 --- a/src/widgets/sp-xmlview-content.cpp +++ b/src/widgets/sp-xmlview-content.cpp @@ -80,7 +80,7 @@ sp_xmlview_content_set_repr (SPXMLViewContent * text, Inkscape::XML::Node * repr GType sp_xmlview_content_get_type(void) { - static GtkType type = 0; + static GType type = 0; if (!type) { GTypeInfo info = { diff --git a/src/widgets/sp-xmlview-content.h b/src/widgets/sp-xmlview-content.h index fe26891d0..941ef0be1 100644 --- a/src/widgets/sp-xmlview-content.h +++ b/src/widgets/sp-xmlview-content.h @@ -41,7 +41,7 @@ struct SPXMLViewContentClass GtkTextViewClass parent_class; }; -GtkType sp_xmlview_content_get_type (void); +GType sp_xmlview_content_get_type (void); GtkWidget * sp_xmlview_content_new (Inkscape::XML::Node * repr); #define SP_XMLVIEW_CONTENT_GET_REPR(text) (SP_XMLVIEW_CONTENT (text)->repr) diff --git a/src/widgets/sp-xmlview-tree.cpp b/src/widgets/sp-xmlview-tree.cpp index b757123b5..e1779b620 100644 --- a/src/widgets/sp-xmlview-tree.cpp +++ b/src/widgets/sp-xmlview-tree.cpp @@ -125,25 +125,23 @@ sp_xmlview_tree_set_repr (SPXMLViewTree * tree, Inkscape::XML::Node * repr) gtk_clist_thaw (GTK_CLIST (tree)); } -GtkType +GType sp_xmlview_tree_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*) "SPXMLViewTree", - sizeof (SPXMLViewTree), + static const GTypeInfo info = { sizeof (SPXMLViewTreeClass), - (GtkClassInitFunc) sp_xmlview_tree_class_init, - (GtkObjectInitFunc) sp_xmlview_tree_init, - NULL, NULL, NULL + NULL, NULL, + (GClassInitFunc) sp_xmlview_tree_class_init, + NULL, NULL, + sizeof (SPXMLViewTree), + 0, + (GInstanceInitFunc) sp_xmlview_tree_init, + NULL }; - type = gtk_type_unique (GTK_TYPE_CTREE, &info); + type = g_type_register_static (GTK_TYPE_CTREE, "SPXMLViewTree", &info, (GTypeFlags)0); } return type; diff --git a/src/widgets/sp-xmlview-tree.h b/src/widgets/sp-xmlview-tree.h index 2b04e79eb..5d228f982 100644 --- a/src/widgets/sp-xmlview-tree.h +++ b/src/widgets/sp-xmlview-tree.h @@ -40,7 +40,7 @@ struct SPXMLViewTreeClass GtkCTreeClass parent_class; }; -GtkType sp_xmlview_tree_get_type (void); +GType sp_xmlview_tree_get_type (void); GtkWidget * sp_xmlview_tree_new (Inkscape::XML::Node * repr, void * factory, void * data); #define SP_XMLVIEW_TREE_REPR(tree) (SP_XMLVIEW_TREE (tree)->repr) |
