]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkstyleproperties.c
GtkWidget::draw() - Document how to get the dirty region
[~andy/gtk] / gtk / gtkstyleproperties.c
index 3589535ff5c84caa068a04388317244bf5c9d3cb..9788006b1612f5dec65c947af8bdea3d25edf9dd 100644 (file)
@@ -24,9 +24,7 @@
 #include <cairo-gobject.h>
 
 #include "gtkstyleprovider.h"
-#include "gtksymboliccolor.h"
 #include "gtkthemingengine.h"
-#include "gtkgradient.h"
 #include "gtkcssshorthandpropertyprivate.h"
 #include "gtkcsstypedvalueprivate.h"
 #include "gtkcsstypesprivate.h"
 #include "gtkstylepropertyprivate.h"
 #include "gtkstyleproviderprivate.h"
 #include "gtkintl.h"
-
 #include "gtkwin32themeprivate.h"
 
+#include "deprecated/gtkgradient.h"
+#include "deprecated/gtksymboliccolorprivate.h"
+
 /**
  * SECTION:gtkstyleproperties
  * @Short_description: Store for style property information
@@ -279,25 +279,26 @@ gtk_style_properties_finalize (GObject *object)
   G_OBJECT_CLASS (gtk_style_properties_parent_class)->finalize (object);
 }
 
-static GtkStyleProperties *
-gtk_style_properties_get_style (GtkStyleProvider *provider,
-                                GtkWidgetPath    *path)
-{
-  /* Return style set itself */
-  return g_object_ref (provider);
-}
-
 static void
 gtk_style_properties_provider_init (GtkStyleProviderIface *iface)
 {
-  iface->get_style = gtk_style_properties_get_style;
 }
 
-static GtkSymbolicColor *
+static GtkCssValue *
 gtk_style_properties_provider_get_color (GtkStyleProviderPrivate *provider,
                                          const char              *name)
 {
-  return gtk_style_properties_lookup_color (GTK_STYLE_PROPERTIES (provider), name);
+  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
@@ -376,6 +377,8 @@ gtk_style_properties_new (void)
  * gtk_style_properties_lookup_color()
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.8: #GtkSymbolicColor is deprecated.
  **/
 void
 gtk_style_properties_map_color (GtkStyleProperties *props,
@@ -390,6 +393,8 @@ 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,
@@ -400,6 +405,8 @@ 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));
 }
 
@@ -414,6 +421,8 @@ gtk_style_properties_map_color (GtkStyleProperties *props,
  * Returns: (transfer none): The mapped color
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.8: #GtkSymbolicColor is deprecated.
  **/
 GtkSymbolicColor *
 gtk_style_properties_lookup_color (GtkStyleProperties *props,
@@ -870,7 +879,9 @@ 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;
         }
     }