Elm_Animation_View : Add elm_animation_view_frame_set/get apis 22/197722/2
authorJunsuChoi <jsuya.choi@samsung.com>
Wed, 16 Jan 2019 01:27:59 +0000 (10:27 +0900)
committerjunsu choi <jsuya.choi@samsung.com>
Wed, 16 Jan 2019 08:00:16 +0000 (08:00 +0000)
commit9ace90e31c4ed088e439449b5a6eb4cc1f355b25
tree3fbe66bbfcf9b5d6785ebf2e0f3ee9666688ef4c
parent6507c7c254c389611bf0e4bdaf3e9cee20ffa937
Elm_Animation_View : Add elm_animation_view_frame_set/get apis

Summary:
   elm_animation_view_frame_set is index of frame of animation view.
   Range of frame value is 0 to elm_animation_view_fame_count - 1.
   This value calculated with keyframe value.

   elm_animation_view_frame_get return index of current frame.

Test Plan:
   setenv("ECTOR_BACKEND", "default", 1);
   setenv("ELM_ACCEL", "gl", 1);

   elm_init(argc, argv);

   Eo *win = elm_win_util_standard_add(NULL, "test");
   evas_object_smart_callback_add(win, "delete,request", win_del, 0);
   elm_win_autodel_set(win, 1);

   //Animation View
   Evas_Object *anim_view = elm_animation_view_add(win);
   elm_animation_view_auto_repeat_set(anim_view, 1);
   elm_animation_view_file_set(anim_view, "a.json", NULL);
   evas_object_show(anim_view);

   evas_object_size_hint_align_set(anim_view, EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_size_hint_weight_set(anim_view, 1, 1);

   elm_win_resize_object_add(win, anim_view);

   evas_object_resize(win, WIDTH, HEIGHT);
   evas_object_show(win);

   printf("Get frame count : %d\n", elm_animation_view_frame_count_get(anim_view));
   printf("Set frame : 35\n");
   elm_animation_view_frame_set(anim_view  , 35);
   printf("Get frame : %d\n", elm_animation_view_frame_get(anim_view));
   printf("Get keyframe : %f\n", elm_animation_view_keyframe_get(anim_view));

   printf("Set frame : 0\n");
   elm_animation_view_frame_set(anim_view  , 0);
   printf("Get frame : %d\n", elm_animation_view_frame_get(anim_view));
   printf("Get keyframe : %f\n", elm_animation_view_keyframe_get(anim_view));

   printf("Set keyframe : 0.5\n");
   elm_animation_view_keyframe_set(anim_view  , 0.5);
   printf("Get keyframe : %f\n", elm_animation_view_keyframe_get(anim_view));
   printf("Get frame : %d\n", elm_animation_view_frame_get(anim_view));

   elm_run();
   elm_shutdown();

Reviewers: Hermet

Subscribers: YOhoho, cedric, SanghyeonLee, #reviewers, smohanty, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7624

Change-Id: I9be2cfb1166ba6b27196b0d8ecb95d55960932c5
src/lib/elementary/elm_animation_view.c
src/lib/elementary/elm_animation_view.eo