Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Foundation/NSObject.mac.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public partial class NSObject {
// FSKit was removed from Xcode 16 RC, but keeping it commented, because it's likely to return in a later release
// static IntPtr fk = Dlfcn.dlopen (Constants.FSKitLibrary, 1);
static IntPtr be = Dlfcn.dlopen (Constants.BrowserEngineKitLibrary, 1);
static IntPtr ce = Dlfcn.dlopen (Constants.CoreHapticsLibrary, 1);

#if !NET
[Obsolete ("Use PlatformAssembly for easier code sharing across platforms.")]
Expand Down
1 change: 1 addition & 0 deletions src/build/dotnet/generator-frameworks.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ partial class Frameworks {
"CoreData",
"CoreFoundation",
"CoreGraphics",
"CoreHaptics",
"CoreImage",
"CoreLocation",
"CoreMedia",
Expand Down
2 changes: 1 addition & 1 deletion src/corehaptics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ interface CHHapticEngine {
[DesignatedInitializer]
NativeHandle Constructor ([NullAllowed] out NSError error);

[NoMac, NoTV]
[NoMac] // AVAudioSession is not available on macOS.
[MacCatalyst (13, 1)]
[Export ("initWithAudioSession:error:")]
[DesignatedInitializer]
Expand Down
1 change: 1 addition & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -2086,6 +2086,7 @@ MACOS_FRAMEWORKS = \
CoreAnimation \
CoreAudioKit \
CoreGraphics \
CoreHaptics \
CoreImage \
CoreLocation \
CoreMotion \
Expand Down
1 change: 1 addition & 0 deletions tests/dotnet/UnitTests/ProjectTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2809,6 +2809,7 @@ public void AppendRuntimeIdentifierToOutputPath_DisableDirectoryBuildProps (Appl
"/System/Library/Frameworks/CoreBluetooth.framework/Versions/A/CoreBluetooth",
"/System/Library/Frameworks/CoreData.framework/Versions/A/CoreData",
"/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation",
"/System/Library/Frameworks/CoreHaptics.framework/Versions/A/CoreHaptics",
"/System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage",
"/System/Library/Frameworks/CoreLocation.framework/Versions/A/CoreLocation",
"/System/Library/Frameworks/CoreMedia.framework/Versions/A/CoreMedia",
Expand Down
6 changes: 6 additions & 0 deletions tests/introspection/ApiWeakPropertyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ protected virtual bool Skip (PropertyInfo property)
}
return false;
}

switch (property.DeclaringType.Name) {
case "CHHapticPatternDefinition":
return property.Name == "WeakParameterCurve" || property.Name == "WeakParameterCurveControlPoints";
}

return false;
}

Expand Down
2 changes: 0 additions & 2 deletions tests/introspection/iOSApiWeakPropertyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ protected override bool Skip (PropertyInfo property)
// NSString manually bound as smart enum CLSContextTopic
case "CLSContext":
return property.Name == "WeakTopic";
case "CHHapticPatternDefinition":
return property.Name == "WeakParameterCurve" || property.Name == "WeakParameterCurveControlPoints";
}
return base.Skip (property);
}
Expand Down
122 changes: 1 addition & 121 deletions tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreHaptics.ignore
Original file line number Diff line number Diff line change
@@ -1,122 +1,2 @@
# This framework, although appers in the header, will not compile: https://github.com/xamarin/maccore/issues/2261
!missing-enum! CHHapticEngineFinishedAction not bound
!missing-enum! CHHapticEngineStoppedReason not bound
!missing-enum! CHHapticErrorCode not bound
!missing-field! CHHapticDynamicParameterIDAudioAttackTimeControl not bound
!missing-field! CHHapticDynamicParameterIDAudioBrightnessControl not bound
!missing-field! CHHapticDynamicParameterIDAudioDecayTimeControl not bound
!missing-field! CHHapticDynamicParameterIDAudioPanControl not bound
!missing-field! CHHapticDynamicParameterIDAudioPitchControl not bound
!missing-field! CHHapticDynamicParameterIDAudioReleaseTimeControl not bound
!missing-field! CHHapticDynamicParameterIDAudioVolumeControl not bound
!missing-field! CHHapticDynamicParameterIDHapticAttackTimeControl not bound
!missing-field! CHHapticDynamicParameterIDHapticDecayTimeControl not bound
!missing-field! CHHapticDynamicParameterIDHapticIntensityControl not bound
!missing-field! CHHapticDynamicParameterIDHapticReleaseTimeControl not bound
!missing-field! CHHapticDynamicParameterIDHapticSharpnessControl not bound
!missing-field! CHHapticEventParameterIDAttackTime not bound
!missing-field! CHHapticEventParameterIDAudioBrightness not bound
!missing-field! CHHapticEventParameterIDAudioPan not bound
!missing-field! CHHapticEventParameterIDAudioPitch not bound
!missing-field! CHHapticEventParameterIDAudioVolume not bound
!missing-field! CHHapticEventParameterIDDecayTime not bound
!missing-field! CHHapticEventParameterIDHapticIntensity not bound
!missing-field! CHHapticEventParameterIDHapticSharpness not bound
!missing-field! CHHapticEventParameterIDReleaseTime not bound
!missing-field! CHHapticEventParameterIDSustained not bound
!missing-field! CHHapticEventTypeAudioContinuous not bound
!missing-field! CHHapticEventTypeAudioCustom not bound
!missing-field! CHHapticEventTypeHapticContinuous not bound
!missing-field! CHHapticEventTypeHapticTransient not bound
!missing-field! CHHapticPatternKeyEvent not bound
!missing-field! CHHapticPatternKeyEventDuration not bound
!missing-field! CHHapticPatternKeyEventParameters not bound
!missing-field! CHHapticPatternKeyEventType not bound
!missing-field! CHHapticPatternKeyEventWaveformPath not bound
!missing-field! CHHapticPatternKeyParameter not bound
!missing-field! CHHapticPatternKeyParameterCurve not bound
!missing-field! CHHapticPatternKeyParameterCurveControlPoints not bound
!missing-field! CHHapticPatternKeyParameterID not bound
!missing-field! CHHapticPatternKeyParameterValue not bound
!missing-field! CHHapticPatternKeyPattern not bound
!missing-field! CHHapticPatternKeyTime not bound
!missing-field! CHHapticPatternKeyVersion not bound
!missing-protocol! CHHapticAdvancedPatternPlayer not bound
!missing-protocol! CHHapticDeviceCapability not bound
!missing-protocol! CHHapticParameterAttributes not bound
!missing-protocol! CHHapticPatternPlayer not bound
!missing-selector! +CHHapticEngine::capabilitiesForHardware not bound
!missing-selector! CHHapticDynamicParameter::initWithParameterID:value:relativeTime: not bound
!missing-selector! CHHapticDynamicParameter::parameterID not bound
!missing-selector! CHHapticDynamicParameter::relativeTime not bound
!missing-selector! CHHapticDynamicParameter::setRelativeTime: not bound
!missing-selector! CHHapticDynamicParameter::setValue: not bound
!missing-selector! CHHapticDynamicParameter::value not bound
!missing-selector! CHHapticEngine::createAdvancedPlayerWithPattern:error: not bound
!missing-selector! CHHapticEngine::createPlayerWithPattern:error: not bound
!missing-selector! CHHapticEngine::currentTime not bound
!missing-selector! CHHapticEngine::initAndReturnError: not bound
# This selector takes an AVAudioSession, which isn't available on macOS.
!missing-selector! CHHapticEngine::initWithAudioSession:error: not bound
!missing-selector! CHHapticEngine::isAutoShutdownEnabled not bound
!missing-selector! CHHapticEngine::isMutedForAudio not bound
!missing-selector! CHHapticEngine::isMutedForHaptics not bound
!missing-selector! CHHapticEngine::notifyWhenPlayersFinished: not bound
!missing-selector! CHHapticEngine::playPatternFromData:error: not bound
!missing-selector! CHHapticEngine::playPatternFromURL:error: not bound
!missing-selector! CHHapticEngine::playsHapticsOnly not bound
!missing-selector! CHHapticEngine::registerAudioResource:options:error: not bound
!missing-selector! CHHapticEngine::resetHandler not bound
!missing-selector! CHHapticEngine::setAutoShutdownEnabled: not bound
!missing-selector! CHHapticEngine::setIsMutedForAudio: not bound
!missing-selector! CHHapticEngine::setIsMutedForHaptics: not bound
!missing-selector! CHHapticEngine::setPlaysHapticsOnly: not bound
!missing-selector! CHHapticEngine::setResetHandler: not bound
!missing-selector! CHHapticEngine::setStoppedHandler: not bound
!missing-selector! CHHapticEngine::startAndReturnError: not bound
!missing-selector! CHHapticEngine::startWithCompletionHandler: not bound
!missing-selector! CHHapticEngine::stoppedHandler not bound
!missing-selector! CHHapticEngine::stopWithCompletionHandler: not bound
!missing-selector! CHHapticEngine::unregisterAudioResource:error: not bound
!missing-selector! CHHapticEvent::duration not bound
!missing-selector! CHHapticEvent::eventParameters not bound
!missing-selector! CHHapticEvent::initWithAudioResourceID:parameters:relativeTime: not bound
!missing-selector! CHHapticEvent::initWithAudioResourceID:parameters:relativeTime:duration: not bound
!missing-selector! CHHapticEvent::initWithEventType:parameters:relativeTime: not bound
!missing-selector! CHHapticEvent::initWithEventType:parameters:relativeTime:duration: not bound
!missing-selector! CHHapticEvent::relativeTime not bound
!missing-selector! CHHapticEvent::setDuration: not bound
!missing-selector! CHHapticEvent::setRelativeTime: not bound
!missing-selector! CHHapticEvent::type not bound
!missing-selector! CHHapticEventParameter::initWithParameterID:value: not bound
!missing-selector! CHHapticEventParameter::parameterID not bound
!missing-selector! CHHapticEventParameter::setValue: not bound
!missing-selector! CHHapticEventParameter::value not bound
!missing-selector! CHHapticParameterCurve::controlPoints not bound
!missing-selector! CHHapticParameterCurve::initWithParameterID:controlPoints:relativeTime: not bound
!missing-selector! CHHapticParameterCurve::parameterID not bound
!missing-selector! CHHapticParameterCurve::relativeTime not bound
!missing-selector! CHHapticParameterCurve::setRelativeTime: not bound
!missing-selector! CHHapticParameterCurveControlPoint::initWithRelativeTime:value: not bound
!missing-selector! CHHapticParameterCurveControlPoint::relativeTime not bound
!missing-selector! CHHapticParameterCurveControlPoint::setRelativeTime: not bound
!missing-selector! CHHapticParameterCurveControlPoint::setValue: not bound
!missing-selector! CHHapticParameterCurveControlPoint::value not bound
!missing-selector! CHHapticPattern::duration not bound
!missing-selector! CHHapticPattern::exportDictionaryAndReturnError: not bound
!missing-selector! CHHapticPattern::initWithDictionary:error: not bound
!missing-selector! CHHapticPattern::initWithEvents:parameterCurves:error: not bound
!missing-selector! CHHapticPattern::initWithEvents:parameters:error: not bound
!missing-type! CHHapticDynamicParameter not bound
!missing-type! CHHapticEngine not bound
!missing-type! CHHapticEvent not bound
!missing-type! CHHapticEventParameter not bound
!missing-type! CHHapticParameterCurve not bound
!missing-type! CHHapticParameterCurveControlPoint not bound
!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

