[gtk+/gtk-style-context: 94/347] GtkCssProvider: refactor out selector matching.



commit 93bc7c43757a78c81c1229f1611555d071debd87
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Jun 18 16:52:34 2010 +0200

    GtkCssProvider: refactor out selector matching.

 gtk/gtkcssprovider.c |   27 +++++++++++++++++++++------
 1 files changed, 21 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index e354675..dace8fe 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -472,17 +472,15 @@ struct StylePriorityInfo
   GtkStateType state;
 };
 
-static GtkStyleSet *
-gtk_style_get_style (GtkStyleProvider *provider,
-                     GtkWidgetPath    *path)
+static GArray *
+css_provider_get_selectors (GtkCssProvider *css_provider,
+                            GtkWidgetPath  *path)
 {
   GtkCssProviderPrivate *priv;
-  GtkStyleSet *set;
   GArray *priority_info;
   guint i, j;
 
-  priv = GTK_CSS_PROVIDER_GET_PRIVATE (provider);
-  set = gtk_style_set_new ();
+  priv = GTK_CSS_PROVIDER_GET_PRIVATE (css_provider);
   priority_info = g_array_new (FALSE, FALSE, sizeof (StylePriorityInfo));
 
   for (i = 0; i < priv->selectors_info->len; i++)
@@ -520,6 +518,23 @@ gtk_style_get_style (GtkStyleProvider *provider,
         g_array_append_val (priority_info, new);
     }
 
+  return priority_info;
+}
+
+static GtkStyleSet *
+gtk_css_provider_get_style (GtkStyleProvider *provider,
+                            GtkWidgetPath    *path)
+{
+  GtkCssProviderPrivate *priv;
+  GtkStyleSet *set;
+  GArray *priority_info;
+  guint i;
+
+  priv = GTK_CSS_PROVIDER_GET_PRIVATE (provider);
+  set = gtk_style_set_new ();
+
+  priority_info = css_provider_get_selectors (GTK_CSS_PROVIDER (provider), path);
+
   for (i = 0; i < priority_info->len; i++)
     {
       StylePriorityInfo *info;



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