Skip to content
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

[CoreMotion] Add support for Xcode 15 beta 7. #18915

Merged
Show file tree
Hide file tree
Changes from 2 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
160 changes: 151 additions & 9 deletions src/coremotion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,15 @@ public enum CMAuthorizationStatus : long {
Authorized,
}

[Watch (8, 4), iOS (15, 4), MacCatalyst (15, 4), TV (15, 4)]
[Native]
public enum CMOdometerOriginDevice : long {
Unknown = 0,
Local,
Remote,
}


[NoMac]
[MacCatalyst (13, 1)]
[BaseType (typeof (NSObject))]
Expand Down Expand Up @@ -631,6 +640,10 @@ interface CMMovementDisorderManager {

[NullAllowed, Export ("monitorKinesiasExpirationDate")]
NSDate MonitorKinesiasExpirationDate { get; }

[Static]
[NullAllowed, Export ("version")]
string Version { get; }
}

[MacCatalyst (13, 1)]
Expand Down Expand Up @@ -687,6 +700,15 @@ public enum CMDeviceMotionSensorLocation : long {
HeadphoneRight,
}

[Watch (10, 0), NoTV, NoMac, iOS (17, 0), MacCatalyst (17, 0)]
[Native]
public enum CMHighFrequencyHeartRateDataConfidence : long {
Low = 0,
Medium,
High,
Highest,
}

