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

Add drawing types templates #628

Merged
merged 7 commits into from
Aug 3, 2022
Merged

Add drawing types templates #628

merged 7 commits into from
Aug 3, 2022

Conversation

elachlan
Copy link
Contributor

@elachlan elachlan commented Jul 28, 2022

Fixes #626
Related: dotnet/winforms#7468

@elachlan
Copy link
Contributor Author

CC: @lonitra

Copy link
Member

@AArnott AArnott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you added the functionality all right where it fits the design. Thank you. Just a couple of changes, please.

src/Microsoft.Windows.CsWin32/templates/RECT.cs Outdated Show resolved Hide resolved
test/Microsoft.Windows.CsWin32.Tests/GeneratorTests.cs Outdated Show resolved Hide resolved
@elachlan elachlan requested a review from AArnott July 29, 2022 00:29
@elachlan elachlan requested a review from AArnott August 2, 2022 03:25
The `SIZE` and and `RECT` structs have no BCL equivalents, at least not with the fields in the right order.
Copy link
Member

@AArnott AArnott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out that SIZE cannot be replaced with the BCL Size struct because the fields are in a different order. I moved POINT and POINTF to another dictionary in the generator so that they are never generated, even when not marshaling, since the BCL struct types should be adequate and this gives an even better interop experience. I deleted the point templates since we never generate those types any more.
Thank you for starting on this, for the tests and the rect and size templates. This is definitely an improvement.

@AArnott AArnott enabled auto-merge August 3, 2022 13:48
@AArnott AArnott merged commit eb1c5c2 into microsoft:main Aug 3, 2022
@elachlan elachlan deleted the 626 branch August 3, 2022 22:19
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.

Consider adding cast operators to System.Drawing types
2 participants