Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
static IntPtr th = Dlfcn.dlopen (Constants.ThreadNetworkLibrary, 1);

#if !NET
Expand Down
6 changes: 4 additions & 2 deletions src/SharedWithYouCore/SWCollaborationMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
//
// Copyright 2022 Microsoft Corporation.
//

#nullable enable

using System;
using Foundation;
using ObjCRuntime;

#if !TVOS && !WATCH

namespace SharedWithYouCore {

#if NET
Expand All @@ -29,7 +30,7 @@ public enum SWIdentifierType {
Collaboration,
}

public partial class SWCollaborationMetadata {
public partial class SWCollaborationMetadata : NSObject {
public SWCollaborationMetadata (string localIdentifier) : base (NSObjectFlag.Empty) =>
InitializeHandle (_InitWithLocalIdentifier (localIdentifier), "initWithLocalIdentifier:");

Expand Down Expand Up @@ -57,3 +58,4 @@ public SWCollaborationMetadata (string identifier, SWIdentifierType identifierTy
}
}
}
#endif
12 changes: 12 additions & 0 deletions src/appkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
using CoreAnimation;
using CoreData;
using Intents;
using SharedWithYouCore;
#if !__MACCATALYST__
using OpenGL;
#endif
Expand Down Expand Up @@ -11624,6 +11625,10 @@ partial interface NSPasteboard // NSPasteboard does _not_ implement NSPasteboard
[Field ("NSPasteboardTypeFileURL")]
NSString NSPasteboardTypeFileUrl { get; }

[Mac (13,0)]
[Field ("NSPasteboardTypeCollaborationMetadata")]
NSString NSPasteboardTypeCollaborationMetadata { get; }

[Mac (10,12)]
[Export ("prepareForNewContentsWithOptions:")]
nint PrepareForNewContents (NSPasteboardContentsOptions options);
Expand Down Expand Up @@ -11683,6 +11688,13 @@ interface NSPasteboardItem : NSPasteboardWriting, NSPasteboardReading {

[Export ("propertyListForType:")]
NSObject GetPropertyListForType (string type);

// @interface SWCollaborationMetadata (NSPasteboardItem)

[Mac (13,0)]
[NullAllowed, Export ("collaborationMetadata", ArgumentSemantic.Copy)]
SWCollaborationMetadata CollaborationMetadata { get; set; }

}

[NoMacCatalyst]
Expand Down
3 changes: 3 additions & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -2100,6 +2100,7 @@ MACOS_FRAMEWORKS = \
ScriptingBridge \
SearchKit \
Security \
SharedWithYou \
SharedWithYouCore \
Social \
Speech \
Expand Down Expand Up @@ -2302,6 +2303,8 @@ TVOS_FRAMEWORKS = \
PhotosUI \
ReplayKit \
Security \
SharedWithYou \
SharedWithYouCore \
SystemConfiguration \
TVMLKit \
TVUIKit \
Expand Down
63 changes: 40 additions & 23 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 All @@ -330,7 +348,7 @@ interface SWCollaborationHighlight : NSSecureCoding, NSCopying

interface ISWHighlightEvent {}

[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)]
[NoWatch, NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)]
[Protocol]
interface SWHighlightEvent : NSSecureCoding, NSCopying
{
Expand All @@ -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
2 changes: 1 addition & 1 deletion src/sharedwithyoucore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ interface SWCollaborationShareOptions : NSCopying, NSSecureCoding {
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface SWCollaborationMetadata : NSSecureCoding, NSCopying, NSMutableCopying
#if IOS
#if IOS || MONOMAC
, NSItemProviderReading
, NSItemProviderWriting
#endif
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

This file was deleted.

1 change: 0 additions & 1 deletion tests/xtro-sharpie/iOS-SharedWithYou.todo

This file was deleted.

3 changes: 3 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 },
{ "ThreadNetwork", "ThreadNetwork", 13,0 },
Expand Down Expand Up @@ -629,6 +630,8 @@ public static Frameworks TVOSFrameworks {
#endif
{ "OSLog", "OSLog", 15,0 },
{ "ShazamKit", "ShazamKit", new Version (15, 0), NotAvailableInSimulator},
{ "SharedWithYou", "SharedWithYou", 16,0 },
{ "SharedWithYouCore", "SharedWithYouCore", 16,0 },
};
}
return tvos_frameworks;
Expand Down