try to add settings button
[livewp] / applet / src / livewp-home-widget.c
index ec87d5f..1be14c4 100644 (file)
@@ -1,4 +1,4 @@
-/* vim: set sw=4 ts=4 et: */
+/*vim: set sw=4 ts=4 et: */
 /*
  * This file is part of Live Wallpaper (livewp)
  * 
@@ -170,7 +170,7 @@ path_line(gint x0, gint x1, double t)
 void
 destroy_hildon_actor(Actor *actor)
 {
-    fprintf(stderr, "destroy_hildon_actor %s\n",actor->name);
+    //fprintf(stderr, "destroy_hildon_actor %s\n",actor->name);
     gtk_widget_destroy(actor->widget);
     actor->widget = NULL;
 }
@@ -250,6 +250,7 @@ gint
 probability_plane()
 {
     return (fast_rnd(10) + 1) * 60;
+//    return 0;
 }
 
 void 
@@ -326,6 +327,7 @@ change_tram(Actor * actor, AWallpaperPlugin *desktop_plugin)
     long sec;
     double t;
 
+    //fprintf(stderr, "change tram\n");
     gettimeofday(&tvb, NULL);
     
     ms = tvb.tv_usec;
@@ -461,7 +463,9 @@ change_cloud(Actor *actor, AWallpaperPlugin *desktop_plugin)
     suseconds_t ms;
     long sec;
     double t;
+    gchar *newfile;
 
+    //fprintf(stderr, "change cloud\n");
     gettimeofday(&tvb, NULL);
     
     ms = tvb.tv_usec;
@@ -470,10 +474,16 @@ change_cloud(Actor *actor, AWallpaperPlugin *desktop_plugin)
    
     if (!actor->visible){
         actor->visible = TRUE;
-        if (scene.daytime == TIME_NIGHT)
-            actor->filename = actor->filename;
-        else
-            actor->filename = actor->filename;
+        if (scene.daytime == TIME_NIGHT){
+            newfile = g_strdup_printf("%s_dark.png", actor->name);
+        }else{
+            newfile = g_strdup_printf("%s.png", actor->name);
+        } 
+        if (actor->filename)
+            g_free(actor->filename);
+        actor->filename = newfile;
+         
+
         create_hildon_actor(actor, desktop_plugin);
     }
     t = (double)((double)sec+(double)ms/1000000 - actor->time_start_animation) / actor->duration_animation;
@@ -511,7 +521,7 @@ change_wind(Actor *actor, AWallpaperPlugin *desktop_plugin)
     if (scene.wind_orientation == 0) scene.wind_orientation = -1;
     scene.wind_angle = (double)(fast_rnd(200) - 100) / 100;
     actor->time_start_animation = time(NULL) + (fast_rnd(10) + 10) * 60;
-    fprintf(stderr, "change wind orient = %d angle = %f after = %d\n", scene.wind_orientation, scene.wind_angle, actor->time_start_animation-time(NULL));
+    //fprintf(stderr, "change wind orient = %d angle = %f after = %d\n", scene.wind_orientation, scene.wind_angle, actor->time_start_animation-time(NULL));
 }
 
 void 
@@ -519,7 +529,6 @@ change_window1(Actor * actor, AWallpaperPlugin *desktop_plugin)
 {
     
     gint now = time(NULL);
-
     if (scene.daytime == TIME_DAY){
         if (actor->visible){
             actor->visible = FALSE;
@@ -535,15 +544,31 @@ change_window1(Actor * actor, AWallpaperPlugin *desktop_plugin)
     if (!actor->visible){
         actor->visible = TRUE;
         create_hildon_actor(actor, desktop_plugin);
-        actor->time_start_animation = now + fast_rnd(20) + 10;
+        actor->time_start_animation = now + fast_rnd(60) + 10;
     }else {
         actor->visible = FALSE;
         destroy_hildon_actor(actor);
-        actor->time_start_animation = now + fast_rnd(20) + 10;
+        actor->time_start_animation = now + fast_rnd(60) + 10;
     }
    
 }
 
+void 
+change_signal(Actor * actor, AWallpaperPlugin *desktop_plugin)
+{
+    gchar *newfile;
+    gint now = time(NULL);
+    newfile = g_strdup_printf("%s%d.png", actor->name, scene.daytime); 
+    if (!strcmp(actor->filename, "red.png"))
+        newfile = g_strdup_printf("%s", "green.png");
+    else 
+        newfile = g_strdup_printf("%s", "red.png");
+    g_free(actor->filename);
+    actor->filename = newfile;
+    change_hildon_actor(actor, desktop_plugin);
+    actor->time_start_animation = now + fast_rnd(30) + 10;
+}
+
 void
 create_hildon_actor(Actor *actor, AWallpaperPlugin *desktop_plugin) 
 {
@@ -649,7 +674,46 @@ change_static_actor(Actor * actor, AWallpaperPlugin *desktop_plugin)
     change_hildon_actor(actor, desktop_plugin);
 }
 
+void 
+change_static_actor_with_corner(Actor * actor, AWallpaperPlugin *desktop_plugin)
+{
+    gchar *newfile;
+    gchar           buffer[2048];
 
+    if (desktop_plugin->priv->right_corner)
+        gtk_widget_destroy(desktop_plugin->priv->right_corner);
+    snprintf(buffer, sizeof(buffer) - 1, "%s/%s/town%i_right_corner.png", \
+                                  THEME_PATH, desktop_plugin->priv->theme, scene.daytime);
+    desktop_plugin->priv->right_corner = gtk_image_new_from_file (buffer);
+    if (desktop_plugin->priv->right_corner){
+        gtk_fixed_put(GTK_FIXED(desktop_plugin->priv->main_widget), desktop_plugin->priv->right_corner, 0, 0);
+        gtk_widget_show (desktop_plugin->priv->right_corner);
+    }
+    change_static_actor(actor, desktop_plugin);
+
+}
+
+void
+change_layer1(Actor * actor, AWallpaperPlugin *desktop_plugin)
+{
+    gint y;
+    y = actor->y + 10;
+    if (y > 480) y = -480;
+    //fprintf(stderr, "!! %s - %d\n", actor->name, y);
+    actor_set_position_full(actor->widget, actor->x, y, actor->z);
+    actor->y = y;
+}
+
+void
+change_layer2(Actor * actor, AWallpaperPlugin *desktop_plugin)
+{
+    gint y;
+    y = actor->y + 15;
+    if (y >= 480) y = -480;
+    //fprintf(stderr, "!! %s - %d\n", actor->name, y);
+    actor_set_position_full(actor->widget, actor->x, y, actor->z);
+    actor->y = y;
+}
 
 /*
 static gint 
@@ -688,9 +752,66 @@ reload_scene(AWallpaperPlugin *desktop_plugin)
         init_scene(desktop_plugin);
     else if (!strcmp(desktop_plugin->priv->theme,"Berlin")) 
         init_scene1(desktop_plugin);
+    else if (!strcmp(desktop_plugin->priv->theme,"Matrix")) 
+        init_scene2(desktop_plugin);
+
 }
 
+static void
+init_scene2(AWallpaperPlugin *desktop_plugin)
+{
+  Actor *actor;
+  gint now = time(NULL);
 
+  /* fprintf(stderr, "init scene \n");*/
+  scene.daytime = get_daytime();
+  scene.actors = NULL;
+
+  
+  actor = init_object(desktop_plugin, "background", "bg.png", 
+                      0, 0, 5, 800, 480, 
+                      TRUE, 100, 255, NULL, NULL);
+  scene.actors = g_slist_append(scene.actors, actor);
+
+  actor = init_object(desktop_plugin, "symbols", "symbols_without.png", 
+                      0, 0, 10, 800, 480, 
+                      TRUE, 100, 255, NULL, NULL);
+  scene.actors = g_slist_append(scene.actors, actor);
+
+  actor = init_object(desktop_plugin, "layer1", "layer1_2.png", 
+                      0, -480, 6, 800, 960, 
+                      TRUE, 100, 255, (gpointer)&change_layer1, NULL);
+  actor->time_start_animation = now;
+  actor->duration_animation = G_MAXINT;
+  scene.actors = g_slist_append(scene.actors, actor);
+
+  actor = init_object(desktop_plugin, "layer1", "layer1_1.png", 
+                      0, (-480 - 480), 7, 800, 960, 
+                      TRUE, 100, 255, (gpointer)&change_layer1, NULL);
+  actor->time_start_animation = now;
+  actor->duration_animation = G_MAXINT;
+  scene.actors = g_slist_append(scene.actors, actor);
+
+  actor = init_object(desktop_plugin, "layer2", "layer2_2.png", 
+                      0, -480, 8, 800, 960, 
+                      TRUE, 100, 255, (gpointer)&change_layer2, NULL);
+  actor->time_start_animation = now;
+  actor->duration_animation = G_MAXINT;
+  scene.actors = g_slist_append(scene.actors, actor);
+
+  actor = init_object(desktop_plugin, "layer2", "layer2_1.png", 
+                      0, (-480 - 480), 9, 800, 960, 
+                      TRUE, 100, 255, (gpointer)&change_layer2, NULL);
+  actor->time_start_animation = now;
+  actor->duration_animation = G_MAXINT;
+  scene.actors = g_slist_append(scene.actors, actor);
+
+
+    
+
+
+    run_long_timeout(desktop_plugin);
+}
 /* Init Modern Scene */
 static void
 init_scene(AWallpaperPlugin *desktop_plugin)
