From 8412b04e1562d7edf67ce011d57bc96852728daf Mon Sep 17 00:00:00 2001 From: tanya Date: Mon, 3 May 2010 15:28:50 +0300 Subject: [PATCH] done matrix slowly, finished init_scene_theme --- applet/src/livewp-actor.c | 10 +++++----- applet/src/livewp-common.h | 1 + applet/src/livewp-home-widget.c | 13 ++++++++++--- applet/src/livewp-scene.c | 21 +++++++-------------- applet/src/livewp-scene.h | 6 +++--- 5 files changed, 26 insertions(+), 25 deletions(-) diff --git a/applet/src/livewp-actor.c b/applet/src/livewp-actor.c index cb4e9b0..ce92008 100644 --- a/applet/src/livewp-actor.c +++ b/applet/src/livewp-actor.c @@ -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; diff --git a/applet/src/livewp-common.h b/applet/src/livewp-common.h index c23a440..a8bfddc 100644 --- a/applet/src/livewp-common.h +++ b/applet/src/livewp-common.h @@ -81,6 +81,7 @@ struct _Animation_WallpaperPrivate gint xapplet; gint yapplet; Scene *scene; + GHashTable * hash_scene_func; }; struct _AWallpaperPlugin diff --git a/applet/src/livewp-home-widget.c b/applet/src/livewp-home-widget.c index 88e0ba5..d5c7e9b 100644 --- a/applet/src/livewp-home-widget.c +++ b/applet/src/livewp-home-widget.c @@ -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); diff --git a/applet/src/livewp-scene.c b/applet/src/livewp-scene.c index 914df70..3cf4667 100644 --- a/applet/src/livewp-scene.c +++ b/applet/src/livewp-scene.c @@ -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); } diff --git a/applet/src/livewp-scene.h b/applet/src/livewp-scene.h index 13035e7..303233e 100644 --- a/applet/src/livewp-scene.h +++ b/applet/src/livewp-scene.h @@ -36,11 +36,11 @@ 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 -- 1.7.9.5