Commit Graph

66713 Commits

Author SHA1 Message Date
Matthias Clasen
9955d900db dropdown: Use the combox accessible role
Its really just a combobox with another name.
2020-10-13 18:31:53 -04:00
Matthias Clasen
e3620bdc22 combobox: Use the combobox accessible role
Makes sense.
2020-10-13 17:53:39 -04:00
Matthias Clasen
b15328e0d6 atspi: Implement Selection for GtkFlowBox
This is a copy of the listbox implementation.
2020-10-13 17:24:06 -04:00
Matthias Clasen
2664c29454 flowbox: Update accessible state for children
Set the SELECTED state to reflect whether the selected
is selected, unselected, or unselectable. This is
enough to make selection changes appear in Accerciser.

While we are at it, also set the multi-selectable
property for the flowbox itself.
2020-10-13 17:24:06 -04:00
Matthias Clasen
db97f99359 atspi: Implement Selection for GtkComboBox
This doesn't really work in Accerciser. But then,
neither does the GTK 3 implementation from which
this is copied.
2020-10-13 17:24:06 -04:00
Matthias Clasen
caeea0e368 Remove excessively spammy debug messages
Non need to announce the same things for every context
we create, and the path is not really that interesting.
without knowing what it belongs to. I would suggest to
make it visible in the inspector instead, so you can
look it up for the widgets you are interested in.
2020-10-13 17:24:06 -04:00
Matthias Clasen
d0753f645e Fix compiler warnings 2020-10-13 17:24:06 -04:00
Matthias Clasen
81e107885c Remove some unused code 2020-10-13 17:24:06 -04:00
Matthias Clasen
8f4bc4a65d atspi: Fix a variant parser oversight
When you pass a variant, the format needs an @.
GVariant is not your friend.
2020-10-13 17:24:06 -04:00
Matthias Clasen
08f57d5c3d atspi: Implement Selection for listbox
Implement the selection interface for GtkListBox.

This also includes a convenience api for context
addresses: gtk_at_spi_context_to_ref.
2020-10-13 17:24:06 -04:00
Matthias Clasen
3cc9ac406d listbox: Update accessible state for rows
Set the SELECTED state to reflect whether the row
is selected, unselected, or unselectable. This is
enough to make selection changes appear in Accerciser.

While we are at it, also set the multi-selectable
property for the listbox itself.
2020-10-13 17:24:06 -04:00
Jakub Steiner
f1e9f853de Adwaita: selected:hover and focus:selected:hover states
- getting pretty deep, but visually seems to make sense. Selected row hovers
  increase contrast.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3251
2020-10-13 21:27:17 +02:00
Matthias Clasen
18b6c4e69d Merge branch 'wip/carlosg/for-master' into 'master'
Cascade-close popovers by default

Closes #3200

See merge request GNOME/gtk!2685
2020-10-13 19:25:59 +00:00
Matthias Clasen
ccbacb5cce Fix the build
I forgot a few casts in a02c50e72f.
2020-10-13 11:23:13 -04:00
Carlos Garnacho
a939203e6e gtkmodelbutton: Drop special case to close GtkPopoverMenu
With ::cascade-popdown in place, this special case is not necessary
anymore.
2020-10-13 16:55:53 +02:00
Carlos Garnacho
3ba60b06fe gtkpopover: Remove GtkPopoverMenu special case
Now that there's ::cascade-popdown, we don't need to treat
GtkPopoverMenu especially here.
2020-10-13 16:55:53 +02:00
Carlos Garnacho
024d832d94 gtkpopover: Add cascade-popdown property/functions
And honor it in gtk_popover_popdown(). By default, a GtkPopover
pops down automatically if a child popover was closed, if this
property is FALSE, the popover will remain opened.
2020-10-13 16:55:53 +02:00
Matthias Clasen
b909455154 atspi: Fix up the role for password entries
We use to set the the 'password text' role for entries with
visibility = FALSE. Nowadays, we have a separate class for
password entries, so fix up the role mapping based on that.
2020-10-13 10:52:43 -04:00
Matthias Clasen
bf0f3a82cf atspi: Make text change notification work
Make text change notification work for editables, by connecting
to the ::insert-text and ::delete-text signals on the wrapped
GtkText widget, and for GtkTextView by connecting to the
corresponding GtkTextBuffer signals.

