diff --git a/src/AudioUnit/AudioComponent.cs b/src/AudioUnit/AudioComponent.cs index a4fad8fefe..30c40144a0 100644 --- a/src/AudioUnit/AudioComponent.cs +++ b/src/AudioUnit/AudioComponent.cs @@ -397,11 +397,11 @@ namespace XamCore.AudioUnit #endif #if IOS || MONOMAC - [NoWatch, NoTV, Mac (10,13), iOS (11,0)] + [NoWatch, NoTV, Mac (10,13, onlyOn64: true), iOS (11,0)] [DllImport (Constants.AudioUnitLibrary)] static extern int /* OSStatus */ AudioUnitExtensionSetComponentList (IntPtr /* CFString */ extensionIdentifier, /* CFArrayRef */ IntPtr audioComponentInfo); - [NoWatch, NoTV, Mac (10,13), iOS (11,0)] + [NoWatch, NoTV, Mac (10,13, onlyOn64: true), iOS (11,0)] [DllImport (Constants.AudioUnitLibrary)] static extern /* CFArrayRef */ IntPtr AudioUnitExtensionCopyComponentList (IntPtr /* CFString */ extensionIdentifier); diff --git a/src/Constants.mac.cs.in b/src/Constants.mac.cs.in index 5f08f1c7a0..6ad4937a16 100644 --- a/src/Constants.mac.cs.in +++ b/src/Constants.mac.cs.in @@ -130,7 +130,7 @@ namespace MonoMac { public const string CoreMLLibrary = "/System/Library/Frameworks/CoreML.framework/CoreML"; public const string VisionLibrary = "/System/Library/Frameworks/Vision.framework/Vision"; public const string IOSurfaceLibrary = "/System/Library/Frameworks/IOSurface.framework/IOSurface"; - public const string PhotosUILibrary = "/System/Library/Frameworks/Photos.framework/PhotosUI"; + public const string PhotosUILibrary = "/System/Library/Frameworks/PhotosUI.framework/PhotosUI"; public const string ExternalAccessoryLibrary = "/System/Library/Frameworks/ExternalAccessory.framework/ExternalAccessory"; } } diff --git a/src/Foundation/NSObject.mac.cs b/src/Foundation/NSObject.mac.cs index c548884f31..cd97a5ea5e 100644 --- a/src/Foundation/NSObject.mac.cs +++ b/src/Foundation/NSObject.mac.cs @@ -95,6 +95,7 @@ namespace XamCore.Foundation { static IntPtr io = Dlfcn.dlopen (Constants.ModelIOLibrary, 1); static IntPtr nc = Dlfcn.dlopen (Constants.NotificationCenterLibrary, 1); static IntPtr pl = Dlfcn.dlopen (Constants.PhotosLibrary, 1); + static IntPtr pu = Dlfcn.dlopen (Constants.PhotosUILibrary, 1); static IntPtr mp = Dlfcn.dlopen (Constants.MediaPlayerLibrary, 1); static IntPtr pc = Dlfcn.dlopen (Constants.PrintCoreLibrary, 1); static IntPtr cml = Dlfcn.dlopen (Constants.CoreMLLibrary, 1); diff --git a/src/corebluetooth.cs b/src/corebluetooth.cs index ec9d2b2dce..7254f712eb 100644 --- a/src/corebluetooth.cs +++ b/src/corebluetooth.cs @@ -59,6 +59,7 @@ namespace XamCore.CoreBluetooth { [Protocolize] CBCentralManagerDelegate Delegate { get; set; } + [Mac (10, 7, onlyOn64: true)] // Was removed from 32-bit in 10.13 unannounced [Export ("initWithDelegate:queue:")] [PostGet ("WeakDelegate")] IntPtr Constructor ([NullAllowed, Protocolize] CBCentralManagerDelegate centralDelegate, [NullAllowed] DispatchQueue queue); @@ -482,11 +483,11 @@ namespace XamCore.CoreBluetooth { [Export ("state")] CBPeripheralState State { get; } - [iOS (11,0)][TV (11,0)][Mac (10,13)] + [iOS (11,0)][TV (11,0)][Mac (10,13, onlyOn64: true)] [Export ("canSendWriteWithoutResponse")] bool CanSendWriteWithoutResponse { get; } - [iOS (11,0)][TV (11,0)][Mac (10,13)] + [iOS (11,0)][TV (11,0)][Mac (10,13, onlyOn64: true)] [Export ("openL2CAPChannel:")] void OpenL2CapChannel (ushort psm); } @@ -779,8 +780,14 @@ namespace XamCore.CoreBluetooth { [Watch (4,0)] [Since (6, 0), Mac(10,9)] + [DisableDefaultCtor] [BaseType (typeof (CBManager), Delegates=new[] { "WeakDelegate" }, Events=new[] { typeof (CBPeripheralManagerDelegate) })] interface CBPeripheralManager { + + [Mac (10,9, onlyOn64: true)] // Was removed from 32-bit in 10.13 unannounced + [Export ("init")] + IntPtr Constructor (); + [NoTV] [NoWatch] [Export ("initWithDelegate:queue:")] @@ -834,11 +841,11 @@ namespace XamCore.CoreBluetooth { [Export ("updateValue:forCharacteristic:onSubscribedCentrals:")] bool UpdateValue (NSData value, CBMutableCharacteristic characteristic, [NullAllowed] CBCentral[] subscribedCentrals); - [iOS (11,0)][TV (11,0)][Mac (10,13)] + [iOS (11,0)][TV (11,0)][Mac (10,13, onlyOn64: true)] [Export ("publishL2CAPChannelWithEncryption:")] void PublishL2CapChannel (bool encryptionRequired); - [iOS (11,0)][TV (11,0)][Mac (10,13)] + [iOS (11,0)][TV (11,0)][Mac (10,13, onlyOn64: true)] [Export ("unpublishL2CAPChannel:")] void UnpublishL2CapChannel (ushort psm); @@ -935,19 +942,23 @@ namespace XamCore.CoreBluetooth { NSUuid Identifier { get; } } + // The type is available in 32bits macOS 10.13 even if most properties are 64 bits only [Watch (4,0)][iOS (11,0)][TV (11,0)][Mac (10,13)] [BaseType (typeof (NSObject), Name = "CBL2CAPChannel")] interface CBL2CapChannel { - + [Mac (10,13, onlyOn64: true)] [Export ("peer")] CBPeer Peer { get; } + [Mac (10,13, onlyOn64: true)] [Export ("inputStream")] NSInputStream InputStream { get; } + [Mac (10,13, onlyOn64: true)] [Export ("outputStream")] NSOutputStream OutputStream { get; } + [Mac (10,13, onlyOn64: true)] [Export ("PSM")] /* uint16_t */ ushort Psm { get; } } diff --git a/src/externalaccessory.cs b/src/externalaccessory.cs index 534287036a..a5f6f25145 100644 --- a/src/externalaccessory.cs +++ b/src/externalaccessory.cs @@ -14,7 +14,7 @@ using XamCore.UIKit; namespace XamCore.ExternalAccessory { - [Mac (10, 13)][TV (10,0)] + [Mac (10, 13, onlyOn64: true)][TV (10,0)] [BaseType (typeof (NSObject), Delegates=new string [] { "WeakDelegate" }, Events=new Type [] {typeof(EAAccessoryDelegate)})] // Objective-C exception thrown. Name: EAAccessoryInitException Reason: -init not supported. EAAccessoryManager is responsible for creating all objects. [DisableDefaultCtor] @@ -58,7 +58,7 @@ namespace XamCore.ExternalAccessory { string DockType { get; } } - [Mac (10, 13)][TV (10,0)] + [Mac (10, 13, onlyOn64: true)][TV (10,0)] [BaseType (typeof (NSObject))] [Model] [Protocol] @@ -67,7 +67,7 @@ namespace XamCore.ExternalAccessory { void Disconnected (EAAccessory accessory); } - [Mac (10, 13)][TV (10,0)] + [Mac (10, 13, onlyOn64: true)][TV (10,0)] interface EAAccessoryEventArgs { [Export ("EAAccessoryKey")] EAAccessory Accessory { get; } @@ -77,7 +77,7 @@ namespace XamCore.ExternalAccessory { EAAccessory Selected { get; } } - [Mac (10, 13)][TV (10,0)] + [Mac (10, 13, onlyOn64: true)][TV (10,0)] [BaseType (typeof (NSObject))] // Objective-C exception thrown. Name: EAAccessoryManagerInitException Reason: -init is not supported. Use +sharedAccessoryManager. [DisableDefaultCtor] @@ -116,7 +116,7 @@ namespace XamCore.ExternalAccessory { void ShowBluetoothAccessoryPicker ([NullAllowed] NSPredicate predicate, [NullAllowed] Action completion); } - [Mac (10, 13)][TV (10,0)] + [Mac (10, 13, onlyOn64: true)][TV (10,0)] [BaseType (typeof (NSObject))] // Objective-C exception thrown. Name: EASessionInitException Reason: -init not supported. use -initWithAccessory:forProtocol. [DisableDefaultCtor] diff --git a/src/foundation.cs b/src/foundation.cs index b64c8443d5..b893717b7a 100644 --- a/src/foundation.cs +++ b/src/foundation.cs @@ -5280,7 +5280,9 @@ namespace XamCore.Foundation #if MONOMAC , NSPasteboardReading, NSPasteboardWriting #endif +#if !(MONOMAC && !XAMCORE_2_0) // exclude Classic/XM , NSItemProviderWriting, NSItemProviderReading +#endif { [Export ("initWithScheme:host:path:")] IntPtr Constructor (string scheme, string host, string path); @@ -5972,20 +5974,20 @@ namespace XamCore.Foundation #endif // From the NSItemProviderReading protocol - [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)] [Static] [Export ("readableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)] new string[] ReadableTypeIdentifiers { get; } // From the NSItemProviderReading protocol - [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)] [Static] [Export ("objectWithItemProviderData:typeIdentifier:error:")] [return: NullAllowed] new NSUrl GetObject (NSData data, string typeIdentifier, [NullAllowed] out NSError outError); // From the NSItemProviderWriting protocol - [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)] [Static] [Export ("writableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)] new string[] WritableTypeIdentifiers { get; } @@ -7788,7 +7790,9 @@ namespace XamCore.Foundation #if MONOMAC , NSPasteboardReading, NSPasteboardWriting // Documented that it implements NSPasteboard protocols even if header doesn't show it #endif +#if !(MONOMAC && !XAMCORE_2_0) // exclude Classic/XM , NSItemProviderReading, NSItemProviderWriting +#endif { [Export ("initWithData:encoding:")] IntPtr Constructor (NSData data, NSStringEncoding encoding); @@ -8050,19 +8054,19 @@ namespace XamCore.Foundation // From the NSItemProviderReading protocol - [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)] [Static] [Export ("readableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)] new string[] ReadableTypeIdentifiers { get; } - [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)] [Static] [Export ("objectWithItemProviderData:typeIdentifier:error:")] [return: NullAllowed] new NSString GetObject (NSData data, string typeIdentifier, [NullAllowed] out NSError outError); // From the NSItemProviderWriting protocol - [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)] [Static] [Export ("writableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)] new string[] WritableTypeIdentifiers { get; } @@ -9742,7 +9746,7 @@ namespace XamCore.Foundation interface INSItemProviderReading {} - [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)] [Protocol] interface NSItemProviderReading { @@ -9765,7 +9769,7 @@ namespace XamCore.Foundation interface INSItemProviderWriting {} - [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)] [Protocol] interface NSItemProviderWriting { diff --git a/src/safariservices.cs b/src/safariservices.cs index 838e791d36..e09c9c4cd8 100644 --- a/src/safariservices.cs +++ b/src/safariservices.cs @@ -185,7 +185,7 @@ namespace XamCore.SafariServices { void ShowPreferencesForExtension (string identifier, [NullAllowed] Action completionHandler); [Mac (10,12,4, onlyOn64 : true)] - [Advice ("Unavailable to extensions")] + [Advice ("Unavailable to extensions.")] [Static][Async] [Export ("dispatchMessageWithName:toExtensionWithIdentifier:userInfo:completionHandler:")] void DispatchMessage (string messageName, string identifier, [NullAllowed] NSDictionary userInfo, [NullAllowed] Action completionHandler); diff --git a/src/spritekit.cs b/src/spritekit.cs index ff6516ca72..bc1f7545b1 100644 --- a/src/spritekit.cs +++ b/src/spritekit.cs @@ -3398,7 +3398,7 @@ namespace XamCore.SpriteKit { // SKRenderer is not available for WatchKit apps and the iOS simulator [NoWatch] - [TV (11,0), Mac (10,13), iOS (11,0)] + [TV (11,0), Mac (10,13, onlyOn64 : true), iOS (11,0)] [BaseType (typeof(NSObject))] [DisableDefaultCtor] interface SKRenderer { diff --git a/src/wkwebkit.cs b/src/wkwebkit.cs index b4e50a703d..22454e4023 100644 --- a/src/wkwebkit.cs +++ b/src/wkwebkit.cs @@ -61,7 +61,7 @@ namespace XamCore.WebKit WKBackForwardListItem ItemAtIndex (nint index); } - [Mac (10,13), iOS (11,0)] + [Mac (10,13, onlyOn64: true), iOS (11,0)] [BaseType (typeof(NSObject))] interface WKContentRuleList { @@ -69,7 +69,7 @@ namespace XamCore.WebKit string Identifier { get; } } - [Mac (10,13), iOS (11,0)] + [Mac (10,13, onlyOn64: true), iOS (11,0)] [BaseType (typeof(NSObject))] interface WKContentRuleListStore { @@ -303,7 +303,7 @@ namespace XamCore.WebKit } - [Mac (10,13), iOS (11,0)] + [Mac (10,13, onlyOn64: true), iOS (11,0)] [BaseType (typeof(NSObject))] interface WKSnapshotConfiguration : NSCopying { [Export ("rect")] diff --git a/tests/apitest/src/EveryFrameworkSmokeTest.cs b/tests/apitest/src/EveryFrameworkSmokeTest.cs index 2cda77a1b7..b92e1035d2 100644 --- a/tests/apitest/src/EveryFrameworkSmokeTest.cs +++ b/tests/apitest/src/EveryFrameworkSmokeTest.cs @@ -67,6 +67,7 @@ namespace Xamarin.Mac.Tests case "SocialLibrary": case "SpriteKitLibrary": case "PhotosLibrary": + case "PhotosUILibrary": case "IntentsLibrary": case "MediaPlayerLibrary": return LoadStatus.Acceptable; diff --git a/tests/introspection/ApiTypoTest.cs b/tests/introspection/ApiTypoTest.cs index c38f9b6aef..4f5d8b1b11 100644 --- a/tests/introspection/ApiTypoTest.cs +++ b/tests/introspection/ApiTypoTest.cs @@ -75,6 +75,7 @@ namespace Introspection "Accurracy", "Achivements", "Acos", + "Acn", "Actionname", "Activitiy", "Addin", diff --git a/tests/introspection/Mac/MacApiCtorInitTest.cs b/tests/introspection/Mac/MacApiCtorInitTest.cs index fa293083c5..b9fc1a405b 100644 --- a/tests/introspection/Mac/MacApiCtorInitTest.cs +++ b/tests/introspection/Mac/MacApiCtorInitTest.cs @@ -155,6 +155,10 @@ namespace Introspection { case "MonoMac.AppKit.NSMutableFontCollection": case "AppKit.NSMutableFontCollection": return true; // Crashes in 10.12 + case "CoreBluetooth.CBCentralManager": + if (IntPtr.Size == 4 && Mac.CheckSystemVersion (10, 13)) // 32-bit removed unannounced in 10.13 + return true; + break; } switch (type.Namespace) { diff --git a/tests/introspection/Mac/MacApiFieldTest.cs b/tests/introspection/Mac/MacApiFieldTest.cs index 9026a486d7..07a56fccac 100644 --- a/tests/introspection/Mac/MacApiFieldTest.cs +++ b/tests/introspection/Mac/MacApiFieldTest.cs @@ -155,6 +155,10 @@ namespace Introspection { // MonoMac.CoreServices.CFHTTPMessage - document in 10.9 but returns null case "_AuthenticationSchemeOAuth1": return true; + case "CBUUIDValidRangeString": + if (Mac.CheckSystemVersion (10, 13)); // radar 32858911 + return true; + break; default: return base.Skip (p); } diff --git a/tests/introspection/Mac/MacApiProtocolTest.cs b/tests/introspection/Mac/MacApiProtocolTest.cs index 6f9b5b4596..60c66a28cd 100644 --- a/tests/introspection/Mac/MacApiProtocolTest.cs +++ b/tests/introspection/Mac/MacApiProtocolTest.cs @@ -217,6 +217,16 @@ namespace Introspection { break; } break; + case "NSItemProviderWriting": + switch (type.Name) { + case "NSMutableString": + case "NSString": + case "NSUrl": + if (IntPtr.Size == 4) // Only on 64-bit version of these types + return true; + break; + } + break; } switch (type.Name) { diff --git a/tests/introspection/Mac/MacApiWeakPropertyTest.cs b/tests/introspection/Mac/MacApiWeakPropertyTest.cs index 66fd681cf9..0938c8d759 100644 --- a/tests/introspection/Mac/MacApiWeakPropertyTest.cs +++ b/tests/introspection/Mac/MacApiWeakPropertyTest.cs @@ -20,6 +20,9 @@ namespace Introspection { return true; case "NSAttributedStringDocumentAttributes": // NSAttributedStringDocumentAttributes.WeakDocumentType is done by hand, not a binding return true; + // VNImageOptions is a DictionaryContainer that exposes a Weak* NSDictionary + case "VNImageOptions": + return true; } return base.Skip (type); } diff --git a/tools/common/StaticRegistrar.cs b/tools/common/StaticRegistrar.cs index fc9f005ca3..6f4dfbfa6b 100644 --- a/tools/common/StaticRegistrar.cs +++ b/tools/common/StaticRegistrar.cs @@ -2382,6 +2382,7 @@ namespace XamCore.Registrar { static bool IsQTKitType (ObjCType type) => IsTypeCore (type, "QTKit"); static bool IsMapKitType (ObjCType type) => IsTypeCore (type, "MapKit"); static bool IsIntentsType (ObjCType type) => IsTypeCore (type, "Intents"); + static bool IsExternalAccessoryType (ObjCType type) => IsTypeCore (type, "ExternalAccessory"); static bool IsMetalType (ObjCType type) { @@ -2440,7 +2441,7 @@ namespace XamCore.Registrar { // These are 64-bit frameworks that extend NSExtensionContext / NSUserActivity, which you can't do // if the header doesn't declare them. So hack it away, since they are useless in 64-bit anyway - if (!Is64Bits && (IsMapKitType (@class) || IsIntentsType (@class))) + if (!Is64Bits && (IsMapKitType (@class) || IsIntentsType (@class) || IsExternalAccessoryType (@class))) continue; #endif diff --git a/tools/linker/ObjCExtensions.cs b/tools/linker/ObjCExtensions.cs index 1fb5bd2340..a4298948f2 100644 --- a/tools/linker/ObjCExtensions.cs +++ b/tools/linker/ObjCExtensions.cs @@ -62,6 +62,7 @@ namespace Xamarin.Linker { IOSurface = profile.GetNamespace ("IOSurface"); PdfKit = profile.GetNamespace ("PdfKit"); #if MONOMAC + PhotosUI = profile.GetNamespace ("PhotosUI"); IOBluetooth = profile.GetNamespace ("IOBluetooth"); IOBluetoothUI = profile.GetNamespace ("IOBluetoothUI"); FinderSync = profile.GetNamespace ("FinderSync"); @@ -147,6 +148,7 @@ namespace Xamarin.Linker { public static string PdfKit { get; private set; } #if MONOMAC + public static string PhotosUI { get; private set; } public static string IOBluetooth { get; private set; } public static string IOBluetoothUI { get; private set; } public static string FinderSync { get; private set; } diff --git a/tools/mmp/linker/MonoMac.Tuner/MonoMacNamespaces.cs b/tools/mmp/linker/MonoMac.Tuner/MonoMacNamespaces.cs index 80a88f7f41..1c883120ef 100644 --- a/tools/mmp/linker/MonoMac.Tuner/MonoMacNamespaces.cs +++ b/tools/mmp/linker/MonoMac.Tuner/MonoMacNamespaces.cs @@ -68,6 +68,7 @@ namespace MonoMac.Tuner { { Constants.MediaPlayerLibrary, Namespaces.MediaPlayer }, { Constants.IntentsLibrary, Namespaces.Intents }, { Constants.PhotosLibrary, Namespaces.Photos }, + { Constants.PhotosUILibrary, Namespaces.PhotosUI }, { Constants.PrintCoreLibrary, Namespaces.PrintCore }, { Constants.CoreMLLibrary, Namespaces.CoreML }, { Constants.VisionLibrary, Namespaces.Vision },