@@ -698,6 +819,7 @@ init_scene(AWallpaperPlugin *desktop_plugin)
   Actor *actor;
   gint now = time(NULL);
   gint i;
+  gint winds[13][2];
 
   /* fprintf(stderr, "init scene \n");*/
   scene.daytime = get_daytime();
@@ -728,13 +850,13 @@ init_scene(AWallpaperPlugin *desktop_plugin)
   actor = init_object(desktop_plugin, "cloud1", "cloud1.png", 0, fast_rnd(300)-97, 7, 150, 97, 
                       FALSE, 100, 255, (gpointer)&change_cloud, NULL);
   actor->time_start_animation = now + fast_rnd(180);
-  actor->duration_animation = 5*60;
+  actor->duration_animation = 3*60;
   scene.actors = g_slist_append(scene.actors, actor);
   
   actor = init_object(desktop_plugin, "cloud2", "cloud2.png", 0, fast_rnd(300)-75, 7, 188, 75, 
                       FALSE, 100, 255, (gpointer)&change_cloud, NULL);
   actor->time_start_animation = now + fast_rnd(180);
-  actor->duration_animation = 5*60;
+  actor->duration_animation = 3*60;
   scene.actors = g_slist_append(scene.actors, actor);
 
   actor = init_object(desktop_plugin, "cloud4", "cloud4.png", 0, fast_rnd(300)-75, 7, 150, 75, 
@@ -751,13 +873,13 @@ init_scene(AWallpaperPlugin *desktop_plugin)
 
   actor = init_object(desktop_plugin, "tram", "tram.png", -300, 225, 9, 350, 210, 
                       FALSE, 100, 255, (gpointer)&change_tram, NULL);
-  actor->time_start_animation = time(NULL) + fast_rnd(60);
+  actor->time_start_animation = time(NULL) + fast_rnd(10); 
   actor->duration_animation = 60;
   scene.actors = g_slist_append(scene.actors, actor);
 
   actor = init_object(desktop_plugin, "border", "border0.png", 0, 480-79, 10, 800, 79,
-                      TRUE, 100, 255, (gpointer)&change_static_actor, NULL);
-  change_static_actor(actor, desktop_plugin);
+                      TRUE, 100, 255, (gpointer)&change_static_actor_with_corner, NULL);
+  change_static_actor_with_corner(actor, desktop_plugin);
   scene.actors = g_slist_append(scene.actors, actor);
   
   actor = init_object(desktop_plugin, "moon", "moon1.png", 400, 20, 6, 60, 60, 
@@ -771,7 +893,6 @@ init_scene(AWallpaperPlugin *desktop_plugin)
   scene.actors = g_slist_append(scene.actors, actor);
 
     /* windows in 4-th house  */
-    gint winds[13][2];
 
     winds[0][0] = 482;
     winds[0][1] = 180;
@@ -849,7 +970,7 @@ init_scene(AWallpaperPlugin *desktop_plugin)
     for (i=0; i<8; i++){
         actor = init_object(desktop_plugin, "window2", "window2.png", 
                             winds[i][0], winds[i][1], 8, 8, 10, 
-                            TRUE, 100, 255, (gpointer)&change_window1, NULL);
+                            FALSE, 100, 255, (gpointer)&change_window1, NULL);
         //change_window1(actor, desktop_plugin);
         actor->time_start_animation = now + fast_rnd(30);
         scene.actors = g_slist_append(scene.actors, actor);
@@ -961,6 +1082,7 @@ init_scene(AWallpaperPlugin *desktop_plugin)
 
     }
 
