Skip to content
2 changes: 2 additions & 0 deletions src/Foundation/NSObject.mac.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ public partial class NSObject {
static IntPtr un = Dlfcn.dlopen (Constants.UserNotificationsLibrary, 1);
static IntPtr il = Dlfcn.dlopen (Constants.iTunesLibraryLibrary, 1);
static IntPtr exl = Dlfcn.dlopen (Constants.ExtensionKitLibrary, 1);
static IntPtr sw = Dlfcn.dlopen (Constants.SharedWithYouLibrary, 1);
static IntPtr swc = Dlfcn.dlopen (Constants.SharedWithYouCoreLibrary, 1);

#if !NET
[Obsolete ("Use PlatformAssembly for easier code sharing across platforms.")]
Expand Down
2 changes: 2 additions & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -2095,6 +2095,7 @@ MACOS_FRAMEWORKS = \
ScriptingBridge \
SearchKit \
Security \
SharedWithYou \
SharedWithYouCore \
Social \
Speech \
Expand Down Expand Up @@ -2296,6 +2297,7 @@ TVOS_FRAMEWORKS = \
PhotosUI \
ReplayKit \
Security \
SharedWithYou \
SystemConfiguration \
TVMLKit \
TVUIKit \
Expand Down
61 changes: 39 additions & 22 deletions src/sharedwithyou.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
using UIMenu=AppKit.NSMenu;
using UIImage=AppKit.NSImage;
using ICloudSharingControllerDelegate=AppKit.INSCloudSharingServiceDelegate;
using UIWindow=AppKit.NSWindow;
#else
using UIKit;
using ICloudSharingControllerDelegate=UIKit.IUICloudSharingControllerDelegate;
Expand All @@ -35,22 +36,22 @@

namespace SharedWithYou {

[NoWatch, TV (16,0), NoMac, iOS (16,0), MacCatalyst (16,0)]
[NoWatch, TV (16,0), Mac (13,0), 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)]
[NoWatch, TV (16,0), Mac (13,0), 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)]
[NoWatch, TV (16,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)]
[Native]
public enum SWAttributionViewHorizontalAlignment : long {
Default = 0,
Expand All @@ -59,7 +60,7 @@ public enum SWAttributionViewHorizontalAlignment : long {
Trailing,
}

[TV (16,0), NoMac, iOS (16,0)]
[TV (16,0), Mac (13,0), iOS (16,0)]
[Native]
public enum SWHighlightCenterErrorCode : long {
NoError = 0,
Expand All @@ -68,21 +69,21 @@ public enum SWHighlightCenterErrorCode : long {
AccessDenied,
}

[NoTV, NoWatch, NoMac, iOS (16,0), MacCatalyst (16,0)]
[NoTV, NoWatch, Mac (13,0), iOS (16,0), MacCatalyst (16,0)]
[Native]
public enum SWHighlightChangeEventTrigger : long {
Edit = 1,
Comment = 2,
}

[NoTV, NoWatch, NoMac, iOS (16,0), MacCatalyst (16,0)]
[NoTV, NoWatch, Mac (13,0), iOS (16,0), MacCatalyst (16,0)]
[Native]
public enum SWHighlightMembershipEventTrigger : long {
AddedCollaborator = 1,
RemovedCollaborator = 2,
}

[NoTV, NoWatch, NoMac, iOS (16,0), MacCatalyst (16,0)]
[NoTV, NoWatch, Mac (13,0), iOS (16,0), MacCatalyst (16,0)]
[Native]
public enum SWHighlightPersistenceEventTrigger : long {
Created = 1,
Expand All @@ -91,7 +92,7 @@ public enum SWHighlightPersistenceEventTrigger : long {
Moved = 4,
}

[NoWatch, NoMac, TV (16,0), iOS (16,0), MacCatalyst (16,0)]
[NoWatch, Mac (13,0), TV (16,0), iOS (16,0), MacCatalyst (16,0)]
[BaseType (typeof (UIView))]
interface SWAttributionView
{
Expand Down Expand Up @@ -124,12 +125,12 @@ interface SWAttributionView
[NullAllowed, Export ("supplementalMenu", ArgumentSemantic.Strong)]
UIMenu SupplementalMenu { get; set; }

[NoMac, NoiOS]
[NoMac, NoiOS, NoMacCatalyst]
[Export ("enablesMarquee")]
bool EnablesMarquee { get; set; }
}

[NoWatch, TV (16,0), NoMac, iOS (16,0), MacCatalyst (16,0)]
[NoWatch, TV (16,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface SWHighlight : NSSecureCoding, NSCopying
Expand All @@ -148,7 +149,7 @@ interface SWHighlight : NSSecureCoding, NSCopying

interface ISWHighlightCenterDelegate {}

[NoWatch, TV (16,0), NoMac, iOS (16,0), MacCatalyst (16,0)]
[NoWatch, TV (16,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)]
#if NET
[Protocol, Model]
#else
Expand All @@ -162,7 +163,7 @@ interface SWHighlightCenterDelegate
void HighlightsDidChange (SWHighlightCenter highlightCenter);
}

[NoWatch, TV (16,0), NoMac, iOS (16,0), MacCatalyst (16,0)]
[NoWatch, TV (16,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)]
[BaseType (typeof (NSObject))]
interface SWHighlightCenter
{
Expand All @@ -188,22 +189,39 @@ interface SWHighlightCenter
[Export ("getHighlightForURL:completionHandler:")]
void GetHighlight (NSUrl urL, Action<SWHighlight, NSError> completionHandler);

[NoTV]
[Export ("collaborationHighlightForIdentifier:error:")]
[return: NullAllowed]
SWCollaborationHighlight GetCollaborationHighlight (string collaborationIdentifier, [NullAllowed] out NSError error);

[NoTV]
[Async]
[Export ("getCollaborationHighlightForURL:completionHandler:")]
void GetCollaborationHighlight (NSUrl url, Action<SWCollaborationHighlight, NSError> completionHandler);

[NoTV]
[Export ("postNoticeForHighlightEvent:")]
void PostNotice (ISWHighlightEvent @event);

[iOS (16,1), NoTV]
[Export ("clearNoticesForHighlight:")]
void ClearNotices (SWCollaborationHighlight highlight);

[NoTV]
[Async]
[Export ("getSignedIdentityProofForCollaborationHighlight:usingData:completionHandler:")]
void GetSignedIdentityProof (SWCollaborationHighlight collaborationHighlight, NSData data, Action<SWSignedPersonIdentityProof, NSError> completionHandler);
}

[NoWatch, Mac (13,0), NoTV, NoiOS, NoMacCatalyst]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface SWRemoveParticipantAlert
{
[Static]
[Export ("showAlertWithParticipant:highlight:inWindow:")]
void ShowAlert (SWPerson participant, SWCollaborationHighlight highlight, [NullAllowed] UIWindow window);
}

[NoWatch, NoMac, NoTV, iOS (16,0), MacCatalyst (16,0)]
[BaseType (typeof (UIViewController))]
Expand All @@ -217,7 +235,7 @@ interface SWRemoveParticipantAlertController

interface ISWCollaborationViewDelegate {}

[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)]
[NoWatch, NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)]
#if NET
[Protocol, Model]
#else
Expand All @@ -241,7 +259,7 @@ interface SWCollaborationViewDelegate
void DidDismissPopover (SWCollaborationView collaborationView);
}

[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)]
[NoWatch, NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)]
[BaseType (typeof (UIView))]
interface SWCollaborationView
{
Expand Down Expand Up @@ -291,12 +309,12 @@ interface SWCollaborationView
[NullAllowed, Export ("cloudSharingControllerDelegate", ArgumentSemantic.Weak)]
NSObject WeakCloudSharingControllerDelegate { get; set; }

[NoiOS]
[NoiOS, NoMacCatalyst]
[Wrap ("WeakCloudSharingServiceDelegate")]
[NullAllowed]
ICloudSharingControllerDelegate CloudSharingServiceDelegate { get; set; }

[NoiOS]
[NoiOS, NoMacCatalyst]
[NullAllowed, Export ("cloudSharingServiceDelegate", ArgumentSemantic.Weak)]
NSObject WeakCloudSharingServiceDelegate { get; set; }

Expand All @@ -311,7 +329,7 @@ interface SWCollaborationView
void SetShowManageButton (bool showManageButton);
}

