Skip to content

Add collections support to AccessKit atspi - #758

Draft
JasonTheKitten wants to merge 4 commits into
AccessKit:mainfrom
BuildABrowser:collections
Draft

Add collections support to AccessKit atspi#758
JasonTheKitten wants to merge 4 commits into
AccessKit:mainfrom
BuildABrowser:collections

Conversation

@JasonTheKitten

Copy link
Copy Markdown

Hello,

I made a fork of AccessKit that includes support for collections in Atspi, needed for Orca Browsing Mode to work properly.

I'm marking this as a Draft PR, because it's not really polished to merge.

It adds the Collection interface with the following four methods:

  • get_active_descendant
  • get_matches (this is the one used by Orca)
  • get_matches_to
  • get_matches_from

The collection interface binding (as well as some atspi shim code) lives in adapters/unix/src/atspi/interfaces/collection.rs.

The actual matching logic is in a dedicated file called adapters/atspi-common/src/node_matcher.rs.

GetMatchesTo and GetMatchesFrom pass a direct object reference (instead of an index) over dbus. I couldn't figure out how existing code handled that, so I did add a helper utility (object_util.rs) to help with that; feel free to replace it with whatever your native method for doing this is.

There's a few reasons why I'm submitting this as a draft PR:

  • It relies on RoleSet from atspi 0.31, which has not been published to crates yet, so need to wait on that
  • atspi role matcher deserialization seems broken, so it uses a slightly hacky shim to work around that
  • Because Orca's features like "Jump to Heading" rely on the node implementing Text to read back the content, and I don't have a full list of all such node types used by Orca, I've changed it to allow any node to have text runs for now
  • There's an unwrap call that I forgot to remove
  • I've only done manual testing (see document_browsing.rs, I also used a dbus mock call app for testing too). I've not written unit tests for it yet, and will not get around to it for a while.

Just figured I'd put my work here in case it is useful, could serve as reference if you decide to implement it differently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant