summaryrefslogtreecommitdiff
path: root/legacy/elementary/src/lib/elm_access.c
diff options
context:
space:
mode:
authorShinwoo Kim <cinoo.kim@samsung.com>2013-07-06 14:41:00 +0900
committerShinwoo Kim <cinoo.kim@samsung.com>2013-07-06 14:41:00 +0900
commite35f12deaa25237a2b095cc6fd46ba9c0cf08f8e (patch)
tree75ffe3ab00e79e258209248ca81bfb3ae6a69db1 /legacy/elementary/src/lib/elm_access.c
parent76657cf05c5f63ea8b6345da8003c74223844f11 (diff)
[access] add elm_access_highlight_next_set, export elm_widget_focus_region_show
Diffstat (limited to 'legacy/elementary/src/lib/elm_access.c')
-rw-r--r--legacy/elementary/src/lib/elm_access.c94
1 files changed, 79 insertions, 15 deletions
diff --git a/legacy/elementary/src/lib/elm_access.c b/legacy/elementary/src/lib/elm_access.c
index 7d88085..9c90d0f 100644
--- a/legacy/elementary/src/lib/elm_access.c
+++ b/legacy/elementary/src/lib/elm_access.c
@@ -509,26 +509,42 @@ _access_highlight_next_get(Evas_Object *obj, Elm_Focus_Direction dir)
509 509
510 _elm_access_read_mode_set(EINA_TRUE); 510 _elm_access_read_mode_set(EINA_TRUE);
511 511
512 ret = elm_widget_focus_next_get(obj, dir, &target); 512 if (dir == ELM_FOCUS_NEXT)
513 if (ret && target) 513 type = ELM_ACCESS_ACTION_HIGHLIGHT_NEXT;
514 { 514 else
515 if (dir == ELM_FOCUS_NEXT) 515 type = ELM_ACCESS_ACTION_HIGHLIGHT_PREV;
516 type = ELM_ACCESS_ACTION_HIGHLIGHT_NEXT;
517 else
518 type = ELM_ACCESS_ACTION_HIGHLIGHT_PREV;
519 516
520 if (!_access_action_callback_call(ho, type, NULL)) 517 /* this value is used in _elm_access_object_highlight();
518 to inform the target object of how to get highlight */
519 action_by = type;
520
521 if (!_access_action_callback_call(ho, type, NULL))
522 {
523 if (ho)
521 { 524 {
522 /* this value is used in _elm_access_object_highlight(); 525 Elm_Access_Info *info = _elm_access_object_get(ho);
523 to inform the target object of how to get highlight */ 526 if (type == ELM_ACCESS_ACTION_HIGHLIGHT_NEXT && info->next)
524 action_by = type; 527 target = info->next;
528 else if (type == ELM_ACCESS_ACTION_HIGHLIGHT_PREV && info->prev)
529 target = info->prev;
530 }
525 531
532 if (target)
533 {
526 _elm_access_highlight_set(target); 534 _elm_access_highlight_set(target);
527 535 elm_widget_focus_region_show(target);
528 action_by = ELM_ACCESS_ACTION_FIRST; 536 ret = EINA_TRUE;
537 }
538 else
539 {
540 ret = elm_widget_focus_next_get(obj, dir, &target);
541 if (ret && target)
542 _elm_access_highlight_set(target);
529 } 543 }
530 } 544 }
531 545
546 action_by = ELM_ACCESS_ACTION_FIRST;
547
532 _elm_access_read_mode_set(EINA_FALSE); 548 _elm_access_read_mode_set(EINA_FALSE);
533 549
534 return ret; 550 return ret;
@@ -659,8 +675,27 @@ _elm_access_highlight_cycle(Evas_Object *obj, Elm_Focus_Direction dir)
659 675
660 action_by = type; 676 action_by = type;
661 677
662 if (!_access_action_callback_call(ho, type, NULL)) 678 if (!ho) elm_widget_focus_cycle(obj, dir);
663 elm_widget_focus_cycle(obj, dir); 679 else if (!_access_action_callback_call(ho, type, NULL))
680 {
681 Elm_Access_Info *info = _elm_access_object_get(ho);
682 Evas_Object *comming = NULL;
683 if (type == ELM_ACCESS_ACTION_HIGHLIGHT_NEXT)
684 {
685 if ((info) && (info->next)) comming = info->next;
686 }
687 else
688 {
689 if ((info) && (info->prev)) comming = info->prev;
690 }
691 if (comming)
692 {
693 _elm_access_highlight_set(comming);
694 elm_widget_focus_region_show(comming);
695 }
696 else
697 elm_widget_focus_cycle(obj, dir);
698 }
664 699
665 action_by = ELM_ACCESS_ACTION_FIRST; 700 action_by = ELM_ACCESS_ACTION_FIRST;
666 701
@@ -1287,6 +1322,35 @@ elm_access_external_info_get(const Evas_Object *obj)
1287 return _elm_access_text_get(ac, ELM_ACCESS_CONTEXT_INFO, obj); 1322 return _elm_access_text_get(ac, ELM_ACCESS_CONTEXT_INFO, obj);
1288} 1323}
1289 1324
1325EAPI void
1326elm_access_highlight_next_set(Evas_Object *obj, Elm_Highlight_Direction dir, Evas_Object *next)
1327{
1328 EINA_SAFETY_ON_FALSE_RETURN(obj);
1329 EINA_SAFETY_ON_FALSE_RETURN(next);
1330
1331 Elm_Access_Info *info = _elm_access_object_get(obj);
1332 Elm_Access_Info *info_next = _elm_access_object_get(next);
1333
1334 if (!info || !info_next)
1335 {
1336 ERR("There is no access information");
1337 return;
1338 }
1339
1340 if (dir == ELM_HIGHLIGHT_DIR_NEXT)
1341 {
1342 info_next->prev = obj;
1343 info->next = next;
1344 }
1345 else if (dir == ELM_HIGHLIGHT_DIR_PREVIOUS)
1346 {
1347 info_next->next = obj;
1348 info->prev = next;
1349 }
1350 else
1351 ERR("Not supported focus direction for access highlight [%d]", dir);
1352}
1353
1290static void 1354static void
1291_elm_access_smart_access(Eo *obj, void *_pd EINA_UNUSED, va_list *list) 1355_elm_access_smart_access(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
1292{ 1356{