}
static void
+atspi_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Eina_Bool val = elm_check_state_get(obj);
+ Eina_Bool sel = elm_config_atspi_mode_get();
+
+ if (val == sel) return;
+ elm_config_atspi_mode_set(val);
+ elm_config_all_flush();
+ elm_config_save();
+}
+
+static void
_status_basic(Evas_Object *win,
Evas_Object *bx0)
{
evas_object_smart_callback_add(ck, "changed", dbg_change, NULL);
+ // atspi
+ ck = elm_check_add(win);
+ elm_object_tooltip_text_set(ck, "Set atspi mode");
+ elm_object_text_set(ck, "Enable ATSPI support.");
+ evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5);
+ elm_check_state_set(ck, elm_config_atspi_mode_get());
+ elm_box_pack_end(bx, ck);
+ evas_object_show(ck);
+
+ evas_object_smart_callback_add(ck, "changed", atspi_change, NULL);
+
evas_object_data_set(win, "etc", bx);
elm_naviframe_item_simple_push(naviframe, bx);
Eldbus_Message *msg;
Eldbus_Connection *session_bus;
- if (!_init_count && (_elm_config->access_mode != ELM_ACCESS_MODE_OFF))
+ if (!_init_count && (_elm_config->atspi_mode != ELM_ATSPI_MODE_OFF))
{
_elm_atspi_init();
ELM_CONFIG_VAL(D, T, audio_mute_alert, T_UCHAR);
ELM_CONFIG_VAL(D, T, audio_mute_all, T_UCHAR);
ELM_CONFIG_LIST(D, T, bindings, _config_bindings_widget_edd);
+ ELM_CONFIG_VAL(D, T, atspi_mode, T_UCHAR);
#undef T
#undef D
#undef T_INT
if (!is_access) _elm_access_shutdown();
}
+Eina_Bool _elm_config_atspi_mode_get(void)
+{
+ return _elm_config->atspi_mode;
+}
+
+void _elm_config_atspi_mode_set(Eina_Bool is_enabled)
+{
+ is_enabled = !!is_enabled;
+ if (_elm_config->atspi_mode == is_enabled) return;
+ _elm_config->atspi_mode = is_enabled;
+
+ if (!is_enabled) _elm_atspi_bridge_shutdown();
+ else _elm_atspi_bridge_init();
+}
+
Eina_Bool _elm_config_selection_unfocused_clear_get(void)
{
return _elm_config->selection_clear_enable;
_elm_config->audio_mute_input = 0;
_elm_config->audio_mute_alert = 0;
_elm_config->audio_mute_all = 0;
+ _elm_config->atspi_mode = ELM_ATSPI_MODE_OFF;
}
static const char *
if (s) _elm_config->magnifier_enable = !!atoi(s);
s = getenv("ELM_MAGNIFIER_SCALE");
if (s) _elm_config->magnifier_scale = _elm_atof(s);
+ s = getenv("ELM_ATSPI_MODE");
+ if (s) _elm_config->atspi_mode = ELM_ATSPI_MODE_ON;
}
static void
}
EAPI Eina_Bool
+elm_config_atspi_mode_get(void)
+{
+ return _elm_config_atspi_mode_get();
+}
+
+EAPI void
+elm_config_atspi_mode_set(Eina_Bool is_enable)
+{
+ _elm_config_atspi_mode_set(is_enable);
+}
+
+EAPI Eina_Bool
elm_config_selection_unfocused_clear_get(void)
{
return _elm_config_selection_unfocused_clear_get();
EAPI void elm_config_audio_mute_set(Edje_Channel channel, Eina_Bool mute);
/**
+ * @defgroup ATSPI AT-SPI2 Accessibility
+ * @ingroup Elementary
+ *
+ * Elementary widgets support Linux Accessibility standard. For more
+ * information please visit:
+ * http://www.linuxfoundation.org/collaborate/workgroups/accessibility/atk/at-spi/at-spi_on_d-bus
+ *
+ * @{
+ */
+
+/**
+ * Gets ATSPI mode
+ *
+ * @return the ATSPI mode
+ *
+ * @since 1.10
+ *
+ * @ingroup ATSPI
+ *
+ * @see elm_config_atspi_mode_set()
+ */
+EAPI Eina_Bool elm_config_atspi_mode_get(void);
+
+/**
+ * Sets ATSPI mode
+ *
+ * @param is_atspi If @c EINA_TRUE, enables ATSPI2 mode
+ *
+ * @note Enables Linux Accessibility support for Elementary widgets.
+ *
+ * @since 1.10
+ *
+ * @ingroup ATSPI
+ *
+ * @see elm_config_atspi_mode_get()
+ */
+EAPI void elm_config_atspi_mode_set(Eina_Bool is_atspi);
+
+/**
+ * @}
+ */
+
+/**
* @}
*/
#define ELM_ACCESS_MODE_OFF EINA_FALSE
#define ELM_ACCESS_MODE_ON EINA_TRUE
+#define ELM_ATSPI_MODE_OFF EINA_FALSE
+#define ELM_ATSPI_MODE_ON EINA_TRUE
+
/* convenience macro to compress code and avoid typos */
#undef MIN
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
unsigned char audio_mute_alert;
unsigned char audio_mute_all;
Eina_List *bindings;
+ Eina_Bool atspi_mode;
/* Not part of the EET file */
Eina_Bool is_mirrored : 1;
evas_object_event_callback_add(sd->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_elm_win_on_resize_obj_changed_size_hints, obj);
- if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
+ if (_elm_config->atspi_mode == ELM_ATSPI_MODE_ON)
{
eo_do(obj, elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_WINDOW));
elm_interface_atspi_accessible_children_changed_added_signal_emit(_elm_atspi_root_get(), obj);