fixed structure of code
[livewp] / applet / src / livewp-home-widget.c
index d971cfa..4d5a088 100644 (file)
@@ -26,7 +26,6 @@
 #include "livewp-home-widget.h"
 #include <gconf/gconf-client.h>
 #include "livewp-rules.h"
-#include "livewp-multiactor.h"
 
 #define PLUGIN_NAME "livewp-home-widget.desktop-0"
 #define GCONF_KEY_POSITION "/apps/osso/hildon-desktop/applets/%s/position"
@@ -150,7 +149,7 @@ init_applet_position(void)
   g_object_unref(gconf_client);
 }
 
-static void
+void
 actor_set_position_full(GtkWidget *actor, gint x, gint y, gint z)
 {
  fprintf(stderr, "actor_set_position_full\n");
@@ -261,11 +260,22 @@ get_sun_screen_pos(double alt, double azm, gint * x, gint * y)
 
 void change_multiactor()
 {
-    fprintf(stderr, "change multiactotr p=%p name= %s x=%d\n", ma1, ma1->name, ma1->x);
     gboolean fl;
+    double scale;
+    gint x, y, z;
     if (ma1->visible) fl = FALSE;
     else fl = TRUE;
-    multiactor_set_visible(ma1, fl);
+    //multiactor_set_visible(ma1, fl);
+
+    scale = ma1->scale;
+    scale -= 0.1;
+    if (scale == 0) scale = 1;
+    //multiactor_set_scale(ma1, scale);
+
+    x = ma1->x + 10;
+    y = ma1->y + 10;
+    multiactor_set_position(ma1, x, y, 0);
+
 }
 
 static void 
@@ -398,6 +408,16 @@ plugin_on_timeout (gpointer data)
 }
 
 static void
+desktop_plugin_visible_notify (GObject    *object,
+                                          GParamSpec *spec,
+                                          AWallpaperPlugin *desktop_plugin)
+{
+      gboolean visible;
+      g_object_get (object, "is-on-current-desktop", &visible, NULL);
+      fprintf (stderr, "is-on-current-desktop changed. visible: %u", visible);
+}
+
+static void
 animation_wallpaper_plugin_init (AWallpaperPlugin *desktop_plugin)
 {
   GtkWidget *label;
@@ -407,6 +427,9 @@ animation_wallpaper_plugin_init (AWallpaperPlugin *desktop_plugin)
   hd_home_plugin_item_set_settings (HD_HOME_PLUGIN_ITEM (desktop_plugin), TRUE);
   g_signal_connect (desktop_plugin, "show-settings",
                             G_CALLBACK (live_wallpaper_settings), NULL);
+  g_signal_connect (desktop_plugin, "notify::is-on-current-desktop",
+                     G_CALLBACK (desktop_plugin_visible_notify), desktop_plugin);
+
   gtk_container_add (GTK_CONTAINER (desktop_plugin), label);
   init_applet_position();
   init_scene(desktop_plugin);