-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/xcode16' into dev/rolf/xcode16-b…
…123456-xkit
- Loading branch information
Showing
184 changed files
with
4,696 additions
and
5,611 deletions.
There are no files selected for viewing
This file contains 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 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,76 @@ | ||
#nullable enable | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
using CoreGraphics; | ||
using Foundation; | ||
using ObjCRuntime; | ||
|
||
#if NET | ||
|
||
namespace Accessibility { | ||
|
||
[SupportedOSPlatform ("ios18.0")] | ||
[SupportedOSPlatform ("maccatalyst18.0")] | ||
[SupportedOSPlatform ("macos15.0")] | ||
[SupportedOSPlatform ("tvos18.0")] | ||
[Native] | ||
public enum AXSettingsFeature : long { | ||
/// <summary>Jump to the "Allow Apps to Request to Use" setting in Personal Voice.</summary> | ||
PersonalVoiceAllowAppsToRequestToUse = 1, | ||
} | ||
|
||
public static class AXSettings { | ||
[SupportedOSPlatform ("ios18.0")] | ||
[SupportedOSPlatform ("maccatalyst18.0")] | ||
[SupportedOSPlatform ("macos15.0")] | ||
[SupportedOSPlatform ("tvos18.0")] | ||
[DllImport (Constants.AccessibilityLibrary)] | ||
static extern byte AXAssistiveAccessEnabled (); | ||
|
||
/// <summary>Returns whether Assistive Access is running.</summary> | ||
[SupportedOSPlatform ("ios18.0")] | ||
[SupportedOSPlatform ("maccatalyst18.0")] | ||
[SupportedOSPlatform ("macos15.0")] | ||
[SupportedOSPlatform ("tvos18.0")] | ||
public static bool IsAssistiveAccessEnabled { | ||
get { | ||
return AXAssistiveAccessEnabled () != 0; | ||
} | ||
} | ||
|
||
[SupportedOSPlatform ("ios18.0")] | ||
[SupportedOSPlatform ("maccatalyst18.0")] | ||
[SupportedOSPlatform ("macos15.0")] | ||
[SupportedOSPlatform ("tvos18.0")] | ||
[DllImport (Constants.AccessibilityLibrary)] | ||
unsafe static extern void AXOpenSettingsFeature (nint /* AXSettingsFeature */ feature, BlockLiteral *block); | ||
|
||
/// <summary>Open the Settings app to the specified section.</summary> | ||
/// <param name="feature">The section to open.</param> | ||
/// <param name="completionHandler">This callback is called when the section has been opened. The <see cref="Foundation.NSError" /> argument will be null if successful.</param> | ||
[SupportedOSPlatform ("ios18.0")] | ||
[SupportedOSPlatform ("maccatalyst18.0")] | ||
[SupportedOSPlatform ("macos15.0")] | ||
[SupportedOSPlatform ("tvos18.0")] | ||
public unsafe static void OpenSettingsFeature (AXSettingsFeature feature, Action<NSError?> completionHandler) | ||
{ | ||
delegate* unmanaged<IntPtr, IntPtr, void> trampoline = &OpenSettingsFeatureCompletionHandler; | ||
using var block = new BlockLiteral (trampoline, completionHandler, typeof (AXSettings), nameof (OpenSettingsFeatureCompletionHandler)); | ||
AXOpenSettingsFeature ((nint) (long) feature, &block); | ||
} | ||
|
||
[UnmanagedCallersOnly] | ||
static void OpenSettingsFeatureCompletionHandler (IntPtr block, IntPtr error) | ||
{ | ||
var del = BlockLiteral.GetTarget<Action<NSError?>> (block); | ||
if (del is not null) { | ||
var errorObject = Runtime.GetNSObject<NSError> (error); | ||
del (errorObject); | ||
} | ||
} | ||
} | ||
} | ||
|
||
#endif // NET |
This file contains 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 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,23 @@ | ||
#if NET | ||
using System; | ||
using System.Runtime.Versioning; | ||
using System.Runtime.InteropServices; | ||
|
||
using ObjCRuntime; | ||
|
||
namespace CoreData { | ||
public partial class NSPersistentStoreCoordinator { | ||
#if !__TVOS__ | ||
[SupportedOSPlatform ("macos15.0")] | ||
[SupportedOSPlatform ("ios18.0")] | ||
[SupportedOSPlatform ("maccatalyst18.0")] | ||
[UnsupportedOSPlatform ("tvos")] | ||
public NSManagedObjectID GetManagedObjectId (string value) | ||
{ | ||
using var str = new TransientString (value); | ||
return GetManagedObjectId ((IntPtr) str, (nuint) value.Length); | ||
} | ||
#endif // !__TVOS__ | ||
} | ||
} | ||
#endif |
This file contains 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 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 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 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 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,34 @@ | ||
#nullable enable | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
using Foundation; | ||
using ObjCRuntime; | ||
|
||
namespace HealthKit { | ||
/// <summary>This class contains helper functions for the <see cref="HKStateOfMindValenceClassification" /> enum.</summary> | ||
#if NET | ||
[SupportedOSPlatform ("ios18.0")] | ||
[SupportedOSPlatform ("maccatalyst18.0")] | ||
[SupportedOSPlatform ("macos15.0")] | ||
[UnsupportedOSPlatform ("tvos")] | ||
#else | ||
[Watch (11, 0), NoTV, Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)] | ||
#endif | ||
public static class HKStateOfMindValence { | ||
[DllImport (Constants.HealthKitLibrary)] | ||
static extern IntPtr HKStateOfMindValenceClassificationForValence (double valence); | ||
|
||
/// <summary>Gets the valence classification appropriate for a given valence value.</summary> | ||
/// <param name="valence">The valence value whose classification to get.</param> | ||
/// <returns>The valence classification, or null if the specified valence is outside of the supported range of valence values.</returns> | ||
public static HKStateOfMindValenceClassification? GetClassification (double valence) | ||
{ | ||
var nsnumber = Runtime.GetNSObject<NSNumber> (HKStateOfMindValenceClassificationForValence (valence), owns: false); | ||
if (nsnumber is null) | ||
return null; | ||
return (HKStateOfMindValenceClassification) (long) nsnumber.LongValue; | ||
} | ||
} | ||
} |
This file contains 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,42 @@ | ||
#if !WATCH | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
using Foundation; | ||
using ObjCRuntime; | ||
using MapKit; | ||
|
||
#nullable enable | ||
|
||
namespace MapKit { | ||
/// <summary>This enum is used to select how to initialize a new instance of a <see cref="MKAddressFilter" />.</summary> | ||
public enum MKAddressFilterConstructorOption { | ||
/// <summary>The <c>options</c> parameter passed to the constructor are inclusive.</summary> | ||
Include, | ||
/// <summary>The <c>options</c> parameter passed to the constructor are exclusive.</summary> | ||
Exclude, | ||
} | ||
|
||
public partial class MKAddressFilter { | ||
/// <summary>Create a new <see cref="MKAddressFilter" /> with the specified address filter options.</summary> | ||
/// <param name="options">The address filter options to use.</param> | ||
/// <param name="constructorOption">Specify whether the <paramref name="options" /> argument is including or excluding the given options.</param> | ||
/// <returns>A new <see cref="MKAddressFilter" /> instance with the specified address filter options.</returns> | ||
public MKAddressFilter (MKAddressFilterOption options, MKAddressFilterConstructorOption constructorOption) | ||
: base (NSObjectFlag.Empty) | ||
{ | ||
switch (constructorOption) { | ||
case MKAddressFilterConstructorOption.Include: | ||
InitializeHandle (_InitIncludingOptions (options)); | ||
break; | ||
case MKAddressFilterConstructorOption.Exclude: | ||
InitializeHandle (_InitExcludingOptions (options)); | ||
break; | ||
default: | ||
throw new ArgumentOutOfRangeException (nameof (constructorOption), constructorOption, "Invalid enum value."); | ||
} | ||
} | ||
} | ||
} | ||
|
||
#endif |
Oops, something went wrong.