Code

Updating deprecated type calls.
authorjoncruz <joncruz@users.sourceforge.net>
Tue, 6 May 2008 07:33:22 +0000 (07:33 +0000)
committerjoncruz <joncruz@users.sourceforge.net>
Tue, 6 May 2008 07:33:22 +0000 (07:33 +0000)
src/dialogs/fill-style.cpp
src/display/sp-canvas.cpp
src/helper/unit-menu.cpp
src/trace/potrace/inkscape-potrace.cpp
src/widgets/button.cpp
src/widgets/desktop-widget.cpp
src/widgets/font-selector.cpp
src/widgets/paint-selector.cpp
src/widgets/sp-xmlview-attr-list.cpp
src/widgets/sp-xmlview-content.cpp

index 4935d5e5a0e8e28db4461c7f784858bb21c35f4a..ebf2d4bdd94a52b3fe8fe3b5229366ae2965cfaa 100644 (file)
@@ -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
index d528f05e299aca7943b531c69df9bf6ef643032f..9cc37a1a0c5b6b1c5a885b3a33d737a1b828164b 100644 (file)
@@ -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<GTypeFlags>(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<GTypeFlags>(0));
     }
-
-    return canvas_type;
+    return type;
 }
 
 /**
index 34a2b63443f15e93e6f3987f5bd0687aa0bbd23b..809d8f92942ddbad61d06e91c3527f14023b290d 100644 (file)
@@ -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<GTypeFlags>(0));
     }
     return type;
 }
index 9a305cc7c45f7cbd761c3cb8533b0ddf7279e61e..296d88c63b2b15838f120392fe08fa5512aeb8b4 100644 (file)
@@ -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);
index 95d5859e83b93aef9b2aff596d258ae090638006..6769fa389d9f1889e29f24e925053f0adb3d8f0f 100644 (file)
@@ -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<GTypeFlags>(0));
+    }
+    return type;
 }
 
 static void
index 997b9c86f38c804488f7073a1a01fbc966ae7e85..df35f07f7eb7ff382f9da29d23c3a6a8a5bfb47f 100644 (file)
@@ -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<GTypeFlags>(0));
     }
     return type;
 }
index c6d23eee2e264bea83ef66f1a4ad33f9fdd10ee4..d6326791b822ba6eec02fdfb4adc108fc3d2fb0c 100644 (file)
@@ -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<GTypeFlags>(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<GTypeFlags>(0));
     }
     return type;
 }
index c66fbd3c7e28ca9fceeb828f4dfd63027cb29950..a55b7bbc0b86bc10058d5296101df4f43da50144 100644 (file)
@@ -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<GTypeFlags>(0));
     }
     return type;
 }
index 923420740338e82693b72254d64c1672653c4959..008ad4970e72e56333c375f3a54f812396c86275 100644 (file)
@@ -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<GTypeFlags>(0));
+    }
+
+    return type;
 }
 
 void
index 393c136c7022260a14f946b41b0166b8551f489e..7150b07fd4b6fa244120073c52d0d04f27aa117e 100644 (file)
@@ -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<GTypeFlags>(0));
     }
 
     return type;