forked from enlightenment/efl
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 <cedric@osg.samsung.com>
This commit is contained in:
parent
38561202bf
commit
520809864d
|
@ -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.
|
||||
|
|
|
@ -8116,6 +8116,44 @@ edje_edit_program_stop_all(Evas_Object *obj)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue