css: Use the tree to print css selectors

This commit is contained in:
Alexander Larsson 2012-11-29 16:00:01 +01:00
parent 6bec577771
commit 3d5e8f98ec
3 changed files with 18 additions and 5 deletions

View File

@ -2884,7 +2884,7 @@ gtk_css_ruleset_print (const GtkCssRuleset *ruleset,
WidgetPropertyValue *widget_value;
guint i;
_gtk_css_selector_print (ruleset->selector, str);
_gtk_css_selector_tree_match_print (ruleset->selector_match, str);
g_string_append (str, " {\n");

View File

@ -1675,6 +1675,18 @@ _gtk_css_selector_tree_print (GtkCssSelectorTree *tree, GString *str, char *pref
}
#endif
void
_gtk_css_selector_tree_match_print (const GtkCssSelectorTree *tree,
GString *str)
{
g_return_if_fail (tree != NULL);
tree->selector.class->print (&tree->selector, str);
if (tree->parent)
_gtk_css_selector_tree_match_print (tree->parent, str);
}
void
_gtk_css_selector_tree_free (GtkCssSelectorTree *tree)
{

View File

@ -40,10 +40,11 @@ gboolean _gtk_css_selector_matches (const GtkCssSelector *sel
int _gtk_css_selector_compare (const GtkCssSelector *a,
const GtkCssSelector *b);
void _gtk_css_selector_tree_free (GtkCssSelectorTree *tree);
GPtrArray *_gtk_css_selector_tree_match_all (GtkCssSelectorTree *tree,
const GtkCssMatcher *matcher);
void _gtk_css_selector_tree_free (GtkCssSelectorTree *tree);
GPtrArray *_gtk_css_selector_tree_match_all (GtkCssSelectorTree *tree,
const GtkCssMatcher *matcher);
void _gtk_css_selector_tree_match_print (const GtkCssSelectorTree *tree,
GString *str);
GtkCssSelectorTreeBuilder *_gtk_css_selector_tree_builder_new (void);
void _gtk_css_selector_tree_builder_add (GtkCssSelectorTreeBuilder *builder,