#define LIVEWP_SIGNAL_RELOAD_CONFIG_PATH "/org/maemo/livewp/reload_config"
#define LIVEWP_RELOAD_CONFIG "reload_config"
#define LIVEWP_RELOAD_PLUGIN "reload_plugin"
+#define LIVEWP_STOP_LIVEBG_ON_VIEW0 "stop_livebg_on_view0"
+#define LIVEWP_STOP_LIVEBG_ON_VIEW1 "stop_livebg_on_view1"
+#define LIVEWP_STOP_LIVEBG_ON_VIEW2 "stop_livebg_on_view2"
+#define LIVEWP_STOP_LIVEBG_ON_VIEW3 "stop_livebg_on_view3"
/* For DBUS notification */
#define NOTIFY_SIGNAL_INTERFACE "org.freedesktop.Notifications"
START_FUNCTION;
#endif
- /*fprintf (stderr, "PATH11111111111111111111 %s %s %s\n", dbus_message_get_path(msg), dbus_message_get_interface (msg), dbus_message_get_member (msg));*/
+ fprintf (stderr, "PATH11111111111111111111 %s %s %s\n", dbus_message_get_path(msg), dbus_message_get_interface (msg), dbus_message_get_member (msg));
if (dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_RELOAD_CONFIG)){
if(read_config(priv)){
fprintf(stderr, "\nCan not read config file.\n");
#endif
}
}
+#if defined APPLICATION
+ fprintf(stderr, "VIEW %i\n", priv->view);
+ if ((priv->view == 0 && dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_STOP_LIVEBG_ON_VIEW0))||
+ (priv->view == 1 && dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_STOP_LIVEBG_ON_VIEW1))||
+ (priv->view == 2 && dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_STOP_LIVEBG_ON_VIEW2))||
+ (priv->view == 3 && dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_STOP_LIVEBG_ON_VIEW3))){
+
+ quit_from_program(priv);
+ }
+#endif
//fprintf(stderr, "Type %i\n", dbus_message_get_type (msg));
if (dbus_message_is_method_call(msg, NOTIFY_SIGNAL_INTERFACE, NOTIFY_MEMBER)){
//fprintf(stderr,"read notifications.db notify\n");
XA_INTEGER, 32, PropModeReplace,
(unsigned char *) &mode, 1);
}
+void
+quit_from_program (Animation_WallpaperPrivate *priv)
+{
+
+ if (priv){
+ livewp_deinitialize_dbus(priv);
+ fprintf(stderr,"Quit from LiveWallpaper \n");
+ if (priv->long_timer){
+ g_source_remove(priv->long_timer);
+ priv->long_timer = 0;
+ }
+ if (priv->short_timer){
+ g_source_remove(priv->short_timer);
+ priv->short_timer = 0;
+ }
+ destroy_scene(priv->desktop_plugin);
+ }
+ gtk_main_quit();
+}
int
main(int argc, char *argv[])
int view = 0;
- if (argc == 2)
+ if (argc == 2)
view = atoi(argv[1]);
fprintf(stderr,"VIEW %i\n", view);
if (view < 0 || view > 3)
priv->window = main_widget;
priv->view = view;
- desktop_plugin->priv->visible = TRUE;
+ priv->visible = TRUE;
/* Load config */
read_config(priv);
/* Initialize DBUS */
livewp_initialize_dbus(priv);
- set_live_bg(GDK_WINDOW_XDISPLAY (main_widget->window), GDK_WINDOW_XID (main_widget->window), view);
+ set_live_bg(GDK_WINDOW_XDISPLAY (main_widget->window), GDK_WINDOW_XID (main_widget->window), view + 1);
init_scene_theme(desktop_plugin);
priv->long_timer = g_timeout_add(LONG_TIMER, (GtkFunction)long_timeout, desktop_plugin);
-
-
-
- gtk_main();
+ gtk_main();
return 0;
}