This code is more or less directly copied from GtkTextViewAccessible
and GtkEntryAccessible in GTK 3.
2020-10-13 09:44:04 -04:00
Matthias Clasen
a02c50e72f text: Make editable signals work again
Since the big editable reorg, GtkText was not emitting
::insert-text and ::delete-text, as is expected of
editables. We want to use those signals for a11y
change notification, so make them work again.
2020-10-13 00:49:10 -04:00
Matthias Clasen
81440675af atspi: Set placeholder-text attribute
This is how GTK3 passes placeholder-text to orca,
and it works - orca reads it.
2020-10-12 23:31:03 -04:00
Matthias Clasen
3af56f5216 atspi: Implement EditableText interface for the entry wrappers
Drop the EditableText implementation for GtkText,
and implement it for all the wrapper widgets instead.
2020-10-12 22:07:18 -04:00
Matthias Clasen
63dd0405c7 accessible: Add some docs
Explain briefly how a11y works for entry wrappers
(since I won't remember a few months from now).
2020-10-12 21:58:49 -04:00
Matthias Clasen
b7ac660f37 atspi: Implement Text interface for the entry wrappers
Drop the Text implementation for GtkText, and implement
it for all the wrapper widgets instead.
2020-10-12 21:45:48 -04:00
Matthias Clasen
76b87272a6 spinbutton: Implement GtkAccessible
This copies what was done for GtkEntry: get
the focused state from the GtkText within.

We also add a private getter for the text widget,
which was missing here.
2020-10-12 21:45:48 -04:00
Matthias Clasen
852c72fa28 passwordentry: Implement GtkAccessible
This copies what was done for GtkEntry: get
the focused state from the GtkText within.
2020-10-12 21:45:48 -04:00
Matthias Clasen
f796d02fea searchentry: Implement GtkAccessible
This copies what was done for GtkEntry: get
the focused state from the GtkText within.
2020-10-12 21:45:48 -04:00
Matthias Clasen
8faf1f64ee entry: Implement GtkAccessible
Override the get_platform_state vfunc to get
the focused state from the GtkText widget within.
2020-10-12 21:45:48 -04:00
Matthias Clasen
8182fab4d9 text: Ignore text widgets for a11y
We want to implement the Text interface on the
wrapper entries.
2020-10-12 21:45:48 -04:00
Matthias Clasen
d0d7848cf2 atspi: Use gtk_accessible_get_platform_state 2020-10-12 21:45:48 -04:00
Matthias Clasen
ade9e4b82a accessible: Add gtk_accessible_get_platform_state
As a companion to go with the platform_change api,
add a gtk_accessible_get_platform_state() function
that can be used by backends to get the platform
state.

This is in preparation for making entries inherit
their focus states from the text widget within.
2020-10-12 21:45:41 -04:00
Matthias Clasen
663934b2dc atspi: Use gtk_accessible_should_present
Replace explicit visibility check by this
more general method of determining whether
an accessible should be presented to the
a11y layer.
2020-10-12 21:43:17 -04:00
Matthias Clasen
d9adc1b5aa accessible: Add a way to hide accessibles
Similar to gtk_widget_should_layout(), add a
gtk_accessible_should_present() function that backends can
use to determine whether an accessible should be presented
or not.

Ways to make a widget not presented in a11y:
- hide the widget
- set its role to NONE
- make it have a NULL AT context

We will use this in future to hide the GtkText inside
an entry, since the Text implementation will be done
by the wrapper.
2020-10-12 21:43:17 -04:00
Matthias Clasen
3bfb32e699 Cosmetics 2020-10-12 21:43:17 -04:00
Matthias Clasen
5eb482ebaa atspi: Treat all entries the same for collecting state
We are determining editable state based on the
accessible role (although we could make it platform
state now), so cover all the roles that we use for
entry wrappers.
2020-10-12 21:43:17 -04:00
Matthias Clasen
61474b5a94 atspi: Fix collecting states
This is somewhat embarrassing.
2020-10-12 21:42:51 -04:00
Matthias Clasen
8f63443393 Fix the build 2020-10-12 21:37:09 -04:00
Matthias Clasen
dd650ff90e atspi: D-Bus methods return tuples
I've learned this the hard way: When returning a
value from a D-Bus call, the variant construct must
*always* be g_variant_new ("(...)"...
2020-10-12 15:50:36 -04:00
Matthias Clasen
101cbe690e Don't unref a floating variant
It gets consumed somewhere along the way.
2020-10-12 15:10:40 -04:00
Matthias Clasen
62747eb243 atspi: Unregister objects on the bus
When a widget is going away, we need to remove
the context from the bus, or else ATs might have
the idea to call methods on them, leading to badness.
2020-10-12 15:10:40 -04:00
Matthias Clasen
d432cbb02b atspi: Emit property changes for focus
With this orca, actually speaks \o/.  Sadly, it only
says 'gtk modelbutton widget' so far, but its a start.
2020-10-12 15:10:40 -04:00
Matthias Clasen
45e82adf87 atspi: Cosmetics
Use simple wrappers instead of opencoding bit twiddling
all over the place.
2020-10-12 15:10:40 -04:00
Matthias Clasen
a2d220edfa widget: Notify a11y of focus changes
This is using the new 'platform changes' mechanism
to tell the a11y backends when focus changes.
2020-10-12 15:10:40 -04:00
Matthias Clasen
b5ee73d299 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.
2020-10-12 15:10:40 -04:00
Matthias Clasen
578c8b5068 atspi: Be more careful about indexes
Don't return a number for IndexInParent when we
don't have one.
2020-10-12 15:10:40 -04:00
Matthias Clasen
f9ee23825e atspi: Set some more atspi states
Pass on more of the states that are represented
as properties in aria: modal, multi-line, orientation.
2020-10-12 15:10:40 -04:00
Matthias Clasen
35f70d5a99 Pass orientation property to accessible
We should set the accessible properties we have,
where they make sense. So set orientation, if the
widget is orientable.
2020-10-12 15:10:40 -04:00
Matthias Clasen
54f1eb4c04 wip: Emit StateChanged signals
This is not fully baked, but it is enough to make accerciser
notice when a text entry goes from editable to not editable.
2020-10-12 15:10:40 -04:00
Matthias Clasen
66a81f1187 atspi: Derive readonly state from aria properties
We can use the read-only property, together with the
accessible role, to determine whether to set editable
and read-only states for at-spi. This lets us avoid
directly poking at the widgets.
2020-10-12 15:10:40 -04:00
Matthias Clasen
2a5af4e1d6 text: Set the readonly accessible property
This mirrors what we already do for GtkTextView.
2020-10-12 15:10:40 -04:00