From 4812f8147450f2bf2b04f07a0e0e24bbecdb4c96 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Mon, 29 Aug 2022 15:01:03 -0400 Subject: [PATCH 1/5] [SahreWithYou] Add support for Xcode 14 beta 6. --- src/appkit.cs | 2 + src/frameworks.sources | 2 + src/sharedwithyou.cs | 399 ++++++++++++++++++ tests/introspection/ApiCtorInitTest.cs | 13 +- tests/introspection/ApiFieldTest.cs | 7 + tests/introspection/ApiSelectorTest.cs | 6 + tests/introspection/iOS/iOSApiCtorInitTest.cs | 12 + tests/introspection/iOS/iOSApiProtocolTest.cs | 3 + tests/mtouch/RegistrarTest.cs | 1 + .../iOS-SharedWithYou.todo | 83 ---- tests/xtro-sharpie/iOS-SharedWithYou.todo | 83 ---- tools/common/Frameworks.cs | 1 + tools/mtouch/Makefile | 1 + 13 files changed, 442 insertions(+), 171 deletions(-) create mode 100644 src/sharedwithyou.cs delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/iOS-SharedWithYou.todo delete mode 100644 tests/xtro-sharpie/iOS-SharedWithYou.todo diff --git a/src/appkit.cs b/src/appkit.cs index 2452aa8dbb97..ac2d13283b8d 100644 --- a/src/appkit.cs +++ b/src/appkit.cs @@ -22839,6 +22839,8 @@ interface NSSharingServiceDelegate interface INSSharingServiceDelegate {} + interface INSCloudSharingServiceDelegate {} + [Protocol, Model] [Mac (10, 12)] [NoMacCatalyst] diff --git a/src/frameworks.sources b/src/frameworks.sources index 0195bdf02b58..ca8ef0a38c6b 100644 --- a/src/frameworks.sources +++ b/src/frameworks.sources @@ -2182,6 +2182,7 @@ IOS_FRAMEWORKS = \ ScreenTime \ Security \ SensorKit \ + SharedWithYou \ SharedWithYouCore \ Social \ Speech \ @@ -2369,6 +2370,7 @@ MACCATALYST_FRAMEWORKS = \ ScreenTime \ Security \ SensorKit \ + SharedWithYou \ SharedWithYouCore \ Social \ Speech \ diff --git a/src/sharedwithyou.cs b/src/sharedwithyou.cs new file mode 100644 index 000000000000..604a5416498f --- /dev/null +++ b/src/sharedwithyou.cs @@ -0,0 +1,399 @@ +// +// SharedWithYou C# bindings +// +// Authors: +// Manuel de la Pena Saenz +// +// Copyright 2022 Microsoft Corporation All rights reserved. +// + +using System; + +using AVFoundation; +using CoreFoundation; +using CoreGraphics; +using Foundation; +using SharedWithYouCore; +using UniformTypeIdentifiers; +using ObjCRuntime; + +#if MONOMAC +using AppKit; +using UIViewController=System.Object; +using UIView=AppKit.NSView; +using UIMenu=AppKit.NSMenu; +using UIImage=AppKit.NSImage; +using ICloudSharingControllerDelegate=AppKit.INSCloudSharingServiceDelegate; +#else +using UIKit; +using ICloudSharingControllerDelegate=UIKit.IUICloudSharingControllerDelegate; +#endif + +#if !NET +using NativeHandle = System.IntPtr; +#endif + +namespace SharedWithYou { + + [NoWatch, TV (16,0), NoMac, iOS (16,0), MacCatalyst (16,0)] + [Native] + public enum SWAttributionViewBackgroundStyle : long { + Default = 0, + Color, + Material, + } + + [NoWatch, TV (16,0), NoMac, iOS (16,0), MacCatalyst (16,0)] + [Native] + public enum SWAttributionViewDisplayContext : long { + Summary = 0, + Detail, + } + + [NoWatch, TV (16,0), NoMac, iOS (16,0), MacCatalyst (16,0)] + [Native] + public enum SWAttributionViewHorizontalAlignment : long { + Default = 0, + Leading, + Center, + Trailing, + } + + [TV (16,0), NoMac, iOS (16,0)] + [Native] + public enum SWHighlightCenterErrorCode : long { + NoError = 0, + InternalError, + InvalidURL, + AccessDenied, + } + + [NoTV, NoWatch, NoMac, iOS (16,0), MacCatalyst (16,0)] + [Native] + public enum SWHighlightChangeEventTrigger : long { + Edit = 1, + Comment = 2, + } + + [NoTV, NoWatch, NoMac, iOS (16,0), MacCatalyst (16,0)] + [Native] + public enum SWHighlightMembershipEventTrigger : long { + AddedCollaborator = 1, + RemovedCollaborator = 2, + } + + [NoTV, NoWatch, NoMac, iOS (16,0), MacCatalyst (16,0)] + [Native] + public enum SWHighlightPersistenceEventTrigger : long { + Created = 1, + Deleted = 2, + Renamed = 3, + Moved = 4, + } + + [NoWatch, NoMac, TV (16,0), iOS (16,0), MacCatalyst (16,0)] + [BaseType (typeof (UIView))] + interface SWAttributionView + { + + [DesignatedInitializer] + [Export ("initWithFrame:")] + NativeHandle Constructor (CGRect frame); + + [NullAllowed, Export ("highlight", ArgumentSemantic.Strong)] + SWHighlight Highlight { get; set; } + + [Export ("displayContext", ArgumentSemantic.Assign)] + SWAttributionViewDisplayContext DisplayContext { get; set; } + + [Export ("horizontalAlignment", ArgumentSemantic.Assign)] + SWAttributionViewHorizontalAlignment HorizontalAlignment { get; set; } + + [Export ("backgroundStyle", ArgumentSemantic.Assign)] + SWAttributionViewBackgroundStyle BackgroundStyle { get; set; } + + [Export ("preferredMaxLayoutWidth")] + nfloat PreferredMaxLayoutWidth { get; set; } + + [Export ("highlightMenu", ArgumentSemantic.Strong)] + UIMenu HighlightMenu { get; } + + [NullAllowed, Export ("menuTitleForHideAction", ArgumentSemantic.Strong)] + string MenuTitleForHideAction { get; set; } + + [NullAllowed, Export ("supplementalMenu", ArgumentSemantic.Strong)] + UIMenu SupplementalMenu { get; set; } + + [NoMac, NoiOS] + [Export ("enablesMarquee")] + bool EnablesMarquee { get; set; } + } + + [NoWatch, TV (16,0), NoMac, iOS (16,0), MacCatalyst (16,0)] + [BaseType (typeof (NSObject))] + [DisableDefaultCtor] + interface SWHighlight : NSSecureCoding, NSCopying + { + + [NoTV] + [Field ("SWCollaborationMetadataTypeIdentifier")] + NSString MetadataTypeIdentifier { get; } + + [Export ("identifier", ArgumentSemantic.Copy)] + NSObject/**/ Identifier { get; } + + [Export ("URL", ArgumentSemantic.Copy)] + NSUrl Url { get; } + } + + interface ISWHighlightCenterDelegate {} + + [NoWatch, TV (16,0), NoMac, iOS (16,0), MacCatalyst (16,0)] +#if NET + [Protocol, Model] +#else + [Protocol, Model (AutoGeneratedName = true)] +#endif + [BaseType (typeof (NSObject))] + interface SWHighlightCenterDelegate + { + [Abstract] + [Export ("highlightCenterHighlightsDidChange:")] + void HighlightCenterHighlightsDidChange (SWHighlightCenter highlightCenter); + } + + [NoWatch, TV (16,0), NoMac, iOS (16,0), MacCatalyst (16,0)] + [BaseType (typeof (NSObject))] + interface SWHighlightCenter + { + [Wrap ("WeakDelegate")] + [NullAllowed] + ISWHighlightCenterDelegate Delegate { get; set; } + + [NullAllowed, Export ("delegate", ArgumentSemantic.Weak)] + NSObject WeakDelegate { get; set; } + + [Export ("highlights", ArgumentSemantic.Copy)] + SWHighlight[] Highlights { get; } + + [Static] + [Export ("highlightCollectionTitle")] + string HighlightCollectionTitle { get; } + + [Static] + [Export ("systemCollaborationSupportAvailable")] + bool SystemCollaborationSupportAvailable { [Bind ("isSystemCollaborationSupportAvailable")] get; } + + [Async] + [Export ("getHighlightForURL:completionHandler:")] + void GetHighlight (NSUrl urL, Action completionHandler); + + [Export ("collaborationHighlightForIdentifier:error:")] + [return: NullAllowed] + SWCollaborationHighlight GetCollaborationHighlight (string collaborationIdentifier, [NullAllowed] out NSError error); + + [Async] + [Export ("getCollaborationHighlightForURL:completionHandler:")] + void GetCollaborationHighlight (NSUrl url, Action completionHandler); + + [Export ("postNoticeForHighlightEvent:")] + void PostNoticeForHighlightEvent (ISWHighlightEvent @event); + + [Async] + [Export ("getSignedIdentityProofForCollaborationHighlight:usingData:completionHandler:")] + void GetSignedIdentityProof (SWCollaborationHighlight collaborationHighlight, NSData data, Action completionHandler); + } + + + [NoWatch, NoMac, NoTV, iOS (16,0), MacCatalyst (16,0)] + [BaseType (typeof (UIViewController))] + [DisableDefaultCtor] + interface SWRemoveParticipantAlertController + { + [Static] + [Export ("alertControllerWithParticipant:highlight:")] + SWRemoveParticipantAlertController Create (SWPerson participant, SWCollaborationHighlight highlight); + } + + interface ISWCollaborationViewDelegate {} + + [NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] +#if NET + [Protocol, Model] +#else + [Protocol, Model (AutoGeneratedName = true)] +#endif + [BaseType (typeof (NSObject))] + interface SWCollaborationViewDelegate + { + + [DesignatedInitializer] + [Export ("initWithFrame:")] + NativeHandle Constructor (CGRect frame); + + [Export ("collaborationViewShouldPresentPopover:")] + bool ShouldPresentPopover (SWCollaborationView collaborationView); + + [Export ("collaborationViewWillPresentPopover:")] + void WillPresentPopover (SWCollaborationView collaborationView); + + [Export ("collaborationViewDidDismissPopover:")] + void DidDismissPopover (SWCollaborationView collaborationView); + } + + [NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] + [BaseType (typeof (UIView))] + interface SWCollaborationView + { + + [DesignatedInitializer] + [Export ("initWithFrame:")] + NativeHandle Constructor (CGRect frame); + + [Wrap ("WeakCloudSharingDelegate")] + [NullAllowed] + ICloudSharingControllerDelegate CloudSharingDelegate { get; set; } + + [NullAllowed, Export ("cloudSharingDelegate", ArgumentSemantic.Weak)] + NSObject WeakCloudSharingDelegate { get; set; } + + [Export ("setContentView:")] + void SetContentView (UIView detailViewListContentView); + + [Export ("initWithItemProvider:")] + NativeHandle Constructor (NSItemProvider itemProvider); + + [Export ("activeParticipantCount")] + nuint ActiveParticipantCount { get; set; } + + [Wrap ("WeakDelegate")] + [NullAllowed] + ISWCollaborationViewDelegate Delegate { get; set; } + + [NullAllowed, Export ("delegate", ArgumentSemantic.Weak)] + NSObject WeakDelegate { get; set; } + + [Export ("headerTitle")] + string HeaderTitle { get; set; } + + [Export ("headerSubtitle")] + string HeaderSubtitle { get; set; } + + [Export ("headerImage", ArgumentSemantic.Strong)] + UIImage HeaderImage { get; set; } + + [NoMac] + [Wrap ("WeakCloudSharingControllerDelegate")] + [NullAllowed] + ICloudSharingControllerDelegate CloudSharingControllerDelegate { get; set; } + + [NoMac] + [NullAllowed, Export ("cloudSharingControllerDelegate", ArgumentSemantic.Weak)] + NSObject WeakCloudSharingControllerDelegate { get; set; } + + [NoiOS] + [Wrap ("WeakCloudSharingServiceDelegate")] + [NullAllowed] + ICloudSharingControllerDelegate CloudSharingServiceDelegate { get; set; } + + [NoiOS] + [NullAllowed, Export ("cloudSharingServiceDelegate", ArgumentSemantic.Weak)] + NSObject WeakCloudSharingServiceDelegate { get; set; } + + // should not be Async + [Export ("dismissPopover:")] + void DismissPopover ([NullAllowed] Action callback); + + [Export ("manageButtonTitle")] + string ManageButtonTitle { get; set; } + + [Export ("setShowManageButton:")] + void SetShowManageButton (bool showManageButton); + } + + [NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] + [BaseType (typeof (SWHighlight))] + interface SWCollaborationHighlight : NSSecureCoding, NSCopying + { + [Export ("collaborationIdentifier")] + string CollaborationIdentifier { get; } + + [NullAllowed, Export ("title")] + string Title { get; } + + [Export ("creationDate", ArgumentSemantic.Copy)] + NSDate CreationDate { get; } + + [Export ("contentType", ArgumentSemantic.Copy)] + UTType ContentType { get; } + } + + interface ISWHighlightEvent {} + + [NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] + [Protocol] + [BaseType (typeof (NSObject))] + interface SWHighlightEvent : NSSecureCoding, NSCopying + { + [Abstract] + [Export ("highlightURL", ArgumentSemantic.Copy)] + NSUrl HighlightUrl { get; } + } + + [NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] + [BaseType (typeof (NSObject))] + [DisableDefaultCtor] + interface SWHighlightChangeEvent : SWHighlightEvent + { + [Export ("changeEventTrigger", ArgumentSemantic.Assign)] + SWHighlightChangeEventTrigger ChangeEventTrigger { get; } + + [Export ("initWithHighlight:trigger:")] + NativeHandle Constructor (SWHighlight highlight, SWHighlightChangeEventTrigger trigger); + + [Export ("highlightURL", ArgumentSemantic.Copy)] + NSUrl HighlightUrl { get; } + } + + [NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] + [BaseType (typeof (NSObject))] + [DisableDefaultCtor] + interface SWHighlightMembershipEvent : SWHighlightEvent + { + [Export ("membershipEventTrigger", ArgumentSemantic.Assign)] + SWHighlightMembershipEventTrigger MembershipEventTrigger { get; } + + [Export ("initWithHighlight:trigger:")] + NativeHandle Constructor (SWHighlight highlight, SWHighlightMembershipEventTrigger trigger); + } + + + [NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] + [BaseType (typeof (NSObject))] + [DisableDefaultCtor] + interface SWHighlightMentionEvent : SWHighlightEvent + { + [Export ("mentionedPersonHandle", ArgumentSemantic.Strong)] + string MentionedPersonHandle { get; } + + [Export ("initWithHighlight:mentionedPersonCloudKitShareHandle:")] + NativeHandle Constructor (SWHighlight highlight, string handle); + + [Export ("initWithHighlight:mentionedPersonIdentity:")] + NativeHandle Constructor (SWHighlight highlight, SWPersonIdentity identity); + } + + [NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] + [BaseType (typeof (NSObject))] + [DisableDefaultCtor] + interface SWHighlightPersistenceEvent : SWHighlightEvent + { + [Export ("persistenceEventTrigger", ArgumentSemantic.Assign)] + SWHighlightPersistenceEventTrigger PersistenceEventTrigger { get; } + + [Export ("initWithHighlight:trigger:")] + NativeHandle Constructor (SWHighlight highlight, SWHighlightPersistenceEventTrigger trigger); + } + + +} diff --git a/tests/introspection/ApiCtorInitTest.cs b/tests/introspection/ApiCtorInitTest.cs index dd50b154ac7d..4b1f8409ae4d 100644 --- a/tests/introspection/ApiCtorInitTest.cs +++ b/tests/introspection/ApiCtorInitTest.cs @@ -310,6 +310,10 @@ public void DesignatedInitializer () int n = 0; foreach (Type t in Assembly.GetTypes ()) { + + if (SkipCheckShouldReExposeBaseCtor (t)) + continue; + // we only care for NSObject subclasses that we expose publicly if (!t.IsPublic || !NSObjectType.IsAssignableFrom (t)) continue; @@ -604,12 +608,11 @@ protected virtual bool SkipCheckShouldNotExposeDefaultCtor (Type type) return true; } - // Add Skipped types here - //switch (type.Namespace) { - //case "": - // return true; - //} + return SkipDueToAttribute (type); + } + protected virtual bool SkipCheckShouldReExposeBaseCtor (Type type) + { return SkipDueToAttribute (type); } diff --git a/tests/introspection/ApiFieldTest.cs b/tests/introspection/ApiFieldTest.cs index e0f9e32d3c2d..a6c3a66d02bf 100644 --- a/tests/introspection/ApiFieldTest.cs +++ b/tests/introspection/ApiFieldTest.cs @@ -59,6 +59,13 @@ protected virtual bool Skip (PropertyInfo property) default: return false; } + case "SWHighlight": + switch (property.Name) { + case "MetadataTypeIdentifier": + return TestRuntime.IsSimulatorOrDesktop; + default: + return false; + } } return SkipDueToAttribute (property); } diff --git a/tests/introspection/ApiSelectorTest.cs b/tests/introspection/ApiSelectorTest.cs index 2466df1032a3..77dfa644b3f9 100644 --- a/tests/introspection/ApiSelectorTest.cs +++ b/tests/introspection/ApiSelectorTest.cs @@ -941,6 +941,12 @@ protected virtual bool Skip (Type type, string selectorName) } #endif break; + case "SWRemoveParticipantAlertController": + switch (selectorName) { + case "initWithFrame:": + return true; + } + break; #if NET // Incorrect attributes in inlined protocol selectors - https://github.com/xamarin/xamarin-macios/issues/14802 case "NSTextAttachment": diff --git a/tests/introspection/iOS/iOSApiCtorInitTest.cs b/tests/introspection/iOS/iOSApiCtorInitTest.cs index 551fcad55d1c..285250eb92dd 100644 --- a/tests/introspection/iOS/iOSApiCtorInitTest.cs +++ b/tests/introspection/iOS/iOSApiCtorInitTest.cs @@ -255,6 +255,18 @@ protected override bool Skip (Type type) return base.Skip (type); } + protected override bool SkipCheckShouldReExposeBaseCtor (Type type) + { + switch(type.Name) { + case "SWRemoveParticipantAlertController": + return true; + default: + return false; + } + + return base.SkipCheckShouldReExposeBaseCtor (type); + } + static List do_not_dispose = new List (); protected override void Dispose (NSObject obj, Type type) diff --git a/tests/introspection/iOS/iOSApiProtocolTest.cs b/tests/introspection/iOS/iOSApiProtocolTest.cs index 8fc7c59c950a..bb2a4354d331 100644 --- a/tests/introspection/iOS/iOSApiProtocolTest.cs +++ b/tests/introspection/iOS/iOSApiProtocolTest.cs @@ -126,6 +126,9 @@ protected override bool Skip (Type type) if (!TestRuntime.CheckXcodeVersion (11,0)) return true; break; + case "SWHighlightEvent": + return TestRuntime.IsSimulatorOrDesktop; + #endif case "UILayoutGuideAspectFitting": case "UISceneWindowingBehaviors": diff --git a/tests/mtouch/RegistrarTest.cs b/tests/mtouch/RegistrarTest.cs index 13a8631202ab..b108a62b3f0f 100644 --- a/tests/mtouch/RegistrarTest.cs +++ b/tests/mtouch/RegistrarTest.cs @@ -351,6 +351,7 @@ public void MT4134 () new { Framework = "ThreadNetwork", Version = "15.0" }, new { Framework = "BackgroundAssets", Version = "16.0" }, new { Framework = "PushToTalk", Version = "16.0" }, + new { Framework = "SharedWithYou", Version = "16.0" }, new { Framework = "SharedWithYouCore", Version = "16.0" }, }; foreach (var framework in invalidFrameworks) diff --git a/tests/xtro-sharpie/api-annotations-dotnet/iOS-SharedWithYou.todo b/tests/xtro-sharpie/api-annotations-dotnet/iOS-SharedWithYou.todo deleted file mode 100644 index 12e23b60a1c1..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-SharedWithYou.todo +++ /dev/null @@ -1,83 +0,0 @@ -!missing-enum! SWAttributionViewBackgroundStyle not bound -!missing-enum! SWAttributionViewDisplayContext not bound -!missing-enum! SWAttributionViewHorizontalAlignment not bound -!missing-enum! SWHighlightCenterErrorCode not bound -!missing-protocol! SWHighlightCenterDelegate not bound -!missing-selector! +SWHighlightCenter::highlightCollectionTitle not bound -!missing-selector! +SWRemoveParticipantAlertController::alertControllerWithParticipant:highlight: not bound -!missing-selector! SWAttributionView::backgroundStyle not bound -!missing-selector! SWAttributionView::displayContext not bound -!missing-selector! SWAttributionView::highlight not bound -!missing-selector! SWAttributionView::highlightMenu not bound -!missing-selector! SWAttributionView::horizontalAlignment not bound -!missing-selector! SWAttributionView::menuTitleForHideAction not bound -!missing-selector! SWAttributionView::preferredMaxLayoutWidth not bound -!missing-selector! SWAttributionView::setBackgroundStyle: not bound -!missing-selector! SWAttributionView::setDisplayContext: not bound -!missing-selector! SWAttributionView::setHighlight: not bound -!missing-selector! SWAttributionView::setHorizontalAlignment: not bound -!missing-selector! SWAttributionView::setMenuTitleForHideAction: not bound -!missing-selector! SWAttributionView::setPreferredMaxLayoutWidth: not bound -!missing-selector! SWAttributionView::setSupplementalMenu: not bound -!missing-selector! SWAttributionView::supplementalMenu not bound -!missing-selector! SWHighlight::identifier not bound -!missing-selector! SWHighlight::URL not bound -!missing-selector! SWHighlightCenter::delegate not bound -!missing-selector! SWHighlightCenter::highlights not bound -!missing-selector! SWHighlightCenter::setDelegate: not bound -!missing-type! SWAttributionView not bound -!missing-type! SWHighlight not bound -!missing-type! SWHighlightCenter not bound -!missing-type! SWRemoveParticipantAlertController not bound -!missing-enum! SWHighlightChangeEventTrigger not bound -!missing-enum! SWHighlightMembershipEventTrigger not bound -!missing-enum! SWHighlightPersistenceEventTrigger not bound -!missing-field! SWCollaborationMetadataTypeIdentifier not bound -!missing-protocol! SWCollaborationViewDelegate not bound -!missing-protocol! SWHighlightEvent not bound -!missing-selector! SWCollaborationHighlight::collaborationIdentifier not bound -!missing-selector! SWCollaborationHighlight::contentType not bound -!missing-selector! SWCollaborationHighlight::creationDate not bound -!missing-selector! SWCollaborationHighlight::title not bound -!missing-selector! SWCollaborationView::activeParticipantCount not bound -!missing-selector! SWCollaborationView::cloudSharingDelegate not bound -!missing-selector! SWCollaborationView::delegate not bound -!missing-selector! SWCollaborationView::dismissPopover: not bound -!missing-selector! SWCollaborationView::headerImage not bound -!missing-selector! SWCollaborationView::headerSubtitle not bound -!missing-selector! SWCollaborationView::headerTitle not bound -!missing-selector! SWCollaborationView::initWithItemProvider: not bound -!missing-selector! SWCollaborationView::manageButtonTitle not bound -!missing-selector! SWCollaborationView::setActiveParticipantCount: not bound -!missing-selector! SWCollaborationView::setCloudSharingDelegate: not bound -!missing-selector! SWCollaborationView::setContentView: not bound -!missing-selector! SWCollaborationView::setDelegate: not bound -!missing-selector! SWCollaborationView::setHeaderImage: not bound -!missing-selector! SWCollaborationView::setHeaderSubtitle: not bound -!missing-selector! SWCollaborationView::setHeaderTitle: not bound -!missing-selector! SWCollaborationView::setManageButtonTitle: not bound -!missing-selector! SWCollaborationView::setShowManageButton: not bound -!missing-selector! SWHighlightCenter::collaborationHighlightForIdentifier:error: not bound -!missing-selector! SWHighlightCenter::getSignedIdentityProofForCollaborationHighlight:usingData:completionHandler: not bound -!missing-selector! SWHighlightCenter::postNoticeForHighlightEvent: not bound -!missing-selector! SWHighlightChangeEvent::changeEventTrigger not bound -!missing-selector! SWHighlightChangeEvent::highlightURL not bound -!missing-selector! SWHighlightChangeEvent::initWithHighlight:trigger: not bound -!missing-selector! SWHighlightMembershipEvent::initWithHighlight:trigger: not bound -!missing-selector! SWHighlightMembershipEvent::membershipEventTrigger not bound -!missing-selector! SWHighlightMentionEvent::initWithHighlight:mentionedPersonCloudKitShareHandle: not bound -!missing-selector! SWHighlightMentionEvent::initWithHighlight:mentionedPersonIdentity: not bound -!missing-selector! SWHighlightMentionEvent::mentionedPersonHandle not bound -!missing-selector! SWHighlightPersistenceEvent::initWithHighlight:trigger: not bound -!missing-selector! SWHighlightPersistenceEvent::persistenceEventTrigger not bound -!missing-type! SWCollaborationHighlight not bound -!missing-type! SWCollaborationView not bound -!missing-type! SWHighlightChangeEvent not bound -!missing-type! SWHighlightMembershipEvent not bound -!missing-type! SWHighlightMentionEvent not bound -!missing-type! SWHighlightPersistenceEvent not bound -!missing-selector! SWCollaborationView::cloudSharingControllerDelegate not bound -!missing-selector! SWCollaborationView::setCloudSharingControllerDelegate: not bound -!missing-selector! +SWHighlightCenter::isSystemCollaborationSupportAvailable not bound -!missing-selector! SWHighlightCenter::getCollaborationHighlightForURL:completionHandler: not bound -!missing-selector! SWHighlightCenter::getHighlightForURL:completionHandler: not bound diff --git a/tests/xtro-sharpie/iOS-SharedWithYou.todo b/tests/xtro-sharpie/iOS-SharedWithYou.todo deleted file mode 100644 index 12e23b60a1c1..000000000000 --- a/tests/xtro-sharpie/iOS-SharedWithYou.todo +++ /dev/null @@ -1,83 +0,0 @@ -!missing-enum! SWAttributionViewBackgroundStyle not bound -!missing-enum! SWAttributionViewDisplayContext not bound -!missing-enum! SWAttributionViewHorizontalAlignment not bound -!missing-enum! SWHighlightCenterErrorCode not bound -!missing-protocol! SWHighlightCenterDelegate not bound -!missing-selector! +SWHighlightCenter::highlightCollectionTitle not bound -!missing-selector! +SWRemoveParticipantAlertController::alertControllerWithParticipant:highlight: not bound -!missing-selector! SWAttributionView::backgroundStyle not bound -!missing-selector! SWAttributionView::displayContext not bound -!missing-selector! SWAttributionView::highlight not bound -!missing-selector! SWAttributionView::highlightMenu not bound -!missing-selector! SWAttributionView::horizontalAlignment not bound -!missing-selector! SWAttributionView::menuTitleForHideAction not bound -!missing-selector! SWAttributionView::preferredMaxLayoutWidth not bound -!missing-selector! SWAttributionView::setBackgroundStyle: not bound -!missing-selector! SWAttributionView::setDisplayContext: not bound -!missing-selector! SWAttributionView::setHighlight: not bound -!missing-selector! SWAttributionView::setHorizontalAlignment: not bound -!missing-selector! SWAttributionView::setMenuTitleForHideAction: not bound -!missing-selector! SWAttributionView::setPreferredMaxLayoutWidth: not bound -!missing-selector! SWAttributionView::setSupplementalMenu: not bound -!missing-selector! SWAttributionView::supplementalMenu not bound -!missing-selector! SWHighlight::identifier not bound -!missing-selector! SWHighlight::URL not bound -!missing-selector! SWHighlightCenter::delegate not bound -!missing-selector! SWHighlightCenter::highlights not bound -!missing-selector! SWHighlightCenter::setDelegate: not bound -!missing-type! SWAttributionView not bound -!missing-type! SWHighlight not bound -!missing-type! SWHighlightCenter not bound -!missing-type! SWRemoveParticipantAlertController not bound -!missing-enum! SWHighlightChangeEventTrigger not bound -!missing-enum! SWHighlightMembershipEventTrigger not bound -!missing-enum! SWHighlightPersistenceEventTrigger not bound -!missing-field! SWCollaborationMetadataTypeIdentifier not bound -!missing-protocol! SWCollaborationViewDelegate not bound -!missing-protocol! SWHighlightEvent not bound -!missing-selector! SWCollaborationHighlight::collaborationIdentifier not bound -!missing-selector! SWCollaborationHighlight::contentType not bound -!missing-selector! SWCollaborationHighlight::creationDate not bound -!missing-selector! SWCollaborationHighlight::title not bound -!missing-selector! SWCollaborationView::activeParticipantCount not bound -!missing-selector! SWCollaborationView::cloudSharingDelegate not bound -!missing-selector! SWCollaborationView::delegate not bound -!missing-selector! SWCollaborationView::dismissPopover: not bound -!missing-selector! SWCollaborationView::headerImage not bound -!missing-selector! SWCollaborationView::headerSubtitle not bound -!missing-selector! SWCollaborationView::headerTitle not bound -!missing-selector! SWCollaborationView::initWithItemProvider: not bound -!missing-selector! SWCollaborationView::manageButtonTitle not bound -!missing-selector! SWCollaborationView::setActiveParticipantCount: not bound -!missing-selector! SWCollaborationView::setCloudSharingDelegate: not bound -!missing-selector! SWCollaborationView::setContentView: not bound -!missing-selector! SWCollaborationView::setDelegate: not bound -!missing-selector! SWCollaborationView::setHeaderImage: not bound -!missing-selector! SWCollaborationView::setHeaderSubtitle: not bound -!missing-selector! SWCollaborationView::setHeaderTitle: not bound -!missing-selector! SWCollaborationView::setManageButtonTitle: not bound -!missing-selector! SWCollaborationView::setShowManageButton: not bound -!missing-selector! SWHighlightCenter::collaborationHighlightForIdentifier:error: not bound -!missing-selector! SWHighlightCenter::getSignedIdentityProofForCollaborationHighlight:usingData:completionHandler: not bound -!missing-selector! SWHighlightCenter::postNoticeForHighlightEvent: not bound -!missing-selector! SWHighlightChangeEvent::changeEventTrigger not bound -!missing-selector! SWHighlightChangeEvent::highlightURL not bound -!missing-selector! SWHighlightChangeEvent::initWithHighlight:trigger: not bound -!missing-selector! SWHighlightMembershipEvent::initWithHighlight:trigger: not bound -!missing-selector! SWHighlightMembershipEvent::membershipEventTrigger not bound -!missing-selector! SWHighlightMentionEvent::initWithHighlight:mentionedPersonCloudKitShareHandle: not bound -!missing-selector! SWHighlightMentionEvent::initWithHighlight:mentionedPersonIdentity: not bound -!missing-selector! SWHighlightMentionEvent::mentionedPersonHandle not bound -!missing-selector! SWHighlightPersistenceEvent::initWithHighlight:trigger: not bound -!missing-selector! SWHighlightPersistenceEvent::persistenceEventTrigger not bound -!missing-type! SWCollaborationHighlight not bound -!missing-type! SWCollaborationView not bound -!missing-type! SWHighlightChangeEvent not bound -!missing-type! SWHighlightMembershipEvent not bound -!missing-type! SWHighlightMentionEvent not bound -!missing-type! SWHighlightPersistenceEvent not bound -!missing-selector! SWCollaborationView::cloudSharingControllerDelegate not bound -!missing-selector! SWCollaborationView::setCloudSharingControllerDelegate: not bound -!missing-selector! +SWHighlightCenter::isSystemCollaborationSupportAvailable not bound -!missing-selector! SWHighlightCenter::getCollaborationHighlightForURL:completionHandler: not bound -!missing-selector! SWHighlightCenter::getHighlightForURL:completionHandler: not bound diff --git a/tools/common/Frameworks.cs b/tools/common/Frameworks.cs index be92a0ed6547..cc252b19afcd 100644 --- a/tools/common/Frameworks.cs +++ b/tools/common/Frameworks.cs @@ -452,6 +452,7 @@ public static Frameworks CreateiOSFrameworks (bool is_simulator_build) { "BackgroundAssets", "BackgroundAssets", 16,0}, { "PushToTalk", "PushToTalk", new Version (16,0), NotAvailableInSimulator}, + { "SharedWithYou", "SharedWithYouCore", 16, 0 }, { "SharedWithYouCore", "SharedWithYouCore", 16, 0 }, // the above MUST be kept in sync with simlauncher diff --git a/tools/mtouch/Makefile b/tools/mtouch/Makefile index 6cc879d19224..573ebfc00031 100644 --- a/tools/mtouch/Makefile +++ b/tools/mtouch/Makefile @@ -174,6 +174,7 @@ SIMLAUNCHER_FRAMEWORKS = \ -weak_framework OSLog \ \ -weak_framework BackgroundAssets \ + -weak_framework SharedWithYou \ -weak_framework SharedWithYouCore \ SIMLAUNCHER64_FRAMEWORKS = \ From 0cc77e216c44950a268de3efb7646c91072b0204 Mon Sep 17 00:00:00 2001 From: Alex Soto Date: Tue, 30 Aug 2022 20:49:08 -0400 Subject: [PATCH 2/5] Apply suggestions from code review --- src/sharedwithyou.cs | 6 +++--- tests/introspection/iOS/iOSApiCtorInitTest.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sharedwithyou.cs b/src/sharedwithyou.cs index 604a5416498f..570270dc251c 100644 --- a/src/sharedwithyou.cs +++ b/src/sharedwithyou.cs @@ -227,9 +227,9 @@ interface ISWCollaborationViewDelegate {} interface SWCollaborationViewDelegate { - [DesignatedInitializer] - [Export ("initWithFrame:")] - NativeHandle Constructor (CGRect frame); + // [DesignatedInitializer] + // [Export ("initWithFrame:")] + // NativeHandle Constructor (CGRect frame); [Export ("collaborationViewShouldPresentPopover:")] bool ShouldPresentPopover (SWCollaborationView collaborationView); diff --git a/tests/introspection/iOS/iOSApiCtorInitTest.cs b/tests/introspection/iOS/iOSApiCtorInitTest.cs index 285250eb92dd..6b2dba0f4f5e 100644 --- a/tests/introspection/iOS/iOSApiCtorInitTest.cs +++ b/tests/introspection/iOS/iOSApiCtorInitTest.cs @@ -257,7 +257,7 @@ protected override bool Skip (Type type) protected override bool SkipCheckShouldReExposeBaseCtor (Type type) { - switch(type.Name) { + switch (type.Name) { case "SWRemoveParticipantAlertController": return true; default: From 50954b460daee054def6c110f3f33f8853d0e918 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Wed, 31 Aug 2022 10:26:06 -0400 Subject: [PATCH 3/5] Update src/sharedwithyou.cs Co-authored-by: Rolf Bjarne Kvinge --- src/sharedwithyou.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sharedwithyou.cs b/src/sharedwithyou.cs index 570270dc251c..7fcb492bfded 100644 --- a/src/sharedwithyou.cs +++ b/src/sharedwithyou.cs @@ -19,7 +19,7 @@ #if MONOMAC using AppKit; -using UIViewController=System.Object; +using UIViewController=AppKit.NSViewController; using UIView=AppKit.NSView; using UIMenu=AppKit.NSMenu; using UIImage=AppKit.NSImage; From 0043adb55a259ac4409c5d44d2ada8131f91d257 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Wed, 31 Aug 2022 16:29:35 -0400 Subject: [PATCH 4/5] Remove not needed base type. --- src/sharedwithyou.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sharedwithyou.cs b/src/sharedwithyou.cs index 7fcb492bfded..56c3a3fd44fd 100644 --- a/src/sharedwithyou.cs +++ b/src/sharedwithyou.cs @@ -332,7 +332,6 @@ interface ISWHighlightEvent {} [NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] [Protocol] - [BaseType (typeof (NSObject))] interface SWHighlightEvent : NSSecureCoding, NSCopying { [Abstract] From 3215848e0f364f1bcf481f4d3c5441d7ccaf9cd2 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Thu, 1 Sep 2022 17:14:12 -0400 Subject: [PATCH 5/5] Apply suggestions from code review Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com> --- src/sharedwithyou.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sharedwithyou.cs b/src/sharedwithyou.cs index 56c3a3fd44fd..f3e064caf84c 100644 --- a/src/sharedwithyou.cs +++ b/src/sharedwithyou.cs @@ -159,7 +159,7 @@ interface SWHighlightCenterDelegate { [Abstract] [Export ("highlightCenterHighlightsDidChange:")] - void HighlightCenterHighlightsDidChange (SWHighlightCenter highlightCenter); + void HighlightsDidChange (SWHighlightCenter highlightCenter); } [NoWatch, TV (16,0), NoMac, iOS (16,0), MacCatalyst (16,0)] @@ -197,7 +197,7 @@ interface SWHighlightCenter void GetCollaborationHighlight (NSUrl url, Action completionHandler); [Export ("postNoticeForHighlightEvent:")] - void PostNoticeForHighlightEvent (ISWHighlightEvent @event); + void PostNotice (ISWHighlightEvent @event); [Async] [Export ("getSignedIdentityProofForCollaborationHighlight:usingData:completionHandler:")]