raster pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ddac21534f9eaa8bc01f8c72c1bff5926de27bd6
commit ddac21534f9eaa8bc01f8c72c1bff5926de27bd6 Author: Igor Gala <i.g...@samsung.com> Date: Thu Jul 3 16:23:15 2014 +0900 edje: Edje-Edit: edje_edit_state_map_perspective_xet() Summary: There are new 'get and set' API for block 'map'. Those functions return or set part's name which is used as 'perspective point' for giving a part '3d look'. @feature Reviewers: seoz, cedric, raster, Hermet CC: reutskiy.v.v, cedric Differential Revision: https://phab.enlightenment.org/D1047 --- src/lib/edje/Edje_Edit.h | 35 +++++++++++++++++++++++++++++++++++ src/lib/edje/edje_edit.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h index 5330618..db5c9c1 100644 --- a/src/lib/edje/Edje_Edit.h +++ b/src/lib/edje/Edje_Edit.h @@ -3271,6 +3271,41 @@ 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); +//@} +/******************************************************************************/ +/************************** MAP API ************************************/ +/******************************************************************************/ +/** @name Map API + * Functions to deal with objects with rotation properties (see @ref edcref). + */ //@{ + +/** Get the part's name that is used as the 'perspective point'. + * + * @param obj Object being edited. + * @param part The name of the part. + * @param state The name of the state to get perspective (not including the state value). + * @param value The state value. + * + * @return The name of the source part that is used as 'perspective point'. + * @since 1.11 + */ +EAPI const char * +edje_edit_state_map_perspective_get(Evas_Object *obj, const char *part, const char *state, double value); + +/** Set the part's name that is used as the 'perspective point'. + * + * @param obj Object being edited. + * @param part The name of the part. + * @param state The name of the state to get perspective (not including the state value). + * @param value The state value. + * @param source_part The source part's name. + * + * @return @cEINA_TRUE in case of success, @cEINA_FALSE otherwise. + * @since 1.11 + */ +EAPI Eina_Bool +edje_edit_state_map_perspective_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 'light' for calculating the brightness. * * @param obj Object being edited. diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index bac6127..9ebd81e 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -5993,6 +5993,40 @@ edje_edit_state_map_rotation_center_set(Evas_Object *obj, const char *part, cons } /**************/ +/* MAP API */ +/**************/ + +EAPI const char * +edje_edit_state_map_perspective_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_persp % ed->table_parts_size]; + if (erl->part->name) + return eina_stringshare_add(erl->part->name); + + return NULL; +} + +EAPI Eina_Bool +edje_edit_state_map_perspective_set(Evas_Object *obj, const char *part, const char *state, double value, const char *source_part) +{ + int src_id; + + if (!source_part) return EINA_FALSE; + GET_PD_OR_RETURN(EINA_FALSE); + + src_id = _edje_part_id_find(ed, source_part); + pd->map.id_persp = src_id; + + edje_object_calc_force(obj); + return EINA_TRUE; +} + + +/**************/ /* TEXT API */ /**************/ --