+    run_long_timeout(desktop_plugin);
 #if 0    
   anim = g_new0(Animation, 1);
   anim->count = 1;
@@ -980,7 +1102,8 @@ init_scene1(AWallpaperPlugin *desktop_plugin)
 {
   Actor *actor;
   gint now = time(NULL);
-  
+  gint i; 
+  gint winds[13][2];
 
   scene.daytime = get_daytime();
   scene.actors = NULL;
@@ -1003,11 +1126,11 @@ init_scene1(AWallpaperPlugin *desktop_plugin)
   change_sun(actor, desktop_plugin);
   scene.actors = g_slist_append(scene.actors, actor);
 
-
+#if 0
   actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50, 
                       TRUE, 100, 255, NULL, NULL);
   scene.actors = g_slist_append(scene.actors, actor);
-
+#endif
 
   actor = init_object(desktop_plugin, "moon", "moon1.png", 400, 15, 6, 60, 60, 
                       FALSE, 100, 255, (gpointer)&change_moon, NULL);
@@ -1017,13 +1140,13 @@ init_scene1(AWallpaperPlugin *desktop_plugin)
   actor = init_object(desktop_plugin, "cloud1", "cloud1.png", 0, fast_rnd(300)-97, 7, 150, 97, 
                       FALSE, 100, 255, (gpointer)&change_cloud, NULL);
   actor->time_start_animation = now + fast_rnd(180);
