Skip to content

Harmonize _AttachableImageWrapper and AttachableAs___ across Darwin and Windows. #1261

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

Merged
merged 3 commits into from
Aug 11, 2025

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Aug 11, 2025

This PR makes some changes to harmonize the _AttachableImageWrapper wrapper type and the AttachableAsCGImage/AttachableAsIWICBitmap protocols across Darwin and Windows:

  • _AttachableImageWrapper is now a class on both platforms, not just Windows.
  • The _makeCopyForAttachment() function is now named _copyAttachableValue() (which is a more accurate name already used on Windows.)
  • A default implementation of _copyAttachableValue() and of _deinitializeAttachableValue() is provided for Sendable types on Windows.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

…in and Windows.

This PR makes some changes to harmonize the `_AttachableImageWrapper` wrapper
type and the `AttachableAsCGImage`/`AttachableAsIWICBitmap` protocols across
Darwin and Windows:

- `_AttachableImageWrapper` is now a class on both platforms, not just Windows.
- The `_makeCopyForAttachment()` function is now named `_copyAttachableValue()`
  (which is a more accurate name already used on Windows.)
- A default implementation of `_copyAttachableValue()` and of
  `_deinitializeAttachableValue()` is provided for `Sendable` types on Windows.
@grynspan grynspan added this to the Swift 6.x (main) milestone Aug 11, 2025
@grynspan grynspan self-assigned this Aug 11, 2025
@grynspan grynspan added the windows 🪟 Windows support label Aug 11, 2025
@grynspan grynspan requested a review from stmontgomery as a code owner August 11, 2025 16:51
@grynspan grynspan added the darwin 🍎 macOS, iOS, watchOS, tvOS, and visionOS support label Aug 11, 2025
@grynspan grynspan added public-api Affects public API attachments/activities 🖇️ Work related to attachments and/or activities cross-import-overlays 🍰 Cross-import overlays (Foundation, Core Graphics, etc.) labels Aug 11, 2025
@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan grynspan requested a review from compnerd August 11, 2025 16:52
@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan grynspan merged commit adcec53 into main Aug 11, 2025
3 checks passed
@grynspan grynspan deleted the jgrynspan/harmonize-image-attachment-wrappers branch August 11, 2025 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
attachments/activities 🖇️ Work related to attachments and/or activities cross-import-overlays 🍰 Cross-import overlays (Foundation, Core Graphics, etc.) darwin 🍎 macOS, iOS, watchOS, tvOS, and visionOS support public-api Affects public API windows 🪟 Windows support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants