Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/xcode16' into dev/rolf/xcode16-b…
Browse files Browse the repository at this point in the history
…1-metalperformanceshaders
  • Loading branch information
rolfbjarne committed Sep 5, 2024
2 parents 9d413ac + 7439acc commit f4f397b
Show file tree
Hide file tree
Showing 64 changed files with 837 additions and 1,001 deletions.
17 changes: 17 additions & 0 deletions src/Accessibility/AXPrefers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,22 @@ public static bool HorizontalTextEnabled ()
return AXPrefersHorizontalTextLayout () != 0;
}

#if NET
[SupportedOSPlatform ("ios18.0")]
[SupportedOSPlatform ("maccatalyst18.0")]
[SupportedOSPlatform ("macos15.0")]
[SupportedOSPlatform ("tvos18.0")]
[DllImport (Constants.AccessibilityLibrary)]
static extern byte AXPrefersNonBlinkingTextInsertionIndicator ();

[SupportedOSPlatform ("ios18.0")]
[SupportedOSPlatform ("maccatalyst18.0")]
[SupportedOSPlatform ("macos15.0")]
[SupportedOSPlatform ("tvos18.0")]
public static bool NonBlinkingTextInsertionIndicator ()
{
return AXPrefersNonBlinkingTextInsertionIndicator () != 0;
}
#endif // NET
}
}
76 changes: 76 additions & 0 deletions src/Accessibility/AXSettings.cs
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
23 changes: 23 additions & 0 deletions src/CoreData/NSPersistentStoreCoordinator.cs
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
56 changes: 56 additions & 0 deletions src/Security/Certificate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,62 @@ internal static bool Equals (SecCertificate first, SecCertificate second)
return Runtime.GetNSObject<NSData> (data, true);
}

#if NET
[SupportedOSPlatform ("ios18.0")]
[SupportedOSPlatform ("maccatalyst18.0")]
[SupportedOSPlatform ("macos15.0")]
[SupportedOSPlatform ("tvos18.0")]
#else
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern /* CFDateRef */ IntPtr SecCertificateCopyNotValidBeforeDate (/* SecCertificateRef */ IntPtr certificate);

/// <summary>Get the date when this certificate becomes valid.</summary>
/// <returns>The date when this certificate becomes valid, or null if the date could not be obtained.</returns>
#if NET
[SupportedOSPlatform ("ios18.0")]
[SupportedOSPlatform ("maccatalyst18.0")]
[SupportedOSPlatform ("macos15.0")]
[SupportedOSPlatform ("tvos18.0")]
#else
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
#endif
public NSDate? NotValidBeforeDate {
get {
var ptr = SecCertificateCopyNotValidBeforeDate (Handle);
return Runtime.GetNSObject<NSDate> (ptr, owns: true);
}
}

#if NET
[SupportedOSPlatform ("ios18.0")]
[SupportedOSPlatform ("maccatalyst18.0")]
[SupportedOSPlatform ("macos15.0")]
[SupportedOSPlatform ("tvos18.0")]
#else
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern /* CFDateRef */ IntPtr SecCertificateCopyNotValidAfterDate (/* SecCertificateRef */ IntPtr certificate);

/// <summary>Get the date when this certificate is no longer valid.</summary>
/// <returns>The date when this certificate is no longer valid, or null if the date could not be obtained.</returns>
#if NET
[SupportedOSPlatform ("ios18.0")]
[SupportedOSPlatform ("maccatalyst18.0")]
[SupportedOSPlatform ("macos15.0")]
[SupportedOSPlatform ("tvos18.0")]
#else
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
#endif
public NSDate? NotValidAfterDate {
get {
var ptr = SecCertificateCopyNotValidAfterDate (Handle);
return Runtime.GetNSObject<NSDate> (ptr, owns: true);
}
}

#endif // COREBUILD
}

