summaryrefslogtreecommitdiff
path: root/legacy/elementary/src/lib/elm_access.c
diff options
context:
space:
mode:
Diffstat (limited to 'legacy/elementary/src/lib/elm_access.c')
-rw-r--r--legacy/elementary/src/lib/elm_access.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/legacy/elementary/src/lib/elm_access.c b/legacy/elementary/src/lib/elm_access.c
index 87e221b..468555a 100644
--- a/legacy/elementary/src/lib/elm_access.c
+++ b/legacy/elementary/src/lib/elm_access.c
@@ -6,6 +6,7 @@
6#define MY_CLASS_NAME "elm_access" 6#define MY_CLASS_NAME "elm_access"
7 7
8static Eina_Bool mouse_event_enable = EINA_TRUE; 8static Eina_Bool mouse_event_enable = EINA_TRUE;
9static Eina_Bool read_mode = EINA_FALSE;
9 10
10static Evas_Object * _elm_access_add(Evas_Object *parent); 11static Evas_Object * _elm_access_add(Evas_Object *parent);
11 12
@@ -256,6 +257,17 @@ void _elm_access_mouse_event_enabled_set(Eina_Bool enabled)
256 mouse_event_enable = enabled; 257 mouse_event_enable = enabled;
257} 258}
258 259
260void _elm_access_read_mode_set(Eina_Bool enabled)
261{
262 enabled = !!enabled;
263 if (read_mode == enabled) return;
264 read_mode = enabled;
265}
266
267Eina_Bool _elm_access_read_mode_get()
268{
269 return read_mode;
270}
259//-------------------------------------------------------------------------// 271//-------------------------------------------------------------------------//
260EAPI void 272EAPI void
261_elm_access_highlight_set(Evas_Object* obj) 273_elm_access_highlight_set(Evas_Object* obj)
@@ -332,6 +344,11 @@ _elm_access_highlight_object_activate(Evas_Object *obj, Elm_Activate act)
332 344
333 if (elm_widget_is(highlight)) 345 if (elm_widget_is(highlight))
334 { 346 {
347 _elm_access_read_mode_set(EINA_FALSE);
348
349 if (!elm_object_focus_get(highlight))
350 elm_object_focus_set(highlight, EINA_TRUE);
351
335 elm_widget_activate(highlight, act); 352 elm_widget_activate(highlight, act);
336 return; 353 return;
337 } 354 }
@@ -347,15 +364,7 @@ _elm_access_highlight_object_activate(Evas_Object *obj, Elm_Activate act)
347EAPI void 364EAPI void
348_elm_access_highlight_cycle(Evas_Object *obj, Elm_Focus_Direction dir) 365_elm_access_highlight_cycle(Evas_Object *obj, Elm_Focus_Direction dir)
349{ 366{
350 Evas_Object *highlight, *focused; 367 _elm_access_read_mode_set(EINA_TRUE);
351
352 highlight = _access_highlight_object_get(obj);
353 focused = elm_widget_focused_object_get(obj);
354
355 if (highlight && (highlight != focused))
356 elm_object_focus_set(highlight, EINA_TRUE);
357
358 /* use focus cycle to read next, previous object */
359 elm_widget_focus_cycle(obj, dir); 368 elm_widget_focus_cycle(obj, dir);
360} 369}
361 370
@@ -451,6 +460,8 @@ _elm_access_object_hilight(Evas_Object *obj)
451 if (ptarget) 460 if (ptarget)
452 { 461 {
453 evas_object_data_del(o, "_elm_access_target"); 462 evas_object_data_del(o, "_elm_access_target");
463 elm_widget_parent_highlight_set(ptarget, EINA_FALSE);
464
454 evas_object_event_callback_del_full(ptarget, EVAS_CALLBACK_DEL, 465 evas_object_event_callback_del_full(ptarget, EVAS_CALLBACK_DEL,
455 _access_obj_hilight_del_cb, NULL); 466 _access_obj_hilight_del_cb, NULL);
456 evas_object_event_callback_del_full(ptarget, EVAS_CALLBACK_HIDE, 467 evas_object_event_callback_del_full(ptarget, EVAS_CALLBACK_HIDE,
@@ -462,6 +473,7 @@ _elm_access_object_hilight(Evas_Object *obj)
462 } 473 }
463 } 474 }
464 evas_object_data_set(o, "_elm_access_target", obj); 475 evas_object_data_set(o, "_elm_access_target", obj);
476 elm_widget_parent_highlight_set(obj, EINA_TRUE);
465 477
466 elm_widget_theme_object_set(obj, o, "access", "base", "default"); 478 elm_widget_theme_object_set(obj, o, "access", "base", "default");
467 479
@@ -499,6 +511,7 @@ _elm_access_object_unhilight(Evas_Object *obj)
499 evas_object_event_callback_del_full(ptarget, EVAS_CALLBACK_RESIZE, 511 evas_object_event_callback_del_full(ptarget, EVAS_CALLBACK_RESIZE,
500 _access_obj_hilight_resize_cb, NULL); 512 _access_obj_hilight_resize_cb, NULL);
501 evas_object_del(o); 513 evas_object_del(o);
514 elm_widget_parent_highlight_set(ptarget, EINA_FALSE);
502 } 515 }
503} 516}
504 517
@@ -644,6 +657,7 @@ _elm_access_object_hilight_disable(Evas *e)
644 _access_obj_hilight_resize_cb, NULL); 657 _access_obj_hilight_resize_cb, NULL);
645 } 658 }
646 evas_object_del(o); 659 evas_object_del(o);
660 elm_widget_parent_highlight_set(ptarget, EINA_FALSE);
647} 661}
648 662
649EAPI void 663EAPI void