done hildon abstraction
authortanya <tanya@moshkanov.oblgaz>
Tue, 27 Apr 2010 19:12:31 +0000 (22:12 +0300)
committertanya <tanya@moshkanov.oblgaz>
Tue, 27 Apr 2010 19:12:31 +0000 (22:12 +0300)
applet/src/livewp-home-widget.c
applet/src/livewp-home-widget.h

index 393673b..f9f1a20 100644 (file)
@@ -386,7 +386,8 @@ change_tram(Actor * actor, AWallpaperPlugin *desktop_plugin)
     scale = path_line(scale0, scale1, t);
     //fprintf(stderr, "change tram t=%f x=%d y=%d scale=%d\n", t, x, y, scale);
     actor_set_position_full(actor->widget, x, y, actor->z);
-    hildon_animation_actor_set_scale(HILDON_ANIMATION_ACTOR(actor->widget), (double)scale/100, (double)scale/100);
+    //hildon_animation_actor_set_scale(HILDON_ANIMATION_ACTOR(actor->widget), (double)scale/100, (double)scale/100);
+    set_actor_scale(actor, (double)scale/100, (double)scale/100);
     if (t >= 1){
         /* stop animation */
         actor->visible = FALSE;
@@ -536,7 +537,8 @@ change_cloud(Actor *actor, AWallpaperPlugin *desktop_plugin)
 
     //fprintf(stderr, "change cloud t=%f x=%d y=%d scale=%d\n", t, x, y, scale);
     actor_set_position_full(actor->widget, x, y, actor->z);
-    hildon_animation_actor_set_scale(HILDON_ANIMATION_ACTOR(actor->widget), (double)scale/100, (double)scale/100);
+    //hildon_animation_actor_set_scale(HILDON_ANIMATION_ACTOR(actor->widget), (double)scale/100, (double)scale/100);
+    set_actor_scale(actor, (double)scale/100, (double)scale/100);
     if ((y < y1 || y > y0) || t >= 1){
         /* stop animation */
         actor->visible = FALSE;
@@ -581,10 +583,11 @@ change_window1(Actor * actor, AWallpaperPlugin *desktop_plugin)
         actor->visible = TRUE;
     else 
         actor->visible = FALSE;
-    hildon_animation_actor_set_show(
-            HILDON_ANIMATION_ACTOR(actor->widget), 
-            actor->visible
-    );
+    //hildon_animation_actor_set_show(
+      //      HILDON_ANIMATION_ACTOR(actor->widget), 
+        //    actor->visible
+    //);
+    set_actor_visible(actor, actor->visible);
     actor->time_start_animation = now + fast_rnd(60) + 10;
 
 }
@@ -613,7 +616,8 @@ change_signal(Actor * actor, AWallpaperPlugin *desktop_plugin)
         a->visible = FALSE;
     else 
         a->visible = TRUE;
-    hildon_animation_actor_set_show (HILDON_ANIMATION_ACTOR(a->widget), a->visible);
+    //hildon_animation_actor_set_show (HILDON_ANIMATION_ACTOR(a->widget), a->visible);
+    set_actor_visible(a, a->visible);
     
     a = g_ptr_array_index(actor->child, 1);
     //fprintf(stderr, "actor name= %s \n", child->name);
@@ -621,12 +625,29 @@ change_signal(Actor * actor, AWallpaperPlugin *desktop_plugin)
         a->visible = FALSE;
     else 
         a->visible = TRUE;
-    hildon_animation_actor_set_show (HILDON_ANIMATION_ACTOR(a->widget), a->visible);
+    //hildon_animation_actor_set_show (HILDON_ANIMATION_ACTOR(a->widget), a->visible);
+    set_actor_visible(a, a->visible);
 
     actor->time_start_animation = now + fast_rnd(30) + 10;
 }
 
 void
+set_actor_scale(Actor *actor, double scalex, double scaley)
+{
+    hildon_animation_actor_set_scale(
+            HILDON_ANIMATION_ACTOR(actor->widget), 
+            scalex, 
+            scaley
+    );
+
+}
+
+void 
+set_actor_visible(Actor *actor, gboolean visible)
+{
+    hildon_animation_actor_set_show(HILDON_ANIMATION_ACTOR(actor->widget), visible);
+}
+void
 create_hildon_actor(Actor *actor, AWallpaperPlugin *desktop_plugin) 
 {
   GtkWidget *ha = NULL;
@@ -658,7 +679,7 @@ create_hildon_actor(Actor *actor, AWallpaperPlugin *desktop_plugin)
   realize(ha);
   gtk_widget_show_all(ha);
   hildon_animation_actor_set_show (HILDON_ANIMATION_ACTOR(ha), actor->visible);
-
+  
   /* TO DO check it */
   /*  gdk_flush (); */
 
index f788dd2..e5895f5 100644 (file)
@@ -78,6 +78,8 @@ void run_long_timeout(AWallpaperPlugin *desktop_plugin);
 static void init_scene(AWallpaperPlugin *desktop_plugin);
 static void init_scene1(AWallpaperPlugin *desktop_plugin);
 static void init_scene2(AWallpaperPlugin *desktop_plugin);
+void set_actor_visible(Actor *actor, gboolean visible);
+void set_actor_scale(Actor *actor, double scalex, double scaley);
 void create_hildon_actor(Actor *actor, AWallpaperPlugin *desktop_plugin);
 void get_sun_screen_pos(double alt, double azm, gint * x, gint * y);
 void show_settings(GtkWidget *widget, Animation_WallpaperPrivate *priv);