Expand Down
14 changes: 14 additions & 0 deletions src/Security/SecAccessControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ public enum SecAccessControlCreateFlags : long {
#if NET
[SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("maccatalyst")]
[ObsoletedOSPlatform ("macos", "Use 'Companion' instead.")]
[ObsoletedOSPlatform ("maccatalyst", "Use 'Companion' instead.")]
[UnsupportedOSPlatform ("ios")]
[UnsupportedOSPlatform ("tvos")]
#else
Expand All @@ -96,6 +98,18 @@ public enum SecAccessControlCreateFlags : long {
#endif
Watch = 1 << 5,

#if NET
[SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("maccatalyst")]
[UnsupportedOSPlatform ("ios")]
[UnsupportedOSPlatform ("tvos")]
#else
[NoiOS]
[NoTV]
[NoWatch]
#endif
Companion = 1 << 5,

#if NET
[SupportedOSPlatform ("ios")]
[SupportedOSPlatform ("macos")]
Expand Down
15 changes: 15 additions & 0 deletions src/Security/SecureTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,31 @@ public enum TlsProtocolVersion : ushort {
// CF_ENUM(uint16_t, tls_ciphersuite_t)
[NativeName ("tls_ciphersuite_t")]
public enum TlsCipherSuite : ushort {
[Deprecated (PlatformName.MacOSX, 15, 0)]
[Deprecated (PlatformName.iOS, 18, 0)]
[Deprecated (PlatformName.WatchOS, 11, 0)]
[Deprecated (PlatformName.TvOS, 18, 0)]
[Deprecated (PlatformName.MacCatalyst, 18, 0)]
RsaWith3desEdeCbcSha = 10,
RsaWithAes128CbcSha = 47,
RsaWithAes256CbcSha = 53,
RsaWithAes128GcmSha256 = 156,
RsaWithAes256GcmSha384 = 157,
RsaWithAes128CbcSha256 = 60,
RsaWithAes256CbcSha256 = 61,
[Deprecated (PlatformName.MacOSX, 15, 0)]
[Deprecated (PlatformName.iOS, 18, 0)]
[Deprecated (PlatformName.WatchOS, 11, 0)]
[Deprecated (PlatformName.TvOS, 18, 0)]
[Deprecated (PlatformName.MacCatalyst, 18, 0)]
EcdheEcdsaWith3desEdeCbcSha = 49160,
EcdheEcdsaWithAes128CbcSha = 49161,
EcdheEcdsaWithAes256CbcSha = 49162,
[Deprecated (PlatformName.MacOSX, 15, 0)]
[Deprecated (PlatformName.iOS, 18, 0)]
[Deprecated (PlatformName.WatchOS, 11, 0)]
[Deprecated (PlatformName.TvOS, 18, 0)]
[Deprecated (PlatformName.MacCatalyst, 18, 0)]
EcdheRsaWith3desEdeCbcSha = 49170,
EcdheRsaWithAes128CbcSha = 49171,
EcdheRsaWithAes256CbcSha = 49172,
Expand Down
31 changes: 30 additions & 1 deletion src/StoreKit/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ namespace StoreKit {
// typedef NSInteger SKPaymentTransactionState;
// StoreKit.framework/Headers/SKPaymentTransaction.h
/// <summary>Transaction state.</summary>
[Deprecated (PlatformName.iOS, 18, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.MacCatalyst, 18, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.MacOSX, 15, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.TvOS, 18, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.WatchOS, 11, 0 /* Apple's replacement requires Swift */ )]
[Watch (6, 2)]
[MacCatalyst (13, 1)]
[Native]
Expand Down Expand Up @@ -70,6 +75,11 @@ public enum SKDownloadState : long {
}

/// <summary>Enumerates authorization states for music store access.</summary>
[Deprecated (PlatformName.iOS, 18, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.MacCatalyst, 18, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.MacOSX, 15, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.TvOS, 18, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.WatchOS, 11, 0 /* Apple's replacement requires Swift */ )]
[Watch (7, 0)]
[MacCatalyst (13, 1)]
[Native]
Expand All @@ -81,19 +91,28 @@ public enum SKCloudServiceAuthorizationStatus : long {
}

/// <summary>Enumerates flags that describe the user's local music library capabilities..</summary>
[Deprecated (PlatformName.iOS, 18, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.MacCatalyst, 18, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.MacOSX, 15, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.TvOS, 18, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.WatchOS, 11, 0 /* Apple's replacement requires Swift */ )]
[Watch (7, 0)]
[MacCatalyst (13, 1)]
[Native]
public enum SKCloudServiceCapability : ulong {
None = 0,
MusicCatalogPlayback = 1 << 0,
[NoTV]
[MacCatalyst (13, 1)]
MusicCatalogSubscriptionEligible = 1 << 1,
AddToCloudMusicLibrary = 1 << 8
}

/// <summary>Enumerates visiblity settings for a promoted product.</summary>
[Deprecated (PlatformName.iOS, 18, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.MacCatalyst, 18, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.MacOSX, 15, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.TvOS, 18, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.WatchOS, 11, 0 /* Apple's replacement requires Swift */ )]
[Mac (11, 0)]
[NoWatch]
[MacCatalyst (13, 1)]
Expand All @@ -105,6 +124,11 @@ public enum SKProductStorePromotionVisibility : long {
}

/// <summary>Defines the natural period for a subscription.</summary>
[Deprecated (PlatformName.iOS, 18, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.MacCatalyst, 18, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.MacOSX, 15, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.TvOS, 18, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.WatchOS, 11, 0 /* Apple's replacement requires Swift */ )]
[Watch (6, 2), iOS (11, 2), TV (11, 2)]
[MacCatalyst (13, 1)]
[Native]
Expand All @@ -116,6 +140,11 @@ public enum SKProductPeriodUnit : ulong {
}

/// <summary>Enumerates how a discount price is applied.</summary>
[Deprecated (PlatformName.iOS, 18, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.MacCatalyst, 18, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.MacOSX, 15, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.TvOS, 18, 0 /* Apple's replacement requires Swift */ )]
[Deprecated (PlatformName.WatchOS, 11, 0 /* Apple's replacement requires Swift */ )]
[Watch (6, 2), iOS (11, 2), TV (11, 2)]
[MacCatalyst (13, 1)]
[Native]
Expand Down
44 changes: 44 additions & 0 deletions src/accessibility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,50 @@ partial interface AXPrefers {
[Notification]
[Field ("AXPrefersHorizontalTextLayoutDidChangeNotification")]
NSString HorizontalTextLayoutDidChangeNotification { get; }

[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
[Notification]
[Field ("AXPrefersNonBlinkingTextInsertionIndicatorDidChangeNotification")]
NSString NonBlinkingTextInsertionIndicatorDidChangeNotification { get; }
}

[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface AXRequest : NSCopying, NSSecureCoding {
[Static]
[Export ("currentRequest"), NullAllowed]
AXRequest Current { get; }

[Export ("technology")]
[BindAs (typeof (AXTechnology))]
NSString Technology { get; }
}

[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
enum AXTechnology {
[Field ("AXTechnologyVoiceOver")]
VoiceOver,

[Field ("AXTechnologySwitchControl")]
SwitchControl,

[Field ("AXTechnologyVoiceControl")]
VoiceControl,

[Field ("AXTechnologyFullKeyboardAccess")]
FullKeyboardAccess,

[Field ("AXTechnologySpeakScreen")]
SpeakScreen,

[Field ("AXTechnologyAutomation")]
Automation,

[Field ("AXTechnologyHoverText")]
HoverText,

[Field ("AXTechnologyZoom")]
Zoom,
}
}
8 changes: 8 additions & 0 deletions src/coredata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ interface UserInfoKeys {
[Watch (7, 0), TV (14, 0), Mac (11, 0), iOS (14, 0), MacCatalyst (17, 0)]
[Field ("NSPersistentStoreDeferredLightweightMigrationOptionKey")]
NSString DeferredLightweightMigrationOptionKey { get; }

[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
[Field ("NSPersistentStoreModelVersionChecksumKey")]
NSString ModelVersionChecksumKey { get; }
}

/// <summary>Enumerates valid keys for the user information dictionary used in <see cref="P:CoreData.NSPersistentStoreCoordinator.StoresWillChangeNotification" /> and <see cref="P:CoreData.NSPersistentStoreCoordinator.StoresDidChangeNotification" />.</summary>
Expand Down Expand Up @@ -2374,6 +2378,10 @@ partial interface NSPersistentStoreCoordinator
[Watch (7, 0), TV (14, 0), Mac (11, 0), iOS (14, 0), MacCatalyst (14, 0)]
[Export ("finishDeferredLightweightMigrationTask:")]
bool FinishDeferredLightweightMigrationTask ([NullAllowed] out NSError error);

[NoWatch, NoTV, Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
[Export ("managedObjectIDFromUTF8String:length:")]
NSManagedObjectID GetManagedObjectId (IntPtr utf8String, nuint length);
}

interface NSPersistentStoreCoordinatorStoreChangeEventArgs {
Expand Down
Loading

0 comments on commit f4f397b

Please sign in to comment.