{
GtkWidget *rich_animation;
gchar buffer[2048];
-
+ gchar str[128];
//fprintf(stderr, "!!!!!!!plugin init \n");
Animation_WallpaperPrivate *priv = Animation_Wallpaper_HOME_PLUGIN_GET_PRIVATE (desktop_plugin);
fprintf(stderr, "!!!theme = %s\n", priv->theme);
+ snprintf(str, sizeof(str) - 1, "%s", "init_scene2");
+ fprintf(stderr, " str = %s\n", str);
priv->scene = NULL;
+#if 0
if (!strcmp(priv->theme,"Modern"))
init_scene(desktop_plugin);
else if (!strcmp(priv->theme,"Berlin"))
init_scene1(desktop_plugin);
else if (!strcmp(priv->theme, "Matrix"))
init_scene2(desktop_plugin);
+#endif
+ init_scene_theme(desktop_plugin);
+
priv->long_timer = g_timeout_add(LONG_TIMER, (GtkFunction)long_timeout, desktop_plugin);
/* TODO Move scene to priv */
//scene.timer_type = LONG_TIMER_TYPE;
{
fprintf(stderr,"Reload scene %s\n", desktop_plugin->priv->theme);
destroy_scene(desktop_plugin);
+#if 0
if (!strcmp(desktop_plugin->priv->theme,"Modern"))
init_scene(desktop_plugin);
else if (!strcmp(desktop_plugin->priv->theme,"Berlin"))
init_scene1(desktop_plugin);
else if (!strcmp(desktop_plugin->priv->theme,"Matrix"))
init_scene2(desktop_plugin);
+#endif
+ init_scene_theme(desktop_plugin);
}
void
}
+void
+init_scene_theme(AWallpaperPlugin *desktop_plugin)
+{
+ GHashTable * hash;
+ void (*func)(gpointer);
+ hash = g_hash_table_new(g_str_hash, g_str_equal);
+
+ g_hash_table_insert(hash, g_strdup("Berlin"), (gpointer)&init_scene1);
+ g_hash_table_insert(hash, g_strdup("Modern"), (gpointer)&init_scene);
+ g_hash_table_insert(hash, g_strdup("Matrix"), (gpointer)&init_scene2);
+
+ func = g_hash_table_lookup(hash, desktop_plugin->priv->theme);
+ if (func){
+ (*func)(desktop_plugin);
+ }
+}
void init_scene1(AWallpaperPlugin *desktop_plugin);
void run_long_timeout(AWallpaperPlugin *desktop_plugin);
void reload_scene(AWallpaperPlugin *desktop_plugin);
+void init_scene_theme(AWallpaperPlugin *desktop_plugin);
+
#endif