-  actor->duration_animation = 5*60;
+  actor->duration_animation = 3*60;
   scene.actors = g_slist_append(scene.actors, actor);
   
   actor = init_object(desktop_plugin, "cloud2", "cloud2.png", 0, fast_rnd(300)-75, 7, 188, 75, 
                       FALSE, 100, 255, (gpointer)&change_cloud, NULL);
   actor->time_start_animation = now + fast_rnd(180);
-  actor->duration_animation = 5*60;
+  actor->duration_animation = 3*60;
   scene.actors = g_slist_append(scene.actors, actor);
 
   actor = init_object(desktop_plugin, "cloud4", "cloud4.png", 0, fast_rnd(300)-75, 7, 150, 75, 
@@ -1039,15 +1162,15 @@ init_scene1(AWallpaperPlugin *desktop_plugin)
   actor->duration_animation = 60;
   scene.actors = g_slist_append(scene.actors, actor);
   
-  actor = init_object(desktop_plugin, "plane1", "tu154_small.png", 620, 233, 9, 300, 116, 
+  actor = init_object(desktop_plugin, "plane1", "tu154.png", 620, 233, 9, 300, 116, 
                       FALSE, 100, 255, (gpointer)&change_plane1, NULL);
   actor->time_start_animation = now + probability_plane();
   actor->duration_animation = 30;
   scene.actors = g_slist_append(scene.actors, actor);
 
   actor = init_object(desktop_plugin, "town", "town.png", 0, 0, 10, 800, 480, 
-                      TRUE, 100, 255, (gpointer)&change_static_actor, NULL);
-  change_static_actor(actor, desktop_plugin);
+                      TRUE, 100, 255, (gpointer)&change_static_actor_with_corner, NULL);
+  change_static_actor_with_corner(actor, desktop_plugin);
   scene.actors = g_slist_append(scene.actors, actor);
 
   actor = init_object(desktop_plugin, "wind", "", 0, 0, 5, 0, 0, 
@@ -1055,6 +1178,62 @@ init_scene1(AWallpaperPlugin *desktop_plugin)
   change_wind(actor, desktop_plugin);
   scene.actors = g_slist_append(scene.actors, actor);
 
+  actor = init_object(desktop_plugin, "signal", "red.png", 486, 425, 10, 18, 38, 
+                      TRUE, 100, 255, (gpointer)&change_signal, NULL);
+  actor->time_start_animation = now + fast_rnd(30) + 10;  
+  scene.actors = g_slist_append(scene.actors, actor);winds[0][0] = 717;
+    
+    winds[0][0] = 389;
+    winds[0][1] = 305;
+
+    winds[1][0] = 373;
+    winds[1][1] = 306;
+
+    winds[2][0] = 355;
+    winds[2][1] = 306;
+
+    winds[3][0] = 356;
+    winds[3][1] = 288;
+    
+    winds[4][0] = 337;
+    winds[4][1] = 269;
+    
+    winds[5][0] = 372;
+    winds[5][1] = 268;
+  
+    winds[6][0] = 372;
+    winds[6][1] = 249;
+    
+    winds[7][0] = 388;
+    winds[7][1] = 249;
+    
+    winds[8][0] = 387;
+    winds[8][1] = 230;
+    
+    winds[9][0] = 372;
+    winds[9][1] = 211;
+    
+    winds[10][0] = 355;
+    winds[10][1] = 159;
+    
+    winds[11][0] = 335;
+    winds[11][1] = 158;
+    
+    winds[12][0] = 386;
+    winds[12][1] = 119;
+  
+    for (i=0; i<13; i++){
+        actor = init_object(desktop_plugin, "window", "window.png", 
+                            winds[i][0], winds[i][1], 10, 8, 9, 
+                            FALSE, 100, 255, (gpointer)&change_window1, NULL);
+        //change_window1(actor, desktop_plugin);
+        actor->time_start_animation = now + fast_rnd(30);
+        scene.actors = g_slist_append(scene.actors, actor);
+
+    }
+    
+    run_long_timeout(desktop_plugin);
+
 }
 
 
@@ -1149,7 +1328,7 @@ short_timeout (AWallpaperPlugin *desktop_plugin)
     Actor *actor;
     gboolean stop_flag = TRUE;
 
-    if (!desktop_plugin->priv->visible || !desktop_plugin->priv->rich_animation){
+if (!desktop_plugin->priv->visible || !desktop_plugin->priv->rich_animation){
         desktop_plugin->priv->short_timer = 0;
         return FALSE;
     }
@@ -1178,26 +1357,16 @@ short_timeout (AWallpaperPlugin *desktop_plugin)
          return TRUE; /* keep running this event */
 }
 
+void
+run_long_timeout(AWallpaperPlugin *desktop_plugin){
 
-static gboolean
-long_timeout (AWallpaperPlugin *desktop_plugin)
-{
     gint daytime = get_daytime();
     GSList * tmp;
     void (*pfunc)(gpointer, gpointer);
     time_t now;
     Actor *actor;
 
-    fprintf(stderr, "long_timeout %i\n", desktop_plugin->priv->long_timer);
-    if (desktop_plugin->priv->long_timer == 0 )
-        return FALSE;
-    if (!desktop_plugin->priv->visible){
-        if(desktop_plugin->priv->short_timer != 0){
-            g_source_remove(desktop_plugin->priv->short_timer);
-            desktop_plugin->priv->short_timer = 0;
-        }
-        return FALSE;
-    }
+
     //fprintf(stderr, "timer daytime=%d\n", daytime);
     if (scene.daytime != daytime){
         scene.daytime = daytime;
@@ -1220,15 +1389,37 @@ long_timeout (AWallpaperPlugin *desktop_plugin)
         if (now >= actor->time_start_animation  
             && actor->time_start_animation > 0
             && desktop_plugin->priv->short_timer == 0){
-            actor->time_start_animation = now;
             /* fprintf(stderr, "start short timer act = %s %d\n", actor->name, now); */
-            if (desktop_plugin->priv->rich_animation)
+            if (desktop_plugin->priv->rich_animation){
+                actor->time_start_animation = now;
                 desktop_plugin->priv->short_timer = g_timeout_add(SHORT_TIMER, (GtkFunction)short_timeout, desktop_plugin);
+            }
+            else {
+                (*actor->func_change)(actor, desktop_plugin);
+            }
         }
         tmp = g_slist_next(tmp);
     }
-   
+}
 
+static gboolean
+long_timeout (AWallpaperPlugin *desktop_plugin)
+{
+    /* fprintf(stderr, "long_timeout %i\n", desktop_plugin->priv->long_timer); */
+    if (desktop_plugin->priv->long_timer == 0 )
+        return FALSE;
+    if (!desktop_plugin->priv->visible){
+        if(desktop_plugin->priv->short_timer != 0){
+            g_source_remove(desktop_plugin->priv->short_timer);
+            desktop_plugin->priv->short_timer = 0;
+        }
+        desktop_plugin->priv->long_timer = 0;
+        return FALSE;
+    }
+  
+
+    run_long_timeout(desktop_plugin);
     return TRUE; /* keep running this event */
 }
 
@@ -1242,8 +1433,10 @@ desktop_plugin_visible_notify (GObject    *object,
     /* fprintf (stderr, "is-on-current-desktop changed. visible: %u", visible); */
     if (visible){
         desktop_plugin->priv->visible = TRUE;
-        if (desktop_plugin->priv->long_timer == 0 )
+        if (desktop_plugin->priv->long_timer == 0 ){
             desktop_plugin->priv->long_timer = g_timeout_add(LONG_TIMER, (GtkFunction)long_timeout, desktop_plugin);
+            run_long_timeout(desktop_plugin);
+        }
     }else{
         desktop_plugin->priv->visible = FALSE;
         if (desktop_plugin->priv->long_timer != 0 ){
@@ -1261,11 +1454,9 @@ rich_animation_press(GtkWidget *widget, GdkEvent *event,
 static void
 animation_wallpaper_plugin_init (AWallpaperPlugin *desktop_plugin)
 {
-    GtkWidget *widget;
     GtkWidget *rich_animation;
     gchar           buffer[2048];
 
-    GtkWidget  *background_town = NULL;
 
     fprintf(stderr, "!!!!!!!plugin init \n");
     Animation_WallpaperPrivate *priv =  Animation_Wallpaper_HOME_PLUGIN_GET_PRIVATE (desktop_plugin);
@@ -1274,14 +1465,15 @@ animation_wallpaper_plugin_init (AWallpaperPlugin *desktop_plugin)
     /* Load config */
     read_config(priv);
     priv->desktop_plugin = desktop_plugin;
-    widget = gtk_fixed_new();
+    desktop_plugin->priv->main_widget = gtk_fixed_new();
 
-    gtk_widget_set_size_request(widget, 100, 32);
+    gtk_widget_set_size_request(desktop_plugin->priv->main_widget, 100, 32);
+    desktop_plugin->priv->right_corner = NULL;
     snprintf(buffer, sizeof(buffer) - 1, "%s/%s/%s", THEME_PATH, desktop_plugin->priv->theme, "town0_right_corner.png");
-    background_town = gtk_image_new_from_file (buffer);
-    if (background_town){
-        gtk_fixed_put(GTK_FIXED(widget), background_town, 0, 0);
-        gtk_widget_show (background_town);
+    desktop_plugin->priv->right_corner = gtk_image_new_from_file (buffer);
+    if (desktop_plugin->priv->right_corner){
+        gtk_fixed_put(GTK_FIXED(desktop_plugin->priv->main_widget), desktop_plugin->priv->right_corner, 0, 0);
+        gtk_widget_show (desktop_plugin->priv->right_corner);
     }
     /* Create rich animation event */
     rich_animation = gtk_event_box_new();
@@ -1291,7 +1483,7 @@ animation_wallpaper_plugin_init (AWallpaperPlugin *desktop_plugin)
         gtk_widget_set_size_request(rich_animation, 100, 32);
         gtk_widget_show (rich_animation);
         g_signal_connect(rich_animation, "button-press-event", G_CALLBACK(rich_animation_press), desktop_plugin);
-        gtk_fixed_put(GTK_FIXED(widget), rich_animation, 0, 0);
+        gtk_fixed_put(GTK_FIXED(desktop_plugin->priv->main_widget), rich_animation, 0, 0);
     }
 /*
     GtkWidget *label = gtk_label_new ("ddddddddddddd"); 
@@ -1303,8 +1495,8 @@ 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 (lw_settings), priv);
-    gtk_widget_show (widget);
-    gtk_container_add (GTK_CONTAINER (desktop_plugin), widget);
+    gtk_widget_show (desktop_plugin->priv->main_widget);
+    gtk_container_add (GTK_CONTAINER (desktop_plugin), desktop_plugin->priv->main_widget);
     init_applet_position();
 
     
@@ -1313,6 +1505,8 @@ animation_wallpaper_plugin_init (AWallpaperPlugin *desktop_plugin)
         init_scene(desktop_plugin);
     else if (!strcmp(priv->theme,"Berlin")) 
         init_scene1(desktop_plugin);
+    else if (!strcmp(priv->theme, "Matrix"))
+        init_scene2(desktop_plugin);
     priv->long_timer = g_timeout_add(LONG_TIMER, (GtkFunction)long_timeout, desktop_plugin);
     priv->short_timer = 0;
     /* TODO Move scene to priv */