diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-07-06 12:16:26 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-07-06 22:37:57 -0400 |
commit | 295273959359245063c8bb2476da2ed87540b832 (patch) | |
tree | 1150767f91625c431cf00a7b1a4508e6d9fa435d | |
parent | b25b33f79faf35619f9c87663a65895864eb2692 (diff) | |
download | gtk+-295273959359245063c8bb2476da2ed87540b832.tar.gz |
GtkCssProvider: Allow to enable debug at runtime
Add a private function that lets us decide at runtime whether to
keep css section information around - this will be useful in the
GtkInspector.
-rw-r--r-- | gtk/gtkcssprovider.c | 11 | ||||
-rw-r--r-- | gtk/gtkcssproviderprivate.h | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c index 30881beda1..c8e76ff74b 100644 --- a/gtk/gtkcssprovider.c +++ b/gtk/gtkcssprovider.c @@ -1244,13 +1244,22 @@ gtk_css_provider_parsing_error (GtkCssProvider *provider, } } +/* This is exported privately for use in GtkInspector. + * It is the callers responsibility to reparse the current theme. + */ +void +gtk_css_provider_set_keep_css_sections (void) +{ + gtk_keep_css_sections = TRUE; +} + static void gtk_css_provider_class_init (GtkCssProviderClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); if (g_getenv ("GTK_CSS_DEBUG")) - gtk_keep_css_sections = TRUE; + gtk_css_provider_set_keep_css_sections (); /** * GtkCssProvider::parsing-error: diff --git a/gtk/gtkcssproviderprivate.h b/gtk/gtkcssproviderprivate.h index 807a205382..7a3777f648 100644 --- a/gtk/gtkcssproviderprivate.h +++ b/gtk/gtkcssproviderprivate.h @@ -28,6 +28,8 @@ void _gtk_css_provider_load_named (GtkCssProvider *provider, const gchar *name, const gchar *variant); +void gtk_css_provider_set_keep_css_sections (void); + G_END_DECLS #endif /* __GTK_CSS_PROVIDER_PRIVATE_H__ */ |