diff --git a/src/Foundation/NSObject.mac.cs b/src/Foundation/NSObject.mac.cs index aaad42fa5ec..f359b5f6ddd 100644 --- a/src/Foundation/NSObject.mac.cs +++ b/src/Foundation/NSObject.mac.cs @@ -105,6 +105,7 @@ public partial class NSObject { static IntPtr vs = Dlfcn.dlopen (Constants.VideoSubscriberAccountLibrary, 1); static IntPtr un = Dlfcn.dlopen (Constants.UserNotificationsLibrary, 1); static IntPtr il = Dlfcn.dlopen (Constants.iTunesLibraryLibrary, 1); + static IntPtr exl = Dlfcn.dlopen (Constants.ExtensionKitLibrary, 1); #if !NET [Obsolete ("Use PlatformAssembly for easier code sharing across platforms.")] diff --git a/src/extensionkit.cs b/src/extensionkit.cs new file mode 100644 index 00000000000..53f8b9cc611 --- /dev/null +++ b/src/extensionkit.cs @@ -0,0 +1,73 @@ +// +// ExtensionKit.cs: This file describes the API that the generator will produce for ExtensionKit +// +// Copyright 2022 Microsoft Corp. All rights reserved +// + +using ObjCRuntime; +using Foundation; + +#if MONOMAC +using AppKit; +using UIView = AppKit.NSView; +using UIViewController = AppKit.NSViewController; +#else +using UIKit; +#endif + +#if !NET +using NativeHandle = System.IntPtr; +#endif + +namespace ExtensionKit { + [Mac (13,0), NoiOS, NoMacCatalyst, NoWatch, NoTV] + [BaseType (typeof (UIViewController))] + interface EXAppExtensionBrowserViewController { + [DesignatedInitializer] + [Export ("initWithNibName:bundle:")] + NativeHandle Constructor ([NullAllowed] string nibNameOrNull, [NullAllowed] NSBundle nibBundleOrNull); + } + + interface IEXHostViewControllerDelegate { } + + [Mac (13,0), NoiOS, NoMacCatalyst, NoWatch, NoTV] +#if NET + [Protocol, Model] +#else + [Protocol, Model (AutoGeneratedName = true)] +#endif + [BaseType (typeof (NSObject))] + interface EXHostViewControllerDelegate { + [Export ("hostViewControllerDidActivate:")] + void DidActivate (EXHostViewController viewController); + + [Export ("hostViewControllerWillDeactivate:error:")] + void WillDeactivate (EXHostViewController viewController, [NullAllowed] NSError error); + + [Export ("shouldAcceptXPCConnection:")] + bool ShouldAcceptXpcConnection (NSXpcConnection connection); + } + + // @interface EXHostViewController : NSViewController + [Mac (13,0), NoiOS, NoMacCatalyst, NoWatch, NoTV] + [BaseType (typeof(UIViewController))] + interface EXHostViewController + { + [DesignatedInitializer] + [Export ("initWithNibName:bundle:")] + NativeHandle Constructor ([NullAllowed] string nibNameOrNull, [NullAllowed] NSBundle nibBundleOrNull); + + [NullAllowed, Wrap ("WeakDelegate")] + IEXHostViewControllerDelegate Delegate { get; set; } + + [NullAllowed, Export ("delegate", ArgumentSemantic.Weak)] + NSObject WeakDelegate { get; set; } + + [Export ("placeholderView", ArgumentSemantic.Strong)] + UIView PlaceholderView { get; set; } + + [Export ("makeXPCConnectionWithError:")] + [return: NullAllowed] + NSXpcConnection MakeXpcConnection ([NullAllowed] out NSError error); + } +} diff --git a/src/frameworks.sources b/src/frameworks.sources index 08ceef73931..243e952169c 100644 --- a/src/frameworks.sources +++ b/src/frameworks.sources @@ -2020,6 +2020,7 @@ MACOS_FRAMEWORKS = \ CoreWlan \ EventKit \ ExecutionPolicy \ + ExtensionKit \ ExternalAccessory \ FileProvider \ FileProviderUI \ diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-ExtensionKit.todo b/tests/xtro-sharpie/api-annotations-dotnet/macOS-ExtensionKit.todo deleted file mode 100644 index 27ee1f23753..00000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-ExtensionKit.todo +++ /dev/null @@ -1,8 +0,0 @@ -!missing-protocol! EXHostViewControllerDelegate not bound -!missing-selector! EXHostViewController::delegate not bound -!missing-selector! EXHostViewController::makeXPCConnectionWithError: not bound -!missing-selector! EXHostViewController::placeholderView not bound -!missing-selector! EXHostViewController::setDelegate: not bound -!missing-selector! EXHostViewController::setPlaceholderView: not bound -!missing-type! EXAppExtensionBrowserViewController not bound -!missing-type! EXHostViewController not bound diff --git a/tests/xtro-sharpie/macOS-ExtensionKit.todo b/tests/xtro-sharpie/macOS-ExtensionKit.todo deleted file mode 100644 index 27ee1f23753..00000000000 --- a/tests/xtro-sharpie/macOS-ExtensionKit.todo +++ /dev/null @@ -1,8 +0,0 @@ -!missing-protocol! EXHostViewControllerDelegate not bound -!missing-selector! EXHostViewController::delegate not bound -!missing-selector! EXHostViewController::makeXPCConnectionWithError: not bound -!missing-selector! EXHostViewController::placeholderView not bound -!missing-selector! EXHostViewController::setDelegate: not bound -!missing-selector! EXHostViewController::setPlaceholderView: not bound -!missing-type! EXAppExtensionBrowserViewController not bound -!missing-type! EXHostViewController not bound diff --git a/tools/common/Frameworks.cs b/tools/common/Frameworks.cs index 7c57c6b889e..c59f20d3808 100644 --- a/tools/common/Frameworks.cs +++ b/tools/common/Frameworks.cs @@ -279,6 +279,7 @@ public static Frameworks MacFrameworks { { "BackgroundAssets", "BackgroundAssets", 13,0 }, { "HealthKit", "HealthKit", 13,0 }, { "SharedWithYouCore", "SharedWithYouCore", 13, 0 }, + { "ExtensionKit", "ExtensionKit", 13,0 }, }; } return mac_frameworks;