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
16 changes: 15 additions & 1 deletion src/Photos/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ public enum PHAssetCollectionSubtype : long {
SmartAlbumUnableToUpload = 216,
[iOS (15,0), TV (15,0), Mac (12,0), MacCatalyst (15,0)]
SmartAlbumRAW = 217,

[iOS (15,0), TV (15,0), Mac (12,0), MacCatalyst (15,0)]
SmartAlbumCinematic = 218,

Any = Int64.MaxValue
}
Expand Down Expand Up @@ -232,6 +233,7 @@ public enum PHAssetMediaSubtype : ulong {
VideoStreamed = (1 << 16),
VideoHighFrameRate = (1 << 17),
VideoTimelapse = (1 << 18),
VideoCinematic = (1 << 21),
}

// NSUInteger -> PhotosTypes.h
Expand Down Expand Up @@ -393,6 +395,7 @@ public enum PHPhotosError : long {
RelinquishingLibraryBundleToWriter = 3142,
SwitchingSystemPhotoLibrary = 3143,
NetworkAccessRequired = 3164,
NetworkError = 3169,
IdentifierNotFound = 3201,
MultipleIdentifiersFound = 3202,
ChangeNotSupported = 3300,
Expand All @@ -404,6 +407,8 @@ public enum PHPhotosError : long {
AccessRestricted = 3310,
AccessUserDenied = 3311,
LibraryInFileProviderSyncRoot = 5423,
PersistentChangeTokenExpired = 3105,
PersistentChangeDetailsUnavailable = 3210,
}

[TV (14,0), Mac (11,0), iOS (14,0)]
Expand All @@ -413,4 +418,13 @@ public enum PHAccessLevel : long
AddOnly = 1,
ReadWrite = 2,
}

[TV (16,0), Mac (13,0), iOS (16,0)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are missing the MacCatalyst.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MacCatalyst?

[Native]
public enum PHObjectType : long
{
Asset = 1,
AssetCollection = 2,
CollectionList = 3,
}
}
3 changes: 2 additions & 1 deletion src/PhotosUI/PHEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ public enum PHProjectCategory {
Undefined,
}

