[gtk/matthiasc/for-master] wip: dump selectors



commit d1e48270aee2aaa93ea6163f57643f24f2ea0415
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Jan 23 18:51:42 2020 -0500

    wip: dump selectors

 gtk/gtkcssprovider.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 6c25afae67..65f918d4fa 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -978,12 +978,33 @@ gtk_css_provider_postprocess (GtkCssProvider *css_provider)
 
       ruleset = &g_array_index (priv->rulesets, GtkCssRuleset, i);
 
+
       _gtk_css_selector_tree_builder_add (builder,
                                          ruleset->selector,
                                          &ruleset->selector_match,
                                          ruleset);
     }
 
+#if 0
+  {
+    GString *str = g_string_new ("");
+    g_string_append_printf (str, "%d rules\n", priv->rulesets->len);
+
+    for (i = 0; i < priv->rulesets->len; i++)
+      {
+        GtkCssRuleset *ruleset;
+
+        ruleset = &g_array_index (priv->rulesets, GtkCssRuleset, i);
+
+        _gtk_css_selector_print (ruleset->selector, str);
+        g_string_append (str, "\n");
+      }
+
+    g_print ("%s\n", str->str);
+    g_string_free (str, TRUE);
+  }
+#endif
+
   priv->tree = _gtk_css_selector_tree_builder_build (builder);
   _gtk_css_selector_tree_builder_free (builder);
 


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