diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-10-12 13:05:43 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-10-12 15:10:40 -0400 |
commit | b5ee73d2992077eba85ebcec9f31556bd8ddb3e5 (patch) | |
tree | 8f068df6cc3fc821245b31627d3b431d337e3681 /gtk/gtkatcontext.c | |
parent | 578c8b5068734c30244c44c064d1bf9675eb7c7d (diff) | |
download | gtk+-b5ee73d2992077eba85ebcec9f31556bd8ddb3e5.tar.gz |
a11y: Pass on platform changes
Add an enum for 'platform changes' to the at context
change notification mechanism. This will let us pass
along things that ARIA considers 'platform state' such
as focus or editability. The difference between the
platform state and other ARIA states is that we don't
keep the platform state separately in the at context
- backends are expected to just query the widgets.
This is just about avoiding notify listeners for
change notification.
Diffstat (limited to 'gtk/gtkatcontext.c')
-rw-r--r-- | gtk/gtkatcontext.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gtk/gtkatcontext.c b/gtk/gtkatcontext.c index 085bf989b2..121951ab9d 100644 --- a/gtk/gtkatcontext.c +++ b/gtk/gtkatcontext.c @@ -36,6 +36,7 @@ #include "gtkatcontextprivate.h" #include "gtkaccessiblevalueprivate.h" +#include "gtkaccessibleprivate.h" #include "gtkdebug.h" #include "gtktestatcontextprivate.h" #include "gtktypebuiltins.h" @@ -137,6 +138,7 @@ gtk_at_context_real_state_change (GtkATContext *self, GtkAccessibleStateChange changed_states, GtkAccessiblePropertyChange changed_properties, GtkAccessibleRelationChange changed_relations, + GtkAccessiblePlatformChange changed_platform, GtkAccessibleAttributeSet *states, GtkAccessibleAttributeSet *properties, GtkAccessibleAttributeSet *relations) @@ -505,7 +507,8 @@ gtk_at_context_update (GtkATContext *self) /* There's no point in notifying of state changes if there weren't any */ if (self->updated_properties == 0 && self->updated_relations == 0 && - self->updated_states == 0) + self->updated_states == 0 && + self->updated_platform == 0) return; GtkAccessibleStateChange changed_states = @@ -517,12 +520,14 @@ gtk_at_context_update (GtkATContext *self) GTK_AT_CONTEXT_GET_CLASS (self)->state_change (self, changed_states, changed_properties, changed_relations, + self->updated_platform, self->states, self->properties, self->relations); g_signal_emit (self, obj_signals[STATE_CHANGE], 0); self->updated_properties = 0; self->updated_relations = 0; self->updated_states = 0; + self->updated_platform = 0; } /*< private > @@ -806,3 +811,10 @@ gtk_at_context_get_label (GtkATContext *self) return g_strdup ("widget"); } + +void +gtk_at_context_platform_changed (GtkATContext *self, + GtkAccessiblePlatformChange change) +{ + self->updated_platform |= change; +} |