[NoWatch, NoTV, NoMac]
[NoWatch, NoTV]
[iOS (14,0)]
[Mac (13,0)]
[Native]
public enum PHPickerConfigurationAssetRepresentationMode : long
{
Expand Down
75 changes: 75 additions & 0 deletions src/photos.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ interface PHAsset {
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[NullAllowed, Export ("adjustmentFormatIdentifier")]
string AdjustmentFormatIdentifier { get; }

[TV (15, 0), Mac (12, 0), iOS (15, 0)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are missing MacCatalyst.

[Export ("hasAdjustments")]
bool HasAdjustments { get; }
}

[iOS (8,0)]
Expand Down Expand Up @@ -269,6 +273,14 @@ interface PHAssetResource
[Static]
[Export ("assetResourcesForLivePhoto:")]
PHAssetResource[] GetAssetResources (PHLivePhoto livePhoto);

[TV (16, 0), Mac (13, 0), iOS (16, 0)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

[Export ("pixelWidth")]
nint PixelWidth { get; }

[TV (16, 0), Mac (13, 0), iOS (16, 0)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

[Export ("pixelHeight")]
nint PixelHeight { get; }
}

[iOS (9,0)]
Expand Down Expand Up @@ -584,6 +596,9 @@ interface PHAssetCollection {
[Export ("fetchAssetCollectionsContainingAsset:withType:options:")]
PHFetchResult FetchAssetCollections (PHAsset asset, PHAssetCollectionType type, [NullAllowed] PHFetchOptions options);

[Deprecated (PlatformName.iOS, 16, 0, message: "Will be removed in a future release.")]
[Deprecated (PlatformName.TvOS, 16, 0, message: "Will be removed in a future release.")]
[Deprecated (PlatformName.MacOSX, 13, 0, message: "Will be removed in a future release.")]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, Catalyst.

[Static]
[Export ("fetchAssetCollectionsWithALAssetGroupURLs:options:")]
PHFetchResult FetchAssetCollections (NSUrl[] assetGroupUrls, [NullAllowed] PHFetchOptions options);
Expand Down Expand Up @@ -1175,6 +1190,15 @@ interface PHPhotoLibrary {
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Field ("PHLocalIdentifiersErrorKey")]
NSString LocalIdentifiersErrorKey { get; }

[TV (16,0), Mac (13,0), iOS (16,0)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

[Export ("fetchPersistentChangesSinceToken:error:")]
[return: NullAllowed]
PHPersistentChangeFetchResult FetchPersistentChanges (PHPersistentChangeToken since, [NullAllowed] out NSError error);

[TV (16, 0), Mac (13, 0), iOS (16, 0)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

[Export ("currentChangeToken")]
PHPersistentChangeToken CurrentChangeToken { get; }
}

[Mac (10,13)]
Expand Down Expand Up @@ -1471,4 +1495,55 @@ interface PHLocalIdentifierMapping
[NullAllowed, Export ("error")]
NSError Error { get; }
}

[TV (16,0), Mac (13,0), iOS (16,0)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface PHPersistentChange
{
[Export ("changeToken")]
PHPersistentChangeToken ChangeToken { get; }

[Export ("changeDetailsForObjectType:error:")]
[return: NullAllowed]
PHPersistentObjectChangeDetails GetChangeDetails (PHObjectType objectType, [NullAllowed] out NSError error);
}

delegate void PHPersistentChangeFetchResultEnumerator (PHPersistentChange change, ref bool stop);


[TV (16,0), Mac (13,0), iOS (16,0)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

[BaseType (typeof(NSObject))]
[DisableDefaultCtor]
interface PHPersistentChangeFetchResult
{
[Export ("enumerateChangesWithBlock:")]
void EnumerateChanges (PHPersistentChangeFetchResultEnumerator block);
}

[TV (16,0), Mac (13,0), iOS (16,0)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

[BaseType (typeof(NSObject))]
[DisableDefaultCtor]
interface PHPersistentChangeToken : NSCopying, NSSecureCoding
{
}

[TV (16,0), Mac (13,0), iOS (16,0)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

[BaseType (typeof(NSObject))]
[DisableDefaultCtor]
interface PHPersistentObjectChangeDetails
{
[Export ("objectType")]
PHObjectType ObjectType { get; }

[Export ("insertedLocalIdentifiers", ArgumentSemantic.Strong)]
NSSet<NSString> InsertedLocalIdentifiers { get; }

[Export ("updatedLocalIdentifiers", ArgumentSemantic.Strong)]
NSSet<NSString> UpdatedLocalIdentifiers { get; }

[Export ("deletedLocalIdentifiers", ArgumentSemantic.Strong)]
NSSet<NSString> DeletedLocalIdentifiers { get; }
}

}
87 changes: 78 additions & 9 deletions src/photosui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
using Foundation;
#if !MONOMAC
using UIKit;
// ease compilation for [NoiOS] and [NoTV] decorated members
using NSView = Foundation.NSObject;
using PHLivePhotoViewContentMode = Foundation.NSObject;
#else
using AppKit;
using UITouch = Foundation.NSObject;
using UIImage = AppKit.NSImage;
using UIColor = AppKit.NSColor;
// ease compilation for [NoMac] decorated members
using UIGestureRecognizer = Foundation.NSObject;
using PHLivePhotoBadgeOptions = Foundation.NSObject;
using UIViewController = Foundation.NSObject;
using UIViewController = AppKit.NSViewController;
#endif
using MapKit;
using Photos;
Expand Down Expand Up @@ -138,6 +137,10 @@ interface PHLivePhotoViewDelegate {

[Export ("livePhotoView:didEndPlaybackWithStyle:")]
void DidEndPlayback (PHLivePhotoView livePhotoView, PHLivePhotoViewPlaybackStyle playbackStyle);

[TV (10,0), iOS (9,1), NoMac]
[Export ("livePhotoView:extraMinimumTouchDurationForTouch:withStyle:")]
double GetExtraMinimumTouchDuration (PHLivePhotoView livePhotoView, UITouch touch, PHLivePhotoViewPlaybackStyle playbackStyle);
}

[Mac (10,13)][NoiOS][NoTV][NoWatch]
Expand Down Expand Up @@ -482,15 +485,18 @@ interface PHProjectTypeDescriptionInvalidator
[NoMac][NoTV]
[DisableDefaultCtor]
[NoMacCatalyst]
#if !NET // Can't apply Deprecated and Obsoleted to same element
[Deprecated (PlatformName.iOS, 13, 0)]
#endif
[Obsoleted (PlatformName.iOS, 14, 0)] // Removed from headers completely
[BaseType (typeof (NSExtensionContext))]
interface PHEditingExtensionContext
{
}

interface IPHPickerViewControllerDelegate {}

[NoWatch, NoTV, NoMac, iOS (14,0)]
[NoWatch, NoTV, Mac (13,0), iOS (14,0)]
[MacCatalyst (14,0)]
#if NET
[Protocol, Model]
Expand All @@ -505,7 +511,7 @@ interface PHPickerViewControllerDelegate
void DidFinishPicking (PHPickerViewController picker, PHPickerResult[] results);
}

[NoWatch, NoTV, NoMac, iOS (14,0)]
[NoWatch, NoTV, Mac (13,0), iOS (14,0)]
[MacCatalyst (14,0)]
[BaseType (typeof (UIViewController))]
[Advice ("This type should not be subclassed.")]
Expand All @@ -524,9 +530,17 @@ interface PHPickerViewController
[Export ("initWithConfiguration:")]
[DesignatedInitializer]
NativeHandle Constructor (PHPickerConfiguration configuration);

[NoWatch, NoTV, Mac (13,0), iOS (16,0)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Catalyst?

[Export ("deselectAssetsWithIdentifiers:")]
void DeselectAssets (string[] identifiers);

[NoWatch, NoTV, Mac (13,0), iOS (16,0)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Catalyst.

[Export ("moveAssetWithIdentifier:afterAssetWithIdentifier:")]
void MoveAsset (string identifier, [NullAllowed] string afterIdentifier);
}

[NoWatch, NoTV, NoMac, iOS (14,0)]
[NoWatch, NoTV, Mac (13,0), iOS (14,0)]
[MacCatalyst (14,0)]
[BaseType (typeof (NSObject))]
[Advice ("This type should not be subclassed.")]
Expand All @@ -553,7 +567,7 @@ interface PHPickerConfiguration : NSCopying
string[] PreselectedAssetIdentifiers { get; set; }
}

[NoWatch, NoTV, NoMac, iOS (14,0)]
[NoWatch, NoTV, Mac (13,0), iOS (14,0)]
[MacCatalyst (14,0)]
[BaseType (typeof (NSObject))]
[Advice ("This type should not be subclassed.")]
Expand All @@ -575,9 +589,64 @@ interface PHPickerFilter : NSCopying
[Static]
[Export ("anyFilterMatchingSubfilters:")]
PHPickerFilter GetAnyFilterMatchingSubfilters (PHPickerFilter[] subfilters);

[NoWatch, NoTV, Mac (13, 0), iOS (16, 0)]
[Static]
[Export ("depthEffectPhotosFilter")]
PHPickerFilter DepthEffectPhotosFilter { get; }

[NoWatch, NoTV, Mac (13, 0), iOS (16, 0)]
[Static]
[Export ("burstsFilter")]
PHPickerFilter BurstsFilter { get; }

[NoWatch, NoTV, Mac (13, 0), iOS (15, 0)]
[Static]
[Export ("panoramasFilter")]
PHPickerFilter PanoramasFilter { get; }

[NoWatch, NoTV, Mac (13, 0), iOS (15, 0)]
[Static]
[Export ("screenshotsFilter")]
PHPickerFilter ScreenshotsFilter { get; }

[NoWatch, NoTV, Mac (13, 0), iOS (15, 0)]
[Static]
[Export ("screenRecordingsFilter")]
PHPickerFilter ScreenRecordingsFilter { get; }

[NoWatch, NoTV, Mac (13, 0), iOS (16, 0)]
[Static]
[Export ("cinematicVideosFilter")]
PHPickerFilter CinematicVideosFilter { get; }

[NoWatch, NoTV, Mac (13, 0), iOS (15, 0)]
[Static]
[Export ("slomoVideosFilter")]
PHPickerFilter SlomoVideosFilter { get; }

[NoWatch, NoTV, Mac (13, 0), iOS (15, 0)]
[Static]
[Export ("timelapseVideosFilter")]
PHPickerFilter TimelapseVideosFilter { get; }

[NoWatch, NoTV, Mac (13,0), iOS (15,0)]
[Static]
[Export ("playbackStyleFilter:")]
Comment on lines +592 to +635

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Catalyst is missing.

PHPickerFilter GetPlaybackStyleFilter (PHAssetPlaybackStyle playbackStyle);

[NoWatch, NoTV, Mac (13,0), iOS (15,0)]
[Static]
[Export ("allFilterMatchingSubfilters:")]
PHPickerFilter GetAllFilterMatchingSubfilters (PHPickerFilter[] subfilters);

[NoWatch, NoTV, Mac (13,0), iOS (15,0)]
[Static]
[Export ("notFilterOfSubfilter:")]
PHPickerFilter GetNotFilterOfSubfilter (PHPickerFilter subfilter);
Comment on lines +638 to +646

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

}

[NoWatch, NoTV, NoMac, iOS (14,0)]
[NoWatch, NoTV, Mac (13,0), iOS (14,0)]
[MacCatalyst (14,0)]
[BaseType (typeof (NSObject))]
[Advice ("This type should not be subclassed.")]
Expand Down Expand Up @@ -605,7 +674,7 @@ interface PHPhotoLibrary_PhotosUISupport
void PresentLimitedLibraryPicker (UIViewController controller, Action<string[]> completionHandler);
}

[NoWatch, NoTV, NoMac, iOS (15,0), MacCatalyst (15,0)]
[NoWatch, NoTV, Mac (13,0), iOS (15,0), MacCatalyst (15,0)]
[Native]
public enum PHPickerConfigurationSelection : long
{
Expand Down
22 changes: 0 additions & 22 deletions tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-Photos.todo

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Removed in Xcode 14 from header
!unknown-type! PHEditingExtensionContext bound

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit missing newline

22 changes: 0 additions & 22 deletions tests/xtro-sharpie/api-annotations-dotnet/iOS-Photos.todo

This file was deleted.

Loading