[gtk+/wip/683896: 2/4] cssprovider: Export gtk_css_provider_load_named) function
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/683896: 2/4] cssprovider: Export gtk_css_provider_load_named) function
- Date: Wed, 19 Sep 2012 14:51:10 +0000 (UTC)
commit 6e179644b3cac67da2e6e9c5480462b424dfeb8c
Author: Benjamin Otte <otte redhat com>
Date: Wed Sep 19 16:15:05 2012 +0200
cssprovider: Export gtk_css_provider_load_named) function
... and document it.
For now, the function is only exported internally.
gtk/gtkcssprovider.c | 22 +++++++++++++++++-----
gtk/gtkcssproviderprivate.h | 4 ++++
2 files changed, 21 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index b0defb7..0c418f8 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -2734,10 +2734,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;
@@ -2855,7 +2867,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 9a24254..807a205 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__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]