aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/elementary/test_photocam.c
diff options
context:
space:
mode:
authorAmitesh Singh <amitesh.sh@samsung.com>2017-06-07 15:54:42 +0900
committerAmitesh Singh <amitesh.sh@samsung.com>2017-06-08 17:39:45 +0900
commit66a79ece6b4b9f8a977d1d26954010eeb9ecd31b (patch)
tree6546557a70123f629b8fa9c40acccc97bfd8ef5f /src/bin/elementary/test_photocam.c
parentEfl.Ui.Image.Zoomable: implement efl.player.playable.get (diff)
downloadefl-66a79ece6b4b9f8a977d1d26954010eeb9ecd31b.tar.gz
Efl.Ui.Image.Zoomable: implement efl.play.get/set
Diffstat (limited to 'src/bin/elementary/test_photocam.c')
-rw-r--r--src/bin/elementary/test_photocam.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/bin/elementary/test_photocam.c b/src/bin/elementary/test_photocam.c
index df586dabcf..5804384a79 100644
--- a/src/bin/elementary/test_photocam.c
+++ b/src/bin/elementary/test_photocam.c
@@ -731,3 +731,58 @@ test_photocam_icon(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
evas_object_resize(win, 150, 150);
evas_object_show(win);
}
+
+static void
+_btn_clicked_cb(void *data , Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Evas_Object *zoomable = data;
+ Eina_Bool play = EINA_FALSE;
+
+ play = !efl_player_play_get(zoomable);
+ printf("image clicked! play = %d\n", play);
+ efl_player_play_set(zoomable, play);
+}
+
+void
+test_photocam_animated(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Evas_Object *win, *bx, *lbl, *zoomable, *btn;
+ char buf[PATH_MAX];
+
+ elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
+
+ win = elm_win_util_standard_add("ImageZoomable", "Image Zoomable animation");
+ elm_win_autodel_set(win, EINA_TRUE);
+
+ bx = elm_box_add(win);
+ evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(win, bx);
+ evas_object_show(bx);
+
+ lbl = elm_label_add(bx);
+ elm_object_text_set(lbl, "Clicking the button will play/pause animation.");
+ elm_box_pack_end(bx, lbl);
+ evas_object_show(lbl);
+
+ zoomable = efl_add(EFL_UI_IMAGE_ZOOMABLE_CLASS, win);
+ snprintf(buf, sizeof(buf), "%s/images/animated_logo.gif", elm_app_data_dir_get());
+ efl_file_set(zoomable, buf, NULL);
+ if (efl_player_playable_get(zoomable))
+ {
+ printf("animation is available for this image.\n");
+ efl_player_play_set(zoomable, EINA_TRUE);
+ }
+ evas_object_size_hint_weight_set(zoomable, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_fill_set(zoomable, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_box_pack_end(bx, zoomable);
+ evas_object_show(zoomable);
+
+ btn = efl_add(EFL_UI_BUTTON_CLASS, bx);
+ efl_text_set(btn, "start/stop");
+ evas_object_smart_callback_add(btn, "clicked", _btn_clicked_cb, zoomable);
+ elm_box_pack_end(bx, btn);
+ evas_object_show(btn);
+
+ evas_object_resize(win, 320, 320);
+ evas_object_show(win);
+}