From 48dc7aaed0f3458ef75d14116aac589ce41ec646 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Fri, 15 Jul 2022 15:12:54 -0400 Subject: [PATCH 1/3] [CoreHpatics] Add support for Xcode 14 beta 1,2, & 3 --- src/corehaptics.cs | 21 +++++++++++++++++++++ tests/xtro-sharpie/iOS-CoreHaptics.todo | 5 ----- tests/xtro-sharpie/macOS-CoreHaptics.ignore | 5 +++++ tests/xtro-sharpie/macOS-CoreHaptics.todo | 5 ----- tests/xtro-sharpie/tvOS-CoreHaptics.todo | 5 ----- 5 files changed, 26 insertions(+), 15 deletions(-) delete mode 100644 tests/xtro-sharpie/iOS-CoreHaptics.todo delete mode 100644 tests/xtro-sharpie/macOS-CoreHaptics.todo delete mode 100644 tests/xtro-sharpie/tvOS-CoreHaptics.todo diff --git a/src/corehaptics.cs b/src/corehaptics.cs index dd654f5f4e32..bcaeea9def94 100644 --- a/src/corehaptics.cs +++ b/src/corehaptics.cs @@ -241,6 +241,7 @@ interface CHHapticAdvancedPatternPlayer : CHHapticPatternPlayer { [DisableDefaultCtor] interface CHHapticEngine { + [Static] [Export ("capabilitiesForHardware")] ICHHapticDeviceCapability GetHardwareCapabilities (); @@ -309,6 +310,10 @@ interface CHHapticEngine [Export ("playPatternFromData:error:")] bool PlayPattern (NSData data, [NullAllowed] out NSError outError); + + [TV (16,0), NoWatch, MacCatalyst (16,0), Mac (13,0), iOS (16,0)] + [Export ("playsAudioOnly")] + bool PlaysAudioOnly { get; set; } } [Static] @@ -357,6 +362,10 @@ partial interface CHHapticPatternDefinitionKeys { [TV (15,0), NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)] [Field ("CHHapticPatternKeyEventWaveformUseVolumeEnvelope")] NSString EventWaveformUseVolumeEnvelopeKey { get; } + + [TV (16,0), NoWatch, MacCatalyst (16,0), Mac (13,0), iOS (16,0)] + [Field ("CHHapticPatternKeyEventWaveformLoopEnabled")] + NSString EventWaveformLoopEnabled { get; } } [Mac (10,15), iOS (13,0), TV (14, 0)] @@ -405,6 +414,10 @@ interface CHHapticPattern { [Wrap ("this (patternDefinition.GetDictionary ()!, out outError)")] NativeHandle Constructor (CHHapticPatternDefinition patternDefinition, [NullAllowed] out NSError outError); + [TV (16,0), NoWatch, MacCatalyst (16,0), Mac (13,0), iOS (16,0)] + [Export ("initWithContentsOfURL:error:")] + NativeHandle Constructor (NSUrl url, [NullAllowed] out NSError outError); + [Internal] [Export ("exportDictionaryAndReturnError:")] [return: NullAllowed] @@ -421,6 +434,11 @@ interface CHHapticPattern { partial interface CHHapticAudioResourceKeys { [Field ("CHHapticAudioResourceKeyUseVolumeEnvelope")] NSString UseVolumeEnvelopeKey { get; } + + [TV (16,0), NoWatch, MacCatalyst (16, 0), Mac (13,0), iOS (16, 0)] + [Field ("CHHapticAudioResourceKeyLoopEnabled")] + NSString LoopEnabledKey { get; } + } [Mac (12,0), iOS (15,0), TV (15,0), MacCatalyst (15,0), NoWatch] @@ -428,6 +446,9 @@ partial interface CHHapticAudioResourceKeys { partial interface CHHapticAudioResourceDefinition { [Advice ("The default value is true.")] bool UseVolumeEnvelope { get; set; } + + [Advice ("The default value is false.")] + bool LoopEnabled { get; set; } } } diff --git a/tests/xtro-sharpie/iOS-CoreHaptics.todo b/tests/xtro-sharpie/iOS-CoreHaptics.todo deleted file mode 100644 index 8635c53a9930..000000000000 --- a/tests/xtro-sharpie/iOS-CoreHaptics.todo +++ /dev/null @@ -1,5 +0,0 @@ -!missing-field! CHHapticAudioResourceKeyLoopEnabled not bound -!missing-field! CHHapticPatternKeyEventWaveformLoopEnabled not bound -!missing-selector! CHHapticEngine::playsAudioOnly not bound -!missing-selector! CHHapticEngine::setPlaysAudioOnly: not bound -!missing-selector! CHHapticPattern::initWithContentsOfURL:error: not bound diff --git a/tests/xtro-sharpie/macOS-CoreHaptics.ignore b/tests/xtro-sharpie/macOS-CoreHaptics.ignore index ec7aba5f84a7..e5d330ec11c5 100644 --- a/tests/xtro-sharpie/macOS-CoreHaptics.ignore +++ b/tests/xtro-sharpie/macOS-CoreHaptics.ignore @@ -115,3 +115,8 @@ !missing-type! CHHapticPattern not bound !missing-field! CHHapticAudioResourceKeyUseVolumeEnvelope not bound !missing-field! CHHapticPatternKeyEventWaveformUseVolumeEnvelope not bound +!missing-field! CHHapticAudioResourceKeyLoopEnabled not bound +!missing-field! CHHapticPatternKeyEventWaveformLoopEnabled not bound +!missing-selector! CHHapticEngine::playsAudioOnly not bound +!missing-selector! CHHapticEngine::setPlaysAudioOnly: not bound +!missing-selector! CHHapticPattern::initWithContentsOfURL:error: not bound diff --git a/tests/xtro-sharpie/macOS-CoreHaptics.todo b/tests/xtro-sharpie/macOS-CoreHaptics.todo deleted file mode 100644 index 8635c53a9930..000000000000 --- a/tests/xtro-sharpie/macOS-CoreHaptics.todo +++ /dev/null @@ -1,5 +0,0 @@ -!missing-field! CHHapticAudioResourceKeyLoopEnabled not bound -!missing-field! CHHapticPatternKeyEventWaveformLoopEnabled not bound -!missing-selector! CHHapticEngine::playsAudioOnly not bound -!missing-selector! CHHapticEngine::setPlaysAudioOnly: not bound -!missing-selector! CHHapticPattern::initWithContentsOfURL:error: not bound diff --git a/tests/xtro-sharpie/tvOS-CoreHaptics.todo b/tests/xtro-sharpie/tvOS-CoreHaptics.todo deleted file mode 100644 index 8635c53a9930..000000000000 --- a/tests/xtro-sharpie/tvOS-CoreHaptics.todo +++ /dev/null @@ -1,5 +0,0 @@ -!missing-field! CHHapticAudioResourceKeyLoopEnabled not bound -!missing-field! CHHapticPatternKeyEventWaveformLoopEnabled not bound -!missing-selector! CHHapticEngine::playsAudioOnly not bound -!missing-selector! CHHapticEngine::setPlaysAudioOnly: not bound -!missing-selector! CHHapticPattern::initWithContentsOfURL:error: not bound From b91c887e152d0502961d80f7fbe3b6c2750a826a Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Fri, 15 Jul 2022 15:30:39 -0400 Subject: [PATCH 2/3] Add missing changes in xtro in .net --- .../xtro-sharpie/api-annotations-dotnet/iOS-CoreHaptics.todo | 5 ----- .../api-annotations-dotnet/macOS-CoreHaptics.ignore | 5 +++++ .../api-annotations-dotnet/macOS-CoreHaptics.todo | 5 ----- .../api-annotations-dotnet/tvOS-CoreHaptics.todo | 5 ----- 4 files changed, 5 insertions(+), 15 deletions(-) delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/iOS-CoreHaptics.todo delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreHaptics.todo delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/tvOS-CoreHaptics.todo diff --git a/tests/xtro-sharpie/api-annotations-dotnet/iOS-CoreHaptics.todo b/tests/xtro-sharpie/api-annotations-dotnet/iOS-CoreHaptics.todo deleted file mode 100644 index 8635c53a9930..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-CoreHaptics.todo +++ /dev/null @@ -1,5 +0,0 @@ -!missing-field! CHHapticAudioResourceKeyLoopEnabled not bound -!missing-field! CHHapticPatternKeyEventWaveformLoopEnabled not bound -!missing-selector! CHHapticEngine::playsAudioOnly not bound -!missing-selector! CHHapticEngine::setPlaysAudioOnly: not bound -!missing-selector! CHHapticPattern::initWithContentsOfURL:error: not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreHaptics.ignore b/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreHaptics.ignore index ec7aba5f84a7..e5d330ec11c5 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreHaptics.ignore +++ b/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreHaptics.ignore @@ -115,3 +115,8 @@ !missing-type! CHHapticPattern not bound !missing-field! CHHapticAudioResourceKeyUseVolumeEnvelope not bound !missing-field! CHHapticPatternKeyEventWaveformUseVolumeEnvelope not bound +!missing-field! CHHapticAudioResourceKeyLoopEnabled not bound +!missing-field! CHHapticPatternKeyEventWaveformLoopEnabled not bound +!missing-selector! CHHapticEngine::playsAudioOnly not bound +!missing-selector! CHHapticEngine::setPlaysAudioOnly: not bound +!missing-selector! CHHapticPattern::initWithContentsOfURL:error: not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreHaptics.todo b/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreHaptics.todo deleted file mode 100644 index 8635c53a9930..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreHaptics.todo +++ /dev/null @@ -1,5 +0,0 @@ -!missing-field! CHHapticAudioResourceKeyLoopEnabled not bound -!missing-field! CHHapticPatternKeyEventWaveformLoopEnabled not bound -!missing-selector! CHHapticEngine::playsAudioOnly not bound -!missing-selector! CHHapticEngine::setPlaysAudioOnly: not bound -!missing-selector! CHHapticPattern::initWithContentsOfURL:error: not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-CoreHaptics.todo b/tests/xtro-sharpie/api-annotations-dotnet/tvOS-CoreHaptics.todo deleted file mode 100644 index 8635c53a9930..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-CoreHaptics.todo +++ /dev/null @@ -1,5 +0,0 @@ -!missing-field! CHHapticAudioResourceKeyLoopEnabled not bound -!missing-field! CHHapticPatternKeyEventWaveformLoopEnabled not bound -!missing-selector! CHHapticEngine::playsAudioOnly not bound -!missing-selector! CHHapticEngine::setPlaysAudioOnly: not bound -!missing-selector! CHHapticPattern::initWithContentsOfURL:error: not bound From 2f6c9f6533f7b2b5e609c32b60b536b141141dfd Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Fri, 15 Jul 2022 17:05:49 -0400 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Alex Soto --- src/corehaptics.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corehaptics.cs b/src/corehaptics.cs index bcaeea9def94..af5243172949 100644 --- a/src/corehaptics.cs +++ b/src/corehaptics.cs @@ -365,7 +365,7 @@ partial interface CHHapticPatternDefinitionKeys { [TV (16,0), NoWatch, MacCatalyst (16,0), Mac (13,0), iOS (16,0)] [Field ("CHHapticPatternKeyEventWaveformLoopEnabled")] - NSString EventWaveformLoopEnabled { get; } + NSString EventWaveformLoopEnabledKey { get; } } [Mac (10,15), iOS (13,0), TV (14, 0)] @@ -416,7 +416,7 @@ interface CHHapticPattern { [TV (16,0), NoWatch, MacCatalyst (16,0), Mac (13,0), iOS (16,0)] [Export ("initWithContentsOfURL:error:")] - NativeHandle Constructor (NSUrl url, [NullAllowed] out NSError outError); + NativeHandle Constructor (NSUrl url, [NullAllowed] out NSError error); [Internal] [Export ("exportDictionaryAndReturnError:")]