Page MenuHomePhabricator

efl_ui_animation_view: Support property change feature

Authored by jsuya on Aug 26 2019, 5:36 AM.



User can control the properties for a specific target or animation_view as a whole.
Keypath is the target a specific content or a set of contents that will be updated.
Animation_view passes property information to the vg object of the data.
The actual property information is managed by efl_canvas_vg_object.

Depends D9724: efl_canvas_vg_object: Support property change feature

Test Plan

[Enable Json loader]

  • value : ['webp', 'json']

+ value : ['webp']

main(int argc, char **argv)

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);

Eo *bg = elm_bg_add(win);
evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(bg, 1, 1);

//Animation View
Evas_Object *main_bx = elm_box_add(win);
evas_object_size_hint_align_set(main_bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(main_bx, 1, 1);

Evas_Object *anim_view;
anim_view = elm_animation_view_add(main_bx);
evas_object_size_hint_align_set(anim_view, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(anim_view, 1, 1);

int r = 0, g = 0, b = 0, op = 0, px, py;
double width = 0.0, x = 0.0, y = 0.0;

efl_ui_animation_view_property_fill_color_set(anim_view, "**", 255, 255, 0);
efl_ui_animation_view_property_fill_color_get(anim_view, "**", &r, &g, &b);
printf("Fill Color %d %d %d\n", r, g, b);

efl_ui_animation_view_property_fill_color_set(anim_view, "SomeName", 0, 255, 0);
efl_ui_animation_view_property_fill_color_get(anim_view, "SomeName", &r, &g, &b);
printf("Fill Color %d %d %d\n", r, g, b);

efl_ui_animation_view_property_fill_opacity_set(anim_view, "**", 100);
op = efl_ui_animation_view_property_fill_opacity_get(anim_view, "**");
printf("Fill Opacity %d\n", op);

efl_ui_animation_view_property_stroke_color_set(anim_view, "SomePart", 0, 123, 0);
efl_ui_animation_view_property_stroke_color_get(anim_view, "SomePart", &r, &g, &b);
printf("Stroke Color %d %d %d\n", r, g, b);

efl_ui_animation_view_property_stroke_opacity_set(anim_view, "**", 100);
op = efl_ui_animation_view_property_stroke_opacity_get(anim_view, "**");
printf("Stroke Opacity %d\n", op);

efl_ui_animation_view_property_stroke_width_set(anim_view, "**", 5.5);
width = efl_ui_animation_view_property_stroke_width_get(anim_view, "**");
printf("Stroke Width %f\n", width);

efl_ui_animation_view_property_transform_position_set(anim_view, "**", 10, 10);
efl_ui_animation_view_property_transform_position_get(anim_view, "**", &px, &py);
printf("Transform position XY %d %d\n", px, py);

efl_ui_animation_view_property_transform_scale_set(anim_view, "**", 2.1, 2.2);
efl_ui_animation_view_property_transform_scale_get(anim_view, "**", &x, &y);
printf("Transform Scale XY %f %f\n", x, y);

efl_ui_animation_view_property_transform_rotation_set(anim_view, "**", 2.3, 2.4);
efl_ui_animation_view_property_transform_rotation_get(anim_view, "**", &x, &y);
printf("Transform rotation XY %f %f\n", x, y);

efl_ui_animation_view_property_transform_anchor_set(anim_view, "**", 2.5, 2.6);
efl_ui_animation_view_property_transform_anchor_get(anim_view, "**", &x, &y);
printf("Transform anchor XY %f %f\n", x, y);

efl_ui_animation_view_property_transform_opacity_set(anim_view, "**", 100);
op = efl_ui_animation_view_property_transform_opacity_get(anim_view, "**");
printf("Transform Opacity  %d\n", op);

char path[250];
sprintf(path, "SOME JSON LOTTIE FILE");
elm_animation_view_file_set(anim_view, path, NULL);
elm_animation_view_auto_repeat_set(anim_view, EINA_TRUE);

elm_box_pack_end(main_bx, anim_view);

elm_win_resize_object_add(win, bg);
elm_win_resize_object_add(win, main_bx);

evas_object_resize(win, WIDTH, HEIGHT);


return 0;


Diff Detail

rEFL core/efl
No Linters Available
No Unit Test Coverage
Build Status
Buildable 12961
Build 9231: arc lint + arc unit
jsuya created this revision.Aug 26 2019, 5:36 AM
jsuya requested review of this revision.Aug 26 2019, 5:36 AM
jsuya updated this revision to Diff 24498.Aug 26 2019, 5:43 AM
jsuya edited the summary of this revision. (Show Details)

update commit message

jsuya updated this revision to Diff 24506.Aug 26 2019, 5:47 AM
jsuya retitled this revision from efl_ui_animatio_view: Support property change feature to efl_ui_animation_view: Support property change feature.

update commit message

Hermet requested changes to this revision.Aug 27 2019, 6:58 PM

After considered to support property overriding,
I think we could add a separate interface i.e. efl_ui_animation_view_property
then extend per properties such as efl_ui_animation_view_property_color, efl_ui_animation_view_property_transform, efl_ui_animation_view_property_stroke, etc.
If so our efl_ui_animation_view could only suggest efl_ui_animation_view_property_override(Eo *anim_view, Efl_Ui_Animation_View_Property *prop);

What do you think?

This revision now requires changes to proceed.Aug 27 2019, 6:58 PM
Hermet added a comment.EditedAug 27 2019, 9:12 PM

thought again with canvas vg altogether,

We can provide in efl interface.
class Efl_Gfx_Vector_Propset;

//These Vg_Propset should define common naming not lottie.
Efl_Gfx_Vg_Propset prop;

efl_ui_animation_view_property_override(anim_view, prop);

jsuya abandoned this revision.Sep 9 2019, 10:08 PM

I created new patch D9874