From: joncruz Date: Tue, 6 May 2008 07:33:22 +0000 (+0000) Subject: Updating deprecated type calls. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e3b6cd4b0523f08a6414dc0800a15a3b1710ce8a;p=inkscape.git Updating deprecated type calls. --- diff --git a/src/dialogs/fill-style.cpp b/src/dialogs/fill-style.cpp index 4935d5e5a..ebf2d4bdd 100644 --- a/src/dialogs/fill-style.cpp +++ b/src/dialogs/fill-style.cpp @@ -283,9 +283,9 @@ sp_fill_style_widget_fillrule_changed ( SPPaintSelector */*psel*/, _("Change fill rule")); } -static gchar *undo_label_1 = "fill:flatcolor:1"; -static gchar *undo_label_2 = "fill:flatcolor:2"; -static gchar *undo_label = undo_label_1; +static gchar const *undo_label_1 = "fill:flatcolor:1"; +static gchar const *undo_label_2 = "fill:flatcolor:2"; +static gchar const *undo_label = undo_label_1; /** This is called repeatedly while you are dragging a color slider, only for flat color diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp index d528f05e2..9cc37a1a0 100644 --- a/src/display/sp-canvas.cpp +++ b/src/display/sp-canvas.cpp @@ -676,25 +676,25 @@ static SPCanvasItemClass *group_parent_class; /** * Registers SPCanvasGroup class with Gtk and returns its type number. */ -GtkType -sp_canvas_group_get_type (void) -{ - static GtkType group_type = 0; - - if (!group_type) { - static GtkTypeInfo const group_info = { - "SPCanvasGroup", - sizeof (SPCanvasGroup), - sizeof (SPCanvasGroupClass), - (GtkClassInitFunc) sp_canvas_group_class_init, - (GtkObjectInitFunc) sp_canvas_group_init, - NULL, NULL, NULL +GType sp_canvas_group_get_type(void) +{ + static GType type = 0; + if (!type) { + GTypeInfo info = { + sizeof(SPCanvasGroupClass), + 0, // base_init + 0, // base_finalize + (GClassInitFunc)sp_canvas_group_class_init, + 0, // class_finalize + 0, // class_data + sizeof(SPCanvasGroup), + 0, // n_preallocs + (GInstanceInitFunc)sp_canvas_group_init, + 0 // value_table }; - - group_type = gtk_type_unique (sp_canvas_item_get_type (), &group_info); + type = g_type_register_static(sp_canvas_item_get_type(), "SPCanvasGroup", &info, static_cast(0)); } - - return group_type; + return type; } /** @@ -932,25 +932,25 @@ static int do_update (SPCanvas *canvas); * * \return The type ID of the SPCanvas class. **/ -GtkType -sp_canvas_get_type (void) -{ - static GtkType canvas_type = 0; - - if (!canvas_type) { - static GtkTypeInfo const canvas_info = { - "SPCanvas", - sizeof (SPCanvas), - sizeof (SPCanvasClass), - (GtkClassInitFunc) sp_canvas_class_init, - (GtkObjectInitFunc) sp_canvas_init, - NULL, NULL, NULL +GType sp_canvas_get_type(void) +{ + static GType type = 0; + if (!type) { + GTypeInfo info = { + sizeof(SPCanvasClass), + 0, // base_init + 0, // base_finalize + (GClassInitFunc)sp_canvas_class_init, + 0, // class_finalize + 0, // class_data + sizeof(SPCanvas), + 0, // n_preallocs + (GInstanceInitFunc)sp_canvas_init, + 0 // value_table }; - - canvas_type = gtk_type_unique (GTK_TYPE_WIDGET, &canvas_info); + type = g_type_register_static(GTK_TYPE_WIDGET, "SPCanvas", &info, static_cast(0)); } - - return canvas_type; + return type; } /** diff --git a/src/helper/unit-menu.cpp b/src/helper/unit-menu.cpp index 34a2b6344..809d8f929 100644 --- a/src/helper/unit-menu.cpp +++ b/src/helper/unit-menu.cpp @@ -58,20 +58,23 @@ static void sp_unit_selector_finalize(GObject *object); static GtkHBoxClass *unit_selector_parent_class; static guint signals[LAST_SIGNAL] = {0}; -GtkType -sp_unit_selector_get_type(void) +GType sp_unit_selector_get_type(void) { - static GtkType type = 0; + static GType type = 0; if (!type) { - static GtkTypeInfo const info = { - "SPUnitSelector", - sizeof(SPUnitSelector), + GTypeInfo info = { sizeof(SPUnitSelectorClass), - (GtkClassInitFunc) sp_unit_selector_class_init, - (GtkObjectInitFunc) sp_unit_selector_init, - NULL, NULL, NULL + 0, // base_init + 0, // base_finalize + (GClassInitFunc)sp_unit_selector_class_init, + 0, // class_finalize + 0, // class_data + sizeof(SPUnitSelector), + 0, // n_preallocs + (GInstanceInitFunc)sp_unit_selector_init, + 0 // value_table }; - type = gtk_type_unique(GTK_TYPE_HBOX, &info); + type = g_type_register_static(GTK_TYPE_HBOX, "SPUnitSelector", &info, static_cast(0)); } return type; } diff --git a/src/trace/potrace/inkscape-potrace.cpp b/src/trace/potrace/inkscape-potrace.cpp index 9a305cc7c..296d88c63 100644 --- a/src/trace/potrace/inkscape-potrace.cpp +++ b/src/trace/potrace/inkscape-potrace.cpp @@ -434,7 +434,7 @@ PotraceTracingEngine::traceSingle(GdkPixbuf * thePixbuf) grayMap->destroy(grayMap); - char *style = "fill:#000000"; + char const *style = "fill:#000000"; //g_message("### GOT '%s' \n", d); TracingEngineResult result(style, d, nodeCount); @@ -459,7 +459,7 @@ PotraceTracingEngine::traceGrayMap(GrayMap *grayMap) long nodeCount; std::string d = grayMapToPath(grayMap, &nodeCount); - char *style = "fill:#000000"; + char const *style = "fill:#000000"; //g_message("### GOT '%s' \n", d); TracingEngineResult result(style, d, nodeCount); diff --git a/src/widgets/button.cpp b/src/widgets/button.cpp index 95d5859e8..6769fa389 100644 --- a/src/widgets/button.cpp +++ b/src/widgets/button.cpp @@ -56,22 +56,25 @@ SPActionEventVector button_event_vector = { NULL }; -GtkType -sp_button_get_type (void) +GType sp_button_get_type(void) { - static GtkType type = 0; - if (!type) { - GtkTypeInfo info = { - "SPButton", - sizeof (SPButton), - sizeof (SPButtonClass), - (GtkClassInitFunc) sp_button_class_init, - (GtkObjectInitFunc) sp_button_init, - NULL, NULL, NULL - }; - type = gtk_type_unique (GTK_TYPE_TOGGLE_BUTTON, &info); - } - return type; + static GType type = 0; + if (!type) { + GTypeInfo info = { + sizeof(SPButtonClass), + 0, // base_init + 0, // base_finalize + (GClassInitFunc)sp_button_class_init, + 0, // class_finalize + 0, // class_data + sizeof(SPButton), + 0, // n_preallocs + (GInstanceInitFunc)sp_button_init, + 0 // value_table + }; + type = g_type_register_static(GTK_TYPE_TOGGLE_BUTTON, "SPButton", &info, static_cast(0)); + } + return type; } static void diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 997b9c86f..df35f07f7 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -243,20 +243,23 @@ SPDesktopWidget::window_get_pointer() /** * Registers SPDesktopWidget class and returns its type number. */ -GtkType -sp_desktop_widget_get_type (void) +GType sp_desktop_widget_get_type(void) { static GtkType type = 0; if (!type) { - static const GtkTypeInfo info = { - "SPDesktopWidget", - sizeof (SPDesktopWidget), - sizeof (SPDesktopWidgetClass), - (GtkClassInitFunc) sp_desktop_widget_class_init, - (GtkObjectInitFunc) sp_desktop_widget_init, - NULL, NULL, NULL + GTypeInfo info = { + sizeof(SPDesktopWidgetClass), + 0, // base_init + 0, // base_finalize + (GClassInitFunc)sp_desktop_widget_class_init, + 0, // class_finalize + 0, // class_data + sizeof(SPDesktopWidget), + 0, // n_preallocs + (GInstanceInitFunc)sp_desktop_widget_init, + 0 // value_table }; - type = gtk_type_unique (SP_TYPE_VIEW_WIDGET, &info); + type = g_type_register_static(SP_TYPE_VIEW_WIDGET, "SPDesktopWidget", &info, static_cast(0)); } return type; } diff --git a/src/widgets/font-selector.cpp b/src/widgets/font-selector.cpp index c6d23eee2..d6326791b 100644 --- a/src/widgets/font-selector.cpp +++ b/src/widgets/font-selector.cpp @@ -107,19 +107,23 @@ namespace { static GtkHBoxClass *fs_parent_class = NULL; static guint fs_signals[LAST_SIGNAL] = { 0 }; -GtkType sp_font_selector_get_type() +GType sp_font_selector_get_type() { - static GtkType type = 0; + static GType type = 0; if (!type) { - static const GtkTypeInfo info = { - "SPFontSelector", - sizeof(SPFontSelector), + GTypeInfo info = { sizeof(SPFontSelectorClass), - (GtkClassInitFunc) sp_font_selector_class_init, - (GtkObjectInitFunc) sp_font_selector_init, - NULL, NULL, NULL + 0, // base_init + 0, // base_finalize + (GClassInitFunc)sp_font_selector_class_init, + 0, // class_finalize + 0, // class_data + sizeof(SPFontSelector), + 0, // n_preallocs + (GInstanceInitFunc)sp_font_selector_init, + 0 // value_table }; - type = gtk_type_unique(GTK_TYPE_HBOX, &info); + type = g_type_register_static(GTK_TYPE_HBOX, "SPFontSelector", &info, static_cast(0)); } return type; } @@ -538,19 +542,23 @@ static gint sp_font_preview_expose(GtkWidget *widget, GdkEventExpose *event); static GtkDrawingAreaClass *fp_parent_class = NULL; -GtkType sp_font_preview_get_type() +GType sp_font_preview_get_type() { - static GtkType type = 0; + static GType type = 0; if (!type) { - static const GtkTypeInfo info = { - "SPFontPreview", - sizeof (SPFontPreview), - sizeof (SPFontPreviewClass), - (GtkClassInitFunc) sp_font_preview_class_init, - (GtkObjectInitFunc) sp_font_preview_init, - NULL, NULL, NULL + GTypeInfo info = { + sizeof(SPFontPreviewClass), + 0, // base_init + 0, // base_finalize + (GClassInitFunc)sp_font_preview_class_init, + 0, // class_finalize + 0, // class_data + sizeof(SPFontPreview), + 0, // n_preallocs + (GInstanceInitFunc)sp_font_preview_init, + 0 // value_table }; - type = gtk_type_unique (GTK_TYPE_DRAWING_AREA, &info); + type = g_type_register_static(GTK_TYPE_DRAWING_AREA, "SPFontPreview", &info, static_cast(0)); } return type; } diff --git a/src/widgets/paint-selector.cpp b/src/widgets/paint-selector.cpp index c66fbd3c7..a55b7bbc0 100644 --- a/src/widgets/paint-selector.cpp +++ b/src/widgets/paint-selector.cpp @@ -88,20 +88,23 @@ static void sp_paint_selector_set_style_buttons(SPPaintSelector *psel, GtkWidget static GtkVBoxClass *parent_class; static guint psel_signals[LAST_SIGNAL] = {0}; -GtkType -sp_paint_selector_get_type(void) +GType sp_paint_selector_get_type(void) { static GtkType type = 0; if (!type) { - GtkTypeInfo info = { - "SPPaintSelector", - sizeof(SPPaintSelector), + GTypeInfo info = { sizeof(SPPaintSelectorClass), - (GtkClassInitFunc) sp_paint_selector_class_init, - (GtkObjectInitFunc) sp_paint_selector_init, - NULL, NULL, NULL + 0, // base_init + 0, // base_finalize + (GClassInitFunc)sp_paint_selector_class_init, + 0, // class_finalize + 0, // class_data + sizeof(SPPaintSelector), + 0, // n_preallocs + (GInstanceInitFunc)sp_paint_selector_init, + 0 // value_table }; - type = gtk_type_unique(GTK_TYPE_VBOX, &info); + type = g_type_register_static(GTK_TYPE_VBOX, "SPPaintSelector", &info, static_cast(0)); } return type; } diff --git a/src/widgets/sp-xmlview-attr-list.cpp b/src/widgets/sp-xmlview-attr-list.cpp index 923420740..008ad4970 100644 --- a/src/widgets/sp-xmlview-attr-list.cpp +++ b/src/widgets/sp-xmlview-attr-list.cpp @@ -77,24 +77,27 @@ sp_xmlview_attr_list_set_repr (SPXMLViewAttrList * list, Inkscape::XML::Node * r gtk_clist_thaw (GTK_CLIST (list)); } -GtkType -sp_xmlview_attr_list_get_type (void) +GType sp_xmlview_attr_list_get_type(void) { - static GtkType type = 0; - - if (!type) { - static const GtkTypeInfo info = { - "SPXMLViewAttrList", - sizeof (SPXMLViewAttrList), - sizeof (SPXMLViewAttrListClass), - (GtkClassInitFunc) sp_xmlview_attr_list_class_init, - (GtkObjectInitFunc) sp_xmlview_attr_list_init, - NULL, NULL, NULL - }; - type = gtk_type_unique (GTK_TYPE_CLIST, &info); - } - - return type; + static GType type = 0; + + if (!type) { + GTypeInfo info = { + sizeof(SPXMLViewAttrListClass), + 0, // base_init + 0, // base_finalize + (GClassInitFunc)sp_xmlview_attr_list_class_init, + 0, // class_finalize + 0, // class_data + sizeof(SPXMLViewAttrList), + 0, // n_preallocs + (GInstanceInitFunc)sp_xmlview_attr_list_init, + 0 // value_table + }; + type = g_type_register_static(GTK_TYPE_CLIST, "SPXMLViewAttrList", &info, static_cast(0)); + } + + return type; } void diff --git a/src/widgets/sp-xmlview-content.cpp b/src/widgets/sp-xmlview-content.cpp index 393c136c7..7150b07fd 100644 --- a/src/widgets/sp-xmlview-content.cpp +++ b/src/widgets/sp-xmlview-content.cpp @@ -77,21 +77,24 @@ sp_xmlview_content_set_repr (SPXMLViewContent * text, Inkscape::XML::Node * repr } } -GtkType -sp_xmlview_content_get_type (void) +GType sp_xmlview_content_get_type(void) { static GtkType type = 0; if (!type) { - static const GtkTypeInfo info = { - "SPXMLViewContent", - sizeof (SPXMLViewContent), - sizeof (SPXMLViewContentClass), - (GtkClassInitFunc) sp_xmlview_content_class_init, - (GtkObjectInitFunc) sp_xmlview_content_init, - NULL, NULL, NULL + GTypeInfo info = { + sizeof(SPXMLViewContentClass), + 0, // base_init + 0, // base_finalize + (GClassInitFunc)sp_xmlview_content_class_init, + 0, // class_finalize + 0, // class_data + sizeof(SPXMLViewContent), + 0, // n_preallocs + (GInstanceInitFunc)sp_xmlview_content_init, + 0 // value_table }; - type = gtk_type_unique (GTK_TYPE_TEXT_VIEW, &info); + type = g_type_register_static(GTK_TYPE_TEXT_VIEW, "SPXMLViewContent", &info, static_cast(0)); } return type;