elm slideshow new animation
authorJonathan Atton <jonathan.atton@gmail.com>
Fri, 25 Sep 2009 10:43:41 +0000 (10:43 +0000)
committerJonathan Atton <jonathan.atton@gmail.com>
Fri, 25 Sep 2009 10:43:41 +0000 (10:43 +0000)
SVN revision: 42695

data/themes/default.edc
src/lib/elm_slideshow.c

index 413e4ea..793cd52 100644 (file)
@@ -6406,7 +6406,9 @@ collections {
 ///////////////////////////////////////////////////////////////////////////////
     group { name: "elm/slideshow/base/default";
         data {
-            item: transitions "fade black_fade horizontal vertical square";
+            item: transitions "fade black_fade horizontal vertical square 4_square";
+            item: image1 "elm.image.1";
+            item: image2 "elm.image.2 elm.image.2_2 elm.image.2_3 elm.image.2_4";
         }
         parts {
             part { name: "elm.image.1";
@@ -6554,6 +6556,96 @@ collections {
                     rel2.relative: 1.0 1.0;
                     color: 255 255 255 255;
                 }
+                description{
+                    state: "4_square_prev_next_init" 0.0;
+                    visible: 1;
+                    rel1.relative: -0.5 -0.5;
+                    rel2.relative: 0.0 0.0;
+                    fill {
+                        origin.relative: 0.0 0.0;
+                        size.relative: 2.0 2.0;
+                    }
+                }
+                description{
+                    state: "4_square_prev_next" 0.0;
+                    inherit: "4_square_prev_next_init" 0.0;
+                    visible: 1;
+                    rel1.relative: 0.0 0.0;
+                    rel2.relative: 0.5 0.5;
+
+                }
+            }
+            part { name: "elm.image.2_2";
+                type: IMAGE;
+                description{
+                    state: "default" 0.0;
+                    visible: 0;
+                }
+                description{
+                    state: "4_square_prev_next_init" 0.0;
+                    visible: 1;
+                    rel1.relative: 1.0 -0.5;
+                    rel2.relative: 1.5 0.0;
+                    fill {
+                        origin.relative: -1.0 0.0;
+                        size.relative: 2.0 2.0;
+                    }
+                }
+                description{
+                    state: "4_square_prev_next" 0.0;
+                    inherit: "4_square_prev_next_init" 0.0;
+                    visible: 1;
+                    rel1.relative: 0.5 0.0;
+                    rel2.relative: 1.0 0.5;
+                }
+            }
+            part { name: "elm.image.2_3";
+                type: IMAGE;
+                description{
+                    state: "default" 0.0;
+                    visible: 0;
+                }
+                description{
+                    state: "4_square_prev_next_init" 0.0;
+                    visible: 1;
+                    rel1.relative: 1.0 1.0;
+                    rel2.relative: 1.5 1.5;
+                    fill {
+                        origin.relative: -1.0 -1.0;
+                        size.relative: 2.0 2.0;
+                    }
+                }
+                description{
+                    state: "4_square_prev_next" 0.0;
+                    inherit: "4_square_prev_next_init" 0.0;
+                    visible: 1;
+                    rel1.relative: 0.5 0.5;
+                    rel2.relative: 1.0 1.0;
+                }
+            }
+            part { name: "elm.image.2_4";
+                type: IMAGE;
+                description{
+                    state: "default" 0.0;
+                    visible: 0;
+                }
+                description{
+                    state: "4_square_prev_next_init" 0.0;
+                    visible: 1;
+                    rel1.relative: -0.5 1.0;
+                    rel2.relative: 0.0 1.5;
+                    fill {
+                        origin.relative: 0.0 -1.0;
+                        size.relative: 2.0 2.0;
+                    }
+                }
+                description{
+                    state: "4_square_prev_next" 0.0;
+                    inherit: "4_square_prev_next_init" 0.0;
+                    visible: 1;
+                    rel1.relative: 0.0 0.5;
+                    rel2.relative: 0.5 1.0;
+                }
             }
         }
         programs {
@@ -6707,10 +6799,42 @@ collections {
                 target: "elm.image.2";
                 after: "square_next_2";
             }
+            program { name: "4_square_next";
+                signal: "4_square,next";
+                source: "slideshow";
+                action: STATE_SET "4_square_prev_next_init" 0.0;
+                target: "elm.image.2";
+                target: "elm.image.2_2";
+                target: "elm.image.2_3";
+                target: "elm.image.2_4";
+                after: "4_square_next_2";
+            }
+            program { name: "4_square_next_2";
+                action: STATE_SET "4_square_prev_next" 0.0;
+                target: "elm.image.2";
+                target: "elm.image.2_2";
+                target: "elm.image.2_3";
+                target: "elm.image.2_4";
+                transition: DECELERATE 1.0;
+                after: "end";
+            }
+            program { name: "4_square_previous";
+                signal: "4_square,previous";
+                source: "slideshow";
+                action: STATE_SET "4_square_prev_next_init" 0.0;
+                target: "elm.image.2";
+                target: "elm.image.2_2";
+                target: "elm.image.2_3";
+                target: "elm.image.2_4";
+                after: "4_square_next_2";
+            }
             program { name: "end";
                 action: STATE_SET "default" 0.0;
                 target: "elm.image.1";
                 target: "elm.image.2";
+                target: "elm.image.2_2";
+                target: "elm.image.2_3";
+                target: "elm.image.2_4";
                 after: "end_signal";
             }
             program { name: "end_signal";
index 585cc72..c305cf7 100644 (file)
@@ -36,6 +36,9 @@ struct _Widget_Data
    Eina_List *transitions;
    const char *transition;
 
+   Eina_List *img1_parts;
+   Eina_List *img2_parts;
+
    Ecore_Timer *timer;
    int timeout;
 };
@@ -116,14 +119,19 @@ _end(void *data, Evas_Object *obj, const char *emission, const char *source)
 {
    Node *node;
    const Evas_Object *o;
+   Eina_List *l;
+   const char *part;
 
    Widget_Data *wd = elm_widget_data_get(data);
 
    node = eina_list_nth(wd->images, wd->current);
    if(!node) return;
 
-   o = edje_object_part_object_get(wd->slideshow, "elm.image.1");
-   evas_object_image_file_set((Evas_Object *)o, node->file, node->group);
+   EINA_LIST_FOREACH(wd->img1_parts, l, part)
+     {
+       o = edje_object_part_object_get(wd->slideshow, part);
+       evas_object_image_file_set((Evas_Object *)o, node->file, node->group);
+     }
 }
 
 
@@ -170,6 +178,8 @@ elm_slideshow_add(Evas_Object *parent)
    wd->transitions = _stringlist_get(edje_object_data_get(wd->slideshow, "transitions"));
    if(eina_list_count(wd->transitions) > 0)
      wd->transition = eina_stringshare_add(eina_list_data_get(wd->transitions));
+   wd->img1_parts = _stringlist_get(edje_object_data_get(wd->slideshow, "image1"));
+   wd->img2_parts = _stringlist_get(edje_object_data_get(wd->slideshow, "image2"));
 
    edje_object_signal_callback_add(wd->slideshow, "end", "slideshow", _end, obj);
 
@@ -217,6 +227,8 @@ elm_slideshow_image_add(Evas_Object *obj, const char *file, const char *group)
 elm_slideshow_goto(Evas_Object *obj, int pos)
 {
    Node *node;
+   Eina_List *l;
+   const char *part;
    const Evas_Object *o;
    Widget_Data *wd = elm_widget_data_get(obj);
    if(!wd) return;
@@ -227,8 +239,11 @@ elm_slideshow_goto(Evas_Object *obj, int pos)
    wd->current = pos;
    node = eina_list_nth(wd->images, wd->current);
 
-   o = edje_object_part_object_get(wd->slideshow, "elm.image.1");
-   evas_object_image_file_set((Evas_Object *)o, node->file, node->group);
+   EINA_LIST_FOREACH(wd->img1_parts, l, part)
+     {
+       o = edje_object_part_object_get(wd->slideshow, part);
+       evas_object_image_file_set((Evas_Object *)o, node->file, node->group);
+     }
 }
 
 /**
@@ -241,6 +256,8 @@ elm_slideshow_next(Evas_Object *obj)
 {
    char buf[1024];
    const Evas_Object *o;
+   Eina_List *l;
+   const char *part;
    Node *node;
    int next;
    Widget_Data *wd = elm_widget_data_get(obj);
@@ -260,8 +277,12 @@ elm_slideshow_next(Evas_Object *obj)
 
    _end(obj, obj, NULL, NULL);
 
-   o = edje_object_part_object_get(wd->slideshow, "elm.image.2");
-   evas_object_image_file_set((Evas_Object *)o, node->file, node->group);
+
+   EINA_LIST_FOREACH(wd->img2_parts, l, part)
+     {
+       o = edje_object_part_object_get(wd->slideshow, part);
+       evas_object_image_file_set((Evas_Object *)o, node->file, node->group);
+     }
 
    snprintf(buf, 1024, "%s,next", wd->transition);
    edje_object_signal_emit(wd->slideshow, buf, "slideshow");
@@ -285,6 +306,8 @@ elm_slideshow_previous(Evas_Object *obj)
 {
    char buf[1024];
    const Evas_Object *o;
+   Eina_List *l;
+   const char *part;
    Node *node;
    int previous;
    Widget_Data *wd = elm_widget_data_get(obj);
@@ -304,8 +327,11 @@ elm_slideshow_previous(Evas_Object *obj)
 
    _end(obj, obj, NULL, NULL);
 
-   o = edje_object_part_object_get(wd->slideshow, "elm.image.2");
-   evas_object_image_file_set((Evas_Object *)o, node->file, node->group);
+   EINA_LIST_FOREACH(wd->img2_parts, l, part)
+     {
+       o = edje_object_part_object_get(wd->slideshow, part);
+       evas_object_image_file_set((Evas_Object *)o, node->file, node->group);
+     }
 
    snprintf(buf, 1024, "%s,previous", wd->transition);
    edje_object_signal_emit(wd->slideshow, buf, "slideshow");