[gtk+] Deprecate all the public API that is using GdkColor struct
- From: Javier JardÃn <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Deprecate all the public API that is using GdkColor struct
- Date: Thu, 22 Dec 2011 03:34:10 +0000 (UTC)
commit a3abc188585156e4a6ba309e26c6d123cfe4f39d
Author: Javier JardÃn <jjardon gnome org>
Date: Tue Dec 13 11:02:13 2011 +0000
Deprecate all the public API that is using GdkColor struct
gdk/gdkcairo.c | 2 ++
gdk/gdkcairo.h | 6 ++++--
gdk/gdkwindow.c | 2 ++
gdk/gdkwindow.h | 1 +
gtk/gtkcellrenderer.c | 9 ++++++++-
gtk/gtkcellrenderertext.c | 18 ++++++++++++++++--
gtk/gtkcellview.c | 12 +++++++++++-
gtk/gtkcellview.h | 5 +++--
gtk/gtkcolorbutton.c | 10 +++++++++-
gtk/gtkcolorbutton.h | 14 +++++++++-----
gtk/gtkcolorsel.c | 18 +++++++++++++++++-
gtk/gtkcolorsel.h | 22 ++++++++++++++--------
gtk/gtktexttag.c | 22 +++++++++++++++++++---
13 files changed, 115 insertions(+), 26 deletions(-)
---
diff --git a/gdk/gdkcairo.c b/gdk/gdkcairo.c
index ea58c42..39320f8 100644
--- a/gdk/gdkcairo.c
+++ b/gdk/gdkcairo.c
@@ -89,6 +89,8 @@ gdk_cairo_get_clip_rectangle (cairo_t *cr,
* Sets the specified #GdkColor as the source color of @cr.
*
* Since: 2.8
+ *
+ * Deprecated: 3.4: Use gdk_cairo_set_source_rgba() instead
*/
void
gdk_cairo_set_source_color (cairo_t *cr,
diff --git a/gdk/gdkcairo.h b/gdk/gdkcairo.h
index f2cf7bd..20c995b 100644
--- a/gdk/gdkcairo.h
+++ b/gdk/gdkcairo.h
@@ -35,8 +35,6 @@ cairo_t * gdk_cairo_create (GdkWindow *window);
gboolean gdk_cairo_get_clip_rectangle (cairo_t *cr,
GdkRectangle *rect);
-void gdk_cairo_set_source_color (cairo_t *cr,
- const GdkColor *color);
void gdk_cairo_set_source_rgba (cairo_t *cr,
const GdkRGBA *rgba);
void gdk_cairo_set_source_pixbuf (cairo_t *cr,
@@ -57,6 +55,10 @@ cairo_region_t *
gdk_cairo_region_create_from_surface
(cairo_surface_t *surface);
+GDK_DEPRECATED_FOR(gdk_cairo_set_source_rgba)
+void gdk_cairo_set_source_color (cairo_t *cr,
+ const GdkColor *color);
+
G_END_DECLS
#endif /* __GDK_CAIRO_H__ */
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index c0e9236..a6170a9 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -6542,6 +6542,8 @@ gdk_window_move_region (GdkWindow *window,
* implementing a custom widget.)
*
* See also gdk_window_set_background_pattern().
+ *
+ * Deprecated: 3.4: Use gdk_window_set_background_rgba() instead.
*/
void
gdk_window_set_background (GdkWindow *window,
diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h
index 81dda7c..f6b2be7 100644
--- a/gdk/gdkwindow.h
+++ b/gdk/gdkwindow.h
@@ -657,6 +657,7 @@ void gdk_window_set_startup_id (GdkWindow *window,
const gchar *startup_id);
void gdk_window_set_transient_for (GdkWindow *window,
GdkWindow *parent);
+GDK_DEPRECATED_FOR(gdk_window_set_background_rgba)
void gdk_window_set_background (GdkWindow *window,
const GdkColor *color);
void gdk_window_set_background_rgba (GdkWindow *window,
diff --git a/gtk/gtkcellrenderer.c b/gtk/gtkcellrenderer.c
index 1cef97b..d701b74 100644
--- a/gtk/gtkcellrenderer.c
+++ b/gtk/gtkcellrenderer.c
@@ -380,13 +380,20 @@ gtk_cell_renderer_class_init (GtkCellRendererClass *class)
NULL,
GTK_PARAM_WRITABLE));
+ /**
+ * GtkCellRenderer:cell-background-gdk:
+ *
+ * Cell background as a #GdkColor
+ *
+ * Deprecated: 3.4: Use #GtkCellRenderer:cell-background-rgba instead.
+ */
g_object_class_install_property (object_class,
PROP_CELL_BACKGROUND_GDK,
g_param_spec_boxed ("cell-background-gdk",
P_("Cell background color"),
P_("Cell background color as a GdkColor"),
GDK_TYPE_COLOR,
- GTK_PARAM_READWRITE));
+ GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
/**
* GtkCellRenderer:cell-background-rgba:
*
diff --git a/gtk/gtkcellrenderertext.c b/gtk/gtkcellrenderertext.c
index ea8973c..580e338 100644
--- a/gtk/gtkcellrenderertext.c
+++ b/gtk/gtkcellrenderertext.c
@@ -290,13 +290,20 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
NULL,
GTK_PARAM_WRITABLE));
+ /**
+ * GtkCellRendererText:background-gdk:
+ *
+ * Background color as a #GdkColor
+ *
+ * Deprecated: 3.4: Use #GtkCellRendererText:background-rgba instead.
+ */
g_object_class_install_property (object_class,
PROP_BACKGROUND_GDK,
g_param_spec_boxed ("background-gdk",
P_("Background color"),
P_("Background color as a GdkColor"),
GDK_TYPE_COLOR,
- GTK_PARAM_READWRITE));
+ GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
/**
* GtkCellRendererText:background-rgba:
@@ -320,13 +327,20 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
NULL,
GTK_PARAM_WRITABLE));
+ /**
+ * GtkCellRendererText:foreground-gdk:
+ *
+ * Foreground color as a #GdkColor
+ *
+ * Deprecated: 3.4: Use #GtkCellRendererText:foreground-rgba instead.
+ */
g_object_class_install_property (object_class,
PROP_FOREGROUND_GDK,
g_param_spec_boxed ("foreground-gdk",
P_("Foreground color"),
P_("Foreground color as a GdkColor"),
GDK_TYPE_COLOR,
- GTK_PARAM_READWRITE));
+ GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
/**
* GtkCellRendererText:foreground-rgba:
diff --git a/gtk/gtkcellview.c b/gtk/gtkcellview.c
index b6ce31f..10532fc 100644
--- a/gtk/gtkcellview.c
+++ b/gtk/gtkcellview.c
@@ -192,13 +192,21 @@ gtk_cell_view_class_init (GtkCellViewClass *klass)
P_("Background color as a string"),
NULL,
GTK_PARAM_WRITABLE));
+
+ /**
+ * GtkCellView:background-gdk
+ *
+ * The background color as a #GdkColor
+ *
+ * Deprecated: 3.4: Use #GtkCellView:background-rgba instead.
+ */
g_object_class_install_property (gobject_class,
PROP_BACKGROUND_GDK,
g_param_spec_boxed ("background-gdk",
P_("Background color"),
P_("Background color as a GdkColor"),
GDK_TYPE_COLOR,
- GTK_PARAM_READWRITE));
+ GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
/**
* GtkCellView:background-rgba
*
@@ -1268,6 +1276,8 @@ gtk_cell_view_get_size_of_row (GtkCellView *cell_view,
* Sets the background color of @view.
*
* Since: 2.6
+ *
+ * Deprecated: 3.4: Use gtk_cell_view_set_background_rgba() instead.
*/
void
gtk_cell_view_set_background_color (GtkCellView *cell_view,
diff --git a/gtk/gtkcellview.h b/gtk/gtkcellview.h
index b8c5f18..797c7a5 100644
--- a/gtk/gtkcellview.h
+++ b/gtk/gtkcellview.h
@@ -75,8 +75,6 @@ GtkTreeModel *gtk_cell_view_get_model (GtkCellView *cell_v
void gtk_cell_view_set_displayed_row (GtkCellView *cell_view,
GtkTreePath *path);
GtkTreePath *gtk_cell_view_get_displayed_row (GtkCellView *cell_view);
-void gtk_cell_view_set_background_color (GtkCellView *cell_view,
- const GdkColor *color);
void gtk_cell_view_set_background_rgba (GtkCellView *cell_view,
const GdkRGBA *rgba);
gboolean gtk_cell_view_get_draw_sensitive (GtkCellView *cell_view);
@@ -90,6 +88,9 @@ GDK_DEPRECATED_FOR(gtk_widget_get_preferred_size)
gboolean gtk_cell_view_get_size_of_row (GtkCellView *cell_view,
GtkTreePath *path,
GtkRequisition *requisition);
+GDK_DEPRECATED_FOR(gtk_cell_view_set_background_rgba)
+void gtk_cell_view_set_background_color (GtkCellView *cell_view,
+ const GdkColor *color);
G_END_DECLS
diff --git a/gtk/gtkcolorbutton.c b/gtk/gtkcolorbutton.c
index 7494565..0be2b89 100644
--- a/gtk/gtkcolorbutton.c
+++ b/gtk/gtkcolorbutton.c
@@ -193,6 +193,8 @@ gtk_color_button_class_init (GtkColorButtonClass *klass)
* The selected color.
*
* Since: 2.4
+ *
+ * Deprecated: 3.4: Use #GtkColorButton:rgba instead.
*/
g_object_class_install_property (gobject_class,
PROP_COLOR,
@@ -200,7 +202,7 @@ gtk_color_button_class_init (GtkColorButtonClass *klass)
P_("Current Color"),
P_("The selected color"),
GDK_TYPE_COLOR,
- GTK_PARAM_READWRITE));
+ GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
/**
* GtkColorButton:alpha:
@@ -555,6 +557,8 @@ gtk_color_button_new (void)
* Returns: a new color button
*
* Since: 2.4
+ *
+ * Deprecated: 3.4: Use gtk_color_button_new_with_rgba() instead.
*/
GtkWidget *
gtk_color_button_new_with_color (const GdkColor *color)
@@ -691,6 +695,8 @@ gtk_color_button_clicked (GtkButton *button)
* Sets the current color to be @color.
*
* Since: 2.4
+ *
+ * Deprecated: Use gtk_color_button_set_rgba() instead.
*/
void
gtk_color_button_set_color (GtkColorButton *color_button,
@@ -741,6 +747,8 @@ gtk_color_button_set_alpha (GtkColorButton *color_button,
* Sets @color to be the current color in the #GtkColorButton widget.
*
* Since: 2.4
+ *
+ * Deprecated: 3.4: Use gtk_color_button_get_rgba() instead.
*/
void
gtk_color_button_get_color (GtkColorButton *color_button,
diff --git a/gtk/gtkcolorbutton.h b/gtk/gtkcolorbutton.h
index 7e1aae1..8f2d2ca 100644
--- a/gtk/gtkcolorbutton.h
+++ b/gtk/gtkcolorbutton.h
@@ -75,14 +75,9 @@ struct _GtkColorButtonClass {
GType gtk_color_button_get_type (void) G_GNUC_CONST;
GtkWidget *gtk_color_button_new (void);
-GtkWidget *gtk_color_button_new_with_color (const GdkColor *color);
GtkWidget *gtk_color_button_new_with_rgba (const GdkRGBA *rgba);
-void gtk_color_button_set_color (GtkColorButton *color_button,
- const GdkColor *color);
void gtk_color_button_set_alpha (GtkColorButton *color_button,
guint16 alpha);
-void gtk_color_button_get_color (GtkColorButton *color_button,
- GdkColor *color);
guint16 gtk_color_button_get_alpha (GtkColorButton *color_button);
void gtk_color_button_set_use_alpha (GtkColorButton *color_button,
gboolean use_alpha);
@@ -95,6 +90,15 @@ void gtk_color_button_set_title (GtkColorButton *color_button,
const gchar *title);
const gchar *gtk_color_button_get_title (GtkColorButton *color_button);
+GDK_DEPRECATED_FOR(gtk_color_button_new_with_rgba)
+GtkWidget *gtk_color_button_new_with_color (const GdkColor *color);
+GDK_DEPRECATED_FOR(gtk_color_button_set_rgba)
+void gtk_color_button_set_color (GtkColorButton *color_button,
+ const GdkColor *color);
+GDK_DEPRECATED_FOR(gtk_color_button_get_rgba)
+void gtk_color_button_get_color (GtkColorButton *color_button,
+ GdkColor *color);
+
G_END_DECLS
diff --git a/gtk/gtkcolorsel.c b/gtk/gtkcolorsel.c
index 32f18ce..85de544 100644
--- a/gtk/gtkcolorsel.c
+++ b/gtk/gtkcolorsel.c
@@ -329,13 +329,21 @@ gtk_color_selection_class_init (GtkColorSelectionClass *klass)
P_("Whether a palette should be used"),
FALSE,
GTK_PARAM_READWRITE));
+
+ /**
+ * GtkColorSelection:current-color
+ *
+ * The current GdkColor color.
+ *
+ * Deprecated: 3.4: Use #GtkColorSelection:current-rgba instead.
+ */
g_object_class_install_property (gobject_class,
PROP_CURRENT_COLOR,
g_param_spec_boxed ("current-color",
P_("Current Color"),
P_("The current color"),
GDK_TYPE_COLOR,
- GTK_PARAM_READWRITE));
+ GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
g_object_class_install_property (gobject_class,
PROP_CURRENT_ALPHA,
g_param_spec_uint ("current-alpha",
@@ -2488,6 +2496,8 @@ gtk_color_selection_set_has_palette (GtkColorSelection *colorsel,
*
* The first time this is called, it will also set
* the original color to be @color too.
+ *
+ * Deprecated: 3.4: Use gtk_color_selection_set_current_rgba() instead.
*/
void
gtk_color_selection_set_current_color (GtkColorSelection *colorsel,
@@ -2556,6 +2566,8 @@ gtk_color_selection_set_current_alpha (GtkColorSelection *colorsel,
* @color: (out): a #GdkColor to fill in with the current color
*
* Sets @color to be the current color in the GtkColorSelection widget.
+ *
+ * Deprecated: 3.4: Use gtk_color_selection_get_current_rgba() instead.
*/
void
gtk_color_selection_get_current_color (GtkColorSelection *colorsel,
@@ -2602,6 +2614,8 @@ gtk_color_selection_get_current_alpha (GtkColorSelection *colorsel)
* as it might seem confusing to have that color change.
* Calling gtk_color_selection_set_current_color() will also
* set this color the first time it is called.
+ *
+ * Deprecated: 3.4: Use gtk_color_selection_set_previous_rgba() instead.
*/
void
gtk_color_selection_set_previous_color (GtkColorSelection *colorsel,
@@ -2661,6 +2675,8 @@ gtk_color_selection_set_previous_alpha (GtkColorSelection *colorsel,
* @color: (out): a #GdkColor to fill in with the original color value
*
* Fills @color in with the original color value.
+ *
+ * Deprecated: 3.4: Use gtk_color_selection_get_previous_rgba() instead.
*/
void
gtk_color_selection_get_previous_color (GtkColorSelection *colorsel,
diff --git a/gtk/gtkcolorsel.h b/gtk/gtkcolorsel.h
index 0dbdae1..d8b7877 100644
--- a/gtk/gtkcolorsel.h
+++ b/gtk/gtkcolorsel.h
@@ -98,19 +98,11 @@ void gtk_color_selection_set_has_palette (GtkColorSelection *color
gboolean has_palette);
-void gtk_color_selection_set_current_color (GtkColorSelection *colorsel,
- const GdkColor *color);
void gtk_color_selection_set_current_alpha (GtkColorSelection *colorsel,
guint16 alpha);
-void gtk_color_selection_get_current_color (GtkColorSelection *colorsel,
- GdkColor *color);
guint16 gtk_color_selection_get_current_alpha (GtkColorSelection *colorsel);
-void gtk_color_selection_set_previous_color (GtkColorSelection *colorsel,
- const GdkColor *color);
void gtk_color_selection_set_previous_alpha (GtkColorSelection *colorsel,
guint16 alpha);
-void gtk_color_selection_get_previous_color (GtkColorSelection *colorsel,
- GdkColor *color);
guint16 gtk_color_selection_get_previous_alpha (GtkColorSelection *colorsel);
void gtk_color_selection_set_current_rgba (GtkColorSelection *colorsel,
@@ -132,6 +124,20 @@ gchar* gtk_color_selection_palette_to_string (const GdkColor *colors,
GtkColorSelectionChangePaletteWithScreenFunc gtk_color_selection_set_change_palette_with_screen_hook (GtkColorSelectionChangePaletteWithScreenFunc func);
+GDK_DEPRECATED_FOR(gtk_color_selection_set_current_rgba)
+void gtk_color_selection_set_current_color (GtkColorSelection *colorsel,
+ const GdkColor *color);
+GDK_DEPRECATED_FOR(gtk_color_selection_get_current_rgba)
+void gtk_color_selection_get_current_color (GtkColorSelection *colorsel,
+ GdkColor *color);
+GDK_DEPRECATED_FOR(gtk_color_selection_set_previous_rgba)
+void gtk_color_selection_set_previous_color (GtkColorSelection *colorsel,
+ const GdkColor *color);
+GDK_DEPRECATED_FOR(gtk_color_selection_get_previous_rgba)
+void gtk_color_selection_get_previous_color (GtkColorSelection *colorsel,
+ GdkColor *color);
+
+
G_END_DECLS
#endif /* __GTK_COLOR_SELECTION_H__ */
diff --git a/gtk/gtktexttag.c b/gtk/gtktexttag.c
index 81f7932..10a849d 100644
--- a/gtk/gtktexttag.c
+++ b/gtk/gtktexttag.c
@@ -200,13 +200,20 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
NULL,
GTK_PARAM_WRITABLE));
+ /**
+ * GtkTextTag:background-gdk:
+ *
+ * Background color as a #GdkColor.
+ *
+ * Deprecated: 3.4: Use #GtkTextTag:background-rgba instead.
+ */
g_object_class_install_property (object_class,
PROP_BACKGROUND_GDK,
g_param_spec_boxed ("background-gdk",
P_("Background color"),
P_("Background color as a GdkColor"),
GDK_TYPE_COLOR,
- GTK_PARAM_READWRITE));
+ GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
/**
* GtkTextTag:background-rgba:
@@ -239,13 +246,20 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
NULL,
GTK_PARAM_WRITABLE));
+ /**
+ * GtkTextTag:foreground-gdk:
+ *
+ * Foreground color as a #GdkColor.
+ *
+ * Deprecated: 3.4: Use #GtkTextTag:foreground-rgba instead.
+ */
g_object_class_install_property (object_class,
PROP_FOREGROUND_GDK,
g_param_spec_boxed ("foreground-gdk",
P_("Foreground color"),
P_("Foreground color as a GdkColor"),
GDK_TYPE_COLOR,
- GTK_PARAM_READWRITE));
+ GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
/**
* GtkTextTag:foreground-rgba:
@@ -553,6 +567,8 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
* The paragraph background color as a as a #GdkColor.
*
* Since: 2.8
+ *
+ * Deprecated: 3.4: Use #GtkTextTag:paragraph-background-rgba instead.
*/
g_object_class_install_property (object_class,
PROP_PARAGRAPH_BACKGROUND_GDK,
@@ -560,7 +576,7 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
P_("Paragraph background color"),
P_("Paragraph background color as a GdkColor"),
GDK_TYPE_COLOR,
- GTK_PARAM_READWRITE));
+ GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
/**
* GtkTextTag:paragraph-background-rgba:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]