[iOS (14, 0)]
[Watch (7, 0)]
[MacCatalyst (14, 0)]
Expand All @@ -696,7 +718,7 @@ public enum CMDeviceMotionSensorLocation : long {
[iOS (14, 0)]
[Watch (7, 0)]
[MacCatalyst (14, 0)]
[NoMac]
[Mac (13, 0)]
[BaseType (typeof (NSObject))]
interface CMHeadphoneMotionManager {

Expand Down Expand Up @@ -735,7 +757,7 @@ interface ICMHeadphoneMotionManagerDelegate { }
[iOS (14, 0)]
[Watch (7, 0)]
[MacCatalyst (14, 0)]
[NoMac]
[Mac (13, 0)]
#if NET
[Protocol, Model]
#else
Expand Down Expand Up @@ -879,15 +901,15 @@ interface CMRecordedPressureData {
NSDate StartDate { get; }
}

[NoMac, NoiOS, NoMacCatalyst, Watch (9, 0), NoTV]
[Mac (13, 0), iOS (16, 0), NoMacCatalyst, Watch (9, 0), NoTV]
[Native]
public enum CMWaterSubmersionState : long {
Unknown = 0,
NotSubmerged,
Submerged,
}

[NoMac, NoiOS, NoMacCatalyst, Watch (9, 0), NoTV]
[Mac (13, 0), iOS (16, 0), NoMacCatalyst, Watch (9, 0), NoTV]
[Native]
public enum CMWaterSubmersionDepthState : long {
Unknown = 0,
Expand All @@ -899,7 +921,7 @@ public enum CMWaterSubmersionDepthState : long {
SensorDepthError = 600,
}

[NoMac, NoiOS, NoMacCatalyst, Watch (9, 0), NoTV]
[NoMac, iOS (16, 0), NoMacCatalyst, Watch (9, 0), NoTV]
[BaseType (typeof (NSObject))]
interface CMWaterSubmersionEvent : NSSecureCoding, NSCopying {
[Export ("date")]
Expand All @@ -909,7 +931,7 @@ interface CMWaterSubmersionEvent : NSSecureCoding, NSCopying {
CMWaterSubmersionState State { get; }
}

[NoMac, NoiOS, NoMacCatalyst, Watch (9, 0), NoTV]
[NoMac, iOS (16, 0), NoMacCatalyst, Watch (9, 0), NoTV]
[BaseType (typeof (NSObject))]
interface CMWaterSubmersionMeasurement : NSSecureCoding, NSCopying {
[Export ("date")]
Expand All @@ -928,7 +950,7 @@ interface CMWaterSubmersionMeasurement : NSSecureCoding, NSCopying {
CMWaterSubmersionDepthState SubmersionState { get; }
}

[NoMac, NoiOS, NoMacCatalyst, Watch (9, 0), NoTV]
[NoMac, iOS (16, 0), NoMacCatalyst, Watch (9, 0), NoTV]
[BaseType (typeof (NSObject))]
interface CMWaterTemperature : NSSecureCoding, NSCopying {
[Export ("date")]
Expand All @@ -943,7 +965,7 @@ interface CMWaterTemperature : NSSecureCoding, NSCopying {

interface ICMWaterSubmersionManagerDelegate { }

[NoMac, NoiOS, NoMacCatalyst, Watch (9, 0), NoTV]
[NoMac, iOS (16, 0), NoMacCatalyst, Watch (9, 0), NoTV]
#if NET
[Protocol, Model]
#else
Expand All @@ -968,7 +990,7 @@ interface CMWaterSubmersionManagerDelegate {
void ErrorOccurred (CMWaterSubmersionManager manager, NSError error);
}

[NoMac, NoiOS, NoMacCatalyst, Watch (9, 0), NoTV]
[NoMac, iOS (16, 0), NoMacCatalyst, Watch (9, 0), NoTV]
[BaseType (typeof (NSObject))]
interface CMWaterSubmersionManager {
[Wrap ("WeakDelegate")]
Expand All @@ -985,5 +1007,125 @@ interface CMWaterSubmersionManager {
[Static]
[Export ("authorizationStatus")]
CMAuthorizationStatus AuthorizationStatus { get; }

[NullAllowed, Export ("maximumDepth")]
NSMeasurement<NSUnitLength> MaximumDepth { get; }
}

[Watch (10, 0), NoMac, iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSObject))]
interface CMBatchedSensorManager {
[Static]
[Export ("authorizationStatus")]
CMAuthorizationStatus AuthorizationStatus { get; }

[Static]
[Export ("accelerometerSupported")]
bool AccelerometerSupported { [Bind ("isAccelerometerSupported")] get; }

[Export ("accelerometerActive")]
bool AccelerometerActive { [Bind ("isAccelerometerActive")] get; }

[Export ("accelerometerDataFrequency")]
nint AccelerometerDataFrequency { get; }

[NullAllowed, Export ("accelerometerBatch")]
CMAccelerometerData [] AccelerometerBatch { get; }

[Export ("startAccelerometerUpdates")]
void StartAccelerometerUpdates ();

[Export ("startAccelerometerUpdatesWithHandler:")]
void StartAccelerometerUpdates (Action<NSArray<CMAccelerometerData>, NSError> handler);
mandel-macaque marked this conversation as resolved.
Show resolved Hide resolved

[Export ("stopAccelerometerUpdates")]
void StopAccelerometerUpdates ();

[Static]
[Export ("deviceMotionSupported")]
bool DeviceMotionSupported { [Bind ("isDeviceMotionSupported")] get; }

[Export ("deviceMotionDataFrequency")]
nint DeviceMotionDataFrequency { get; }

[Export ("deviceMotionActive")]
bool DeviceMotionActive { [Bind ("isDeviceMotionActive")] get; }

[NullAllowed, Export ("deviceMotionBatch")]
CMDeviceMotion [] DeviceMotionBatch { get; }

[Export ("startDeviceMotionUpdates")]
void StartDeviceMotionUpdates ();

[Export ("startDeviceMotionUpdatesWithHandler:")]
void StartDeviceMotionUpdates (Action<NSArray<CMDeviceMotion>, NSError> handler);
mandel-macaque marked this conversation as resolved.
Show resolved Hide resolved

[Export ("stopDeviceMotionUpdates")]
void StopDeviceMotionUpdates ();
}

[Mac (14, 0), MacCatalyst (13, 1)]
[BaseType (typeof (NSObject))]
interface CMOdometerData : NSSecureCoding, NSCopying {
[Export ("startDate", ArgumentSemantic.Strong)]
NSDate StartDate { get; }

[Export ("endDate", ArgumentSemantic.Strong)]
NSDate EndDate { get; }

[Watch (10, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("deltaDistance")]
double DeltaDistance { get; }

[Watch (10, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("deltaDistanceAccuracy")]
double DeltaDistanceAccuracy { get; }

[Watch (10, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("speed")]
double Speed { get; }

[Watch (10, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("speedAccuracy")]
double SpeedAccuracy { get; }

[Watch (10, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("gpsDate", ArgumentSemantic.Strong)]
NSDate GpsDate { get; }

[Watch (10, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("deltaAltitude")]
double DeltaAltitude { get; }

[Watch (10, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("verticalAccuracy")]
double VerticalAccuracy { get; }

[Watch (8, 4), iOS (15, 4), MacCatalyst (15, 4)]
[Export ("originDevice", ArgumentSemantic.Assign)]
CMOdometerOriginDevice OriginDevice { get; }

[Watch (8, 4), iOS (15, 4), MacCatalyst (15, 4)]
[NullAllowed]
[Export ("slope", ArgumentSemantic.Strong)]
NSNumber Slope { get; }

[Watch (8, 4), iOS (15, 4), MacCatalyst (15, 4)]
[NullAllowed]
[Export ("maxAbsSlope", ArgumentSemantic.Strong)]
NSNumber MaxAbsSlope { get; }
}

[Watch (10, 0), NoTV, NoMac, iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (CMLogItem))]
interface CMHighFrequencyHeartRateData {
[Export ("heartRate")]
double HeartRate { get; }

[Export ("confidence")]
CMHighFrequencyHeartRateDataConfidence Confidence { get; }

[NullAllowed, Export ("date")]
NSDate Date { get; }
}
}
57 changes: 0 additions & 57 deletions tests/xtro-sharpie/api-annotations-dotnet/iOS-CoreMotion.todo

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,11 @@
!missing-selector! CMRotationRateData::rotationRate not bound
!missing-type! CMAmbientPressureData not bound
!missing-type! CMRecordedRotationRateData not bound
!missing-type! CMRotationRateData not bound
!missing-type! CMRotationRateData not bound

# added in 13 and deprecated in 14 so we will just ignore them
!missing-selector! +CMStepCounter::isStepCountingAvailable not bound
!missing-selector! CMStepCounter::queryStepCountStartingFrom:to:toQueue:withHandler: not bound
!missing-selector! CMStepCounter::startStepCountingUpdatesToQueue:updateOn:withHandler: not bound
!missing-selector! CMStepCounter::stopStepCountingUpdates not bound
!missing-type! CMStepCounter not bound
32 changes: 0 additions & 32 deletions tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreMotion.todo

This file was deleted.

Loading