summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukasz Stanislawski <l.stanislaws@samsung.com>2015-06-03 17:36:42 +0200
committerLukasz Stanislawski <l.stanislaws@samsung.com>2015-06-03 17:38:34 +0200
commit9f7de33fdb26db5a3b14fb08a1d99b12cfb41d22 (patch)
treea9e9843faf90838f6d76320c691415284fa0d73c
parent4b041b4740e7bcf759fb936d9ced5015b669616f (diff)
entry: improve at-spi2 accessibility support
* return guide text instead of content * mask passwords * set proper at-spi roles when entry enables password mode.
-rw-r--r--src/lib/elm_entry.c28
-rw-r--r--src/lib/elm_entry.eo1
2 files changed, 29 insertions, 0 deletions
diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c
index c20582e69..c88cfe2d3 100644
--- a/src/lib/elm_entry.c
+++ b/src/lib/elm_entry.c
@@ -59,6 +59,8 @@
59 59
60ELM_PRIV_ENTRY_SIGNALS(ELM_PRIV_STATIC_VARIABLE_DECLARE); 60ELM_PRIV_ENTRY_SIGNALS(ELM_PRIV_STATIC_VARIABLE_DECLARE);
61 61
62#define ENTRY_PASSWORD_MASK_CHARACTER 0x002A
63
62static const Evas_Smart_Cb_Description _smart_callbacks[] = { 64static const Evas_Smart_Cb_Description _smart_callbacks[] = {
63 ELM_PRIV_ENTRY_SIGNALS(ELM_PRIV_SMART_CALLBACKS_DESC) 65 ELM_PRIV_ENTRY_SIGNALS(ELM_PRIV_SMART_CALLBACKS_DESC)
64 {SIG_WIDGET_LANG_CHANGED, ""}, /**< handled by elm_widget */ 66 {SIG_WIDGET_LANG_CHANGED, ""}, /**< handled by elm_widget */
@@ -3813,6 +3815,7 @@ _elm_entry_password_set(Eo *obj, Elm_Entry_Data *sd, Eina_Bool password)
3813 sd->line_wrap = ELM_WRAP_NONE; 3815 sd->line_wrap = ELM_WRAP_NONE;
3814 elm_entry_input_hint_set(obj, ((sd->input_hints & ~ELM_INPUT_HINT_AUTO_COMPLETE) | ELM_INPUT_HINT_SENSITIVE_DATA)); 3816 elm_entry_input_hint_set(obj, ((sd->input_hints & ~ELM_INPUT_HINT_AUTO_COMPLETE) | ELM_INPUT_HINT_SENSITIVE_DATA));
3815 _entry_selection_callbacks_unregister(obj); 3817 _entry_selection_callbacks_unregister(obj);
3818 elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_PASSWORD_TEXT);
3816 } 3819 }
3817 else 3820 else
3818 { 3821 {
@@ -3825,6 +3828,7 @@ _elm_entry_password_set(Eo *obj, Elm_Entry_Data *sd, Eina_Bool password)
3825 3828
3826 elm_entry_input_hint_set(obj, ((sd->input_hints | ELM_INPUT_HINT_AUTO_COMPLETE) & ~ELM_INPUT_HINT_SENSITIVE_DATA)); 3829 elm_entry_input_hint_set(obj, ((sd->input_hints | ELM_INPUT_HINT_AUTO_COMPLETE) & ~ELM_INPUT_HINT_SENSITIVE_DATA));
3827 _entry_selection_callbacks_register(obj); 3830 _entry_selection_callbacks_register(obj);
3831 elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_ENTRY);
3828 } 3832 }
3829 3833
3830 eo_do(obj, elm_obj_widget_theme_apply()); 3834 eo_do(obj, elm_obj_widget_theme_apply());
@@ -5112,6 +5116,9 @@ _elm_entry_elm_interface_atspi_text_character_get(Eo *obj, Elm_Entry_Data *_pd E
5112 5116
5113 free(txt); 5117 free(txt);
5114 5118
5119 if (_pd->password)
5120 ret = ENTRY_PASSWORD_MASK_CHARACTER;
5121
5115 return ret; 5122 return ret;
5116} 5123}
5117 5124
@@ -5198,6 +5205,13 @@ _elm_entry_elm_interface_atspi_text_string_get(Eo *obj, Elm_Entry_Data *_pd EINA
5198 evas_textblock_cursor_free(cur); 5205 evas_textblock_cursor_free(cur);
5199 evas_textblock_cursor_free(cur2); 5206 evas_textblock_cursor_free(cur2);
5200 5207
5208 if (ret && _pd->password)
5209 {
5210 int i = 0;
5211 while (ret[i] != '\0')
5212 ret[i++] = ENTRY_PASSWORD_MASK_CHARACTER;
5213 }
5214
5201 return ret; 5215 return ret;
5202 5216
5203fail: 5217fail:
@@ -5233,6 +5247,13 @@ _elm_entry_elm_interface_atspi_text_text_get(Eo *obj, Elm_Entry_Data *_pd EINA_U
5233 evas_textblock_cursor_free(cur); 5247 evas_textblock_cursor_free(cur);
5234 evas_textblock_cursor_free(cur2); 5248 evas_textblock_cursor_free(cur2);
5235 5249
5250 if (ret && _pd->password)
5251 {
5252 int i = 0;
5253 while (ret[i] != '\0')
5254 ret[i++] = ENTRY_PASSWORD_MASK_CHARACTER;
5255 }
5256
5236 return ret; 5257 return ret;
5237 5258
5238fail: 5259fail:
@@ -5647,4 +5668,11 @@ _elm_entry_elm_interface_atspi_accessible_state_set_get(Eo *obj, Elm_Entry_Data
5647 return ret; 5668 return ret;
5648} 5669}
5649 5670
5671EOLIAN static char*
5672_elm_entry_elm_interface_atspi_accessible_name_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
5673{
5674 const char *ret = edje_object_part_text_get(sd->entry_edje, "elm.guide");
5675 return ret ? strdup(ret) : NULL;
5676}
5677
5650#include "elm_entry.eo.c" 5678#include "elm_entry.eo.c"
diff --git a/src/lib/elm_entry.eo b/src/lib/elm_entry.eo
index c60e84850..baf422c28 100644
--- a/src/lib/elm_entry.eo
+++ b/src/lib/elm_entry.eo
@@ -1200,6 +1200,7 @@ class Elm.Entry (Elm.Layout, Elm_Interface_Scrollable, Evas.Clickable_Interface,
1200 Elm_Interface_Scrollable.policy.set; 1200 Elm_Interface_Scrollable.policy.set;
1201 Elm_Interface_Scrollable.bounce_allow.set; 1201 Elm_Interface_Scrollable.bounce_allow.set;
1202 Elm_Interface_Atspi_Accessible.state_set.get; 1202 Elm_Interface_Atspi_Accessible.state_set.get;
1203 Elm_Interface_Atspi_Accessible.name.get;
1203 Elm_Interface_Atspi_Text.text.get; 1204 Elm_Interface_Atspi_Text.text.get;
1204 Elm_Interface_Atspi_Text.string.get; 1205 Elm_Interface_Atspi_Text.string.get;
1205 Elm_Interface_Atspi_Text.attribute.get; 1206 Elm_Interface_Atspi_Text.attribute.get;