Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

atspi: Make EventBody generic over serializable types for kind #36

Merged
merged 1 commit into from
Nov 15, 2022

Conversation

DataTriny
Copy link
Contributor

I still haven't figured out the best way forward for this, but at least now it's possible to serialize events holding a kind which type is something other than &str. At least I'll be able to take advantage of this for AccessKit.

  • Added serde support to the State type.
  • Rearranged EventBodyQT (I don't see why we would need a borrowing version of this type, it's kind of a bug in Qt so you wouldn't want anybody to use it on the server-side).
  • Updated signals to use EventBody<&str> (except object's state_changed which now takes EventBody<State>).

Hopefully this can spark ideas on how to better type-check these event related structs.

@DataTriny DataTriny changed the title atspi: Make EventBody generic over serializable type for kind atspi: Make EventBody generic over serializable types for kind Nov 12, 2022
@TTWNO
Copy link
Member

TTWNO commented Nov 13, 2022

Really great PR! Let me play around with it over the next few days so I understand what it's doing.

@DataTriny DataTriny marked this pull request as draft November 13, 2022 19:32
@DataTriny
Copy link
Contributor Author

It's not doing much on client's side. You'd have to write a provider to take advantage of this. I'll ping you here once I've got something working with AccessKit so you can see a use case for it.

@DataTriny
Copy link
Contributor Author

@TTWNO

You can find how it's used here.

To play with it locally:

git clone https://github.com/DataTriny/accesskit
cd accesskit/platforms/winit
git checkout atspi_basics
cargo run --release --example simple

You can see that Orca is able to detect focus state updates on the window and the buttons (we don't raise org.a11y.atspi.Event.Focus.Focus, only org.a11y.atspi.Event.Object.StateChange) signals.

@TTWNO TTWNO marked this pull request as ready for review November 15, 2022 03:41
@TTWNO TTWNO merged commit ddeca1f into odilia-app:main Nov 15, 2022
@TTWNO
Copy link
Member

TTWNO commented Nov 15, 2022

This is really well done! Thank you, again, for your generous contributions to this library!

@DataTriny DataTriny deleted the atspi_events branch January 8, 2023 21:32
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.

None yet

2 participants