[gtk+] Deprecate GdkColor
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Deprecate GdkColor
- Date: Thu, 22 May 2014 13:10:56 +0000 (UTC)
commit 49cf5142ba9e9542e3e848f0fc55c4fd2eaa9f7f
Author: Matthias Clasen <mclasen redhat com>
Date: Thu May 22 09:05:58 2014 -0400
Deprecate GdkColor
It has been replaced by GdkRGBA. Time to make it official.
http://bugzilla.gnome.org/show_bug.cgi?id=636695
demos/gtk-demo/iconview_edit.c | 16 ++++++++++------
gdk/Makefile.am | 27 ++++++++++++++++++++-------
gdk/{ => deprecated}/gdkcolor.c | 17 ++++++++++++++++-
gdk/{ => deprecated}/gdkcolor.h | 14 +++++++-------
gdk/gdk.h | 5 ++++-
gdk/gdkcairo.h | 2 +-
gdk/gdkevents.h | 1 -
gtk/gtkbuilder.c | 6 ++++--
gtk/gtkcellrenderer.c | 2 ++
gtk/gtkcellrenderertext.c | 4 ++++
gtk/gtkcellview.c | 2 ++
gtk/gtkcolorbutton.c | 2 ++
gtk/gtkcsscustomproperty.c | 4 +++-
gtk/gtkcssstylefuncs.c | 7 +++++--
gtk/gtkiconview.c | 2 +-
gtk/gtklabel.c | 6 +++++-
gtk/gtkmodifierstyle.c | 4 ++++
gtk/gtksettings.c | 8 +++-----
gtk/gtkstylecontext.c | 2 ++
gtk/gtktextattributes.c | 10 ++++++++++
gtk/gtktextbufferserialize.c | 4 ++++
gtk/gtktextdisplay.c | 2 ++
gtk/gtktextlayout.c | 4 ++++
gtk/gtktexttag.c | 10 +++++++---
gtk/gtktextview.c | 2 ++
gtk/gtktreeview.c | 3 ++-
gtk/gtkwidget.c | 8 ++++++--
gtk/inspector/prop-editor.c | 4 +++-
28 files changed, 135 insertions(+), 43 deletions(-)
---
diff --git a/demos/gtk-demo/iconview_edit.c b/demos/gtk-demo/iconview_edit.c
index 0487e52..25bc80f 100644
--- a/demos/gtk-demo/iconview_edit.c
+++ b/demos/gtk-demo/iconview_edit.c
@@ -52,20 +52,24 @@ set_cell_color (GtkCellLayout *cell_layout,
gpointer data)
{
gchar *text;
- GdkColor color;
+ GdkRGBA color;
guint32 pixel = 0;
GdkPixbuf *pixbuf;
gtk_tree_model_get (tree_model, iter, COL_TEXT, &text, -1);
- if (gdk_color_parse (text, &color))
+ if (!text)
+ return;
+
+ if (gdk_rgba_parse (&color, text))
pixel =
- (color.red >> 8) << 24 |
- (color.green >> 8) << 16 |
- (color.blue >> 8) << 8;
+ ((gint)(color.red * 255)) << 24 |
+ ((gint)(color.green * 255)) << 16 |
+ ((gint)(color.blue * 255)) << 8 |
+ ((gint)(color.alpha * 255));
g_free (text);
- pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, 24, 24);
+ pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, 24, 24);
gdk_pixbuf_fill (pixbuf, pixel);
g_object_set (cell, "pixbuf", pixbuf, NULL);
diff --git a/gdk/Makefile.am b/gdk/Makefile.am
index ed4540c..c9fd11d 100644
--- a/gdk/Makefile.am
+++ b/gdk/Makefile.am
@@ -62,11 +62,11 @@ LDADD = \
#
# GDK header files for public installation (non-generated)
#
+#
gdk_public_h_sources = \
gdk.h \
gdkapplaunchcontext.h \
gdkcairo.h \
- gdkcolor.h \
gdkcursor.h \
gdkdevice.h \
gdkdevicemanager.h \
@@ -94,6 +94,13 @@ gdk_public_h_sources = \
gdkvisual.h \
gdkwindow.h
+deprecated_h_sources = \
+ deprecated/gdkcolor.h
+
+gdk_h_sources = \
+ $(gdk_public_h_sources) \
+ $(deprecated_h_sources)
+
gdk_private_headers = \
gdkapplaunchcontextprivate.h \
gdkcursorprivate.h \
@@ -111,11 +118,14 @@ gdk_private_headers = \
gdkvisualprivate.h \
gdkx.h
+deprecated_c_sources = \
+ deprecated/gdkcolor.c
+
gdk_c_sources = \
+ $(deprecated_c_sources) \
gdk.c \
gdkapplaunchcontext.c \
gdkcairo.c \
- gdkcolor.c \
gdkcursor.c \
gdkdeprecated.c \
gdkdevice.c \
@@ -157,6 +167,9 @@ gdkincludedir = $(includedir)/gtk-3.0/gdk
gdkinclude_HEADERS = $(gdk_public_h_sources) gdkenumtypes.h gdkversionmacros.h
nodist_gdkinclude_HEADERS = gdkconfig.h
+deprecatedincludedir = $(includedir)/gtk-3.0/gdk/deprecated
+deprecatedinclude_HEADERS = $(deprecated_h_sources)
+
common_sources = \
$(gdk_private_headers) \
$(gdk_c_sources) \
@@ -196,7 +209,7 @@ endif
if HAVE_INTROSPECTION
introspection_files = \
- $(filter-out gdkkeysyms-compat.h, $(gdk_public_h_sources)) \
+ $(filter-out gdkkeysyms-compat.h, $(gdk_h_sources)) \
$(gdk_c_sources) \
gdkenumtypes.c \
gdkenumtypes.h
@@ -378,15 +391,15 @@ BUILT_SOURCES = \
gdkenumtypes.h: stamp-gdkenumtypes.h
@true
-stamp-gdkenumtypes.h: $(gdk_public_h_sources) gdkenumtypes.h.template
+stamp-gdkenumtypes.h: $(gdk_h_sources) gdkenumtypes.h.template
$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.h.template \
- $(gdk_public_h_sources) ) >> xgen-geth \
+ $(gdk_h_sources) ) >> xgen-geth \
&& (cmp -s xgen-geth gdkenumtypes.h || cp xgen-geth gdkenumtypes.h ) \
&& rm -f xgen-geth \
&& echo timestamp > $(@F)
-gdkenumtypes.c: $(gdk_public_h_sources) gdkenumtypes.c.template
+gdkenumtypes.c: $(gdk_h_sources) gdkenumtypes.c.template
$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.c.template \
- $(gdk_public_h_sources) ) > xgen-getc \
+ $(gdk_h_sources) ) > xgen-getc \
&& cp xgen-getc gdkenumtypes.c \
&& rm -f xgen-getc
diff --git a/gdk/gdkcolor.c b/gdk/deprecated/gdkcolor.c
similarity index 93%
rename from gdk/gdkcolor.c
rename to gdk/deprecated/gdkcolor.c
index 43d0d91..fb45a87 100644
--- a/gdk/gdkcolor.c
+++ b/gdk/deprecated/gdkcolor.c
@@ -31,6 +31,8 @@
#include <time.h>
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
/**
* SECTION:colors
* @Short_description: Manipulation of colors
@@ -39,7 +41,8 @@
* A #GdkColor represents a color.
*
* When working with cairo, it is often more convenient
- * to use a #GdkRGBA instead.
+ * to use a #GdkRGBA instead, and #GdkColor has been
+ * deprecated in favor of #GdkRGBA.
*/
@@ -52,6 +55,8 @@
* The result must be freed using gdk_color_free().
*
* Returns: a copy of @color
+ *
+ * Deprecated: 3.14: Use #GdkRGBA
*/
GdkColor*
gdk_color_copy (const GdkColor *color)
@@ -70,6 +75,8 @@ gdk_color_copy (const GdkColor *color)
* @color: a #GdkColor
*
* Frees a #GdkColor created with gdk_color_copy().
+ *
+ * Deprecated: 3.14: Use #GdkRGBA
*/
void
gdk_color_free (GdkColor *color)
@@ -87,6 +94,8 @@ gdk_color_free (GdkColor *color)
* table that stores #GdkColors.
*
* Returns: The hash function applied to @color
+ *
+ * Deprecated: 3.14: Use #GdkRGBA
*/
guint
gdk_color_hash (const GdkColor *color)
@@ -105,6 +114,8 @@ gdk_color_hash (const GdkColor *color)
* Compares two colors.
*
* Returns: %TRUE if the two colors compare equal
+ *
+ * Deprecated: 3.14: Use #GdkRGBA
*/
gboolean
gdk_color_equal (const GdkColor *colora,
@@ -139,6 +150,8 @@ G_DEFINE_BOXED_TYPE (GdkColor, gdk_color,
* and “\#ffffffffffff”).
*
* Returns: %TRUE if the parsing succeeded
+ *
+ * Deprecated: 3.14: Use #GdkRGBA
*/
gboolean
gdk_color_parse (const gchar *spec,
@@ -171,6 +184,8 @@ gdk_color_parse (const gchar *spec,
* Returns: a newly-allocated text string
*
* Since: 2.12
+ *
+ * Deprecated: 3.14: Use #GdkRGBA
*/
gchar *
gdk_color_to_string (const GdkColor *color)
diff --git a/gdk/gdkcolor.h b/gdk/deprecated/gdkcolor.h
similarity index 93%
rename from gdk/gdkcolor.h
rename to gdk/deprecated/gdkcolor.h
index 2744b24..0be61c4 100644
--- a/gdk/gdkcolor.h
+++ b/gdk/deprecated/gdkcolor.h
@@ -59,24 +59,24 @@ struct _GdkColor
#define GDK_TYPE_COLOR (gdk_color_get_type ())
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_14
GType gdk_color_get_type (void) G_GNUC_CONST;
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_14
GdkColor *gdk_color_copy (const GdkColor *color);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_14
void gdk_color_free (GdkColor *color);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_14
guint gdk_color_hash (const GdkColor *color);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_14
gboolean gdk_color_equal (const GdkColor *colora,
const GdkColor *colorb);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_14
gboolean gdk_color_parse (const gchar *spec,
GdkColor *color);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_14
gchar * gdk_color_to_string (const GdkColor *color);
diff --git a/gdk/gdk.h b/gdk/gdk.h
index 36d5c3b..5761fa1 100644
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -31,7 +31,6 @@
#include <gdk/gdkversionmacros.h>
#include <gdk/gdkapplaunchcontext.h>
#include <gdk/gdkcairo.h>
-#include <gdk/gdkcolor.h>
#include <gdk/gdkcursor.h>
#include <gdk/gdkdevice.h>
#include <gdk/gdkdevicemanager.h>
@@ -58,6 +57,10 @@
#include <gdk/gdkvisual.h>
#include <gdk/gdkwindow.h>
+#ifndef GDK_DISABLE_DEPRECATED
+#include <gdk/deprecated/gdkcolor.h>
+#endif
+
#undef __GDK_H_INSIDE__
#endif /* __GDK_H__ */
diff --git a/gdk/gdkcairo.h b/gdk/gdkcairo.h
index a311d8e..bc9ee97 100644
--- a/gdk/gdkcairo.h
+++ b/gdk/gdkcairo.h
@@ -23,7 +23,7 @@
#endif
#include <gdk/gdkversionmacros.h>
-#include <gdk/gdkcolor.h>
+#include <gdk/deprecated/gdkcolor.h>
#include <gdk/gdkrgba.h>
#include <gdk/gdkpixbuf.h>
#include <pango/pangocairo.h>
diff --git a/gdk/gdkevents.h b/gdk/gdkevents.h
index 2af1419..71316b4 100644
--- a/gdk/gdkevents.h
+++ b/gdk/gdkevents.h
@@ -30,7 +30,6 @@
#endif
#include <gdk/gdkversionmacros.h>
-#include <gdk/gdkcolor.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkdnd.h>
#include <gdk/gdkdevice.h>
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c
index 165e9e5..f6e5c52 100644
--- a/gtk/gtkbuilder.c
+++ b/gtk/gtkbuilder.c
@@ -122,7 +122,7 @@
* as %FALSE), enumerations (can be specified by their name, nick or
* integer value), flags (can be specified by their name, nick, integer
* value, optionally combined with “|”, e.g. “GTK_VISIBLE|GTK_REALIZED”)
- * and colors (in a format understood by gdk_color_parse()). Pixbufs can
+ * and colors (in a format understood by gdk_rgba_parse()). Pixbufs can
* be specified as a filename of an image file to load. Objects can be
* referred to by their name and by default refer to objects declared
* in the local xml fragment and objects exposed via
@@ -1977,10 +1977,11 @@ gtk_builder_value_from_string_type (GtkBuilder *builder,
}
break;
case G_TYPE_BOXED:
- if (G_VALUE_HOLDS (value, GDK_TYPE_COLOR))
+ if (G_VALUE_HOLDS (value, g_type_from_name ("GdkColor")))
{
GdkColor color = { 0, };
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (gdk_color_parse (string, &color))
g_value_set_boxed (value, &color);
else
@@ -1992,6 +1993,7 @@ gtk_builder_value_from_string_type (GtkBuilder *builder,
string);
ret = FALSE;
}
+G_GNUC_END_IGNORE_DEPRECATIONS
}
else if (G_VALUE_HOLDS (value, GDK_TYPE_RGBA))
{
diff --git a/gtk/gtkcellrenderer.c b/gtk/gtkcellrenderer.c
index 67b6909..d369779 100644
--- a/gtk/gtkcellrenderer.c
+++ b/gtk/gtkcellrenderer.c
@@ -395,6 +395,7 @@ gtk_cell_renderer_class_init (GtkCellRendererClass *class)
*
* Deprecated: 3.4: Use #GtkCellRenderer:cell-background-rgba instead.
*/
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
g_object_class_install_property (object_class,
PROP_CELL_BACKGROUND_GDK,
g_param_spec_boxed ("cell-background-gdk",
@@ -402,6 +403,7 @@ gtk_cell_renderer_class_init (GtkCellRendererClass *class)
P_("Cell background color as a GdkColor"),
GDK_TYPE_COLOR,
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
+G_GNUC_END_IGNORE_DEPRECATIONS
/**
* GtkCellRenderer:cell-background-rgba:
*
diff --git a/gtk/gtkcellrenderertext.c b/gtk/gtkcellrenderertext.c
index fc17b38..6402b4b 100644
--- a/gtk/gtkcellrenderertext.c
+++ b/gtk/gtkcellrenderertext.c
@@ -295,6 +295,7 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
*
* Deprecated: 3.4: Use #GtkCellRendererText:background-rgba instead.
*/
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
g_object_class_install_property (object_class,
PROP_BACKGROUND_GDK,
g_param_spec_boxed ("background-gdk",
@@ -302,6 +303,7 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
P_("Background color as a GdkColor"),
GDK_TYPE_COLOR,
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
+G_GNUC_END_IGNORE_DEPRECATIONS
/**
* GtkCellRendererText:background-rgba:
@@ -332,6 +334,7 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
*
* Deprecated: 3.4: Use #GtkCellRendererText:foreground-rgba instead.
*/
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
g_object_class_install_property (object_class,
PROP_FOREGROUND_GDK,
g_param_spec_boxed ("foreground-gdk",
@@ -339,6 +342,7 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
P_("Foreground color as a GdkColor"),
GDK_TYPE_COLOR,
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
+G_GNUC_END_IGNORE_DEPRECATIONS
/**
* GtkCellRendererText:foreground-rgba:
diff --git a/gtk/gtkcellview.c b/gtk/gtkcellview.c
index 5870f10..d554dd8 100644
--- a/gtk/gtkcellview.c
+++ b/gtk/gtkcellview.c
@@ -199,6 +199,7 @@ gtk_cell_view_class_init (GtkCellViewClass *klass)
*
* Deprecated: 3.4: Use #GtkCellView:background-rgba instead.
*/
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
g_object_class_install_property (gobject_class,
PROP_BACKGROUND_GDK,
g_param_spec_boxed ("background-gdk",
@@ -206,6 +207,7 @@ gtk_cell_view_class_init (GtkCellViewClass *klass)
P_("Background color as a GdkColor"),
GDK_TYPE_COLOR,
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
+G_GNUC_END_IGNORE_DEPRECATIONS
/**
* GtkCellView:background-rgba:
*
diff --git a/gtk/gtkcolorbutton.c b/gtk/gtkcolorbutton.c
index 661c5c6..00bbc87 100644
--- a/gtk/gtkcolorbutton.c
+++ b/gtk/gtkcolorbutton.c
@@ -197,6 +197,7 @@ gtk_color_button_class_init (GtkColorButtonClass *klass)
*
* Deprecated: 3.4: Use #GtkColorButton:rgba instead.
*/
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
g_object_class_install_property (gobject_class,
PROP_COLOR,
g_param_spec_boxed ("color",
@@ -204,6 +205,7 @@ gtk_color_button_class_init (GtkColorButtonClass *klass)
P_("The selected color"),
GDK_TYPE_COLOR,
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
+G_GNUC_END_IGNORE_DEPRECATIONS
/**
* GtkColorButton:alpha:
diff --git a/gtk/gtkcsscustomproperty.c b/gtk/gtkcsscustomproperty.c
index 31e516b..0fecddb 100644
--- a/gtk/gtkcsscustomproperty.c
+++ b/gtk/gtkcsscustomproperty.c
@@ -151,11 +151,13 @@ gtk_css_custom_property_create_initial_value (GParamSpec *pspec)
gdk_rgba_parse (&color, "pink");
g_value_set_boxed (&value, &color);
}
- else if (pspec->value_type == GDK_TYPE_COLOR)
+ else if (pspec->value_type == g_type_from_name ("GdkColor"))
{
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
GdkColor color;
gdk_color_parse ("pink", &color);
g_value_set_boxed (&value, &color);
+G_GNUC_END_IGNORE_DEPRECATIONS
}
else if (pspec->value_type == GTK_TYPE_BORDER)
{
diff --git a/gtk/gtkcssstylefuncs.c b/gtk/gtkcssstylefuncs.c
index 9bb5406..8b5393a 100644
--- a/gtk/gtkcssstylefuncs.c
+++ b/gtk/gtkcssstylefuncs.c
@@ -272,7 +272,9 @@ color_value_print (const GValue *value,
g_string_append (string, "none");
else
{
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
char *s = gdk_color_to_string (color);
+G_GNUC_END_IGNORE_DEPRECATIONS
g_string_append (string, s);
g_free (s);
}
@@ -976,13 +978,14 @@ gtk_css_style_funcs_init (void)
rgba_value_parse,
rgba_value_print,
rgba_value_compute);
+
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+
register_conversion_function (GDK_TYPE_COLOR,
color_value_parse,
color_value_print,
color_value_compute);
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-
register_conversion_function (GTK_TYPE_SYMBOLIC_COLOR,
symbolic_color_value_parse,
symbolic_color_value_print,
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 4cd36b9..f428612 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -669,7 +669,7 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
g_param_spec_boxed ("selection-box-color",
P_("Selection Box Color"),
P_("Color of the selection box"),
- GDK_TYPE_COLOR,
+ g_type_from_name ("GdkColor"),
GTK_PARAM_READABLE));
gtk_widget_class_install_style_property (widget_class,
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 0e72265..b3ed083 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -1375,9 +1375,11 @@ attribute_from_text (GtkBuilder *builder,
}
break;
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
/* PangoAttrColor */
case PANGO_ATTR_FOREGROUND:
- if (gtk_builder_value_from_string_type (builder, GDK_TYPE_COLOR,
+ if (gtk_builder_value_from_string_type (builder, GDK_TYPE_COLOR,
value, &val, error))
{
color = g_value_get_boxed (&val);
@@ -1408,6 +1410,8 @@ attribute_from_text (GtkBuilder *builder,
attribute = pango_attr_strikethrough_color_new (color->red, color->green, color->blue);
}
break;
+
+G_GNUC_END_IGNORE_DEPRECATIONS
/* PangoAttrShape */
case PANGO_ATTR_SHAPE:
diff --git a/gtk/gtkmodifierstyle.c b/gtk/gtkmodifierstyle.c
index 88cd0d5..247292f 100644
--- a/gtk/gtkmodifierstyle.c
+++ b/gtk/gtkmodifierstyle.c
@@ -90,10 +90,14 @@ gtk_modifier_style_get_style_property (GtkStyleProvider *provider,
GdkColor color;
gchar *str;
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
/* Reject non-color types for now */
if (pspec->value_type != GDK_TYPE_COLOR)
return FALSE;
+G_GNUC_END_IGNORE_DEPRECATIONS
+
priv = GTK_MODIFIER_STYLE (provider)->priv;
str = g_strdup_printf ("-%s-%s",
g_type_name (pspec->owner_type),
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index dd46662..7a70e79 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -1837,9 +1837,7 @@ gtk_settings_get_property (GObject *object,
switch (property_id)
{
case PROP_COLOR_HASH:
- g_value_take_boxed (value,
- g_hash_table_new_full (g_str_hash, g_str_equal,
- g_free, (GDestroyNotify) gdk_color_free));
+ g_value_take_boxed (value, g_hash_table_new (g_str_hash, g_str_equal));
return;
default: ;
}
@@ -1851,7 +1849,7 @@ gtk_settings_get_property (GObject *object,
if ((g_value_type_transformable (G_TYPE_INT, value_type) &&
!(fundamental_type == G_TYPE_ENUM || fundamental_type == G_TYPE_FLAGS)) ||
g_value_type_transformable (G_TYPE_STRING, G_VALUE_TYPE (value)) ||
- g_value_type_transformable (GDK_TYPE_COLOR, G_VALUE_TYPE (value)))
+ g_value_type_transformable (GDK_TYPE_RGBA, G_VALUE_TYPE (value)))
{
if (priv->property_values[property_id - 1].source == GTK_SETTINGS_SOURCE_APPLICATION ||
!gdk_screen_get_setting (priv->screen, pspec->name, value))
@@ -2151,7 +2149,7 @@ settings_install_property_parser (GtkSettingsClass *class,
GtkRcPropertyParser
_gtk_rc_property_parser_from_type (GType type)
{
- if (type == GDK_TYPE_COLOR)
+ if (type == g_type_from_name ("GdkColor"))
return gtk_rc_property_parse_color;
else if (type == GTK_TYPE_REQUISITION)
return gtk_rc_property_parse_requisition;
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index ebdc243..a93b1ac 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -3638,7 +3638,9 @@ get_cursor_color (GtkStyleContext *context,
color->blue = style_color->blue / 65535.0;
color->alpha = 1;
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gdk_color_free (style_color);
+G_GNUC_END_IGNORE_DEPRECATIONS
}
else
{
diff --git a/gtk/gtktextattributes.c b/gtk/gtktextattributes.c
index a5dd897..5998bd3 100644
--- a/gtk/gtktextattributes.c
+++ b/gtk/gtktextattributes.c
@@ -128,8 +128,10 @@ gtk_text_attributes_copy_values (GtkTextAttributes *src,
if (dest->font)
pango_font_description_free (dest->font);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (dest->pg_bg_color)
gdk_color_free (dest->pg_bg_color);
+G_GNUC_END_IGNORE_DEPRECATIONS
if (dest->pg_bg_rgba)
gdk_rgba_free (dest->pg_bg_rgba);
@@ -153,8 +155,10 @@ gtk_text_attributes_copy_values (GtkTextAttributes *src,
if (src->font)
dest->font = pango_font_description_copy (src->font);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (src->pg_bg_color)
dest->pg_bg_color = gdk_color_copy (src->pg_bg_color);
+G_GNUC_END_IGNORE_DEPRECATIONS
if (src->pg_bg_rgba)
dest->pg_bg_rgba = gdk_rgba_copy (src->pg_bg_rgba);
@@ -209,8 +213,10 @@ gtk_text_attributes_unref (GtkTextAttributes *values)
if (values->font)
pango_font_description_free (values->font);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (values->pg_bg_color)
gdk_color_free (values->pg_bg_color);
+G_GNUC_END_IGNORE_DEPRECATIONS
if (values->pg_bg_rgba)
gdk_rgba_free (values->pg_bg_rgba);
@@ -280,15 +286,19 @@ _gtk_text_attributes_fill_from_tags (GtkTextAttributes *dest,
if (dest->pg_bg_color)
{
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gdk_color_free (dest->pg_bg_color);
dest->pg_bg_color = NULL;
+G_GNUC_END_IGNORE_DEPRECATIONS
}
if (vals->pg_bg_rgba)
dest->pg_bg_rgba = gdk_rgba_copy (vals->pg_bg_rgba);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (vals->pg_bg_color)
dest->pg_bg_color = gdk_color_copy (vals->pg_bg_color);
+G_GNUC_END_IGNORE_DEPRECATIONS
}
if (vals->font)
diff --git a/gtk/gtktextbufferserialize.c b/gtk/gtktextbufferserialize.c
index 3976e1f..3b77074 100644
--- a/gtk/gtktextbufferserialize.c
+++ b/gtk/gtktextbufferserialize.c
@@ -50,6 +50,7 @@ typedef struct
static gchar *
serialize_value (GValue *value)
{
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (g_value_type_transformable (value->g_type, G_TYPE_STRING))
{
GValue text_value = G_VALUE_INIT;
@@ -73,6 +74,7 @@ serialize_value (GValue *value)
{
g_warning ("Type %s is not serializable\n", g_type_name (value->g_type));
}
+G_GNUC_END_IGNORE_DEPRECATIONS
return NULL;
}
@@ -81,6 +83,7 @@ static gboolean
deserialize_value (const gchar *str,
GValue *value)
{
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (g_value_type_transformable (G_TYPE_STRING, value->g_type))
{
GValue text_value = G_VALUE_INIT;
@@ -191,6 +194,7 @@ deserialize_value (const gchar *str,
{
g_warning ("Type %s can not be deserialized\n", g_type_name (value->g_type));
}
+G_GNUC_END_IGNORE_DEPRECATIONS
return FALSE;
}
diff --git a/gtk/gtktextdisplay.c b/gtk/gtktextdisplay.c
index 24cc0ec..9e8fcea 100644
--- a/gtk/gtktextdisplay.c
+++ b/gtk/gtktextdisplay.c
@@ -224,7 +224,9 @@ gtk_text_renderer_prepare_run (PangoRenderer *renderer,
rgba.green = color->green / 65535.;
rgba.blue = color->blue / 65535.;
rgba.alpha = 1;
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gdk_color_free (color);
+G_GNUC_END_IGNORE_DEPRECATIONS
text_renderer->error_color = gdk_rgba_copy (&rgba);
}
diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c
index 4ad0aee..9990928 100644
--- a/gtk/gtktextlayout.c
+++ b/gtk/gtktextlayout.c
@@ -1400,10 +1400,12 @@ set_para_values (GtkTextLayout *layout,
display->total_width = MAX (layout->screen_width, layout->width) - display->left_margin -
display->right_margin;
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (style->pg_bg_color)
display->pg_bg_color = gdk_color_copy (style->pg_bg_color);
else
display->pg_bg_color = NULL;
+G_GNUC_END_IGNORE_DEPRECATIONS
if (style->pg_bg_rgba)
display->pg_bg_rgba = gdk_rgba_copy (style->pg_bg_rgba);
@@ -2497,8 +2499,10 @@ gtk_text_layout_free_line_display (GtkTextLayout *layout,
if (display->cursors)
g_array_free (display->cursors, TRUE);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (display->pg_bg_color)
gdk_color_free (display->pg_bg_color);
+G_GNUC_END_IGNORE_DEPRECATIONS
if (display->pg_bg_rgba)
gdk_rgba_free (display->pg_bg_rgba);
diff --git a/gtk/gtktexttag.c b/gtk/gtktexttag.c
index 4510872..6e16fd6 100644
--- a/gtk/gtktexttag.c
+++ b/gtk/gtktexttag.c
@@ -218,7 +218,7 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
g_param_spec_boxed ("background-gdk",
P_("Background color"),
P_("Background color as a GdkColor"),
- GDK_TYPE_COLOR,
+ g_type_from_name ("GdkColor"),
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
/**
@@ -264,7 +264,7 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
g_param_spec_boxed ("foreground-gdk",
P_("Foreground color"),
P_("Foreground color as a GdkColor"),
- GDK_TYPE_COLOR,
+ g_type_from_name ("GdkColor"),
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
/**
@@ -581,7 +581,7 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
g_param_spec_boxed ("paragraph-background-gdk",
P_("Paragraph background color"),
P_("Paragraph background color as a GdkColor"),
- GDK_TYPE_COLOR,
+ g_type_from_name ("GdkColor"),
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
/**
@@ -890,8 +890,10 @@ set_pg_bg_rgba (GtkTextTag *tag, GdkRGBA *rgba)
if (priv->values->pg_bg_rgba)
gdk_rgba_free (priv->values->pg_bg_rgba);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (priv->values->pg_bg_color)
gdk_color_free (priv->values->pg_bg_color);
+G_GNUC_END_IGNORE_DEPRECATIONS
priv->values->pg_bg_rgba = NULL;
priv->values->pg_bg_color = NULL;
@@ -909,7 +911,9 @@ set_pg_bg_rgba (GtkTextTag *tag, GdkRGBA *rgba)
priv->values->pg_bg_rgba = gdk_rgba_copy (rgba);
copy_rgba_to_gdk_color (rgba, &color);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
priv->values->pg_bg_color = gdk_color_copy (&color);
+G_GNUC_END_IGNORE_DEPRECATIONS
}
else
{
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 9a709a4..8431e3f 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -911,12 +911,14 @@ gtk_text_view_class_init (GtkTextViewClass *klass)
/*
* Style properties
*/
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_widget_class_install_style_property (widget_class,
g_param_spec_boxed ("error-underline-color",
P_("Error underline color"),
P_("Color with which to draw error-indication
underlines"),
GDK_TYPE_COLOR,
GTK_PARAM_READABLE));
+G_GNUC_END_IGNORE_DEPRECATIONS
/*
* Signals
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index a401cc5..c0e855d 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -1226,7 +1226,7 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
P_("Make the expanders indented"),
TRUE,
GTK_PARAM_READABLE));
-
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_widget_class_install_style_property (widget_class,
g_param_spec_boxed ("even-row-color",
P_("Even Row Color"),
@@ -1240,6 +1240,7 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
P_("Color to use for odd rows"),
GDK_TYPE_COLOR,
GTK_PARAM_READABLE));
+G_GNUC_END_IGNORE_DEPRECATIONS
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("grid-line-width",
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index fd70264..d5cc921 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -3499,6 +3499,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
P_("Width, in pixels, between focus indicator
and the widget 'box'"),
0, G_MAXINT, 1,
GTK_PARAM_READABLE | G_PARAM_DEPRECATED));
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_widget_class_install_style_property (klass,
g_param_spec_boxed ("cursor-color",
P_("Cursor color"),
@@ -3511,6 +3512,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
P_("Color with which to draw the secondary
insertion cursor when editing mixed right-to-left and left-to-right text"),
GDK_TYPE_COLOR,
GTK_PARAM_READABLE));
+G_GNUC_END_IGNORE_DEPRECATIONS
gtk_widget_class_install_style_property (klass,
g_param_spec_float ("cursor-aspect-ratio",
P_("Cursor line aspect ratio"),
@@ -3525,6 +3527,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
FALSE,
GTK_PARAM_READABLE));
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/**
* GtkWidget:link-color:
*
@@ -3540,7 +3543,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
P_("Unvisited Link Color"),
P_("Color of unvisited links"),
GDK_TYPE_COLOR,
- GTK_PARAM_READABLE));
+ GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
/**
* GtkWidget:visited-link-color:
@@ -3557,7 +3560,8 @@ G_GNUC_END_IGNORE_DEPRECATIONS
P_("Visited Link Color"),
P_("Color of visited links"),
GDK_TYPE_COLOR,
- GTK_PARAM_READABLE));
+ GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
+G_GNUC_END_IGNORE_DEPRECATIONS
/**
* GtkWidget:wide-separators:
diff --git a/gtk/inspector/prop-editor.c b/gtk/inspector/prop-editor.c
index 91562b4..2ec3456 100644
--- a/gtk/inspector/prop-editor.c
+++ b/gtk/inspector/prop-editor.c
@@ -696,6 +696,7 @@ color_modified (GtkColorButton *cb, GParamSpec *ignored, ObjectProperty *p)
g_value_unset (&val);
}
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static void
color_changed (GObject *object, GParamSpec *pspec, gpointer data)
{
@@ -721,6 +722,7 @@ color_changed (GObject *object, GParamSpec *pspec, gpointer data)
g_value_unset (&val);
}
+G_GNUC_END_IGNORE_DEPRECATIONS
static void
font_modified (GtkFontChooser *fb, GParamSpec *pspec, ObjectProperty *p)
@@ -1005,7 +1007,7 @@ property_widget (GObject *object,
object, spec, G_CALLBACK (rgba_modified));
}
else if (type == G_TYPE_PARAM_BOXED &&
- G_PARAM_SPEC_VALUE_TYPE (spec) == GDK_TYPE_COLOR)
+ G_PARAM_SPEC_VALUE_TYPE (spec) == g_type_from_name ("GdkColor"))
{
prop_edit = gtk_color_chooser_widget_new ();
gtk_color_chooser_set_use_alpha (GTK_COLOR_CHOOSER (prop_edit), FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]