[gtk+] styleproperties: Deprecate



commit a51378dda882115449b185aaa33b921d397568c9
Author: Benjamin Otte <otte redhat com>
Date:   Fri Oct 24 21:22:43 2014 +0200

    styleproperties: Deprecate

 gtk/gtkmodifierstyle.c   |   12 ++++--------
 gtk/gtkstyleproperties.c |   38 ++++++++++++++++++++++++++++----------
 gtk/gtkstyleproperties.h |   22 +++++++++++-----------
 gtk/gtkstyleproperty.c   |    2 ++
 4 files changed, 45 insertions(+), 29 deletions(-)
---
diff --git a/gtk/gtkmodifierstyle.c b/gtk/gtkmodifierstyle.c
index ca23223..e09f671 100644
--- a/gtk/gtkmodifierstyle.c
+++ b/gtk/gtkmodifierstyle.c
@@ -20,6 +20,8 @@
 #include "gtkstyleproviderprivate.h"
 #include "gtkintl.h"
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
 typedef struct StylePropertyValue StylePropertyValue;
 
 struct _GtkModifierStylePrivate
@@ -75,14 +77,10 @@ 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),
@@ -240,16 +238,12 @@ _gtk_modifier_style_map_color (GtkModifierStyle *style,
 
   priv = style->priv;
 
-  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-
   if (color)
     symbolic_color = gtk_symbolic_color_new_literal (color);
 
   gtk_style_properties_map_color (priv->style,
                                   name, symbolic_color);
 
-  G_GNUC_END_IGNORE_DEPRECATIONS;
-
   _gtk_style_provider_private_changed (GTK_STYLE_PROVIDER_PRIVATE (style));
 }
 
@@ -292,3 +286,5 @@ _gtk_modifier_style_set_color_property (GtkModifierStyle *style,
 
   _gtk_style_provider_private_changed (GTK_STYLE_PROVIDER_PRIVATE (style));
 }
+
+G_GNUC_END_IGNORE_DEPRECATIONS
diff --git a/gtk/gtkstyleproperties.c b/gtk/gtkstyleproperties.c
index 32f0f24..f61f7a2 100644
--- a/gtk/gtkstyleproperties.c
+++ b/gtk/gtkstyleproperties.c
@@ -39,6 +39,8 @@
 #include "deprecated/gtkgradient.h"
 #include "deprecated/gtksymboliccolorprivate.h"
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+
 /**
  * SECTION:gtkstyleproperties
  * @Short_description: Store for style property information
@@ -56,6 +58,10 @@
  * and its variants are the preferred way to access styling information
  * from widget implementations and theming engine implementations
  * should use the APIs provided by #GtkThemingEngine instead.
+ *
+ * #GtkStyleProperties has been deprecated in GTK 3.16. The CSS
+ * machinery does not use it anymore and all users of this object
+ * have been deprecated.
  */
 
 typedef struct PropertyData PropertyData;
