summaryrefslogtreecommitdiff
path: root/legacy/elementary/src/lib/elm_access.c
diff options
context:
space:
mode:
authorShinwoo Kim <kimcinoo.efl@gmail.com>2012-11-13 05:50:08 +0000
committerShinwoo Kim <kimcinoo.efl@gmail.com>2012-11-13 05:50:08 +0000
commit58e25b3c43308decb27ad1f8ecdcd5877283cd78 (patch)
tree53a68be6de42f000e068aa3bdaeefaf869a5b6b9 /legacy/elementary/src/lib/elm_access.c
parent17d5be23ff92806b970a7cd3dc70dae21b04d130 (diff)
[access] enhance access features
1. add smart_activate(); to access object. 2. add an API _elm_access_activate_callback_set(); - this callback is called when user wants to activate access object which would represent widget item or edje part object. 3. add owner referece to the Elm_Access_Info for access object. 4. clock: use _elm_access_activate_callback_set(); SVN revision: 79199
Diffstat (limited to 'legacy/elementary/src/lib/elm_access.c')
-rw-r--r--legacy/elementary/src/lib/elm_access.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/legacy/elementary/src/lib/elm_access.c b/legacy/elementary/src/lib/elm_access.c
index 6a5b868..c35a48b 100644
--- a/legacy/elementary/src/lib/elm_access.c
+++ b/legacy/elementary/src/lib/elm_access.c
@@ -26,6 +26,20 @@ _elm_access_smart_on_focus(Evas_Object *obj)
26 return EINA_TRUE; 26 return EINA_TRUE;
27} 27}
28 28
29static Eina_Bool
30_elm_access_smart_activate(Evas_Object *obj, Elm_Activate act)
31{
32 if (act != ELM_ACTIVATE_DEFAULT) return EINA_FALSE;
33
34 Elm_Access_Info *ac = evas_object_data_get(obj, "_elm_access");
35 if (!ac) return EINA_FALSE;
36
37 if (ac->activate)
38 ac->activate(ac->activate_data, ac->part_object, ac->widget_item);
39
40 return EINA_TRUE;
41}
42
29static void 43static void
30_elm_access_smart_set_user(Elm_Widget_Smart_Class *sc) 44_elm_access_smart_set_user(Elm_Widget_Smart_Class *sc)
31{ 45{
@@ -35,6 +49,7 @@ _elm_access_smart_set_user(Elm_Widget_Smart_Class *sc)
35 sc->focus_next = NULL; 49 sc->focus_next = NULL;
36 sc->focus_direction = NULL; 50 sc->focus_direction = NULL;
37 sc->on_focus = _elm_access_smart_on_focus; 51 sc->on_focus = _elm_access_smart_on_focus;
52 sc->activate = _elm_access_smart_activate;
38 53
39 return; 54 return;
40} 55}
@@ -294,6 +309,16 @@ _elm_access_on_highlight_hook_set(Elm_Access_Info *ac,
294} 309}
295 310
296EAPI void 311EAPI void
312_elm_access_activate_callback_set(Elm_Access_Info *ac,
313 Elm_Access_Activate_Cb func,
314 void *data)
315{
316 if (!ac) return;
317 ac->activate = func;
318 ac->activate_data = data;
319}
320
321EAPI void
297_elm_access_highlight_object_activate(Evas_Object *obj, Elm_Activate act) 322_elm_access_highlight_object_activate(Evas_Object *obj, Elm_Activate act)
298{ 323{
299 Evas_Object *highlight_obj; 324 Evas_Object *highlight_obj;
@@ -506,6 +531,7 @@ _elm_access_edje_object_part_object_register(Evas_Object* obj,
506 Evas_Object *ao; 531 Evas_Object *ao;
507 Evas_Object *po = (Evas_Object *)edje_object_part_object_get(eobj, part); 532 Evas_Object *po = (Evas_Object *)edje_object_part_object_get(eobj, part);
508 Evas_Coord x, y, w, h; 533 Evas_Coord x, y, w, h;
534 Elm_Access_Info *ac;
509 535
510 if (!obj || !po) return NULL; 536 if (!obj || !po) return NULL;
511 537
@@ -540,6 +566,10 @@ _elm_access_edje_object_part_object_register(Evas_Object* obj,
540 // set access object 566 // set access object
541 evas_object_data_set(po, "_part_access_obj", ao); 567 evas_object_data_set(po, "_part_access_obj", ao);
542 568
569 /* set owner part object */
570 ac = evas_object_data_get(ao, "_elm_access");
571 ac->part_object = po;
572
543 return ao; 573 return ao;
544} 574}
545 575
@@ -693,6 +723,7 @@ _elm_access_widget_item_register(Elm_Widget_Item *item)
693{ 723{
694 Evas_Object *ao, *ho; 724 Evas_Object *ao, *ho;
695 Evas_Coord x, y, w, h; 725 Evas_Coord x, y, w, h;
726 Elm_Access_Info *ac;
696 727
697 if (!item) return; 728 if (!item) return;
698 729
@@ -713,6 +744,10 @@ _elm_access_widget_item_register(Elm_Widget_Item *item)
713 _elm_access_object_register(ao, ho); 744 _elm_access_object_register(ao, ho);
714 745
715 item->access_obj = ao; 746 item->access_obj = ao;
747
748 /* set owner widget item */
749 ac = evas_object_data_get(ao, "_elm_access");
750 ac->widget_item = item;
716} 751}
717 752
718EAPI void 753EAPI void