From c830d132ea7f29e73b55f87badff602b065f8eac Mon Sep 17 00:00:00 2001 From: JucaBlues Date: Mon, 9 Feb 2009 17:20:32 +0000 Subject: [PATCH] adding comments/TODOs and/or reverting some of the things done in r20655 due to JonCruz considerations about the proper way of doing it. --- src/dialogs/swatches.cpp | 26 +++++++++++++------ src/extension/internal/filter/filter.cpp | 4 +-- src/ui/view/view-widget.cpp | 4 ++- src/ui/widget/selected-style.cpp | 8 +++++- src/widgets/gradient-image.cpp | 4 +++ src/widgets/icon.cpp | 4 +++ src/widgets/ruler.cpp | 32 +++++++++++++++++------- src/widgets/sp-color-slider.cpp | 4 +++ src/widgets/sp-widget.cpp | 4 +++ src/widgets/sp-xmlview-tree.cpp | 4 +++ 10 files changed, 74 insertions(+), 20 deletions(-) diff --git a/src/dialogs/swatches.cpp b/src/dialogs/swatches.cpp index 4b2976a62..7ab5c099b 100644 --- a/src/dialogs/swatches.cpp +++ b/src/dialogs/swatches.cpp @@ -100,13 +100,19 @@ typedef enum { TEXT_DATA } colorFlavorType; +//TODO: warning: deprecated conversion from string constant to ‘gchar*’ +// +//Turn out to be warnings that we should probably leave in place. The +// pointers/types used need to be read-only. So until we correct the using +// code, those warnings are actually desired. They say "Hey! Fix this". We +// definitely don't want to hide/ignore them. --JonCruz static const GtkTargetEntry sourceColorEntries[] = { #if ENABLE_MAGIC_COLORS -// {(gchar*) "application/x-inkscape-color-id", GTK_TARGET_SAME_APP, APP_X_INKY_COLOR_ID}, - {(gchar*) "application/x-inkscape-color", 0, APP_X_INKY_COLOR}, +// {"application/x-inkscape-color-id", GTK_TARGET_SAME_APP, APP_X_INKY_COLOR_ID}, + {"application/x-inkscape-color", 0, APP_X_INKY_COLOR}, #endif // ENABLE_MAGIC_COLORS - {(gchar*) "application/x-color", 0, APP_X_COLOR}, - {(gchar*) "text/plain", 0, TEXT_DATA}, + {"application/x-color", 0, APP_X_COLOR}, + {"text/plain", 0, TEXT_DATA}, }; void ColorItem::_dragGetColorData( GtkWidget *widget, @@ -347,12 +353,18 @@ static void dieDieDie( GtkObject *obj, gpointer user_data ) g_message("die die die %p %p", obj, user_data ); } +//TODO: warning: deprecated conversion from string constant to ‘gchar*’ +// +//Turn out to be warnings that we should probably leave in place. The +// pointers/types used need to be read-only. So until we correct the using +// code, those warnings are actually desired. They say "Hey! Fix this". We +// definitely don't want to hide/ignore them. --JonCruz static const GtkTargetEntry destColorTargets[] = { #if ENABLE_MAGIC_COLORS -// {(gchar*) "application/x-inkscape-color-id", GTK_TARGET_SAME_APP, APP_X_INKY_COLOR_ID}, - {(gchar*) "application/x-inkscape-color", 0, APP_X_INKY_COLOR}, +// {"application/x-inkscape-color-id", GTK_TARGET_SAME_APP, APP_X_INKY_COLOR_ID}, + {"application/x-inkscape-color", 0, APP_X_INKY_COLOR}, #endif // ENABLE_MAGIC_COLORS - {(gchar*) "application/x-color", 0, APP_X_COLOR}, + {"application/x-color", 0, APP_X_COLOR}, }; #include "color.h" // for SP_RGBA32_U_COMPOSE diff --git a/src/extension/internal/filter/filter.cpp b/src/extension/internal/filter/filter.cpp index 3dd6d31bd..048207332 100644 --- a/src/extension/internal/filter/filter.cpp +++ b/src/extension/internal/filter/filter.cpp @@ -111,8 +111,8 @@ Filter::merge_filters (Inkscape::XML::Node * to, Inkscape::XML::Node * from, Ink } } -#define FILTER_SRC_GRAPHIC (gchar*) "fbSourceGraphic" -#define FILTER_SRC_GRAPHIC_ALPHA (gchar*) "fbSourceGraphicAlpha" +#define FILTER_SRC_GRAPHIC "fbSourceGraphic" +#define FILTER_SRC_GRAPHIC_ALPHA "fbSourceGraphicAlpha" void Filter::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View *document, Inkscape::Extension::Implementation::ImplementationDocumentCache * docCache) diff --git a/src/ui/view/view-widget.cpp b/src/ui/view/view-widget.cpp index d1f9d677c..cf0f55f2c 100644 --- a/src/ui/view/view-widget.cpp +++ b/src/ui/view/view-widget.cpp @@ -30,7 +30,9 @@ static GtkEventBoxClass *widget_parent_class; GtkType 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 if (!type) { GtkTypeInfo info = { (gchar*) "SPViewWidget", diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index 90ef79b92..9a5364874 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -86,8 +86,14 @@ typedef enum { APP_X_COLOR } ui_drop_target_info; +//TODO: warning: deprecated conversion from string constant to ‘gchar*’ +// +//Turn out to be warnings that we should probably leave in place. The +// pointers/types used need to be read-only. So until we correct the using +// code, those warnings are actually desired. They say "Hey! Fix this". We +// definitely don't want to hide/ignore them. --JonCruz static GtkTargetEntry ui_drop_target_entries [] = { - {(gchar*) "application/x-color", 0, APP_X_COLOR} + {"application/x-color", 0, APP_X_COLOR} }; #define ENTRIES_SIZE(n) sizeof(n)/sizeof(n[0]) diff --git a/src/widgets/gradient-image.cpp b/src/widgets/gradient-image.cpp index d13e8fd12..11d2d528a 100644 --- a/src/widgets/gradient-image.cpp +++ b/src/widgets/gradient-image.cpp @@ -44,6 +44,10 @@ static GtkWidgetClass *parent_class; GtkType 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; if (!type) { GtkTypeInfo info = { diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp index dccd0916e..35ab1842d 100644 --- a/src/widgets/icon.cpp +++ b/src/widgets/icon.cpp @@ -99,6 +99,10 @@ static std::map > iconSetCache; GtkType sp_icon_get_type() { + //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; if (!type) { GtkTypeInfo info = { diff --git a/src/widgets/ruler.cpp b/src/widgets/ruler.cpp index d4ff91f3c..7e347acad 100644 --- a/src/widgets/ruler.cpp +++ b/src/widgets/ruler.cpp @@ -41,6 +41,10 @@ static GtkWidgetClass *hruler_parent_class; GtkType 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; if (!hruler_type) @@ -378,6 +382,10 @@ static GtkWidgetClass *vruler_parent_class; GtkType 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; if (!vruler_type) @@ -703,19 +711,25 @@ sp_vruler_size_allocate (GtkWidget *widget, GtkAllocation *allocation) } while (parent != NULL); } +//TODO: warning: deprecated conversion from string constant to ‘gchar*’ +// +//Turn out to be warnings that we should probably leave in place. The +// pointers/types used need to be read-only. So until we correct the using +// code, those warnings are actually desired. They say "Hey! Fix this". We +// definitely don't want to hide/ignore them. --JonCruz /// Ruler metrics. static GtkRulerMetric const sp_ruler_metrics[] = { // NOTE: the order of records in this struct must correspond to the SPMetric enum. - {(gchar*) "NONE", (gchar*) "", 1, { 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000 }, { 1, 5, 10, 50, 100 }}, - {(gchar*) "millimeters", (gchar*) "mm", PX_PER_MM, { 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000 }, { 1, 5, 10, 50, 100 }}, - {(gchar*) "centimeters", (gchar*) "cm", PX_PER_CM, { 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000 }, { 1, 5, 10, 50, 100 }}, - {(gchar*) "inches", (gchar*) "in", PX_PER_IN, { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512 }, { 1, 2, 4, 8, 16 }}, - {(gchar*) "feet", (gchar*) "ft", PX_PER_FT, { 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000 }, { 1, 5, 10, 50, 100 }}, - {(gchar*) "points", (gchar*) "pt", PX_PER_PT, { 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000 }, { 1, 5, 10, 50, 100 }}, - {(gchar*) "picas", (gchar*) "pc", PX_PER_PC, { 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000 }, { 1, 5, 10, 50, 100 }}, - {(gchar*) "pixels", (gchar*) "px", PX_PER_PX, { 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000 }, { 1, 5, 10, 50, 100 }}, - {(gchar*) "meters", (gchar*) "m", PX_PER_M, { 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000 }, { 1, 5, 10, 50, 100 }}, + {"NONE", "", 1, { 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000 }, { 1, 5, 10, 50, 100 }}, + {"millimeters", "mm", PX_PER_MM, { 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000 }, { 1, 5, 10, 50, 100 }}, + {"centimeters", "cm", PX_PER_CM, { 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000 }, { 1, 5, 10, 50, 100 }}, + {"inches", "in", PX_PER_IN, { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512 }, { 1, 2, 4, 8, 16 }}, + {"feet", "ft", PX_PER_FT, { 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000 }, { 1, 5, 10, 50, 100 }}, + {"points", "pt", PX_PER_PT, { 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000 }, { 1, 5, 10, 50, 100 }}, + {"picas", "pc", PX_PER_PC, { 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000 }, { 1, 5, 10, 50, 100 }}, + {"pixels", "px", PX_PER_PX, { 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000 }, { 1, 5, 10, 50, 100 }}, + {"meters", "m", PX_PER_M, { 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000 }, { 1, 5, 10, 50, 100 }}, }; void diff --git a/src/widgets/sp-color-slider.cpp b/src/widgets/sp-color-slider.cpp index 14a7fb5b2..b8eb899cc 100644 --- a/src/widgets/sp-color-slider.cpp +++ b/src/widgets/sp-color-slider.cpp @@ -59,6 +59,10 @@ static guint slider_signals[LAST_SIGNAL] = {0}; GtkType 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; if (!type) { GtkTypeInfo info = { diff --git a/src/widgets/sp-widget.cpp b/src/widgets/sp-widget.cpp index afa707904..f694c461c 100644 --- a/src/widgets/sp-widget.cpp +++ b/src/widgets/sp-widget.cpp @@ -46,6 +46,10 @@ static guint signals[LAST_SIGNAL] = {0}; GtkType 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; if (!type) { static const GtkTypeInfo info = { diff --git a/src/widgets/sp-xmlview-tree.cpp b/src/widgets/sp-xmlview-tree.cpp index d9d208857..698ee81ee 100644 --- a/src/widgets/sp-xmlview-tree.cpp +++ b/src/widgets/sp-xmlview-tree.cpp @@ -128,6 +128,10 @@ sp_xmlview_tree_set_repr (SPXMLViewTree * tree, Inkscape::XML::Node * repr) GtkType 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; if (!type) { -- 2.30.2