cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=520809864db744675e0596934614ca4fcd2578cf
commit 520809864db744675e0596934614ca4fcd2578cf Author: Andrii Kroitor <an.kroi...@samsung.com> Date: Fri Sep 12 23:02:31 2014 +0200 edje: Edje_Edit - add edje_edit_program_transition_state_set Summary: Set parts into intermediate state of programs transition. 0.0 represents the start state, 1.0 - the final state. Other values will set parts to an intermediate state taking into account programs transition type. Reviewers: seoz, Hermet, cedric Reviewed By: cedric Subscribers: cedric, reutskiy.v.v Differential Revision: https://phab.enlightenment.org/D1435 Signed-off-by: Cedric BAIL <ced...@osg.samsung.com> --- src/lib/edje/Edje_Edit.h | 12 ++++++++++++ src/lib/edje/edje_edit.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h index 55b68ce..d9600d7 100644 --- a/src/lib/edje/Edje_Edit.h +++ b/src/lib/edje/Edje_Edit.h @@ -5444,6 +5444,18 @@ EAPI Eina_Bool edje_edit_program_run(Evas_Object *obj, const char *prog); */ EAPI Eina_Bool edje_edit_program_stop_all(Evas_Object *obj); +/** Set parts into intermediate state of programs transition. + * + * @param obj Object being edited. + * @param prog The name of the program to use. Program should have action STATE_SET. + * @param pos State of transition to be setted. Value from 0.0 to 1.0. + * 0.0 represents the start state, 1.0 - the final state. Other values will set + * parts to an intermediate state taking into account programs transition type. + * + * @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise. + */ +EAPI Eina_Bool edje_edit_program_transition_state_set(Evas_Object *obj, const char *prog, double pos); + /** Set a new name for the given program * * @param obj Object being edited. diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index d8c8cc4..3aec4bc 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -8117,6 +8117,44 @@ edje_edit_program_stop_all(Evas_Object *obj) } EAPI Eina_Bool +edje_edit_program_transition_state_set(Evas_Object *obj, const char *prog, double position) +{ + Edje_Program_Target *pt; + Edje_Real_Part *rp; + Eina_List *l; + + GET_ED_OR_RETURN(EINA_FALSE); + GET_EPR_OR_RETURN(EINA_FALSE); + if (position < 0 || position > 1) return EINA_FALSE; + if (epr->action != EDJE_ACTION_TYPE_STATE_SET) return EINA_FALSE; + + EINA_LIST_FOREACH(epr->targets, l, pt) + { + if (pt->id >= 0) + { + rp = ed->table_parts[pt->id % ed->table_parts_size]; + if (rp) + { + _edje_part_description_apply(ed, rp, + rp->param1.description->state.name, + rp->param1.description->state.value, + epr->state, + epr->value); + _edje_part_pos_set(ed, rp, + epr->tween.mode, position, + epr->tween.v1, + epr->tween.v2, + epr->tween.v3, + epr->tween.v4); + } + } + } + _edje_recalc(ed); + + return EINA_TRUE; +} + +EAPI Eina_Bool edje_edit_program_name_set(Evas_Object *obj, const char *prog, const char* new_name) { GET_EED_OR_RETURN(EINA_FALSE); --