diff libpurple/theme-loader.h @ 32728:5050da3d9c95

Add a directory probe to theme loaders. The default just checks for $dir/purple/$type as the theme manager currently does.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 03 Mar 2012 06:39:49 +0000
parents 4d92a431d0a1
children
line wrap: on
line diff
--- a/libpurple/theme-loader.h	Tue Feb 28 07:10:15 2012 +0000
+++ b/libpurple/theme-loader.h	Sat Mar 03 06:39:49 2012 +0000
@@ -56,6 +56,7 @@
 {
 	GObjectClass parent_class;
 	PurpleTheme *((*purple_theme_loader_build)(const gchar*));
+	gboolean (*probe_directory)(const gchar *);
 };
 
 /**************************************************************************/
@@ -88,5 +89,19 @@
  */
 PurpleTheme *purple_theme_loader_build(PurpleThemeLoader *loader, const gchar *dir);
 
+/**
+ * Probes a directory to see if it might possibly contain a theme
+ *
+ * This function might only check for obvious files or directory structure.
+ * Loading of a theme may fail for other reasons.
+ * The default prober checks for $dir/purple/$type.
+ *
+ * @param loader The theme loader
+ * @param dir    The directory that may contain the theme
+ *
+ * @returns TRUE if the directory appears to contain a theme, FALSE otherwise.
+ */
+gboolean purple_theme_loader_probe(PurpleThemeLoader *loader, const gchar *dir);
+
 G_END_DECLS
 #endif /* PURPLE_THEME_LOADER_H */