[gtk+] gtkgradient: Deprecate



commit 0862afadedf1a8e0188c21d213fdc0906477a625
Author: Benjamin Otte <otte redhat com>
Date:   Sun Nov 25 03:47:51 2012 +0100

    gtkgradient: Deprecate

 gtk/gtkcssstylefuncs.c |    4 ++++
 gtk/gtkgradient.c      |   19 +++++++++++++++++++
 gtk/gtkgradient.h      |    8 ++++++++
 3 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcssstylefuncs.c b/gtk/gtkcssstylefuncs.c
index 5b2b5db..f399881 100644
--- a/gtk/gtkcssstylefuncs.c
+++ b/gtk/gtkcssstylefuncs.c
@@ -715,6 +715,8 @@ gradient_value_print (const GValue *value,
 {
   GtkGradient *gradient = g_value_get_boxed (value);
 
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+
   if (gradient == NULL)
     g_string_append (string, "none");
   else
@@ -723,6 +725,8 @@ gradient_value_print (const GValue *value,
       g_string_append (string, s);
       g_free (s);
     }
+
+  G_GNUC_END_IGNORE_DEPRECATIONS;
 }
 
 static gboolean 
diff --git a/gtk/gtkgradient.c b/gtk/gtkgradient.c
index 78c0694..78cf7a3 100644
--- a/gtk/gtkgradient.c
+++ b/gtk/gtkgradient.c
@@ -43,6 +43,11 @@
  * It is not normally necessary to deal directly with #GtkGradients,
  * since they are mostly used behind the scenes by #GtkStyleContext and
  * #GtkCssProvider.
+ *
+ * #GtkGradient is deprecated. It was used internally by GTK's CSS engine
+ * to represent gradients. As its handling is not conforming to modern
+ * web standards, it is not used anymore. If you want to use gradients in
+ * your own code, please use Cairo directly.
  */
 
 G_DEFINE_BOXED_TYPE (GtkGradient, gtk_gradient,
@@ -83,6 +88,8 @@ struct _GtkGradient
  * Returns: A newly created #GtkGradient
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.8: #GtkGradient is deprecated.
  **/
 GtkGradient *
 gtk_gradient_new_linear (gdouble x0,
@@ -123,6 +130,8 @@ gtk_gradient_new_linear (gdouble x0,
  * Returns: A newly created #GtkGradient
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.8: #GtkGradient is deprecated.
  **/
 GtkGradient *
 gtk_gradient_new_radial (gdouble x0,
@@ -158,6 +167,8 @@ gtk_gradient_new_radial (gdouble x0,
  * Adds a stop color to @gradient.
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.8: #GtkGradient is deprecated.
  **/
 void
 gtk_gradient_add_color_stop (GtkGradient      *gradient,
@@ -183,6 +194,8 @@ gtk_gradient_add_color_stop (GtkGradient      *gradient,
  * Returns: The same @gradient
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.8: #GtkGradient is deprecated.
  **/
 GtkGradient *
 gtk_gradient_ref (GtkGradient *gradient)
@@ -202,6 +215,8 @@ gtk_gradient_ref (GtkGradient *gradient)
  * if the reference count reaches 0.
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.8: #GtkGradient is deprecated.
  **/
 void
 gtk_gradient_unref (GtkGradient *gradient)
@@ -242,6 +257,8 @@ gtk_gradient_unref (GtkGradient *gradient)
  * Returns: %TRUE if the gradient has been resolved
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.8: #GtkGradient is deprecated.
  **/
 gboolean
 gtk_gradient_resolve (GtkGradient         *gradient,
@@ -375,6 +392,8 @@ append_number (GString    *str,
  * for using in GTK CSS files.
  *
  * Returns: A string representation for @gradient
+ *
+ * Deprecated: 3.8: #GtkGradient is deprecated.
  **/
 char *
 gtk_gradient_to_string (GtkGradient *gradient)
diff --git a/gtk/gtkgradient.h b/gtk/gtkgradient.h
index 59a0710..52bbb2e 100644
--- a/gtk/gtkgradient.h
+++ b/gtk/gtkgradient.h
@@ -33,10 +33,12 @@ G_BEGIN_DECLS
 
 GType         gtk_gradient_get_type       (void) G_GNUC_CONST;
 
+GDK_DEPRECATED_IN_3_8
 GtkGradient * gtk_gradient_new_linear     (gdouble              x0,
                                            gdouble              y0,
                                            gdouble              x1,
                                            gdouble              y1);
+GDK_DEPRECATED_IN_3_8
 GtkGradient * gtk_gradient_new_radial     (gdouble              x0,
                                            gdouble              y0,
                                            gdouble              radius0,
@@ -44,21 +46,27 @@ GtkGradient * gtk_gradient_new_radial     (gdouble              x0,
                                            gdouble              y1,
                                            gdouble              radius1);
 
+GDK_DEPRECATED_IN_3_8
 void          gtk_gradient_add_color_stop (GtkGradient         *gradient,
                                            gdouble              offset,
                                            GtkSymbolicColor    *color);
 
+GDK_DEPRECATED_IN_3_8
 GtkGradient * gtk_gradient_ref            (GtkGradient         *gradient);
+GDK_DEPRECATED_IN_3_8
 void          gtk_gradient_unref          (GtkGradient         *gradient);
 
+GDK_DEPRECATED_IN_3_8
 gboolean      gtk_gradient_resolve        (GtkGradient         *gradient,
                                            GtkStyleProperties  *props,
                                            cairo_pattern_t    **resolved_gradient);
+GDK_DEPRECATED_IN_3_8
 cairo_pattern_t *
               gtk_gradient_resolve_for_context
                                           (GtkGradient         *gradient,
                                            GtkStyleContext     *context);
 
+GDK_DEPRECATED_IN_3_8
 char *        gtk_gradient_to_string      (GtkGradient         *gradient);
 
 G_END_DECLS



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]