From b71b2b5ce57617c404bbbaa9b0226bffd080df5d Mon Sep 17 00:00:00 2001 From: Felipe Corr??a da Silva Sanches Date: Mon, 9 Feb 2009 17:20:32 +0000 Subject: adding comments/TODOs and/or reverting some of the things done in r20655 due to JonCruz considerations about the proper way of doing it. (bzr r7254) --- 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 ++++ 6 files changed, 43 insertions(+), 9 deletions(-) (limited to 'src/widgets') 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) { -- cgit v1.2.3