Skip to content

Commit

Permalink
Some Catalyst API annotations and corrections
Browse files Browse the repository at this point in the history
- Part of dotnet#10216
- This includes most of the smaller SDKs.
  • Loading branch information
chamons committed Sep 9, 2021
1 parent 209486a commit 304b78e
Show file tree
Hide file tree
Showing 18 changed files with 22 additions and 602 deletions.
3 changes: 3 additions & 0 deletions src/avfoundation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4639,6 +4639,7 @@ interface AVAssetTrack : NSCopying {
}

[Mac (10,10), NoiOS, NoTV, NoWatch]
[MacCatalyst (14,0)]
[DisableDefaultCtor]
[BaseType (typeof (NSObject))]
interface AVSampleCursor : NSCopying {
Expand Down Expand Up @@ -8627,6 +8628,7 @@ interface AVCaptureSession {
NSString InterruptionReasonKey { get; }

[iOS (7,0)]
[MacCatalyst (14,0)]
[Export ("usesApplicationAudioSession")]
bool UsesApplicationAudioSession { get; set; }

Expand Down Expand Up @@ -10546,6 +10548,7 @@ interface AVCaptureDevice {
bool HasTorch { get; }

[NoiOS, NoWatch]
[MacCatalyst (14,0)]
[Export ("inUseByAnotherApplication")]
bool InUseByAnotherApplication { [Bind ("isInUseByAnotherApplication")] get; }

Expand Down
3 changes: 1 addition & 2 deletions src/callkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,7 @@ interface CXCallDirectoryManager {
[Export ("getEnabledStatusForExtensionWithIdentifier:completionHandler:")]
void GetEnabledStatusForExtension (string identifier, Action<CXCallDirectoryEnabledStatus, NSError> completion);

[NoMacCatalyst]
[NoWatch, NoTV, NoMac, iOS (13,4)]
[NoWatch, NoTV, NoMac, iOS (13,4), MacCatalyst (10,14)]
[Async]
[Export ("openSettingsWithCompletionHandler:")]
void OpenSettings ([NullAllowed] Action<NSError> completion);
Expand Down
2 changes: 1 addition & 1 deletion src/fileprovider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ interface NSFileProviderItem {
[Export ("userInfo")]
NSDictionary GetUserInfo ();

[NoiOS]
[NoiOS, NoMacCatalyst]
[Export ("fileSystemFlags")]
NSFileProviderFileSystemFlags FileSystemFlags { get; }

Expand Down
1 change: 1 addition & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -2232,6 +2232,7 @@ MACCATALYST_FRAMEWORKS = \
BusinessChat \
CallKit \
CFNetwork \
Chip \
ClassKit \
CloudKit \
Contacts \
Expand Down
1 change: 1 addition & 0 deletions src/iTunesLibrary/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ public enum ITLibPlaylistProperty {
Kind,
}

[MacCatalyst (14,0)]
[Mac (10,14)]
public enum ITLibMediaEntityProperty {
[Field ("ITLibMediaEntityPropertyPersistentID")]
Expand Down
8 changes: 4 additions & 4 deletions src/intents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3732,25 +3732,25 @@ interface INImage : NSCopying, NSSecureCoding {
// INImage_IntentsUI (IntentsUI)

[NoMac, NoWatch, NoTV]
[NoMacCatalyst]
[MacCatalyst (13, 0)]
[Static]
[Export ("imageWithCGImage:")]
INImage FromImage (CGImage image);

[NoMac, NoWatch, NoTV]
[NoMacCatalyst]
[MacCatalyst (13, 0)]
[Static]
[Export ("imageWithUIImage:")]
INImage FromImage (UIImage image);

[NoMac, NoWatch, NoTV]
[NoMacCatalyst]
[MacCatalyst (13, 0)]
[Static]
[Export ("imageSizeForIntentResponse:")]
CGSize GetImageSize (INIntentResponse response);

[NoMac, NoWatch, iOS (11,0), NoTV]
[NoMacCatalyst]
[MacCatalyst (13, 0)]
[Async]
[Export ("fetchUIImageWithCompletion:")]
void FetchImage (Action<UIImage> completion);
Expand Down
5 changes: 5 additions & 0 deletions src/intentsui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
namespace IntentsUI {

[iOS (10, 0)]
[MacCatalyst (13, 0)]
[Native]
public enum INUIHostedViewContext : ulong {
SiriSnippet,
MapsCard
}

[iOS (11,0)]
[MacCatalyst (13, 0)]
[Native]
public enum INUIInteractiveBehavior : ulong {
None,
Expand All @@ -49,6 +51,7 @@ public enum INUIAddVoiceShortcutButtonStyle : ulong {
delegate void INUIHostedViewControllingConfigureViewHandler (bool success, NSSet<INParameter> configuredParameters, CGSize desiredSize);

[iOS (10, 0)]
[MacCatalyst (13, 0)]
[Protocol]
interface INUIHostedViewControlling {

Expand All @@ -64,6 +67,7 @@ interface INUIHostedViewControlling {
}

[iOS (10, 0)]
[MacCatalyst (13, 0)]
[Category]
[BaseType (typeof (NSExtensionContext))]
interface NSExtensionContext_INUIHostedViewControlling {
Expand All @@ -80,6 +84,7 @@ interface NSExtensionContext_INUIHostedViewControlling {
}

[iOS (10, 0)]
[MacCatalyst (13, 0)]
[Protocol]
interface INUIHostedViewSiriProviding {

Expand Down
6 changes: 0 additions & 6 deletions src/pencilkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,25 +102,20 @@ interface PKCanvasView : PKToolPickerObserver {
[Export ("drawing", ArgumentSemantic.Copy)]
PKDrawing Drawing { get; set; }

[Unavailable (PlatformName.MacCatalyst), Advice ("This API is not available when using Catalyst on macOS.")]
[Export ("tool", ArgumentSemantic.Copy)]
PKTool Tool { get; set; }

[Unavailable (PlatformName.MacCatalyst), Advice ("This API is not available when using Catalyst on macOS.")]
[Export ("rulerActive")]
bool RulerActive { [Bind ("isRulerActive")] get; set; }

[Unavailable (PlatformName.MacCatalyst), Advice ("This API is not available when using Catalyst on macOS.")]
[Export ("drawingGestureRecognizer")]
UIGestureRecognizer DrawingGestureRecognizer { get; }

[Deprecated (PlatformName.iOS, 14, 0, message: "Use 'DrawingPolicy' property instead.")]
[Unavailable (PlatformName.MacCatalyst), Advice ("This API is not available when using Catalyst on macOS.")]
[Export ("allowsFingerDrawing")]
bool AllowsFingerDrawing { get; set; }

[iOS (14, 0)]
[Unavailable (PlatformName.MacCatalyst), Advice ("This API is not available when using Catalyst on macOS.")]
[Export ("drawingPolicy", ArgumentSemantic.Assign)]
PKCanvasViewDrawingPolicy DrawingPolicy { get; set; }
}
Expand Down Expand Up @@ -299,7 +294,6 @@ interface PKToolPicker {
UIUserInterfaceStyle ColorUserInterfaceStyle { get; set; }

[Deprecated (PlatformName.iOS, 14, 0, message: "Create individual instances instead.")]
[Unavailable (PlatformName.MacCatalyst), Advice ("This API is not available when using Catalyst on macOS.")]
[Static]
[return: NullAllowed]
[Export ("sharedToolPickerForWindow:")]
Expand Down
1 change: 1 addition & 0 deletions src/pushkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ interface PKPushRegistryDelegate {
void DidReceiveIncomingPush (PKPushRegistry registry, PKPushPayload payload, string type);

[iOS (11,0)]
[MacCatalyst (10,13)]
[Export ("pushRegistry:didReceiveIncomingPushWithPayload:forType:withCompletionHandler:")]
void DidReceiveIncomingPush (PKPushRegistry registry, PKPushPayload payload, string type, Action completion);

Expand Down
2 changes: 1 addition & 1 deletion src/quicklookthumbnailing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ interface QLThumbnailGenerationRequest : NSCopying, NSSecureCoding {
UTType ContentType { get; set; }
}

[Mac (10,15), iOS (13,0)]
[Mac (10,15), iOS (13,0), MacCatalyst (13,0)]
[BaseType (typeof (NSObject))]
interface QLThumbnailRepresentation {

Expand Down
16 changes: 0 additions & 16 deletions tests/xtro-sharpie/MacCatalyst-AVFoundation.todo
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@
!missing-selector! AVAudioSession::supportsMultichannelContent not bound
!missing-selector! AVAudioSessionPortDescription::isSpatialAudioEnabled not bound
!missing-selector! AVAudioUnitSampler::overallGain not bound
!missing-selector! AVAudioUnitSampler::setOverallGain: not bound
!missing-selector! AVCaptureDevice::isInUseByAnotherApplication not bound
!missing-selector! AVCaptureDevice::isPortraitEffectActive not bound
!missing-selector! AVCaptureDevice::minimumFocusDistance not bound
!missing-selector! AVCaptureDeviceFormat::isHighPhotoQualitySupported not bound
Expand Down Expand Up @@ -193,20 +191,6 @@
!missing-selector! AVPlayerPlaybackCoordinator::setDelegate: not bound
!missing-selector! AVSampleBufferAudioRenderer::allowedAudioSpatializationFormats not bound
!missing-selector! AVSampleBufferAudioRenderer::setAllowedAudioSpatializationFormats: not bound
!missing-selector! AVSampleCursor::comparePositionInDecodeOrderWithPositionOfCursor: not bound
!missing-selector! AVSampleCursor::copyCurrentSampleFormatDescription not bound
!missing-selector! AVSampleCursor::currentChunkInfo not bound
!missing-selector! AVSampleCursor::currentChunkStorageRange not bound
!missing-selector! AVSampleCursor::currentChunkStorageURL not bound
!missing-selector! AVSampleCursor::currentSampleDependencyInfo not bound
!missing-selector! AVSampleCursor::currentSampleDuration not bound
!missing-selector! AVSampleCursor::currentSampleIndexInChunk not bound
!missing-selector! AVSampleCursor::currentSampleStorageRange not bound
!missing-selector! AVSampleCursor::currentSampleSyncInfo not bound
!missing-selector! AVSampleCursor::decodeTimeStamp not bound
!missing-selector! AVSampleCursor::presentationTimeStamp not bound
!missing-selector! AVSampleCursor::samplesWithEarlierDecodeTimeStampsMayHaveLaterPresentationTimeStampsThanCursor: not bound
!missing-selector! AVSampleCursor::samplesWithLaterDecodeTimeStampsMayHaveEarlierPresentationTimeStampsThanCursor: not bound
!missing-selector! AVSpeechSynthesizer::setUsesApplicationAudioSession: not bound
!missing-selector! AVSpeechSynthesizer::usesApplicationAudioSession not bound
!missing-selector! AVURLAsset::findCompatibleTrackForCompositionTrack:completionHandler: not bound
Expand Down
Loading

0 comments on commit 304b78e

Please sign in to comment.