return result;
}
+
+/*******************************************************************************/
+#ifdef APPLICATION
+void
+fill_priv(Animation_WallpaperPrivate *priv)
+{
+ /* Load config */
+ read_config(priv);
+ /* Set function */
+ if (!strcmp(priv->theme, "Accel"))
+ priv->scene_func = (gpointer)&init_scene_Accel;
+ if (!strcmp(priv->theme, "Berlin"))
+ priv->scene_func = (gpointer)&init_scene_Berlin;
+ if (!strcmp(priv->theme, "Modern"))
+ priv->scene_func = (gpointer)&init_scene_Modern;
+ if (!strcmp(priv->theme, "Matrix"))
+ priv->scene_func = (gpointer)&init_scene_Matrix;
+ if (!strcmp(priv->theme, "Video"))
+ priv->scene_func = (gpointer)&init_scene_Video;
+
+ priv->extheme_list = get_list_exthemes();
+ GSList *store = priv->extheme_list;
+ while (store){
+ if (!strcmp(priv->theme, g_hash_table_lookup(store->data, "name"))){
+ priv->scene_func = (gpointer)&init_scene_External;
+ priv->hash_theme = store->data;
+ break;
+ }
+ store = g_slist_next(store);
+ }
+
+}
+#endif
/*******************************************************************************/
gint
read_config(Animation_WallpaperPrivate *priv) {
#define GCONF_KEY_THEME GCONF_KEY_PREFIX"/theme"
#define GCONF_KEY_RANIMATION GCONF_KEY_PREFIX"/rich_animation"
#define GCONF_KEY_ADDIONAL_STRING_1 GCONF_KEY_PREFIX"/additional_string_1"
+void init_scene_Modern(AWallpaperPlugin *desktop_plugin);
+void init_scene_Berlin(AWallpaperPlugin *desktop_plugin);
+void init_scene_Matrix(AWallpaperPlugin *desktop_plugin);
+void init_scene_Accel(AWallpaperPlugin *desktop_plugin);
+void init_scene_Video(AWallpaperPlugin *desktop_plugin);
+void init_scene_External(AWallpaperPlugin *desktop_plugin);
+void init_scene_theme(AWallpaperPlugin *desktop_plugin);
gint read_config(Animation_WallpaperPrivate *priv);
void save_config(Animation_WallpaperPrivate *priv);
+void fill_priv(Animation_WallpaperPrivate *priv);
gint current_active_view(void);
#endif
else
priv->visible = FALSE;
- /* Load config */
- read_config(priv);
- /* Set function */
- if (!strcmp(priv->theme, "Accel"))
- priv->scene_func = (gpointer)&init_scene_Accel;
- if (!strcmp(priv->theme, "Berlin"))
- priv->scene_func = (gpointer)&init_scene_Berlin;
- if (!strcmp(priv->theme, "Modern"))
- priv->scene_func = (gpointer)&init_scene_Modern;
- if (!strcmp(priv->theme, "Matrix"))
- priv->scene_func = (gpointer)&init_scene_Matrix;
- if (!strcmp(priv->theme, "Video"))
- priv->scene_func = (gpointer)&init_scene_Video;
+ fill_priv(priv);
- priv->extheme_list = get_list_exthemes();
- GSList *store = priv->extheme_list;
- while (store){
- if (!strcmp(priv->theme, g_hash_table_lookup(store->data, "name"))){
- priv->scene_func = (gpointer)&init_scene_External;
- priv->hash_theme = store->data;
- break;
- }
- store = g_slist_next(store);
- }
/* Initialize DBUS */
livewp_initialize_dbus(priv);
set_live_bg(GDK_WINDOW_XDISPLAY (main_widget->window), GDK_WINDOW_XID (main_widget->window), view);
void
destroy_scene(AWallpaperPlugin *desktop_plugin)
{
+ int status = 0;
+
if (desktop_plugin->priv->scene){
GSList * tmp = desktop_plugin->priv->scene->actors;
while (tmp != NULL){
desktop_plugin->priv->pipeline = NULL;
}
if (desktop_plugin->priv->podpid > 1){
+ fprintf(stderr, "rrrrrrr\n");
kill (desktop_plugin->priv->podpid, SIGTERM);
+ while (TRUE){
+ if (wait(&status) == desktop_plugin->priv->podpid)
+ break;
+ }
desktop_plugin->priv->podpid = -1;
+ desktop_plugin->priv->running = FALSE;
}
}
/*******************************************************************************/
void
reload_scene(AWallpaperPlugin *desktop_plugin)
{
- /* fprintf(stderr,"Reload scene %s\n", desktop_plugin->priv->theme); */
+ fprintf(stderr,"Reload scene %s\n", desktop_plugin->priv->theme);
destroy_scene(desktop_plugin);
+ fill_priv(desktop_plugin->priv);
init_scene_theme(desktop_plugin);
}
/*******************************************************************************/