[gtk+/gtk-style-context: 77/347] GtkCssProvider: Compare GtkWidgetPath regions with css.



commit 2d2e136482336cfb1072e568ef19981b2ebd98e8
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Apr 23 01:31:44 2010 +0200

    GtkCssProvider: Compare GtkWidgetPath regions with css.

 gtk/gtkcssprovider.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index e903ec5..9360488 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -384,6 +384,24 @@ compare_selector_element (GtkWidgetPath   *path,
 
       return TRUE;
     }
+  else if (elem->elem_type == SELECTOR_REGION)
+    {
+      const gchar *region_name;
+      GtkChildClassFlags flags;
+
+      /* FIXME: Need GQuark API here */
+      region_name = g_quark_to_string (elem->region.name);
+
+      if (!gtk_widget_path_iter_has_region (path, index, region_name, &flags))
+        return FALSE;
+
+      if (elem->region.flags != 0 &&
+          (flags & elem->region.flags) == 0)
+        return FALSE;
+
+      *score = 0xF;
+      return TRUE;
+    }
   else if (elem->elem_type == SELECTOR_GLOB)
     {
       /* Treat as lowest matching type */



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