Skip to content

Commit

Permalink
Merge branch 'main' into xcode13.0-accessibility-b1
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelkang committed Jun 22, 2021
2 parents 2295f2e + 6898920 commit ebc3918
Show file tree
Hide file tree
Showing 18 changed files with 71 additions and 59 deletions.
16 changes: 8 additions & 8 deletions dotnet/targets/Microsoft.Sdk.DefaultItems.template.props
Expand Up @@ -18,21 +18,21 @@
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Default plist file inclusion -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == '@PLATFORM@' And '$(_EnableDefaultXamarinItems)' == 'true'">
<ItemGroup Condition="'$(EnableDefault@PLATFORM@Items)' == 'true'">
<None Include="*.plist">
<Link>$([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(Identity)'))</Link>
</None>
</ItemGroup>

<!-- Default SceneKit assets inclusion -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == '@PLATFORM@' And '$(_EnableDefaultXamarinItems)' == 'true'">
<ItemGroup Condition="'$(EnableDefault@PLATFORM@Items)' == 'true'">
<SceneKitAsset Include="**\*.scnassets\*" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" >
<IsDefaultItem>true</IsDefaultItem>
</SceneKitAsset>
</ItemGroup>

<!-- Default Asset Catalog file inclusion -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == '@PLATFORM@' And '$(_EnableDefaultXamarinItems)' == 'true' ">
<ItemGroup Condition="'$(EnableDefault@PLATFORM@Items)' == 'true'">
<ImageAsset Include="**\*.xcassets\**\*.png;**\*.xcassets\*\*.jpg;**\*.xcassets\**\*.pdf;**\*.xcassets\**\*.json" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)">
<Link>$([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(Identity)'))</Link>
<Visible>false</Visible>
Expand All @@ -41,39 +41,39 @@
</ItemGroup>

<!-- Default Storyboard file inclusion -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == '@PLATFORM@' And '$(_EnableDefaultXamarinItems)' == 'true'">
<ItemGroup Condition="'$(EnableDefault@PLATFORM@Items)' == 'true'">
<InterfaceDefinition Include="**\*.storyboard;**\*.xib" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" >
<Link>$([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(Identity)'))</Link>
<IsDefaultItem>true</IsDefaultItem>
</InterfaceDefinition>
</ItemGroup>

<!-- Default Atlas Texture file inclusion -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == '@PLATFORM@' And '$(_EnableDefaultXamarinItems)' == 'true'">
<ItemGroup Condition="'$(EnableDefault@PLATFORM@Items)' == 'true'">
<AtlasTexture Include="**\*.atlas\*.png" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" >
<Link>$([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(Identity)'))</Link>
<IsDefaultItem>true</IsDefaultItem>
</AtlasTexture>
</ItemGroup>

<!-- Default CoreMLModel inclusion -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == '@PLATFORM@' And '$(_EnableDefaultXamarinItems)' == 'true' ">
<ItemGroup Condition="'$(EnableDefault@PLATFORM@Items)' == 'true'">
<CoreMLModel Include="**\*.mlmodel" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" >
<Link>$([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(Identity)'))</Link>
<IsDefaultItem>true</IsDefaultItem>
</CoreMLModel>
</ItemGroup>

<!-- Default Metal inclusion -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == '@PLATFORM@' And '$(_EnableDefaultXamarinItems)' == 'true' ">
<ItemGroup Condition="'$(EnableDefault@PLATFORM@Items)' == 'true'">
<Metal Include="**\*.metal" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" >
<Link>$([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(Identity)'))</Link>
<IsDefaultItem>true</IsDefaultItem>
</Metal>
</ItemGroup>

<!-- Default SceneKit assets inclusion -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == '@PLATFORM@' And '$(_EnableDefaultXamarinItems)' == 'true' ">
<ItemGroup Condition="'$(EnableDefault@PLATFORM@Items)' == 'true'">
<SceneKitAsset Include="**\*.scnassets\*" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" >
<IsDefaultItem>true</IsDefaultItem>
</SceneKitAsset>
Expand Down
5 changes: 0 additions & 5 deletions dotnet/targets/Xamarin.Shared.Sdk.DefaultItems.targets
Expand Up @@ -10,11 +10,6 @@
<EnableDefaultwatchOSItems Condition=" '$(_PlatformName)' == 'watchOS' And '$(EnableDefaultwatchOSItems)' == '' ">$(EnableDefaultItems)</EnableDefaultwatchOSItems>
<EnableDefaultmacOSItems Condition=" '$(_PlatformName)' == 'macOS' And '$(EnableDefaultmacOSItems)' == '' ">$(EnableDefaultItems)</EnableDefaultmacOSItems>
<EnableDefaultMacCatalystItems Condition=" '$(_PlatformName)' == 'MacCatalyst' And '$(EnableDefaultMacCatalystItems)' == '' ">$(EnableDefaultItems)</EnableDefaultMacCatalystItems>
<_EnableDefaultXamarinItems Condition=" '$(_PlatformName)' == 'iOS' ">$(EnableDefaultiOSItems)</_EnableDefaultXamarinItems>
<_EnableDefaultXamarinItems Condition=" '$(_PlatformName)' == 'tvOS' ">$(EnableDefaulttvOSItems)</_EnableDefaultXamarinItems>
<_EnableDefaultXamarinItems Condition=" '$(_PlatformName)' == 'watchOS' ">$(EnableDefaultwatchOSItems)</_EnableDefaultXamarinItems>
<_EnableDefaultXamarinItems Condition=" '$(_PlatformName)' == 'macOS' ">$(EnableDefaultmacOSItems)</_EnableDefaultXamarinItems>
<_EnableDefaultXamarinItems Condition=" '$(_PlatformName)' == 'MacCatalyst' ">$(EnableDefaultMacCatalystItems)</_EnableDefaultXamarinItems>

<!-- Don't include default Compile items for binding projects, because that would pick up ApiDefinition.cs and StructsAndEnums.cs -->
<EnableDefaultCompileItems Condition=" '$(IsBindingProject)' == 'true' ">false</EnableDefaultCompileItems>
Expand Down
33 changes: 33 additions & 0 deletions src/pdfkit.cs
Expand Up @@ -317,6 +317,20 @@ enum PdfAnnotationHighlightingMode {
Push,
}

[Native]
[iOS (15,0), Mac (12,0), MacCatalyst (15,0)]
public enum PdfAccessPermissions : ulong
{
LowQualityPrinting = (1uL << 0),
HighQualityPrinting = (1uL << 1),
DocumentChanges = (1uL << 2),
DocumentAssembly = (1uL << 3),
ContentCopying = (1uL << 4),
ContentAccessibility = (1uL << 5),
Commenting = (1uL << 6),
FormFieldEntry = (1uL << 7),
}

[Mac (10,13)]
[iOS (11,0)]
[Static]
Expand Down Expand Up @@ -411,6 +425,10 @@ interface PdfDocumentWriteOptionKeys {

[Field ("PDFDocumentUserPasswordOption", "+PDFKit")]
NSString UserPasswordKey { get; }

[iOS (15,0), Mac (12,0), MacCatalyst (15,0)]
[Field ("PDFDocumentAccessPermissionsOption", "+PDFKit")]
NSString AccessPermissionsKey { get; }
}

[Mac (10,13)]
Expand All @@ -420,6 +438,9 @@ interface PdfDocumentWriteOptions {

string OwnerPassword { get; set; }
string UserPassword { get; set; }

[iOS (15,0), Mac (12,0), MacCatalyst (15,0)]
string AccessPermissions { get; set; }
}

[Mac (10,13)]
Expand Down Expand Up @@ -1157,6 +1178,14 @@ interface PdfDocument : NSCopying {
[Notification]
NSString DidEndPageWriteNotification { get; }

[iOS (15,0), Mac (12,0), MacCatalyst (15,0)]
[Field ("PDFDocumentFoundSelectionKey")]
NSString FoundSelectionKey { get; }

[iOS (15,0), Mac (12,0), MacCatalyst (15,0)]
[Field ("PDFDocumentPageIndexKey")]
NSString PageIndexKey { get; }

// - (instancetype)init NS_DESIGNATED_INITIALIZER;
[Export ("init")]
[DesignatedInitializer]
Expand All @@ -1183,6 +1212,10 @@ interface PdfDocument : NSCopying {
[NullAllowed]
NSDictionary DocumentAttributes { get; set; }

[iOS (15,0), Mac (12,0), MacCatalyst (15,0)]
[Export ("accessPermissions")]
PdfAccessPermissions AccessPermissions { get; }

[Wrap ("new PdfDocumentAttributes (DocumentAttributes)")]
PdfDocumentAttributes GetDocumentAttributes ();

Expand Down
28 changes: 26 additions & 2 deletions src/photosui.cs
Expand Up @@ -24,9 +24,8 @@ namespace PhotosUI {
[NoTV]
[iOS (8, 0)]
[Mac (10, 13)]
[MacCatalyst (14,0)]
[Protocol]
[Unavailable (PlatformName.MacCatalyst)]
[Advice ("This API is not available when using UIKit on macOS.")]
#if !XAMCORE_4_0 && !TVOS && !MONOMAC
// According to documentation you're supposed to implement this protocol in a UIViewController subclass,
// which means a model (which does not inherit from UIViewController) is not useful.
Expand Down Expand Up @@ -126,6 +125,10 @@ interface PHLivePhotoView {
[Protocol, Model]
[BaseType (typeof (NSObject))]
interface PHLivePhotoViewDelegate {
[TV (15,0), iOS (15,0), MacCatalyst (15,0), Mac (12,0)]
[Export ("livePhotoView:canBeginPlaybackWithStyle:")]
bool CanBeginPlayback (PHLivePhotoView livePhotoView, PHLivePhotoViewPlaybackStyle playbackStyle);

[Export ("livePhotoView:willBeginPlaybackWithStyle:")]
void WillBeginPlayback (PHLivePhotoView livePhotoView, PHLivePhotoViewPlaybackStyle playbackStyle);

Expand Down Expand Up @@ -525,6 +528,10 @@ interface PHPickerConfiguration : NSCopying
[Export ("preferredAssetRepresentationMode", ArgumentSemantic.Assign)]
PHPickerConfigurationAssetRepresentationMode PreferredAssetRepresentationMode { get; set; }

[iOS (15,0), MacCatalyst (15,0)]
[Export ("selection", ArgumentSemantic.Assign)]
PHPickerConfigurationSelection Selection { get; set; }

[Export ("selectionLimit")]
nint SelectionLimit { get; set; }

Expand All @@ -533,6 +540,10 @@ interface PHPickerConfiguration : NSCopying

[Export ("initWithPhotoLibrary:")]
IntPtr Constructor (PHPhotoLibrary photoLibrary);

[iOS (15,0), MacCatalyst (15,0)]
[Export ("preselectedAssetIdentifiers", ArgumentSemantic.Copy)]
string[] PreselectedAssetIdentifiers { get; set; }
}

[NoWatch, NoTV, NoMac, iOS (14,0)]
Expand Down Expand Up @@ -580,5 +591,18 @@ interface PHPhotoLibrary_PhotosUISupport
{
[Export ("presentLimitedLibraryPickerFromViewController:")]
void PresentLimitedLibraryPicker (UIViewController controller);

[Async]
[iOS (15,0), MacCatalyst (15,0)]
[Export ("presentLimitedLibraryPickerFromViewController:completionHandler:")]
void PresentLimitedLibraryPicker (UIViewController controller, Action<string[]> completionHandler);
}

[NoWatch, NoTV, NoMac, iOS (15,0), MacCatalyst (15,0)]
[Native]
public enum PHPickerConfigurationSelection : long
{
Default = 0,
Ordered = 1,
}
}
2 changes: 0 additions & 2 deletions tests/xtro-sharpie/MacCatalyst-CoreText.todo
Expand Up @@ -3,8 +3,6 @@
!missing-field! kCTFontManagerBundleIdentifier not bound
!missing-field! kCTFontRegistrationUserInfoAttribute not bound
!missing-pinvoke! CTFontCollectionCopyExclusionDescriptors is not bound
!missing-pinvoke! CTFontCollectionCopyFontAttribute is not bound
!missing-pinvoke! CTFontCollectionCopyFontAttributes is not bound
!missing-pinvoke! CTFontCollectionCopyQueryDescriptors is not bound
!missing-pinvoke! CTFontCollectionCreateMatchingFontDescriptorsForFamily is not bound
!missing-pinvoke! CTFontCollectionCreateMutableCopy is not bound
Expand Down
5 changes: 0 additions & 5 deletions tests/xtro-sharpie/MacCatalyst-PDFKit.todo

This file was deleted.

2 changes: 2 additions & 0 deletions tests/xtro-sharpie/MacCatalyst-PhotosUI.ignore
@@ -0,0 +1,2 @@
## This type is deprecated in iOS 13 and does not support MacCatalyst
!missing-type! PHEditingExtensionContext not bound
10 changes: 0 additions & 10 deletions tests/xtro-sharpie/MacCatalyst-PhotosUI.todo

This file was deleted.

2 changes: 2 additions & 0 deletions tests/xtro-sharpie/common-CoreText.ignore
Expand Up @@ -138,3 +138,5 @@
## part of an unnamed enum inside CTStringAttributes.h
!extra-enum-value! Managed value 2 for CTWritingDirection.Override not found in native headers

!missing-pinvoke! CTFontCollectionCopyFontAttribute is not bound
!missing-pinvoke! CTFontCollectionCopyFontAttributes is not bound
2 changes: 0 additions & 2 deletions tests/xtro-sharpie/iOS-CoreText.todo

This file was deleted.

5 changes: 0 additions & 5 deletions tests/xtro-sharpie/iOS-PDFKit.todo

This file was deleted.

7 changes: 0 additions & 7 deletions tests/xtro-sharpie/iOS-PhotosUI.todo

This file was deleted.

2 changes: 0 additions & 2 deletions tests/xtro-sharpie/macOS-CoreText.ignore
Expand Up @@ -2,8 +2,6 @@
!missing-field! kCTFontCollectionIncludeDisabledFontsOption not bound
!missing-field! kCTFontManagerBundleIdentifier not bound
!missing-pinvoke! CTFontCollectionCopyExclusionDescriptors is not bound
!missing-pinvoke! CTFontCollectionCopyFontAttribute is not bound
!missing-pinvoke! CTFontCollectionCopyFontAttributes is not bound
!missing-pinvoke! CTFontCollectionCopyQueryDescriptors is not bound
!missing-pinvoke! CTFontCollectionCreateMatchingFontDescriptorsForFamily is not bound
!missing-pinvoke! CTFontCollectionCreateMutableCopy is not bound
Expand Down
5 changes: 0 additions & 5 deletions tests/xtro-sharpie/macOS-PDFKit.todo

This file was deleted.

1 change: 0 additions & 1 deletion tests/xtro-sharpie/macOS-PhotosUI.todo

This file was deleted.

2 changes: 0 additions & 2 deletions tests/xtro-sharpie/tvOS-CoreText.todo

This file was deleted.

1 change: 0 additions & 1 deletion tests/xtro-sharpie/tvOS-PhotosUI.todo

This file was deleted.

2 changes: 0 additions & 2 deletions tests/xtro-sharpie/watchOS-CoreText.todo

This file was deleted.

0 comments on commit ebc3918

Please sign in to comment.