Skip to content

Harmonize _AttachableImageWrapper and AttachableAs___ across Darwin and Windows.#1261

Merged
grynspan merged 3 commits into
mainfrom
jgrynspan/harmonize-image-attachment-wrappers
Aug 11, 2025
Merged

Harmonize _AttachableImageWrapper and AttachableAs___ across Darwin and Windows.#1261
grynspan merged 3 commits into
mainfrom
jgrynspan/harmonize-image-attachment-wrappers

Conversation

@grynspan

@grynspan grynspan commented Aug 11, 2025

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

@swift-ci test

@grynspan grynspan requested a review from compnerd August 11, 2025 16:52
@grynspan

Copy link
Copy Markdown
Contributor Author

@swift-ci test

Comment thread Sources/Overlays/_Testing_WinSDK/Attachments/AttachableImageFormat+CLSID.swift Outdated
@grynspan

Copy link
Copy Markdown
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