cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=7e4b9b6f09ea50555ee48c0a100e152a5206f79d

commit 7e4b9b6f09ea50555ee48c0a100e152a5206f79d
Author: Igor Gala <[email protected]>
Date:   Mon Jun 16 18:45:26 2014 +0200

    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 <[email protected]>
---
 src/lib/edje/Edje_Edit.h | 30 ++++++++++++++++++++++++++++++
 src/lib/edje/edje_edit.c | 29 +++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+)

diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h
index 3f46e02..2adcdf3 100644
--- a/src/lib/edje/Edje_Edit.h
+++ b/src/lib/edje/Edje_Edit.h
@@ -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   ************************************/
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index be2d945..e45e282 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -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 */
 /**************/

-- 


Reply via email to