From fb4e481bdb247c34f6958e3430bdef417e9d1485 Mon Sep 17 00:00:00 2001 From: Prasoon Singh Date: Thu, 6 Oct 2016 20:49:24 +0530 Subject: [PATCH] [atspi] Expose access object only when brigde is connected. Change-Id: Ibfda3df165475d72395105daf80710e056d1a865 --- src/lib/elc_multibuttonentry.c | 4 ++-- src/lib/elc_naviframe.c | 2 +- src/lib/elc_popup.c | 2 +- src/lib/elm_calendar.c | 2 +- src/lib/elm_flipselector.c | 2 +- src/lib/elm_priv.h | 12 ++++++++++++ 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/lib/elc_multibuttonentry.c b/src/lib/elc_multibuttonentry.c index ca28ab1..daa061a 100644 --- a/src/lib/elc_multibuttonentry.c +++ b/src/lib/elc_multibuttonentry.c @@ -989,7 +989,7 @@ _item_new(Elm_Multibuttonentry_Data *sd, //TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off, //register/unregister access objects accordingly. - if (_elm_config->atspi_mode) + if (_elm_atspi_enabled()) _atspi_multibuttonentry_item_register(obj, eo_item, EINA_TRUE); // return eo_item; @@ -1517,7 +1517,7 @@ _view_init(Evas_Object *obj, Elm_Multibuttonentry_Data *sd) _access_multibuttonentry_label_register(obj, EINA_TRUE); //TIZEN_ONLY(20160527) : expose label as at-spi object - if (_elm_config->atspi_mode) + if (_elm_atspi_enabled()) _atspi_multibuttonentry_label_register(obj, EINA_TRUE); /// diff --git a/src/lib/elc_naviframe.c b/src/lib/elc_naviframe.c index face85c..a3c1b75 100644 --- a/src/lib/elc_naviframe.c +++ b/src/lib/elc_naviframe.c @@ -386,7 +386,7 @@ _item_style_set(Elm_Naviframe_Item_Data *it, evas_object_freeze_events_set(VIEW(it), EINA_FALSE); //TIZEN ONLY(20151012): expose title as at-spi object - if (_elm_config->atspi_mode) + if (_elm_atspi_enabled()) _atspi_expose_title(it, EINA_TRUE); // } diff --git a/src/lib/elc_popup.c b/src/lib/elc_popup.c index be0176a..47687f7 100644 --- a/src/lib/elc_popup.c +++ b/src/lib/elc_popup.c @@ -1204,7 +1204,7 @@ _title_text_set(Evas_Object *obj, } //TIZEN ONLY(20150717): expose title as at-spi object - if (_elm_config->atspi_mode) + if (_elm_atspi_enabled()) _atspi_expose_title(obj, EINA_TRUE); // if (sd->title_text) diff --git a/src/lib/elm_calendar.c b/src/lib/elm_calendar.c index 91dcb98..4a7dc65 100644 --- a/src/lib/elm_calendar.c +++ b/src/lib/elm_calendar.c @@ -912,7 +912,7 @@ _populate(Evas_Object *obj) edje_object_message_signal_process(elm_layout_edje_get(obj)); //TIZEN_ONLY(20151012): Register smart callbacks for calendar buttons. - if (_elm_config->atspi_mode) + if (_elm_atspi_enabled()) _atspi_expose_objects(obj, EINA_TRUE); // } diff --git a/src/lib/elm_flipselector.c b/src/lib/elm_flipselector.c index 1bd6da8..bdf5596 100644 --- a/src/lib/elm_flipselector.c +++ b/src/lib/elm_flipselector.c @@ -666,7 +666,7 @@ _elm_flipselector_eo_base_constructor(Eo *obj, Elm_Flipselector_Data *sd) elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_LIST)); //TIZEN ONLY(20151012): expose flipselector top/bottom buttons for accessibility tree - if (_elm_config->atspi_mode) + if (_elm_atspi_enabled()) _atspi_expose_flipselector_top_bottom(sd, EINA_TRUE); // return obj; diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h index 3032819..7f71cb7 100644 --- a/src/lib/elm_priv.h +++ b/src/lib/elm_priv.h @@ -610,6 +610,18 @@ _elm_dgettext(const char *string) #endif +//TIZEN_ONLY(20160710): Expose access object only when brigde is connected. +static inline Eina_Bool +_elm_atspi_enabled() +{ + Eo *bridge = NULL; + Eina_Bool ret = EINA_FALSE; + if (_elm_config->atspi_mode && (bridge = _elm_atspi_bridge_get())) + eo_do(bridge, ret = elm_obj_atspi_bridge_connected_get()); + return ret; +} +// + /* Used by the paste handler */ void _elm_entry_entry_paste(Evas_Object *obj, const char *entry); -- 2.7.4