include elementary_config.h first (hence no need for _GNU_SOURCE)
[framework/uifw/elementary.git] / src / bin / test_slideshow.c
index b351dc1..85ae340 100644 (file)
@@ -1,5 +1,5 @@
-#include <Elementary.h>
 #include "elementary_config.h"
+#include <Elementary.h>
 #ifndef ELM_LIB_QUICKLAUNCH
 
 static Evas_Object *slideshow, *bt_start, *bt_stop;
@@ -99,24 +99,25 @@ _get(void *data, Evas_Object *obj)
    return photo;
 }
 
-
+static void
+_slide_transition(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+   Elm_Object_Item *slide_it = (Elm_Object_Item *) event_info;
+   if (data == slide_it)
+     printf("Reaches to End of slides\n");
+}
 
 void
 test_slideshow(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
 {
-   Evas_Object *win, *bg, *notify, *bx, *bt, *hv, *spin;
+   Evas_Object *win, *notify, *bx, *bt, *hv, *spin;
    const Eina_List *l;
    const char *transition, *layout;
+   Elm_Object_Item *slide_last_it;
 
-   win = elm_win_add(NULL, "slideshow", ELM_WIN_BASIC);
-   elm_win_title_set(win, "Slideshow");
+   win = elm_win_util_standard_add("slideshow", "Slideshow");
    elm_win_autodel_set(win, EINA_TRUE);
 
-   bg = elm_bg_add(win);
-   elm_win_resize_object_add(win, bg);
-   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-   evas_object_show(bg);
-
    slideshow = elm_slideshow_add(win);
    elm_slideshow_loop_set(slideshow, EINA_TRUE);
    elm_win_resize_object_add(win, slideshow);
@@ -134,10 +135,12 @@ test_slideshow(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
    elm_slideshow_item_add(slideshow, &itc, img5);
    elm_slideshow_item_add(slideshow, &itc, img6);
    elm_slideshow_item_add(slideshow, &itc, img7);
-   elm_slideshow_item_add(slideshow, &itc, img8);
+   slide_last_it = elm_slideshow_item_add(slideshow, &itc, img8);
+   evas_object_smart_callback_add(slideshow, "transition,end", _slide_transition, slide_last_it);
 
    notify = elm_notify_add(win);
    elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_BOTTOM);
+   evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    elm_win_resize_object_add(win, notify);
    elm_notify_timeout_set(notify, 3.0);