-
Notifications
You must be signed in to change notification settings - Fork 574
[AccessoryAccess] Add bindings up to Xcode 27.0 Beta 3 #25982
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
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b8c602d
[AccessoryAccess] Add bindings up to Xcode 27.0 Beta 3
dalexsoto cd23dcf
[AccessoryAccess] Address PR review feedback.
dalexsoto 9e59a56
Merge branch 'xcode27.0' into dev/alex/xc27-accessoryaccess
dalexsoto f1385f2
[AccessoryAccess] Add XML doc comment for open completion delegate
Copilot 8e8538b
[AccessoryAccess] Refine AAUsbAccessoryOpenCompletionHandler docs
Copilot 82fdf94
[AccessoryAccess] Document open completion error
Copilot 584be51
[AccessoryAccess] Update documentation known-failures baseline
dalexsoto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| using System; | ||
|
|
||
| using CoreFoundation; | ||
| using Foundation; | ||
| using ObjCRuntime; | ||
|
|
||
| // 'xpc_object_t' is an opaque OS_object that's shuttled across XPC boundaries; it has no managed API | ||
| // surface of its own, so macios binds it as NSObject everywhere (see src/browserenginekit.cs). | ||
| using OS_xpc_object = Foundation.NSObject; | ||
|
|
||
| namespace AccessoryAccess { | ||
|
|
||
| [Mac (27, 0)] | ||
| [Native] | ||
| [ErrorDomain ("AAErrorDomain")] | ||
| public enum AAErrorCode : long { | ||
| Internal = 1, | ||
| AccessoryListenerAlreadyRegistered = 2, | ||
| AccessoryNotAccessible = 3, | ||
| InvalidAccessoryState = 4, | ||
| } | ||
|
|
||
| [Mac (27, 0)] | ||
| [Native ("AAUSBAccessoryMatchingCriteriaInterfaceMatchingOption")] | ||
| public enum AAUsbAccessoryMatchingCriteriaInterfaceMatchingOption : long { | ||
| MatchAll, | ||
| MatchAny, | ||
| } | ||
|
|
||
| // 'device' is a live IOUSBHostDevice handle (an IOUSBHost Objective-C object). IOUSBHost is | ||
| // intentionally not bound in macios (a low-level IOKit/DriverKit-adjacent, NS_REFINED_FOR_SWIFT | ||
| // framework; see IGNORED_MACOS_FRAMEWORKS in tests/xtro-sharpie/Makefile), so the handle is surfaced | ||
| // as a raw IntPtr that stays valid until the accessory is closed (Close). To perform USB I/O, hand | ||
| // the accessory to a native/Swift service via CreateXpcRepresentation, or bridge the handle through | ||
| // native IOUSBHost code. | ||
| delegate void AAUsbAccessoryOpenCompletionHandler (IntPtr device, [NullAllowed] NSError error); | ||
| delegate void AAUsbAccessoryCloseCompletionHandler ([NullAllowed] NSError error); | ||
|
|
||
| [Mac (27, 0)] | ||
| [BaseType (typeof (NSObject), Name = "AAUSBAccessory")] | ||
| [DisableDefaultCtor] | ||
| interface AAUsbAccessory : NSSecureCoding { | ||
| [Export ("initWithXPCRepresentation:")] | ||
| [DesignatedInitializer] | ||
| NativeHandle Constructor (OS_xpc_object xpcRepresentation); | ||
|
|
||
| [Export ("registryID")] | ||
| ulong RegistryId { get; } | ||
|
|
||
| [Export ("deviceDescriptorData")] | ||
| NSData DeviceDescriptorData { get; } | ||
|
|
||
| [NullAllowed, Export ("configurationDescriptorData")] | ||
| NSData ConfigurationDescriptorData { get; } | ||
|
|
||
| [Export ("createXPCRepresentation")] | ||
| OS_xpc_object CreateXpcRepresentation (); | ||
|
|
||
| [Export ("openWithServiceQueue:completionHandler:")] | ||
| [Async] | ||
| void Open ([NullAllowed] DispatchQueue serviceQueue, AAUsbAccessoryOpenCompletionHandler completionHandler); | ||
|
|
||
| [Export ("closeWithCompletionHandler:")] | ||
| [Async] | ||
| void Close (AAUsbAccessoryCloseCompletionHandler completionHandler); | ||
| } | ||
|
|
||
| interface IAAUsbAccessoryListener { } | ||
|
|
||
| [Mac (27, 0)] | ||
| [Protocol (BackwardsCompatibleCodeGeneration = false, Name = "AAUSBAccessoryListener"), Model] | ||
| [BaseType (typeof (NSObject))] | ||
| interface AAUsbAccessoryListener { | ||
| [Export ("usbAccessoryDidConnect:")] | ||
| void UsbAccessoryDidConnect (AAUsbAccessory usbAccessory); | ||
|
|
||
| [Export ("usbAccessoryDidDisconnect:")] | ||
| void UsbAccessoryDidDisconnect (AAUsbAccessory usbAccessory); | ||
| } | ||
|
|
||
| delegate void AAUsbAccessoryManagerRegisterListenerCompletionHandler (AAUsbAccessory [] accessories, [NullAllowed] NSError error); | ||
| delegate void AAUsbAccessoryManagerUnregisterListenerCompletionHandler (); | ||
|
|
||
| [Mac (27, 0)] | ||
| [BaseType (typeof (NSObject), Name = "AAUSBAccessoryManager")] | ||
| [DisableDefaultCtor] | ||
| interface AAUsbAccessoryManager { | ||
| [Static] | ||
| [Export ("sharedManager", ArgumentSemantic.Strong)] | ||
| AAUsbAccessoryManager SharedManager { get; } | ||
|
|
||
| [Export ("registerListener:withMatchingCriteria:completionHandler:")] | ||
| [Async] | ||
| void RegisterListener (IAAUsbAccessoryListener listener, AAUsbAccessoryMatchingCriteria [] matchingCriteria, AAUsbAccessoryManagerRegisterListenerCompletionHandler completionHandler); | ||
|
|
||
| [Export ("unregisterListener:completionHandler:")] | ||
| [Async] | ||
| void UnregisterListener (IAAUsbAccessoryListener listener, AAUsbAccessoryManagerUnregisterListenerCompletionHandler completionHandler); | ||
| } | ||
|
|
||
| [Mac (27, 0)] | ||
| [BaseType (typeof (NSObject), Name = "AAUSBAccessoryMatchingCriteria")] | ||
| [DisableDefaultCtor] | ||
| interface AAUsbAccessoryMatchingCriteria : NSCopying { | ||
| [Export ("initWithDeviceMatchingDictionary:")] | ||
| [DesignatedInitializer] | ||
| NativeHandle Constructor (NSDictionary<NSString, NSObject> dictionary); | ||
|
|
||
| [Export ("initWithDeviceMatchingDictionary:interfaceMatchingDictionaries:interfaceMatchingOption:")] | ||
| [DesignatedInitializer] | ||
| NativeHandle Constructor ([NullAllowed] NSDictionary<NSString, NSObject> deviceMatchingDictionary, NSDictionary<NSString, NSObject> [] interfaceMatchingDictionaries, AAUsbAccessoryMatchingCriteriaInterfaceMatchingOption interfaceMatchingOption); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
tests/dotnet/UnitTests/expected/MacOSX-NativeAOT-TrimmableStatic-size.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 0 additions & 19 deletions
19
tests/xtro-sharpie/api-annotations-dotnet/macOS-AccessoryAccess.todo
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
At least part of this information sounds like it could be useful in an xml comment on the delegate.
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.
@copilot understand the context and please apply this suggestion
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.
Addressed in 8e8538b. I added XML documentation to
AAUsbAccessoryOpenCompletionHandler, including thedevicehandle semantics and native IOUSBHost guidance.