edje: Edje_Edit - add edje_edit_state_map_rotation_center_xet()

Summary:
There are new 'get and set' API for block 'map'.
Those functions return or set part's name which is used as center for rotation.
@feature

Reviewers: seoz, cedric, raster, Hermet

CC: reutskiy.v.v, cedric

Differential Revision: https://phab.enlightenment.org/D1050

Signed-off-by: Cedric BAIL <c.bail@partner.samsung.com>
This commit is contained in:
Igor Gala 2014-06-17 08:46:41 +02:00 committed by Cedric BAIL
parent bb878758e6
commit 036267c4f5
2 changed files with 50 additions and 3 deletions

View File

@ -3204,8 +3204,6 @@ 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.
@ -3233,7 +3231,32 @@ edje_edit_state_map_light_get(Evas_Object *obj, const char *part, const char *st
EAPI Eina_Bool
edje_edit_state_map_light_set(Evas_Object *obj, const char *part, const char *state, double value, const char *source_part);
/** Get the part's name that is used as the center rotation.
*
* @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 center rotation.
* @since 1.11
**/
EAPI const char *
edje_edit_state_map_rotation_center_get(Evas_Object *obj, const char *part, const char *state, double value);
/** This sets the part that is used as the center of rotation when rotating the part with this description. If no center is given, the parts original center itself is used for the rotation center.
*
* @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_rotation_center_set(Evas_Object *obj, const char *part, const char *state, double value, const char *source_part);
//@}
/******************************************************************************/

View File

@ -5649,7 +5649,6 @@ edje_edit_state_limit_get(Evas_Object *obj, const char *part, const char *state,
}
EAPI const char *
edje_edit_state_map_light_get(Evas_Object *obj, const char *part, const char *state, double value)
{
@ -5664,6 +5663,20 @@ edje_edit_state_map_light_get(Evas_Object *obj, const char *part, const char *st
return NULL;
}
EAPI const char *
edje_edit_state_map_rotation_center_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.rot.id_center % 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)
{
@ -5676,6 +5689,17 @@ edje_edit_state_map_light_set(Evas_Object *obj, const char *part, const char *st
return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_state_map_rotation_center_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.rot.id_center = _edje_part_id_find(ed, source_part);
edje_object_calc_force(obj);
return EINA_TRUE;
}
/**************/
/* TEXT API */