[gtk+/parser: 41/80] cssprovider: Add a private structure to the scanner



commit bdda76dfafeffbecacf4fdb5a999880151681bf4
Author: Benjamin Otte <otte redhat com>
Date:   Sun Apr 10 03:39:52 2011 +0200

    cssprovider: Add a private structure to the scanner
    
    So far, it's unused

 gtk/gtkcssprovider.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 5e50634..eb69e22 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -735,6 +735,7 @@
 typedef struct SelectorElement SelectorElement;
 typedef struct SelectorPath SelectorPath;
 typedef struct SelectorStyleInfo SelectorStyleInfo;
+typedef struct _GtkCssScannerPrivate GtkCssScannerPrivate;
 typedef enum SelectorElementType SelectorElementType;
 typedef enum CombinatorType CombinatorType;
 typedef enum ParserScope ParserScope;
@@ -785,6 +786,11 @@ struct SelectorStyleInfo
   GHashTable *style;
 };
 
+struct _GtkCssScannerPrivate
+{
+  int unused;
+};
+
 struct _GtkCssProviderPrivate
 {
   GScanner *scanner;
@@ -1093,16 +1099,23 @@ selector_style_info_set_style (SelectorStyleInfo *info,
 static void
 gtk_css_scanner_destroy (GScanner *scanner)
 {
+  GtkCssScannerPrivate *priv = scanner->user_data;
+
+  g_slice_free (GtkCssScannerPrivate, priv);
+  
   g_scanner_destroy (scanner);
 }
 
 static GScanner *
 gtk_css_provider_create_scanner (GtkCssProvider *provider)
 {
+  GtkCssScannerPrivate *priv;
   GScanner *scanner;
 
   scanner = g_scanner_new (NULL);
 
+  priv = scanner->user_data = g_slice_new0 (GtkCssScannerPrivate);
+
   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));



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