[gtk+/parser: 1/74] cssprovider: Store cssprovider in scanner's user data
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/parser: 1/74] cssprovider: Store cssprovider in scanner's user data
- Date: Mon, 9 May 2011 15:22:02 +0000 (UTC)
commit ddae1c37b2fe7f7e3a249e055693ecb086d3b888
Author: Benjamin Otte <otte redhat com>
Date: Tue Apr 5 19:56:00 2011 +0200
cssprovider: Store cssprovider in scanner's user data
gtk/gtkcssprovider.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index e1729cb..d38d1da 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -1039,12 +1039,14 @@ selector_style_info_set_style (SelectorStyleInfo *info,
}
static GScanner *
-create_scanner (void)
+gtk_css_provider_create_scanner (GtkCssProvider *provider)
{
GScanner *scanner;
scanner = g_scanner_new (NULL);
+ scanner->user_data = provider;
+
g_scanner_scope_add_symbol (scanner, SCOPE_PSEUDO_CLASS, "active", GUINT_TO_POINTER (GTK_STATE_ACTIVE));
g_scanner_scope_add_symbol (scanner, SCOPE_PSEUDO_CLASS, "prelight", GUINT_TO_POINTER (GTK_STATE_PRELIGHT));
g_scanner_scope_add_symbol (scanner, SCOPE_PSEUDO_CLASS, "hover", GUINT_TO_POINTER (GTK_STATE_PRELIGHT));
@@ -1079,7 +1081,7 @@ gtk_css_provider_init (GtkCssProvider *css_provider)
GtkCssProviderPrivate);
priv->selectors_info = g_ptr_array_new_with_free_func ((GDestroyNotify) selector_style_info_free);
- priv->scanner = create_scanner ();
+ priv->scanner = gtk_css_provider_create_scanner (css_provider);
priv->symbolic_colors = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify) g_free,
@@ -3284,7 +3286,7 @@ parse_rule (GtkCssProvider *css_provider,
scanner_backup = priv->scanner;
priv->state = NULL;
- priv->scanner = create_scanner ();
+ priv->scanner = gtk_css_provider_create_scanner (css_provider);
/* FIXME: Avoid recursive importing */
loaded = gtk_css_provider_load_from_path_internal (css_provider, path,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]