done matrix slowly, finished init_scene_theme
authortanya <tanya@tanin.oblgaz>
Mon, 3 May 2010 12:28:50 +0000 (15:28 +0300)
committertanya <tanya@tanin.oblgaz>
Mon, 3 May 2010 12:28:50 +0000 (15:28 +0300)
applet/src/livewp-actor.c
applet/src/livewp-common.h
applet/src/livewp-home-widget.c
applet/src/livewp-scene.c
applet/src/livewp-scene.h

index cb4e9b0..ce92008 100644 (file)
@@ -459,31 +459,31 @@ change_signal(Actor * actor, AWallpaperPlugin *desktop_plugin)
 void
 change_layer(Actor * actor, AWallpaperPlugin *desktop_plugin)
 {
-    gint y;
+    gint y, speed1 = 8, speed2 = 16;
     Actor *a;
 
     if (!desktop_plugin->priv->rich_animation) return;
 
     a = g_ptr_array_index(actor->child, 0);
-    y = a->y + 10;
+    y = a->y + speed1;
     if (y > 480) y = -480;
     set_actor_position(a, a->x, y, a->z, desktop_plugin);
     a->y = y;
     
     a = g_ptr_array_index(actor->child, 1);
-    y = a->y + 10;
+    y = a->y + speed1;
     if (y > 480) y = -480;
     set_actor_position(a, a->x, y, a->z, desktop_plugin);
     a->y = y;
 
     a = g_ptr_array_index(actor->child, 2);
-    y = a->y + 20;
+    y = a->y + speed2;
     if (y > 480) y = -480;
     set_actor_position(a, a->x, y, a->z, desktop_plugin);
     a->y = y;
 
     a = g_ptr_array_index(actor->child, 3);
-    y = a->y + 20;
+    y = a->y + speed2;
     if (y > 480) y = -480;
     set_actor_position(a, a->x, y, a->z, desktop_plugin);
     a->y = y;
index c23a440..a8bfddc 100644 (file)
@@ -81,6 +81,7 @@ struct _Animation_WallpaperPrivate
     gint xapplet;
     gint yapplet;
     Scene *scene;
+    GHashTable * hash_scene_func;
 };
 
 struct _AWallpaperPlugin
index 88e0ba5..d5c7e9b 100644 (file)
@@ -405,6 +405,13 @@ animation_wallpaper_plugin_init (AWallpaperPlugin *desktop_plugin)
     priv->short_timer = 0;
     priv->xapplet = 0;
     priv->yapplet = 0;
+//#if 0 
+    priv->hash_scene_func = g_hash_table_new(g_str_hash, g_str_equal);
+    
+    g_hash_table_insert(priv->hash_scene_func, g_strdup("Berlin"), (gpointer)&init_scene_Berlin);
+    g_hash_table_insert(priv->hash_scene_func, g_strdup("Modern"), (gpointer)&init_scene_Modern);
+    g_hash_table_insert(priv->hash_scene_func, g_strdup("Matrix"), (gpointer)&init_scene_Matrix);
+//#endif
     //priv->theme = g_strdup("Modern");
     desktop_plugin->priv->main_widget = gtk_fixed_new();
 
@@ -447,11 +454,11 @@ animation_wallpaper_plugin_init (AWallpaperPlugin *desktop_plugin)
     priv->scene = NULL;
 #if 0
     if (!strcmp(priv->theme,"Modern"))
-        init_scene(desktop_plugin);
+        init_scene_Modern(desktop_plugin);
     else if (!strcmp(priv->theme,"Berlin")) 
-        init_scene1(desktop_plugin);
+        init_scene_Berlin(desktop_plugin);
     else if (!strcmp(priv->theme, "Matrix"))
-        init_scene2(desktop_plugin);
+        init_scene_Matrix(desktop_plugin);
 #endif
     init_scene_theme(desktop_plugin);
         
index 914df70..3cf4667 100644 (file)
@@ -47,17 +47,17 @@ reload_scene(AWallpaperPlugin *desktop_plugin)
     destroy_scene(desktop_plugin);
 #if 0
     if (!strcmp(desktop_plugin->priv->theme,"Modern"))
-        init_scene(desktop_plugin);
+        init_scene_Modern(desktop_plugin);
     else if (!strcmp(desktop_plugin->priv->theme,"Berlin")) 
-        init_scene1(desktop_plugin);
+        init_scene_Berlin(desktop_plugin);
     else if (!strcmp(desktop_plugin->priv->theme,"Matrix")) 
-        init_scene2(desktop_plugin);
+        init_scene_Matrix(desktop_plugin);
 #endif
     init_scene_theme(desktop_plugin);
 }
 
 void
-init_scene2(AWallpaperPlugin *desktop_plugin)
+init_scene_Matrix(AWallpaperPlugin *desktop_plugin)
 {
   Actor *actor;
   Scene *scene;
@@ -142,7 +142,7 @@ init_scene2(AWallpaperPlugin *desktop_plugin)
 
 /* Init Modern Scene */
 void
-init_scene(AWallpaperPlugin *desktop_plugin)
+init_scene_Modern(AWallpaperPlugin *desktop_plugin)
 {
   Actor *actor;
   Scene *scene;
@@ -459,7 +459,7 @@ init_scene(AWallpaperPlugin *desktop_plugin)
 
 /* Init Berlin Scene */
 void
-init_scene1(AWallpaperPlugin *desktop_plugin)
+init_scene_Berlin(AWallpaperPlugin *desktop_plugin)
 {
   Actor *actor, *actor1, *actor2;
   Scene *scene;
@@ -630,15 +630,8 @@ init_scene1(AWallpaperPlugin *desktop_plugin)
 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);
+    func = g_hash_table_lookup(desktop_plugin->priv->hash_scene_func, desktop_plugin->priv->theme);
     if (func){
         (*func)(desktop_plugin);
     }
index 13035e7..303233e 100644 (file)
 
 void destroy_scene(AWallpaperPlugin *desktop_plugin);
 void reload_scene(AWallpaperPlugin *desktop_plugin);
-void init_scene2(AWallpaperPlugin *desktop_plugin);
-void init_scene(AWallpaperPlugin *desktop_plugin);
-void init_scene1(AWallpaperPlugin *desktop_plugin);
 void run_long_timeout(AWallpaperPlugin *desktop_plugin);
 void reload_scene(AWallpaperPlugin *desktop_plugin);
+void init_scene_Modern(AWallpaperPlugin *desktop_plugin);
+void init_scene_Berlin(AWallpaperPlugin *desktop_plugin);
+void init_scene_Matrix(AWallpaperPlugin *desktop_plugin);
 void init_scene_theme(AWallpaperPlugin *desktop_plugin);
 
 #endif