diff options
author | Benjamin Otte <otte@redhat.com> | 2012-09-19 16:15:05 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-10-31 11:09:09 +0100 |
commit | 738b453c66b0135c665289b9ffe2b26181cf77dc (patch) | |
tree | 0c208a7695aecdf676c4def827d377f9cccf64d4 | |
parent | 9c9d82f1a92794cb1d42c647e1232ff79f7e1868 (diff) | |
download | gtk+-738b453c66b0135c665289b9ffe2b26181cf77dc.tar.gz |
cssprovider: Export gtk_css_provider_load_named) function
... and document it.
For now, the function is only exported internally.
-rw-r--r-- | gtk/gtkcssprovider.c | 22 | ||||
-rw-r--r-- | gtk/gtkcssproviderprivate.h | 4 |
2 files changed, 21 insertions, 5 deletions
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c index 203b90252e..92506ee6d2 100644 --- a/gtk/gtkcssprovider.c +++ b/gtk/gtkcssprovider.c @@ -2692,10 +2692,22 @@ _gtk_css_provider_get_theme_dir (void) return path; } -static void -gtk_css_provider_load_named (GtkCssProvider *provider, - const gchar *name, - const gchar *variant) +/** + * _gtk_css_provider_load_named: + * @provider: a #GtkCssProvider + * @name: A theme name + * @variant: (allow-none): variant to load, for example, "dark", or + * %NULL for the default + * + * Loads a theme from the usual theme paths. The actual process of + * finding the theme might change between releases, but it is + * guaranteed that this function uses the same mechanism to load the + * theme than GTK uses for loading its own theme. + **/ +void +_gtk_css_provider_load_named (GtkCssProvider *provider, + const gchar *name, + const gchar *variant) { gchar *subpath, *path; gchar *resource_path; @@ -2813,7 +2825,7 @@ gtk_css_provider_get_named (const gchar *name, if (!provider) { provider = gtk_css_provider_new (); - gtk_css_provider_load_named (provider, name, variant); + _gtk_css_provider_load_named (provider, name, variant); g_hash_table_insert (themes, g_strdup (key), provider); } diff --git a/gtk/gtkcssproviderprivate.h b/gtk/gtkcssproviderprivate.h index 9a242547a8..807a205382 100644 --- a/gtk/gtkcssproviderprivate.h +++ b/gtk/gtkcssproviderprivate.h @@ -24,6 +24,10 @@ G_BEGIN_DECLS gchar *_gtk_css_provider_get_theme_dir (void); +void _gtk_css_provider_load_named (GtkCssProvider *provider, + const gchar *name, + const gchar *variant); + G_END_DECLS #endif /* __GTK_CSS_PROVIDER_PRIVATE_H__ */ |