objects accordingly. naviframe, popup, calendar,flipselector.
Change-Id: Ia4d1caa8342f6bbbdd5109627abdff8c720567ea
Signed-off-by: Shilpa Singh <shilpa.singh@samsung.com>
evas_object_propagate_events_set(VIEW(item), !is_access);
}
+//TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
+//register/unregister access objects accordingly.
+static char *
+_label_access_info_cb(void *data, Evas_Object *obj EINA_UNUSED)
+{
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(data, sd, NULL);
+ return strdup((char *)sd->label_str);
+}
+
+static void
+_atspi_multibuttonentry_label_register(Evas_Object *obj, Eina_Bool is_atspi)
+{
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
+ Evas_Object *label_obj;
+ label_obj = (Evas_Object *)edje_object_part_object_get(sd->label, "elm.text");
+ if (label_obj)
+ {
+ if (is_atspi)
+ {
+ sd->label_access = elm_access_object_register(label_obj, obj);
+ _elm_access_callback_set(_elm_access_info_get(sd->label_access),
+ ELM_ACCESS_INFO, _label_access_info_cb, obj);
+ elm_atspi_accessible_role_set(sd->label_access, ELM_ATSPI_ROLE_HEADING);
+ evas_object_pass_events_set(label_obj, !_elm_config->atspi_mode);
+ evas_object_propagate_events_set(sd->label, !_elm_config->atspi_mode);
+ }
+ else
+ {
+ elm_access_object_unregister(label_obj);
+ }
+ }
+}
+
+static void
+_atspi_multibuttonentry_item_register(Evas_Object *obj,
+ Elm_Object_Item *eo_item,
+ Eina_Bool is_atspi)
+{
+ ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
+ if (is_atspi)
+ {
+ elm_interface_atspi_accessible_children_changed_added_signal_emit(obj, eo_item);
+ elm_interface_atspi_accessible_added(eo_item);
+ }
+ else
+ elm_interface_atspi_accessible_children_changed_del_signal_emit(WIDGET(item), eo_item);
+}
+//
+
EOLIAN static Eo *
_elm_multibuttonentry_item_eo_base_constructor(Eo *eo_item, Elm_Multibuttonentry_Item_Data *item)
{
}
eo_do(obj, eo_event_callback_call
(ELM_MULTIBUTTONENTRY_EVENT_ITEM_ADDED, eo_item));
- if (_elm_config->atspi_mode)
- {
- elm_interface_atspi_accessible_children_changed_added_signal_emit(obj, eo_item);
- elm_interface_atspi_accessible_added(eo_item);
- }
-
+ //TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
+ //register/unregister access objects accordingly.
+ if (_elm_config->atspi_mode)
+ _atspi_multibuttonentry_item_register(obj, eo_item, EINA_TRUE);
+ //
return eo_item;
}
}
}
-static char *
-_label_access_info_cb(void *data, Evas_Object *obj EINA_UNUSED)
-{
- ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN_VAL(data, sd, NULL);
- return strdup((char *)sd->label_str);
-}
-
static void
_view_init(Evas_Object *obj, Elm_Multibuttonentry_Data *sd)
{
//TIZEN_ONLY(20160527) : expose label as at-spi object
if (_elm_config->atspi_mode)
- {
- Evas_Object *label_obj;
- label_obj = (Evas_Object *)edje_object_part_object_get(sd->label, "elm.text");
- if (label_obj)
- {
- sd->label_access = elm_access_object_register(label_obj, obj);
- _elm_access_callback_set(_elm_access_info_get(sd->label_access),
- ELM_ACCESS_INFO, _label_access_info_cb, obj);
- elm_atspi_accessible_role_set(sd->label_access, ELM_ATSPI_ROLE_HEADING);
- evas_object_pass_events_set(label_obj, !_elm_config->atspi_mode);
- evas_object_propagate_events_set(sd->label, !_elm_config->atspi_mode);
- }
- }
+ _atspi_multibuttonentry_label_register(obj, EINA_TRUE);
///
sd->entry = elm_entry_add(obj);
_access_multibuttonentry_item_register(obj, it, is_access);
}
+//TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
+//register/unregister access objects accordingly.
+static void
+_atspi_obj_process(Evas_Object *obj, Eina_Bool is_atspi)
+{
+ Eina_List *l;
+ Elm_Object_Item *it;
+
+ ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(obj, sd);
+
+ /* label */
+ _atspi_multibuttonentry_label_register(obj, is_atspi);
+
+ /* items */
+ EINA_LIST_FOREACH(sd->items, l, it)
+ _atspi_multibuttonentry_item_register(obj, it, is_atspi);
+}
+//
+
EOLIAN static void
_elm_multibuttonentry_elm_widget_access(Eo *obj, Elm_Multibuttonentry_Data *sd EINA_UNUSED, Eina_Bool acs)
{
_access_obj_process(obj, _elm_multibuttonentry_smart_focus_next_enable);
}
+//TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
+//register/unregister access objects accordingly.
+EOLIAN static void
+_elm_multibuttonentry_elm_widget_atspi(Eo *obj, Elm_Multibuttonentry_Data *sd EINA_UNUSED, Eina_Bool is_atspi)
+{
+ _atspi_obj_process(obj, is_atspi);
+}
+//
+
EAPI Evas_Object *
elm_multibuttonentry_add(Evas_Object *parent)
{
static void
_unregister_naviframe_atspi_bridge_callbacks(Elm_Naviframe_Item_Data *it)
{
- if (!_elm_config->atspi_mode) return;
-
eo_do(_elm_atspi_bridge_get(),
eo_event_callback_del(ELM_ATSPI_BRIDGE_EVENT_CONNECTED, _naviframe_atspi_bridge_on_connect_cb, it));
eo_do(_elm_atspi_bridge_get(),
}
static void
-_atspi_expose_title(Elm_Naviframe_Item_Data *it)
+_atspi_expose_title(Elm_Naviframe_Item_Data *it, Eina_Bool is_atspi)
{
Eina_Bool connected = EINA_FALSE;
-
- if (!_elm_config->atspi_mode) return;
+ _unregister_naviframe_atspi_bridge_callbacks(it);
+ if (!is_atspi) return;
// If bridge is connected expose it now
eo_do(_elm_atspi_bridge_get(), connected = elm_obj_atspi_bridge_connected_get());
evas_object_freeze_events_set(VIEW(it), EINA_FALSE);
//TIZEN ONLY(20151012): expose title as at-spi object
- _atspi_expose_title(it);
+ if (_elm_config->atspi_mode)
+ _atspi_expose_title(it, EINA_TRUE);
//
}
_access_obj_process(it, is_access);
}
+//TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
+//register/unregister access objects accordingly.
+EOLIAN static void
+_elm_naviframe_elm_widget_atspi(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd, Eina_Bool is_atspi)
+{
+ Elm_Naviframe_Item_Data *it;
+
+ EINA_INLIST_FOREACH(sd->stack, it)
+ _atspi_expose_title(it, is_atspi);
+}
+//
+
static void
_item_push_helper(Elm_Naviframe_Item_Data *item)
{
elm_object_mirrored_set(sd->notify, rtl);
}
+//TIZEN ONLY(20150717): expose title as at-spi object
+static char *
+_access_info_cb(void *data, Evas_Object *obj EINA_UNUSED)
+{
+ Eina_Strbuf *buf;
+ Elm_Popup_Data *priv = data;
+ char *ret = NULL;
+ if (priv->title_text)
+ {
+ buf = eina_strbuf_new();
+ eina_strbuf_append_printf(buf, "%s, %s", priv->title_text, N_("Title"));
+ ret = eina_strbuf_string_steal(buf);
+ eina_strbuf_free(buf);
+ return strdup(ret);
+ }
+ return NULL;
+}
+//
+
+//TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
+//register/unregister access objects accordingly.
+static void
+_atspi_expose_title(Eo *obj, Eina_Bool is_atspi)
+{
+ Evas_Object *ao = NULL;
+ ELM_POPUP_DATA_GET(obj, sd);
+
+ if (sd->title_text && is_atspi)
+ {
+ ao = _access_object_get(obj, ACCESS_TITLE_PART);
+ if (!ao)
+ {
+ ao = _elm_access_edje_object_part_object_register
+ (sd->main_layout, elm_layout_edje_get(sd->main_layout), ACCESS_TITLE_PART);
+ elm_atspi_accessible_role_set(ao, ELM_ATSPI_ROLE_HEADING);
+ _elm_access_callback_set(_elm_access_info_get(ao),
+ ELM_ACCESS_INFO, _access_info_cb, sd);
+ }
+ }
+ else
+ {
+ ao = _access_object_get(obj, ACCESS_TITLE_PART);
+ if (ao)
+ _elm_access_object_unregister(ao, NULL);
+ }
+}
+//
+
static void
_access_obj_process(Eo *obj, Eina_Bool is_access)
{
}
}
-//TIZEN ONLY(20150717): expose title as at-spi object
-static char *
-_access_info_cb(void *data, Evas_Object *obj EINA_UNUSED)
-{
- Eina_Strbuf *buf;
- Elm_Popup_Data *priv = data;
- char *ret = NULL;
- if (priv->title_text)
- {
- buf = eina_strbuf_new();
- eina_strbuf_append_printf(buf, "%s, %s", priv->title_text, N_("Title"));
- ret = eina_strbuf_string_steal(buf);
- eina_strbuf_free(buf);
- return strdup(ret);
- }
- return NULL;
-}
-//
-
static Eina_Bool
_title_text_set(Evas_Object *obj,
const char *text)
//TIZEN ONLY(20150717): expose title as at-spi object
if (_elm_config->atspi_mode)
- {
- if (sd->title_text)
- {
- ao = _access_object_get(obj, ACCESS_TITLE_PART);
- if (!ao)
- {
- ao = _elm_access_edje_object_part_object_register
- (sd->main_layout, elm_layout_edje_get(sd->main_layout), ACCESS_TITLE_PART);
- elm_atspi_accessible_role_set(ao, ELM_ATSPI_ROLE_HEADING);
- _elm_access_callback_set(_elm_access_info_get(ao),
- ELM_ACCESS_INFO, _access_info_cb, sd);
- }
- }
- else
- {
- ao = _access_object_get(obj, ACCESS_TITLE_PART);
- if (ao)
- _elm_access_object_unregister(ao, NULL);
- }
- }
+ _atspi_expose_title(obj, EINA_TRUE);
//
if (sd->title_text)
elm_layout_signal_emit(sd->main_layout, "elm,state,title,text,visible", "elm");
_access_obj_process(obj, is_access);
}
+//TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
+//register/unregister access objects accordingly.
+EOLIAN static void
+_elm_popup_elm_widget_atspi(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED, Eina_Bool is_atspi)
+{
+ _atspi_expose_title(obj, is_atspi);
+}
+//
+
EAPI Evas_Object *
elm_popup_add(Evas_Object *parent)
{
if (p)
pd->pending_requests = eina_list_append(pd->pending_requests, p);
}
+
static void
_screen_reader_enabled_get(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
_a11y_connection_init(data);
else
DBG("AT-SPI2 stack not enabled.");
+ //TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
+ //register/unregister access objects accordingly.
+ _elm_win_atspi(is_enabled);
+ //
}
static void _bridge_object_register(Eo *bridge, Eo *obj)
_a11y_connection_init(bridge);
else
_a11y_connection_shutdown(bridge);
+ //TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
+ //register/unregister access objects accordingly.
+ _elm_win_atspi(val);
+ //
}
}
}
static void
-_register_smart_callbacks_for_calendar_buttons(Evas_Object *obj)
+_atspi_expose_objects(Evas_Object *obj, Eina_Bool is_atspi)
{
Eina_Bool connected = EINA_FALSE;
-
- if (!_elm_config->atspi_mode) return;
-
- // If already connected register callendar buttons callbacks
- eo_do(_elm_atspi_bridge_get(), connected = elm_obj_atspi_bridge_connected_get());
- if (connected)
- _calendar_atspi_bridge_on_connect_cb(obj, NULL, NULL, NULL);
-
// Register bridge connect/disconnect
_unregister_atspi_calendar_bridge_callbacks(obj);
- eo_do(_elm_atspi_bridge_get(),
- eo_event_callback_add(ELM_ATSPI_BRIDGE_EVENT_CONNECTED, _calendar_atspi_bridge_on_connect_cb, obj));
- eo_do(_elm_atspi_bridge_get(),
- eo_event_callback_add(ELM_ATSPI_BRIDGE_EVENT_DISCONNECTED, _calendar_atspi_bridge_on_disconnect_cb, obj));
+ if (is_atspi)
+ {
+ // If already connected register callendar buttons callbacks
+ eo_do(_elm_atspi_bridge_get(), connected = elm_obj_atspi_bridge_connected_get());
+ if (connected)
+ _calendar_atspi_bridge_on_connect_cb(obj, NULL, NULL, NULL);
+ eo_do(_elm_atspi_bridge_get(),
+ eo_event_callback_add(ELM_ATSPI_BRIDGE_EVENT_CONNECTED,
+ _calendar_atspi_bridge_on_connect_cb, obj));
+ eo_do(_elm_atspi_bridge_get(),
+ eo_event_callback_add(ELM_ATSPI_BRIDGE_EVENT_DISCONNECTED,
+ _calendar_atspi_bridge_on_disconnect_cb, obj));
+ }
}
//
edje_object_message_signal_process(elm_layout_edje_get(obj));
//TIZEN_ONLY(20151012): Register smart callbacks for calendar buttons.
- _register_smart_callbacks_for_calendar_buttons(obj);
+ if (_elm_config->atspi_mode)
+ _atspi_expose_objects(obj, EINA_TRUE);
//
}
_access_obj_process(obj, _elm_calendar_smart_focus_next_enable);
}
+//TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
+//register/unregister access objects accordingly.
+EOLIAN static void
+_elm_calendar_elm_widget_atspi(Eo *obj EINA_UNUSED, Elm_Calendar_Data *_pd EINA_UNUSED, Eina_Bool is_atspi)
+{
+ _atspi_expose_objects(obj, is_atspi);
+}
+//
+
EAPI Evas_Object *
elm_calendar_add(Evas_Object *parent)
{
Elm.Widget.focus_next_manager_is;
Elm.Widget.focus_direction_manager_is;
Elm.Widget.access;
+ //TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
+ //register/unregister access objects accordingly.
+ Elm.Widget.atspi;
+ //
Elm.Widget.focus_next;
Elm.Widget.event;
Elm.Layout.sizing_eval;
if ((_elm_config->atspi_mode == is_enabled) && (connected == is_enabled)) return;
//
_elm_config->atspi_mode = is_enabled;
-
if (!is_enabled) _elm_atspi_bridge_shutdown();
else _elm_atspi_bridge_init();
}
}
static void
-_atspi_expose_flipselector_top_bottom(Elm_Flipselector_Data *sd)
+_atspi_expose_flipselector_top_bottom(Elm_Flipselector_Data *sd, Eina_Bool is_atspi)
{
Eina_Bool connected = EINA_FALSE;
- if (!_elm_config->atspi_mode) return;
-
sd->access_top_button = NULL;
sd->access_bottom_button = NULL;
- // Expose flipselector buttons
- eo_do(_elm_atspi_bridge_get(), connected = elm_obj_atspi_bridge_connected_get());
- if (connected)
- _flipselector_atspi_bridge_on_connect_cb(sd, NULL, NULL, NULL);
-
- // Register for ATSPI bridge enable/disable
+ // UnRegister for ATSPI bridge enable/disable
_unregister_flipselector_atspi_bridge_callbacks(sd);
- eo_do(_elm_atspi_bridge_get(),
- eo_event_callback_add(ELM_ATSPI_BRIDGE_EVENT_CONNECTED, _flipselector_atspi_bridge_on_connect_cb, sd));
- eo_do(_elm_atspi_bridge_get(),
- eo_event_callback_add(ELM_ATSPI_BRIDGE_EVENT_DISCONNECTED, _flipselector_atspi_bridge_on_disconnect_cb, sd));
+
+ if (is_atspi)
+ {
+ // Expose flipselector buttons
+ eo_do(_elm_atspi_bridge_get(), connected = elm_obj_atspi_bridge_connected_get());
+ if (connected)
+ _flipselector_atspi_bridge_on_connect_cb(sd, NULL, NULL, NULL);
+
+ eo_do(_elm_atspi_bridge_get(),
+ eo_event_callback_add(ELM_ATSPI_BRIDGE_EVENT_CONNECTED,
+ _flipselector_atspi_bridge_on_connect_cb, sd));
+ eo_do(_elm_atspi_bridge_get(),
+ eo_event_callback_add(ELM_ATSPI_BRIDGE_EVENT_DISCONNECTED,
+ _flipselector_atspi_bridge_on_disconnect_cb, sd));
+ }
+}
+//
+
+//TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
+//register/unregister access objects accordingly.
+EOLIAN static void
+_elm_flipselector_elm_widget_atspi(Eo *obj EINA_UNUSED, Elm_Flipselector_Data *sd, Eina_Bool is_atspi)
+{
+ _atspi_expose_flipselector_top_bottom(sd, is_atspi);
}
//
elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_LIST));
//TIZEN ONLY(20151012): expose flipselector top/bottom buttons for accessibility tree
- _atspi_expose_flipselector_top_bottom(sd);
+ if (_elm_config->atspi_mode)
+ _atspi_expose_flipselector_top_bottom(sd, EINA_TRUE);
//
return obj;
}
Elm.Widget.focus_next_manager_is;
Elm.Widget.focus_direction_manager_is;
Elm.Widget.event;
+ //TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
+ //register/unregister access objects accordingly.
+ Elm.Widget.atspi;
+ //
Elm.Layout.sizing_eval;
Elm_Interface_Atspi_Widget_Action.elm_actions.get;
///TIZEN_ONLY(20150716) : fix accessible_at_point getter
Elm.Widget.focus_next_manager_is;
Elm.Widget.focus_direction_manager_is;
Elm.Widget.access;
+ //TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
+ //register/unregister access objects accordingly.
+ Elm.Widget.atspi;
+ //
Elm.Widget.focus_next;
Elm.Widget.on_focus;
Elm.Widget.translate;
Elm.Widget.focus_next_manager_is;
Elm.Widget.focus_direction_manager_is;
Elm.Widget.access;
+ //TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
+ //register/unregister access objects accordingly.
+ Elm.Widget.atspi;
+ //
Elm.Widget.focus_next;
Elm.Widget.translate;
Elm.Widget.theme_apply;
Elm.Widget.theme_apply;
Elm.Widget.focus_direction_manager_is;
Elm.Widget.access;
+ //TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
+ //register/unregister access objects accordingly.
+ Elm.Widget.atspi;
+ //
Elm.Widget.focus_next;
Elm.Widget.parent.set;
Elm.Widget.translate;
void _elm_win_rescale(Elm_Theme *th,
Eina_Bool use_theme);
void _elm_win_access(Eina_Bool is_access);
+//TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
+//register/unregister access objects accordingly.
+void _elm_win_atspi(Eina_Bool is_atspi);
+//
void _elm_win_translate(void);
void _elm_win_focus_reconfigure(void);
return ret;
}
+//TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
+//register/unregister access objects accordingly.
+EAPI Eina_Bool
+elm_widget_atspi(Evas_Object *obj,
+ Eina_Bool is_atspi)
+{
+ const Eina_List *l;
+ Evas_Object *child;
+ Eina_Bool ret = EINA_TRUE;
+
+ API_ENTRY return EINA_FALSE;
+ EINA_LIST_FOREACH(sd->subobjs, l, child)
+ {
+ if (elm_widget_is(child))
+ ret &= elm_widget_atspi(child, is_atspi);
+ }
+ eo_do(obj, elm_obj_widget_atspi(is_atspi));
+
+ return ret;
+}
+
+EOLIAN static void
+_elm_widget_atspi(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Eina_Bool is_atspi EINA_UNUSED)
+{
+}
+//
+
EOLIAN static void
_elm_widget_access(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Eina_Bool is_access EINA_UNUSED)
{
}
legacy: null;
}
+ //TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
+ //register/unregister access objects accordingly.
+ atspi {
+ [['Virtual' function on the widget being set access.]]
+ params {
+ @in is_atspi: bool;
+ }
+ legacy: null;
+ }
+ //
cursor_del {
params {
@in cur: Elm_Cursor *;
EAPI void elm_widget_parent_set(Evas_Object *, Evas_Object *);
EAPI Eina_Bool elm_widget_api_check(int ver);
EAPI Eina_Bool elm_widget_access(Evas_Object *obj, Eina_Bool is_access);
+//TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
+//register/unregister access objects accordingly.
+EAPI Eina_Bool elm_widget_atspi(Evas_Object *obj, Eina_Bool is_access);
+//
EAPI Elm_Theme_Apply elm_widget_theme(Evas_Object *obj);
EAPI void elm_widget_theme_specific(Evas_Object *obj, Elm_Theme *th, Eina_Bool force);
EAPI void elm_widget_translate(Evas_Object *obj);
}
}
+//TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
+//register/unregister access objects accordingly.
+void
+_elm_win_atspi(Eina_Bool is_atspi)
+{
+ Evas *evas;
+ const Eina_List *l;
+ Evas_Object *obj;
+ Evas_Object *fobj;
+ Eina_Bool highlight = EINA_FALSE;
+
+ EINA_LIST_FOREACH(_elm_win_list, l, obj)
+ {
+ elm_widget_atspi(obj, is_atspi);
+
+ /* floating orphan object. if there are A, B, C objects and user does
+ as below, then there would be floating orphan objects.
+
+ 1. elm_object_content_set(layout, A);
+ 2. elm_object_content_set(layout, B);
+ 3. elm_object_content_set(layout, C);
+
+ now, the object A and B are floating orphan objects */
+
+ fobj = obj;
+ for (;;)
+ {
+ fobj = evas_object_below_get(fobj);
+ if (!fobj) break;
+
+ if (elm_widget_is(fobj) && !elm_widget_parent_get(fobj))
+ {
+ elm_widget_atspi(fobj, is_atspi);
+ }
+ }
+
+ if (!is_atspi)
+ {
+ eo_do(obj, highlight = elm_interface_atspi_component_highlight_clear());
+ }
+ }
+}
+//
+
void
_elm_win_translate(void)
{