From: Shinwoo Kim Date: Wed, 22 May 2013 05:43:56 +0000 (+0900) Subject: [access] support automatically read in order X-Git-Tag: accepted/tizen/20130927.071315^2~460 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6dece539e6a6e3185a863aad8f48572fade97572;p=profile%2Fmobile%2Felementary.git [access] support automatically read in order Change-Id: I3a81087e0db152618a86b3907dd389e6828f74a5 --- diff --git a/src/lib/elm_access.c b/src/lib/elm_access.c index 008c2da..eb21f8e 100644 --- a/src/lib/elm_access.c +++ b/src/lib/elm_access.c @@ -335,7 +335,6 @@ static void _access_read_done(void *data __UNUSED__) { printf("read done\n"); - // FIXME: produce event here } static void @@ -714,6 +713,42 @@ _access_highlight_next_get(Evas_Object *obj, Elm_Focus_Direction dir) return ret; } +void +_elm_access_all_read_stop() +{ + _access_init(); + if (mapi) + { + if (mapi->out_done_callback_set) + mapi->out_done_callback_set(NULL, NULL); + } +} + +static void +_access_all_read_done(void *data) +{ + printf("all read done\n"); + _elm_access_highlight_cycle(data, ELM_FOCUS_NEXT); +} + +void +_elm_access_all_read_start(Evas_Object *obj) +{ + Evas_Object *ho; + + ho = _access_highlight_object_get(obj); + if (ho) _elm_access_object_unhilight(ho); + + _access_init(); + if (mapi) + { + if (mapi->out_done_callback_set) + mapi->out_done_callback_set(_access_all_read_done, obj); + } + + _elm_access_highlight_cycle(obj, ELM_FOCUS_NEXT); +} + //-------------------------------------------------------------------------// EAPI void _elm_access_highlight_set(Evas_Object* obj) @@ -839,12 +874,11 @@ _elm_access_highlight_cycle(Evas_Object *obj, Elm_Focus_Direction dir) Evas_Object *ho, *parent; ho = _access_highlight_object_get(obj); - if (!ho) return; parent = ho; /* find highlight root */ - do + while (parent) { ELM_WIDGET_DATA_GET(parent, sd); if (sd->highlight_root) @@ -855,7 +889,6 @@ _elm_access_highlight_cycle(Evas_Object *obj, Elm_Focus_Direction dir) } parent = elm_widget_parent_get(parent); } - while (parent); _elm_access_auto_highlight_set(EINA_TRUE); @@ -866,7 +899,7 @@ _elm_access_highlight_cycle(Evas_Object *obj, Elm_Focus_Direction dir) action_by = type; - if (!_access_action_callback_call(ho, type, NULL)) + if (!ho || !_access_action_callback_call(ho, type, NULL)) elm_widget_focus_cycle(obj, dir); action_by = ELM_ACCESS_ACTION_FIRST; @@ -931,8 +964,6 @@ _elm_access_say(const char *txt) _access_init(); if (mapi) { - if (mapi->out_done_callback_set) - mapi->out_done_callback_set(_access_read_done, NULL); if (mapi->out_cancel) mapi->out_cancel(); if (txt) { diff --git a/src/lib/elm_widget.h b/src/lib/elm_widget.h index a5cb5f5..2df9778 100644 --- a/src/lib/elm_widget.h +++ b/src/lib/elm_widget.h @@ -594,6 +594,8 @@ const Eina_List *_elm_access_widget_item_access_order_get(const Elm_Widget_ void _elm_access_widget_item_access_order_unset(Elm_Widget_Item *item); void _elm_access_highlight_object_scroll(Evas_Object *obj, int type, int x, int y); void _elm_access_highlight_object_mouse(Evas_Object *obj, int type, int x, int y); +void _elm_access_all_read_start(Evas_Object *obj); +void _elm_access_all_read_stop(); EAPI void _elm_access_clear(Elm_Access_Info *ac); EAPI void _elm_access_text_set(Elm_Access_Info *ac, int type, const char *text); diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c index 515efa4..c930b8c 100755 --- a/src/lib/elm_win.c +++ b/src/lib/elm_win.c @@ -2020,6 +2020,10 @@ _elm_win_client_message(void *data, atom_scroll = ecore_x_atom_get("_E_MOD_SCREEN_READER_ACTION_SCROLL_"); atom_back = ecore_x_atom_get("_E_MOD_SCREEN_READER_ACTION_BACK_"); atom_control_panel_open = ecore_x_atom_get("_E_MOD_SCREEN_READER_ACTION_CONTROL_PANEL_OPEN_"); + if ((unsigned int)e->data.l[1] != atom_control_panel_open) + { + _elm_access_all_read_stop(); + } if ((unsigned int)e->data.l[1] == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_NEXT) @@ -2109,6 +2113,7 @@ _elm_win_client_message(void *data, } else if ((unsigned int)e->data.l[1] == atom_control_panel_open) { + _elm_access_all_read_start(ELM_WIDGET_DATA(sd)->obj); } } }