summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2019-10-02 13:21:35 +0900
committerJunsuChoi <jsuya.choi@samsung.com>2019-10-02 14:19:30 +0900
commit6deb21f9f9e326921c16dabbd774b8d1666867c8 (patch)
tree90e85b1c5a0a761bf912b8a0fb99f6d352254343 /src/lib/elementary
parent94c193e40b3111664344bf41beb22006bfab2670 (diff)
Efl.Gfx.Vg.Value_Provider: Introduce property change feature of Efl.Ui.Animation_View
Summary: Efl.Gfx.Vg.Value_Provider is an object for integrating and managing the properties of vector objects. These values are dependent on the keypath. Keypath is the target a specific content or a set of contents that will be updated. It can include the specific name of the contents, wildcard(*) or Globstar(**). The valueProvider is borrowed from another library that uses a vector object of type json, such as Efl.Ui.Animation_View (https://github.com/airbnb/lottie-ios/blob/5fc0e59e0cb85d3586b1d0d1cf4a2c9669b91d15/lottie-swift/src/Public/iOS/AnimatedControl.swift#L50) This feature should be used with some patches that apply to the vg json loader and Efl.Canvas.Vg.Object. Test Plan: N/A Reviewers: Hermet, kimcinoo, smohanty Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9874
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/efl_ui_animation_view.c36
-rw-r--r--src/lib/elementary/efl_ui_animation_view.eo14
-rw-r--r--src/lib/elementary/efl_ui_animation_view_private.h1
3 files changed, 51 insertions, 0 deletions
diff --git a/src/lib/elementary/efl_ui_animation_view.c b/src/lib/elementary/efl_ui_animation_view.c
index 418d8ad..bca8c1d 100644
--- a/src/lib/elementary/efl_ui_animation_view.c
+++ b/src/lib/elementary/efl_ui_animation_view.c
@@ -236,6 +236,11 @@ EOLIAN static void
236_efl_ui_animation_view_efl_object_destructor(Eo *obj, 236_efl_ui_animation_view_efl_object_destructor(Eo *obj,
237 Efl_Ui_Animation_View_Data *pd EINA_UNUSED) 237 Efl_Ui_Animation_View_Data *pd EINA_UNUSED)
238{ 238{
239 Efl_Gfx_Vg_Value_Provider *vp;
240 EINA_LIST_FREE(pd->vp_list, vp)
241 efl_unref(vp);
242 eina_list_free(pd->vp_list);
243
239 efl_destructor(efl_super(obj, MY_CLASS)); 244 efl_destructor(efl_super(obj, MY_CLASS));
240} 245}
241 246
@@ -707,6 +712,37 @@ _efl_ui_animation_view_max_frame_get(const Eo *obj EINA_UNUSED, Efl_Ui_Animation
707 return pd->max_progress * (evas_object_vg_animated_frame_count_get(pd->vg) - 1); 712 return pd->max_progress * (evas_object_vg_animated_frame_count_get(pd->vg) - 1);
708} 713}
709 714
715EOLIAN static void
716_efl_ui_animation_view_value_provider_override(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd, Efl_Gfx_Vg_Value_Provider *value_provider)
717{
718 if (!value_provider) return;
719
720 if (pd->vp_list)
721 {
722 const char *keypath1 = efl_gfx_vg_value_provider_keypath_get(value_provider);
723 if (!keypath1)
724 {
725 ERR("Couldn't override Value Provider(%p). Keypath is NULL.", value_provider);
726 return;
727 }
728 const Eina_List *l;
729 Efl_Gfx_Vg_Value_Provider *_vp;
730 EINA_LIST_FOREACH(pd->vp_list, l, _vp)
731 {
732 const char *keypath2 = efl_gfx_vg_value_provider_keypath_get(_vp);
733 if (!strcmp(keypath1, keypath2))
734 {
735 pd->vp_list = eina_list_remove(pd->vp_list, _vp);
736 efl_unref(_vp);
737 break;
738 }
739 }
740 }
741
742 efl_ref(value_provider);
743 pd->vp_list = eina_list_append(pd->vp_list, value_provider);
744}
745
710EAPI Elm_Animation_View* 746EAPI Elm_Animation_View*
711elm_animation_view_add(Evas_Object *parent) 747elm_animation_view_add(Evas_Object *parent)
712{ 748{
diff --git a/src/lib/elementary/efl_ui_animation_view.eo b/src/lib/elementary/efl_ui_animation_view.eo
index 474bd76..d079059 100644
--- a/src/lib/elementary/efl_ui_animation_view.eo
+++ b/src/lib/elementary/efl_ui_animation_view.eo
@@ -256,7 +256,21 @@ class @beta Efl.Ui.Animation_View extends Efl.Ui.Widget implements Efl.Gfx.View,
256 ]] 256 ]]
257 } 257 }
258 } 258 }
259 value_provider_override{
260 [[Override each value of the animation object.
261 Values can be properties of Efl.Gfx.Vg.Value_provider such as color and matrix information.
259 262
263 Example:
264 Eo *vp = efl_add(EFL_GFX_VG_VALUE_PROVIDER_CLASS, NULL);
265 @Efl.Gfx.Vg.Value_Provider.keypath.set(vp, "SomeLayer:SomeObject:SomeContents");
266 // Set vp property
267 @.value_provider_override(target_animation_view, vg);
268 See @Efl.Gfx.Vg.Value_Provider
269 ]]
270 params {
271 value_provider: Efl.Gfx.Vg.Value_Provider; [[ Override the values of the animation object. this should have keypath infomation. See @Efl.Gfx.Vg.Value_Provider ]]
272 }
273 }
260 } 274 }
261 implements { 275 implements {
262 Efl.Object.constructor; 276 Efl.Object.constructor;
diff --git a/src/lib/elementary/efl_ui_animation_view_private.h b/src/lib/elementary/efl_ui_animation_view_private.h
index 0de9b2a..9199dc7 100644
--- a/src/lib/elementary/efl_ui_animation_view_private.h
+++ b/src/lib/elementary/efl_ui_animation_view_private.h
@@ -19,6 +19,7 @@ struct _Efl_Ui_Animation_View_Data
19 double frame_duration; 19 double frame_duration;
20 double min_progress; 20 double min_progress;
21 double max_progress; 21 double max_progress;
22 Eina_List *vp_list;
22 23
23 Eina_Bool play_back : 1; 24 Eina_Bool play_back : 1;
24 Eina_Bool auto_play : 1; 25 Eina_Bool auto_play : 1;