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

Rework the patterns! macro to re-de-duplicate logic #104

Open
str4d opened this issue May 21, 2022 · 1 comment
Open

Rework the patterns! macro to re-de-duplicate logic #104

str4d opened this issue May 21, 2022 · 1 comment

Comments

@str4d
Copy link
Contributor

str4d commented May 21, 2022

The patterns! macro previously both generated the ResolvedPlatformNode::pattern_provider and ResolvedPlatformNode::enqueue_pattern_property_changes methods, and also generated some of the boilerplate methods for the #[implement(_)] derivations from the windows crate.

In windows 0.32 the implement macro was reworked to use traits (microsoft/windows-rs#1450). As a result, we can't just derive the methods for all patterns in the existing patterms! macro invocation, because:

  • The per-trait methods need to go into separate impl IFooBarProvider_Impl for FooBarProvider trait impls.
  • The patterns are a subset of the trait methods that need to be implemented.

In #102 I took the simple approach of duplication: we now manually implement the boilerplate methods in addition to specifying their details inside the patterns! macro. It would be nice to figure out how to rework the patterns! macro to re-introduce the previous de-duplication.

@str4d
Copy link
Contributor Author

str4d commented May 21, 2022

Aaand the moment I wrote this issue, I figured out how to do this nicely 😄 I'll update #102 with this.

str4d added a commit to str4d/accesskit that referenced this issue May 21, 2022
This is in preparation for windows-rs 0.32 which moves to a trait-based
`implement` macro.

Closes AccessKit#104.
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

No branches or pull requests

1 participant