Eina_Bool is_same_str (const char *s1, const char *s2);
-Live_Region_Politeness try_parse_politeness(GHashTable *attrs);
+Live_Region_Politeness try_parse_politeness(GHashTable *attrs, Eina_Bool assertive_by_default);
static inline void ESAL(Eina_Strbuf *buf, const char *txt)
{
if (!rcd)
return;
- Live_Region_Politeness mode = try_parse_politeness(rcd->attributes);
- if (object_has_highlighted_state(obj) || mode != ACCESSIBLE_LIVE_REGION_OFF) {
+ Live_Region_Politeness mode = try_parse_politeness(rcd->attributes, object_has_highlighted_state(obj));
+ if (mode != ACCESSIBLE_LIVE_REGION_OFF) {
char* text_to_speak = reading_composer_value_text_get(rcd);
tw_speak_and_free(text_to_speak, mode == ACCESSIBLE_LIVE_REGION_ASSERTIVE ? 1 : 0);
}
GHashTable *attrs = atspi_accessible_get_attributes(event->source, NULL);
- Live_Region_Politeness mode = try_parse_politeness(attrs);
+ Live_Region_Politeness mode = try_parse_politeness(attrs, object_has_highlighted_state(event->source));
if (attrs)
g_hash_table_destroy(attrs);
} else if (!g_strcmp0(event->type, TEXT_INSERT_SIG)) {
DEBUG("Set ignore_next_caret_move event to true");
spi->ignore_next_caret_move = EINA_TRUE;
- Live_Region_Politeness mode = try_parse_politeness(attrs);
- if (object_has_focused_state(event->source) || mode != ACCESSIBLE_LIVE_REGION_OFF) {
+ Live_Region_Politeness mode = try_parse_politeness(attrs, object_has_focused_state(event->source));
+ if (mode != ACCESSIBLE_LIVE_REGION_OFF) {
*text_to_read = spi_on_text_insert_get_text(spi, event);
if (cancel)
*cancel = mode == ACCESSIBLE_LIVE_REGION_ASSERTIVE ? 1 : 0;
}
} else if (!g_strcmp0(event->type, TEXT_DELETE_SIG)) {
- Live_Region_Politeness mode = try_parse_politeness(attrs);
- if (object_has_focused_state(event->source) || mode != ACCESSIBLE_LIVE_REGION_OFF) {
+ Live_Region_Politeness mode = try_parse_politeness(attrs, object_has_focused_state(event->source));
+ if (mode != ACCESSIBLE_LIVE_REGION_OFF) {
*text_to_read = spi_on_text_delete_get_text(spi, event);
if (cancel)
*cancel = mode == ACCESSIBLE_LIVE_REGION_ASSERTIVE ? 1 : 0;
spi->ignore_next_caret_move = EINA_TRUE;
}
} else if (!g_strcmp0(event->type, VALUE_CHANGED_SIG)) {
- Live_Region_Politeness mode = try_parse_politeness(attrs);
- if (object_has_focused_state(event->source) || mode != ACCESSIBLE_LIVE_REGION_OFF) {
+ Live_Region_Politeness mode = try_parse_politeness(attrs, object_has_focused_state(event->source));
+ if (mode != ACCESSIBLE_LIVE_REGION_OFF) {
*text_to_read = spi_on_value_changed_get_text(spi, event);
if (cancel)
*cancel = mode == ACCESSIBLE_LIVE_REGION_ASSERTIVE ? 1 : 0;
return !strncmp (s1, s2, l1);
}
-Live_Region_Politeness try_parse_politeness(GHashTable *attrs)
+Live_Region_Politeness try_parse_politeness(GHashTable *attrs, Eina_Bool assertive_by_default)
{
- Live_Region_Politeness mode = ACCESSIBLE_LIVE_REGION_OFF;
+ Live_Region_Politeness mode = assertive_by_default ? ACCESSIBLE_LIVE_REGION_ASSERTIVE : ACCESSIBLE_LIVE_REGION_OFF;
if (attrs) {
const char *val = g_hash_table_lookup(attrs, "container-live");
DEBUG("got attributes, containter-live is '%s'", val);
if (val) {
if (g_strcmp0(val, "polite") == 0) mode = ACCESSIBLE_LIVE_REGION_POLITE;
else if (g_strcmp0(val, "assertive") == 0) mode = ACCESSIBLE_LIVE_REGION_ASSERTIVE;
+ else if (g_strcmp0(val, "off") == 0) mode = ACCESSIBLE_LIVE_REGION_OFF;
}
}
DEBUG("speaking politeness mode is %d", mode);