cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8370b22fa889b176a9c3af69d5e98f8007b9b4c8
commit 8370b22fa889b176a9c3af69d5e98f8007b9b4c8 Author: Igor Gala <[email protected]> Date: Tue Jun 17 09:50:22 2014 +0200 edje: Edje_Edit - add edje_edit_part_entry_mode_xet() Summary: There are new 'get and set' API for block 'entry_mode'. These properties have only parts with type 'TEXTBLOCK'. These functions return or set entry mode for a given part. @feature Reviewers: seoz, cedric, Hermet, raster CC: reutskiy.v.v, cedric Differential Revision: https://phab.enlightenment.org/D1033 Signed-off-by: Cedric BAIL <[email protected]> --- src/lib/edje/Edje_Edit.h | 41 +++++++++++++++++++++++++++++++++++++---- src/lib/edje/edje_edit.c | 27 ++++++++++++++++++++++++++- 2 files changed, 63 insertions(+), 5 deletions(-) diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h index 11ae4af..58cffcf 100644 --- a/src/lib/edje/Edje_Edit.h +++ b/src/lib/edje/Edje_Edit.h @@ -33,7 +33,6 @@ # endif #endif - typedef enum _Edje_Edit_Image_Comp { EDJE_EDIT_IMAGE_COMP_RAW, @@ -58,6 +57,14 @@ typedef enum _Edje_Edit_Sound_Comp EDJE_EDIT_SOUND_COMP_AS_IS } Edje_Edit_Sound_Comp; +typedef enum _Edje_Edit_Entry_Mode +{ + EDJE_EDIT_ENTRY_MODE_NONE, + EDJE_EDIT_ENTRY_MODE_PLAIN, + EDJE_EDIT_ENTRY_MODE_EDITABLE, + EDJE_EDIT_ENTRY_MODE_PASSWORD +} Edje_Edit_Entry_Mode; + struct _Edje_Edit_Script_Error { const char *program_name; /* null == group shared script */ @@ -792,16 +799,17 @@ EAPI Eina_Bool edje_edit_external_del(Evas_Object *obj, const char *external); */ //@{ /** Get the select mode for a textblock part - * + * @param obj Object being edited. * @param part Name of the part. - + * * @return One of possible enum Edje_Edit_Select_Mode. + * @since 1.11 */ EAPI Edje_Edit_Select_Mode edje_edit_part_select_mode_get(Evas_Object *obj, const char *part); -/** Sets the select mode for a textblock part +/** Set the select mode for a textblock part * * @param obj Object being edited. * @param part Name of the part. @@ -809,10 +817,35 @@ edje_edit_part_select_mode_get(Evas_Object *obj, const char *part); * EDJE_EDIT_SELECT_MODE_DEFAULT, EDJE_EDIT_SELECT_MODE_EXPLICIT. * * @return EINA_TRUE if successful, EINA_FALSE otherwise. + * @since 1.11 */ EAPI Eina_Bool edje_edit_part_select_mode_set(Evas_Object *obj, const char *part, Edje_Edit_Select_Mode mode); +/** Get the edit mode for a textblock part + * + * @param obj Object being edited. + * @param part Name of the part. + * + * @return One of possible enum Edje_Entry_Mode. + * @since 1.11 + */ +EAPI Edje_Edit_Entry_Mode +edje_edit_part_entry_mode_get(Evas_Object *obj, const char *part); + +/** Set the edit mode for a textblock part + * + * @param obj Object being edited. + * @param part Name of the part. + * @param mode One of possible enum Edje_Entry_Mode: + * EDJE_EDIT_ENTRY_MODE_NONE, EDJE_EDIT_ENTRY_MODE_PLAIN, EDJE_EDIT_ENTRY_MODE_EDITABLE, EDJE_EDIT_ENTRY_MODE_PASSWORD. + + * @return EINA_TRUE if successful, EINA_FALSE otherwise. + * @since 1.11 + */ +EAPI Eina_Bool +edje_edit_part_entry_mode_set(Evas_Object *obj, const char *part, Edje_Edit_Entry_Mode mode); + /** Get the list of all the parts in the given edje object. * * @param obj Object being edited. diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index 94401f8..76101f8 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -2637,7 +2637,32 @@ edje_edit_part_select_mode_set(Evas_Object *obj, const char *part, Edje_Edit_Sel return EINA_FALSE; rp->part->select_mode = (unsigned char) mode; - return EINA_TRUE; + return EINA_TRUE; +} + +EAPI Edje_Edit_Entry_Mode +edje_edit_part_entry_mode_get(Evas_Object *obj, const char *part) +{ + GET_RP_OR_RETURN(EINA_FALSE); + + if (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) + return EINA_FALSE; + + return (Edje_Edit_Entry_Mode) rp->part->entry_mode; +} + +EAPI Eina_Bool +edje_edit_part_entry_mode_set(Evas_Object *obj, const char *part, Edje_Edit_Entry_Mode mode) +{ + if (mode > EDJE_EDIT_ENTRY_MODE_PASSWORD) + return EINA_FALSE; + GET_RP_OR_RETURN(EINA_FALSE); + + if (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) + return EINA_FALSE; + + rp->part->entry_mode = (unsigned char) mode; + return EINA_TRUE; } EAPI Eina_List * --
