[glide] Start to implement some theme loading



commit 8a21a8a908bb2fabb54a7972d9eafe1b95db3380
Author: Robert Carr <racarr Valentine localdomain>
Date:   Tue May 25 13:49:42 2010 -0400

    Start to implement some theme loading

 libglide/glide-theme-manager.c |   18 ++++++++++++++++++
 libglide/glide-theme-manager.h |    1 +
 2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/libglide/glide-theme-manager.c b/libglide/glide-theme-manager.c
index ecae77d..3de6ba5 100644
--- a/libglide/glide-theme-manager.c
+++ b/libglide/glide-theme-manager.c
@@ -27,6 +27,24 @@
 #include "glide-debug.h"
 
 static GList *themes = NULL;
+static GHashTable *loaded_themes = NULL;
+
+GlideTheme *
+glide_theme_manager_get_theme (const gchar *theme_path)
+{
+  GlideTheme *ret;
+  
+  if (G_UNLIKELY (loaded_themes == NULL))
+    loaded_themes = g_hash_table_new (g_str_hash, g_direct_equal);
+
+  if (ret = g_hash_table_lookup (loaded_themes, theme_path)){}
+  else
+    {
+      ret  = glide_theme_new (theme_path);
+      g_hash_table_insert (loaded_themes, (gpointer)theme_path, (gpointer)ret);
+    }
+  return ret;
+}
 
 void
 glide_theme_manager_refresh_theme_list ()
diff --git a/libglide/glide-theme-manager.h b/libglide/glide-theme-manager.h
index 56453ed..c6ff510 100644
--- a/libglide/glide-theme-manager.h
+++ b/libglide/glide-theme-manager.h
@@ -24,6 +24,7 @@
 
 G_BEGIN_DECLS
 
+GlideTheme *glide_theme_manager_get_theme (const gchar *theme_path);
 void glide_theme_manager_refresh_theme_list ();
 
 G_END_DECLS



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