[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)]
[NoWatch, NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)]
[BaseType (typeof (SWHighlight))]
interface SWCollaborationHighlight : NSSecureCoding, NSCopying
{
Expand Down Expand Up @@ -339,7 +357,7 @@ interface SWHighlightEvent : NSSecureCoding, NSCopying
NSUrl HighlightUrl { get; }
}

[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)]
[NoWatch, NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface SWHighlightChangeEvent : SWHighlightEvent
Expand All @@ -354,7 +372,7 @@ interface SWHighlightChangeEvent : SWHighlightEvent
NSUrl HighlightUrl { get; }
}

[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)]
[NoWatch, NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface SWHighlightMembershipEvent : SWHighlightEvent
Expand All @@ -366,8 +384,7 @@ interface SWHighlightMembershipEvent : SWHighlightEvent
NativeHandle Constructor (SWHighlight highlight, SWHighlightMembershipEventTrigger trigger);
}


[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)]
[NoWatch, NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface SWHighlightMentionEvent : SWHighlightEvent
Expand All @@ -382,7 +399,7 @@ interface SWHighlightMentionEvent : SWHighlightEvent
NativeHandle Constructor (SWHighlight highlight, SWPersonIdentity identity);
}

[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)]
[NoWatch, NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface SWHighlightPersistenceEvent : SWHighlightEvent
Expand Down
4 changes: 0 additions & 4 deletions tests/xtro-sharpie/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ XWATCHOS_PCH = watchos$(WATCH_SDK_VERSION)-$(XWATCHOS_ARCH).pch
$(XWATCHOS_PCH): .stamp-check-sharpie
$(SHARPIE) sdk-db --xcode $(XCODE) -s watchos$(WATCH_SDK_VERSION) -a $(XWATCHOS_ARCH) \
-exclude RealityKit \
-exclude SharedWithYou \

XTVOS ?= $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/64bits/tvOS/Xamarin.TVOS.dll
XTVOS_GL ?= $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.TVOS/OpenTK-1.0.dll
Expand All @@ -71,7 +70,6 @@ XTVOS_RID = tvos-arm64
$(XTVOS_PCH): .stamp-check-sharpie
$(SHARPIE) sdk-db --xcode $(XCODE) -s appletvos$(TVOS_SDK_VERSION) -a $(XTVOS_ARCH) \
-exclude RealityKit \
-exclude SharedWithYou \

XMACOS ?= $(MAC_DESTDIR)/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/64bits/mobile/Xamarin.Mac.dll
XMACOS_ARCH = x86_64
Expand All @@ -83,7 +81,6 @@ $(XMACOS_PCH): .stamp-check-sharpie
-exclude NearbyInteraction \
-exclude RealityKit \
-exclude JavaNativeFoundation \
-exclude SharedWithYou \
$(CORETELEPHONY_HEADERS) \

XMACCATALYST_ARCH = x86_64
Expand Down Expand Up @@ -111,7 +108,6 @@ $(XMACCATALYST_PCH): .stamp-check-sharpie
-exclude QuickLookUI \
-exclude RealityKit \
-exclude SecurityInterface \
-exclude SharedWithYou \
-exclude Virtualization \
-i HomeKit/HomeKit.h \
$(CORETELEPHONY_HEADERS) \
Expand Down
2 changes: 2 additions & 0 deletions tools/common/Frameworks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ public static Frameworks MacFrameworks {
{ "AVRouting", "AVRouting", 13,0},
{ "BackgroundAssets", "BackgroundAssets", 13,0},
{ "HealthKit", "HealthKit", 13,0 },
{ "SharedWithYou", "SharedWithYou", 13,0 },
{ "SharedWithYouCore", "SharedWithYouCore", 13, 0 },
{ "ExtensionKit", "ExtensionKit", 13,0 },
};
Expand Down Expand Up @@ -628,6 +629,7 @@ public static Frameworks TVOSFrameworks {
#endif
{ "OSLog", "OSLog", 15,0 },
{ "ShazamKit", "ShazamKit", new Version (15, 0), NotAvailableInSimulator},
{ "SharedWithYou", "SharedWithYou", 16,0 },
};
}
return tvos_frameworks;
Expand Down