This file was deleted.

3 changes: 1 addition & 2 deletions tools/common/Frameworks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,7 @@ public static Frameworks MacFrameworks {
{ "PencilKit", "PencilKit", 10,15 },
{ "Speech", "Speech", 10,15 },
{ "LinkPresentation", "LinkPresentation", 10,15 },
// not sure if the API is available, issue: https://github.com/xamarin/maccore/issues/1951
//{ "CoreHaptics", "CoreHaptics", 10,15 },
{ "CoreHaptics", "CoreHaptics", 10, 15 },

{ "AutomaticAssessmentConfiguration", "AutomaticAssessmentConfiguration", 10,15,4 },

Expand Down
8 changes: 5 additions & 3 deletions tools/common/StaticRegistrar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2261,15 +2261,17 @@ void CheckNamespace (string ns, List<Exception> exceptions)
string h;
switch (ns) {
case "CallKit":
case "CoreHaptics":
if (App.Platform == ApplePlatform.MacOSX) {
// AVFoundation can't be imported before CallKit on macOS
// AVFoundation can't be imported before CallKit or CoreHaptics on macOS
// Ref: https://github.com/xamarin/maccore/issues/2301
// Ref: https://github.com/xamarin/maccore/issues/2257
// Ref: https://github.com/xamarin/maccore/issues/2261
// The fun part is that other frameworks can import AVFoundation, so we can't check for AVFoundation specifically.
// Instead add CallKit before any other imports.
// Instead add CallKit/CoreHaptics before any other imports.
var firstImport = header.StringBuilder.ToString ().IndexOf ("#import <");
if (firstImport >= 0) {
header.StringBuilder.Insert (firstImport, "#import <CallKit/CallKit.h>\n");
header.StringBuilder.Insert (firstImport, $"#import <{ns}/{ns}.h>\n");
return;
}
}
Expand Down
Loading