-
Notifications
You must be signed in to change notification settings - Fork 6
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
Fix our Collection
story
#196
Conversation
- Move from `MatchArgs` to `ObjectMatchRule` (note the "Object" prefix to avoid confusion with `zbus::MatchRule`) - Remove comment block on "Role fields" which are now a proper type `ObjectMatchRule` - Place the clippy suppression on the item that violates the rule. ToDo: - [ ] Document the methods properly This probably requires some digging in sources to find out what all arguments actually (were meant to) mean.
- `Live` is now known as `Politeness` - `ObjectMatchRule` not verifiable
`FromIterator` allows us to `.collect()` into an `InterfaceSet` `Default` impl returns an empty set.
- Remove `MatchArgs` - Move over `MatchType`, `TreeTraversalType` to `object_match.rs` - Introduce `ObjectMatchRule` with builder pattern - Move over / create tests
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #196 +/- ##
==========================================
+ Coverage 86.51% 87.22% +0.71%
==========================================
Files 39 40 +1
Lines 3344 3508 +164
==========================================
+ Hits 2893 3060 +167
+ Misses 451 448 -3 ☔ View full report in Codecov by Sentry. |
Missing item fixed.
Only `SortOrder::Canonical` and `SortOrder::ReverseCanonical` seem implemented. [upstream issue 140](Are all the AtspiCollectionSortOrder types really a thing?)
Seems to be unimplemented as our upstream libatspi peers say it is.
Move `SortOrder` to object_match module Delete duplicate tests.
Just took a cursory glance and am very excited! I can review this today, but probably still a couple hours out. Only thing I noticed is that there's link as to why no more then N objects will be returned from certain methods. Thank you Luuk! This looks like quite the upgrade! |
You raise a better point than I would like. In atk-adaptor of at-spi2-core, we find that #define MAX_CHILDREN 65536 and both implemented sort-orders check for it. However, atk-adaptor may not be the only implementer on the bus. Accesskit does not implement
Thanks! What we need is a few experiments to see if things indeed work as we think it does. |
Remove maximum object number from documentation. Even though atk-adaptor implements the maximum as of present, they may not always have and it may not be the only implementation on the bus either.
atspi-common/src/object_match.rs
Outdated
|
||
/// Insert a slice of `Interface`s | ||
#[must_use] | ||
pub fn interfaces(mut self, interfaces: &[Interface], mt: MatchType) -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly consider interfaces: T where T: IntoIteer<Interface>
? I think we've implemented that on InterfaceSet
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea - thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
assert_eq!(rule.states, StateSet::new(State::Active)); | ||
assert_eq!( | ||
rule.attr, | ||
[("name".to_string(), "value".to_string())].iter().cloned().collect() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise here as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented!
Only `Canonical` and `ReverseCanonical` are in use in atk-adaptor. Other or future implementation might use other variants. (but this is unlikely at this point in time.)
Items may be either &Interface or Interface
`IntoIterator` uses `StateSet`s own iter, which returned `impl Iterator<Item = State>`, The `IntoIterator` implementation does not accept the opaque type, it needs the specific type to coincide with its own type, so the return type on `StateSet::iter` is adjusted to enumflags2::Iter<State>`.
atk-adaptor does not offer this method, but another maybe might. Added information in docs.
ToDo:
The above may take some digging in remote sources or asking around.
Note that 'collection.xml' isn't that helpful here.