@@ -284,15 +290,11 @@ gtk_style_properties_provider_get_color (GtkStyleProviderPrivate *provider,
 {
   GtkSymbolicColor *symbolic;
 
-  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-
   symbolic = gtk_style_properties_lookup_color (GTK_STYLE_PROPERTIES (provider), name);
   if (symbolic == NULL)
     return NULL;
 
   return _gtk_symbolic_color_get_css_value (symbolic);
-
-  G_GNUC_END_IGNORE_DEPRECATIONS;
 }
 
 static void
@@ -354,6 +356,8 @@ gtk_style_properties_provider_private_init (GtkStyleProviderPrivateInterface *if
  * Returns a newly created #GtkStyleProperties
  *
  * Returns: a new #GtkStyleProperties
+ *
+ * Deprecated: 3.16: #GtkStyleProperties are deprecated.
  **/
 GtkStyleProperties *
 gtk_style_properties_new (void)
@@ -387,8 +391,6 @@ gtk_style_properties_map_color (GtkStyleProperties *props,
 
   priv = props->priv;
 
-  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-
   if (G_UNLIKELY (!priv->color_map))
     priv->color_map = g_hash_table_new_full (g_str_hash,
                                              g_str_equal,
@@ -399,8 +401,6 @@ gtk_style_properties_map_color (GtkStyleProperties *props,
                         g_strdup (name),
                         gtk_symbolic_color_ref (color));
 
-  G_GNUC_END_IGNORE_DEPRECATIONS;
-
   _gtk_style_provider_private_changed (GTK_STYLE_PROVIDER_PRIVATE (props));
 }
 
@@ -472,6 +472,8 @@ _gtk_style_properties_set_property_by_property (GtkStyleProperties  *props,
  * Sets a styling property in @props.
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.16: #GtkStyleProperties are deprecated.
  **/
 void
 gtk_style_properties_set_property (GtkStyleProperties *props,
@@ -510,6 +512,8 @@ gtk_style_properties_set_property (GtkStyleProperties *props,
  * Sets several style properties on @props.
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.16: #GtkStyleProperties are deprecated.
  **/
 void
 gtk_style_properties_set_valist (GtkStyleProperties *props,
@@ -570,6 +574,8 @@ gtk_style_properties_set_valist (GtkStyleProperties *props,
  * Sets several style properties on @props.
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.16: #GtkStyleProperties are deprecated.
  **/
 void
 gtk_style_properties_set (GtkStyleProperties *props,
@@ -618,6 +624,8 @@ style_query_func (guint    id,
  * Returns: %TRUE if the property exists in @props, %FALSE otherwise
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.16: #GtkStyleProperties are deprecated.
  **/
 gboolean
 gtk_style_properties_get_property (GtkStyleProperties *props,
@@ -661,6 +669,8 @@ gtk_style_properties_get_property (GtkStyleProperties *props,
  * Retrieves several style property values from @props for a given state.
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.16: #GtkStyleProperties are deprecated.
  **/
 void
 gtk_style_properties_get_valist (GtkStyleProperties *props,
@@ -708,6 +718,8 @@ gtk_style_properties_get_valist (GtkStyleProperties *props,
  * given state.
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.16: #GtkStyleProperties are deprecated.
  **/
 void
 gtk_style_properties_get (GtkStyleProperties *props,
@@ -732,6 +744,8 @@ gtk_style_properties_get (GtkStyleProperties *props,
  * Unsets a style property in @props.
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.16: #GtkStyleProperties are deprecated.
  **/
 void
 gtk_style_properties_unset_property (GtkStyleProperties *props,
@@ -799,6 +813,8 @@ gtk_style_properties_unset_property (GtkStyleProperties *props,
  * @props: a #GtkStyleProperties
  *
  * Clears all style information from @props.
+ *
+ * Deprecated: 3.16: #GtkStyleProperties are deprecated.
  **/
 void
 gtk_style_properties_clear (GtkStyleProperties *props)
@@ -825,6 +841,8 @@ gtk_style_properties_clear (GtkStyleProperties *props)
  * will prevail.
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.16: #GtkStyleProperties are deprecated.
  **/
 void
 gtk_style_properties_merge (GtkStyleProperties       *props,
@@ -858,9 +876,7 @@ gtk_style_properties_merge (GtkStyleProperties       *props,
               g_hash_table_lookup (priv->color_map, name))
             continue;
 
-          G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
           gtk_style_properties_map_color (props, name, color);
-          G_GNUC_END_IGNORE_DEPRECATIONS;
         }
     }
 
@@ -936,3 +952,5 @@ gtk_style_properties_merge (GtkStyleProperties       *props,
 
   _gtk_style_provider_private_changed (GTK_STYLE_PROVIDER_PRIVATE (props));
 }
+
+G_GNUC_END_IGNORE_DEPRECATIONS;
diff --git a/gtk/gtkstyleproperties.h b/gtk/gtkstyleproperties.h
index 0e3f33a..c59c7af 100644
--- a/gtk/gtkstyleproperties.h
+++ b/gtk/gtkstyleproperties.h
@@ -65,7 +65,7 @@ typedef gboolean (* GtkStylePropertyParser) (const gchar  *string,
                                              GValue       *value,
                                              GError      **error);
 
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_16
 GType gtk_style_properties_get_type (void) G_GNUC_CONST;
 
 /* Next 2 are implemented in gtkcsscustomproperty.c */
@@ -77,7 +77,7 @@ gboolean gtk_style_properties_lookup_property   (const gchar             *proper
                                                  GtkStylePropertyParser  *parse_func,
                                                  GParamSpec             **pspec);
 
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_16
 GtkStyleProperties * gtk_style_properties_new (void);
 
 GDK_DEPRECATED_IN_3_8
@@ -88,43 +88,43 @@ GDK_DEPRECATED_IN_3_8
 GtkSymbolicColor * gtk_style_properties_lookup_color (GtkStyleProperties *props,
                                                       const gchar        *name);
 
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_16
 void     gtk_style_properties_set_property (GtkStyleProperties *props,
                                             const gchar        *property,
                                             GtkStateFlags       state,
                                             const GValue       *value);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_16
 void     gtk_style_properties_set_valist   (GtkStyleProperties *props,
                                             GtkStateFlags       state,
                                             va_list             args);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_16
 void     gtk_style_properties_set          (GtkStyleProperties *props,
                                             GtkStateFlags       state,
                                             ...) G_GNUC_NULL_TERMINATED;
 
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_16
 gboolean gtk_style_properties_get_property (GtkStyleProperties *props,
                                             const gchar        *property,
                                             GtkStateFlags       state,
                                             GValue             *value);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_16
 void     gtk_style_properties_get_valist   (GtkStyleProperties *props,
                                             GtkStateFlags       state,
                                             va_list             args);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_16
 void     gtk_style_properties_get          (GtkStyleProperties *props,
                                             GtkStateFlags       state,
                                             ...) G_GNUC_NULL_TERMINATED;
 
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_16
 void     gtk_style_properties_unset_property (GtkStyleProperties *props,
                                               const gchar        *property,
                                               GtkStateFlags       state);
 
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_16
 void     gtk_style_properties_clear          (GtkStyleProperties  *props);
 
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_16
 void     gtk_style_properties_merge          (GtkStyleProperties       *props,
                                               const GtkStyleProperties *props_to_merge,
                                               gboolean                  replace);
diff --git a/gtk/gtkstyleproperty.c b/gtk/gtkstyleproperty.c
index ac08164..40bcd46 100644
--- a/gtk/gtkstyleproperty.c
+++ b/gtk/gtkstyleproperty.c
@@ -179,7 +179,9 @@ _gtk_style_property_assign (GtkStyleProperty   *property,
   GtkStylePropertyClass *klass;
 
   g_return_if_fail (GTK_IS_STYLE_PROPERTY (property));
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
   g_return_if_fail (GTK_IS_STYLE_PROPERTIES (props));
+G_GNUC_END_IGNORE_DEPRECATIONS;
   g_return_if_fail (value != NULL);
 
   klass = GTK_STYLE_PROPERTY_GET_CLASS (property);


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