char *name_from_text_iface = NULL;
char *state_from_role = NULL;
AtspiAccessibleReadingMaterial *rm;
+ bool add_disabled_trait = false; /* set to true when states are requested to be read, but the object hasn't got ATSPI "enabled" state */
if (!data)
return NULL;
}
}
+ if (reading_attribute & ACCESSIBLE_READING_INFO_TYPE_STATE) {
+ DEBUG("START : ACCESSIBLE_READING_INFO_TYPE_STATE");
+ state_from_role = generate_state_trait(rm);
+ if (state_from_role && strlen(state_from_role) > 0) {
+ if (eina_strbuf_length_get(buf))
+ ESAL(buf, " , ");
+ ESAL(buf, state_from_role);
+ }
+ if (!STATE_SET_CONTAINS(rm->states, ATSPI_STATE_ENABLED)) {
+ /* Lack of ATSPI "enabled" state results means the object is disabled. */
+ /* This should be read at the end of the description, so we keep it for later. */
+ add_disabled_trait = true;
+ }
+ SCREEN_READER_SAFE_FREE(state_from_role, free);
+ DEBUG("END : ACCESSIBLE_READING_INFO_TYPE_STATE");
+ }
+
if (reading_attribute & ACCESSIBLE_READING_INFO_TYPE_NAME) {
DEBUG("START : ACCESSIBLE_READING_INFO_TYPE_NAME");
name = rm->name;
SCREEN_READER_SAFE_FREE(role_name, free);
DEBUG("END : ACCESSIBLE_READING_INFO_TYPE_ROLE");
}
- if (reading_attribute & ACCESSIBLE_READING_INFO_TYPE_STATE) {
- DEBUG("START : ACCESSIBLE_READING_INFO_TYPE_STATE");
- state_from_role = generate_state_trait(rm);
- if (state_from_role && strlen(state_from_role) > 0) {
- if (eina_strbuf_length_get(buf))
- ESAL(buf, " , ");
- ESAL(buf, state_from_role);
- }
- if (!STATE_SET_CONTAINS(rm->states, ATSPI_STATE_ENABLED)) {
- if (eina_strbuf_length_get(buf))
- ESAL(buf, " , ");
- ESAL(buf, _("IDS_ACCS_BODY_DISABLED_TTS"));
- }
- SCREEN_READER_SAFE_FREE(state_from_role, free);
- DEBUG("END : ACCESSIBLE_READING_INFO_TYPE_STATE");
+ /* "Disabled" trait should be read at the end of the description */
+ if (add_disabled_trait) {
+ if (eina_strbuf_length_get(buf))
+ ESAL(buf, " , ");
+ ESAL(buf, _("IDS_ACCS_BODY_DISABLED_TTS"));
}
DEBUG("RESULT: %s", eina_strbuf_string_get(buf));