[gtk/matthiasc/a11y] atspi: Set some more atspi states
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/a11y] atspi: Set some more atspi states
- Date: Mon, 12 Oct 2020 04:56:56 +0000 (UTC)
commit 944ce59e1bab80b052d60279029cacf6159e0f4b
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Oct 12 00:21:14 2020 -0400
atspi: Set some more atspi states
Pass on more of the states that are represented
as properties in aria: modal, multi-line, orientation.
gtk/a11y/gtkatspicontext.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
---
diff --git a/gtk/a11y/gtkatspicontext.c b/gtk/a11y/gtkatspicontext.c
index f9593474a2..19583a9626 100644
--- a/gtk/a11y/gtkatspicontext.c
+++ b/gtk/a11y/gtkatspicontext.c
@@ -115,6 +115,29 @@ collect_states (GtkAtSpiContext *self,
}
}
+ if (gtk_at_context_has_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_ORIENTATION))
+ {
+ value = gtk_at_context_get_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_ORIENTATION);
+ if (gtk_orientation_accessible_value_get (value) == GTK_ORIENTATION_HORIZONTAL)
+ state |= (G_GUINT64_CONSTANT (1) << ATSPI_STATE_HORIZONTAL);
+ else
+ state |= (G_GUINT64_CONSTANT (1) << ATSPI_STATE_VERTICAL);
+ }
+
+ if (gtk_at_context_has_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_MODAL))
+ {
+ value = gtk_at_context_get_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_MODAL);
+ if (gtk_boolean_accessible_value_get (value))
+ state |= (G_GUINT64_CONSTANT (1) << ATSPI_STATE_MODAL);
+ }
+
+ if (gtk_at_context_has_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_MULTI_LINE))
+ {
+ value = gtk_at_context_get_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_MULTI_LINE);
+ if (gtk_boolean_accessible_value_get (value))
+ state |= (G_GUINT64_CONSTANT (1) << ATSPI_STATE_MULTI_LINE);
+ }
+
if (gtk_at_context_has_accessible_state (ctx, GTK_ACCESSIBLE_STATE_BUSY))
{
value = gtk_at_context_get_accessible_state (ctx, GTK_ACCESSIBLE_STATE_BUSY);
@@ -720,6 +743,33 @@ gtk_at_spi_context_state_change (GtkATContext *ctx,
if (ctx->accessible_role == GTK_ACCESSIBLE_ROLE_TEXT_BOX)
emit_state_changed (self, "editable", !readonly);
}
+
+ if (changed_properties & GTK_ACCESSIBLE_PROPERTY_CHANGE_ORIENTATION)
+ {
+ value = gtk_accessible_attribute_set_get_value (properties, GTK_ACCESSIBLE_PROPERTY_ORIENTATION);
+ if (gtk_orientation_accessible_value_get (value) == GTK_ORIENTATION_HORIZONTAL)
+ {
+ emit_state_changed (self, "horizontal", TRUE);
+ emit_state_changed (self, "vertical", FALSE);
+ }
+ else
+ {
+ emit_state_changed (self, "horizontal", FALSE);
+ emit_state_changed (self, "vertical", TRUE);
+ }
+ }
+
+ if (changed_properties & GTK_ACCESSIBLE_PROPERTY_CHANGE_MODAL)
+ {
+ value = gtk_accessible_attribute_set_get_value (properties, GTK_ACCESSIBLE_PROPERTY_MODAL);
+ emit_state_changed (self, "modal", gtk_boolean_accessible_value_get (value));
+ }
+
+ if (changed_properties & GTK_ACCESSIBLE_PROPERTY_CHANGE_MULTI_LINE)
+ {
+ value = gtk_accessible_attribute_set_get_value (properties, GTK_ACCESSIBLE_PROPERTY_MULTI_LINE);
+ emit_state_changed (self, "multi-line", gtk_boolean_accessible_value_get (value));
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]