diff --git a/legacy/evas/AUTHORS b/legacy/evas/AUTHORS index 5fc19ad5af..ed740cac26 100644 --- a/legacy/evas/AUTHORS +++ b/legacy/evas/AUTHORS @@ -24,4 +24,5 @@ Sung W. Park Jiyoun Park Myoungwoon Roy Kim(roy_kim) Thierry el Borgi +Shilpa Singh diff --git a/legacy/evas/ChangeLog b/legacy/evas/ChangeLog index 7ed0336bc4..fa7e6056c3 100644 --- a/legacy/evas/ChangeLog +++ b/legacy/evas/ChangeLog @@ -285,3 +285,8 @@ evas_image_loader.extension e.g. evas_image_loader.pdf or evas_image_loader.xcf or evas_image_loader.xcf.gz etc. etc. +2011-04-28 Shilpaonkar Singh + + * Textblock: Add "password" tag to turn on/off password in the middle + of the textblok. Especially useful for implementing "show last char" + for password entries. diff --git a/legacy/evas/src/lib/canvas/evas_object_textblock.c b/legacy/evas/src/lib/canvas/evas_object_textblock.c index 63383fd40d..2e1d450b9e 100644 --- a/legacy/evas/src/lib/canvas/evas_object_textblock.c +++ b/legacy/evas/src/lib/canvas/evas_object_textblock.c @@ -342,6 +342,7 @@ struct _Evas_Object_Textblock_Format unsigned char underline2 : 1; unsigned char strikethrough : 1; unsigned char backing : 1; + unsigned char password : 1; }; struct _Evas_Textblock_Style @@ -1026,6 +1027,7 @@ static const char *linerelgapstr = NULL; static const char *itemstr = NULL; static const char *linefillstr = NULL; static const char *ellipsisstr = NULL; +static const char *passwordstr = NULL; /** * @internal @@ -1066,6 +1068,7 @@ _format_command_init(void) itemstr = eina_stringshare_add("item"); linefillstr = eina_stringshare_add("linefill"); ellipsisstr = eina_stringshare_add("ellipsis"); + passwordstr = eina_stringshare_add("password"); } format_refcount++; } @@ -1109,6 +1112,7 @@ _format_command_shutdown(void) eina_stringshare_del(itemstr); eina_stringshare_del(linefillstr); eina_stringshare_del(ellipsisstr); + eina_stringshare_del(passwordstr); } /** @@ -1510,6 +1514,13 @@ _format_command(Evas_Object *obj, Evas_Object_Textblock_Format *fmt, const char o->have_ellipsis = 1; } } + else if (cmd == passwordstr) + { + if (!strcmp(tmp_param, "off")) + fmt->password = 0; + else if (!strcmp(tmp_param, "on")) + fmt->password = 1; + } if (new_font) { @@ -1993,6 +2004,7 @@ _layout_format_push(Ctxt *c, Evas_Object_Textblock_Format *fmt) fmt->linerelsize = 0.0; fmt->linegap = 0; fmt->linerelgap = 0.0; + fmt->password = 1; } return fmt; } @@ -2770,7 +2782,7 @@ _layout_text_append(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Text /* If we work with a replacement char, create a string which is the same * but with replacement chars instead of regular chars. */ - if ((repch) && (eina_ustrbuf_length_get(n->unicode))) + if ((fmt->password) && (repch) && (eina_ustrbuf_length_get(n->unicode))) { int i, ind; Eina_Unicode *ptr;