forked from enlightenment/efl
edje: Edje_Edit - add edje_edit_state_map_light_xet()
Summary: There are new 'get and set' API for block 'map'. Those functions return or set part's name which is used as 'light' for calculating the brightness. @feature Reviewers: cedric, seoz, raster, Hermet CC: reutskiy.v.v, cedric Differential Revision: https://phab.enlightenment.org/D1049 Signed-off-by: Cedric BAIL <c.bail@partner.samsung.com>
This commit is contained in:
parent
2b40860f78
commit
7e4b9b6f09
|
@ -3159,6 +3159,36 @@ EAPI Eina_Bool edje_edit_state_limit_set(Evas_Object *obj, const char *part, con
|
|||
EAPI unsigned char edje_edit_state_limit_get(Evas_Object *obj, const char *part, const char *state, double value);
|
||||
|
||||
|
||||
|
||||
/** Get the part's name that is used as the 'light' for calculating the brightness.
|
||||
*
|
||||
* @param obj Object being edited.
|
||||
* @param part The name of the part.
|
||||
* @param state The name of the state (not including the state value).
|
||||
* @param value The state value.
|
||||
*
|
||||
* @return The name of the source part that is used as 'light'.
|
||||
* @since 1.11
|
||||
**/
|
||||
EAPI const char *
|
||||
edje_edit_state_map_light_get(Evas_Object *obj, const char *part, const char *state, double value);
|
||||
|
||||
/** Set the part that is used as the 'light'.
|
||||
*
|
||||
* @param obj Object being edited.
|
||||
* @param part The name of the part.
|
||||
* @param state The name of the state (not including the state value).
|
||||
* @param value The state value.
|
||||
* @param source_part The source part's name.
|
||||
*
|
||||
* @return EINA_TRUE in case of success, EINA_FALSE otherwise.
|
||||
* @since 1.11
|
||||
**/
|
||||
EAPI Eina_Bool
|
||||
edje_edit_state_map_light_set(Evas_Object *obj, const char *part, const char *state, double value, const char *source_part);
|
||||
|
||||
|
||||
|
||||
//@}
|
||||
/******************************************************************************/
|
||||
/************************** TEXT API ************************************/
|
||||
|
|
|
@ -5593,6 +5593,35 @@ edje_edit_state_limit_get(Evas_Object *obj, const char *part, const char *state,
|
|||
return pd->limit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
EAPI const char *
|
||||
edje_edit_state_map_light_get(Evas_Object *obj, const char *part, const char *state, double value)
|
||||
{
|
||||
Edje_Real_Part *erl;
|
||||
|
||||
GET_PD_OR_RETURN(NULL);
|
||||
|
||||
erl = ed->table_parts[pd->map.id_light % ed->table_parts_size];
|
||||
if (erl->part->name)
|
||||
return eina_stringshare_add(erl->part->name);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
edje_edit_state_map_light_set(Evas_Object *obj, const char *part, const char *state, double value, const char *source_part)
|
||||
{
|
||||
if (!source_part) return EINA_FALSE;
|
||||
GET_PD_OR_RETURN(EINA_FALSE);
|
||||
|
||||
pd->map.id_light = _edje_part_id_find(ed, source_part);
|
||||
|
||||
edje_object_calc_force(obj);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**************/
|
||||
/* TEXT API */
|
||||
/**************/
|
||||
|
|
Loading…
Reference in New Issue