From 3a9cf89fa7e024250b413c89eb9ae56b002e9efb Mon Sep 17 00:00:00 2001 From: Haritha Mohan Date: Fri, 18 Aug 2023 15:14:18 -0700 Subject: [PATCH 1/6] [PencilKit] Add support for Xcode 15 beta 6 --- src/pencilkit.cs | 59 +++++++++++++++++++++++++ tests/xtro-sharpie/iOS-PencilKit.todo | 15 ------- tests/xtro-sharpie/macOS-PencilKit.todo | 11 ----- 3 files changed, 59 insertions(+), 26 deletions(-) delete mode 100644 tests/xtro-sharpie/iOS-PencilKit.todo delete mode 100644 tests/xtro-sharpie/macOS-PencilKit.todo diff --git a/src/pencilkit.cs b/src/pencilkit.cs index 163f804f5373..5ef1208f9cdb 100644 --- a/src/pencilkit.cs +++ b/src/pencilkit.cs @@ -59,6 +59,22 @@ enum PKInkType { [Field ("PKInkTypeMarker")] Marker, + + [Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] + [Field("PKInkTypeMonoline")] + Monoline, + + [Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] + [Field("PKInkTypeFountainPen")] + FountainPen, + + [Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] + [Field("PKInkTypeWatercolor")] + Watercolor, + + [Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] + [Field("PKInkTypeCrayon")] + Crayon, } [iOS (14, 0), NoMac] @@ -70,6 +86,14 @@ enum PKCanvasViewDrawingPolicy : ulong { PencilOnly, } + [Native] + public enum PKContentVersion : long + { + PKContentVersion1 = 1, + PKContentVersion2 = 2, + Latest = PKContentVersion2 + } + [iOS (13, 0), NoMac] [Introduced (PlatformName.MacCatalyst, 14, 0)] [BaseType (typeof (NSObject))] @@ -130,6 +154,10 @@ interface PKCanvasView : PKToolPickerObserver { [MacCatalyst (14, 0)] [Export ("drawingPolicy", ArgumentSemantic.Assign)] PKCanvasViewDrawingPolicy DrawingPolicy { get; set; } + + [iOS(17, 0), MacCatalyst(17, 0)] + [Export("maximumSupportedContentVersion", ArgumentSemantic.Assign)] + PKContentVersion MaximumSupportedContentVersion { get; set; } } [iOS (13, 0)] @@ -174,6 +202,10 @@ interface PKDrawing : NSCopying, NSSecureCoding { [MacCatalyst (14, 0)] [Export ("drawingByAppendingStrokes:")] PKDrawing GetDrawing (PKStroke [] strokes); + + [Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] + [Export("requiredContentVersion")] + PKContentVersion RequiredContentVersion { get; } } [iOS (13, 0), Mac (11, 0)] @@ -214,6 +246,8 @@ interface PKEraserTool { nfloat GetMaximumWidth (PKEraserType eraserType); } + + [iOS (13, 0), Mac (11, 0)] [Introduced (PlatformName.MacCatalyst, 14, 0)] [BaseType (typeof (PKTool))] @@ -264,6 +298,10 @@ interface PKInkingTool { [MacCatalyst (14, 0)] [Export ("ink")] PKInk Ink { get; } + + [Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] + [Export("requiredContentVersion")] + PKContentVersion RequiredContentVersion { get; } } [iOS (13, 0), Mac (11, 0)] @@ -353,6 +391,10 @@ interface PKToolPicker { [NullAllowed] [Export ("stateAutosaveName")] string StateAutosaveName { get; set; } + + [iOS(17, 0), MacCatalyst(17, 0)] + [Export("maximumSupportedContentVersion", ArgumentSemantic.Assign)] + PKContentVersion MaximumSupportedContentVersion { get; set; } } [Mac (11, 0), iOS (14, 0)] @@ -377,6 +419,10 @@ interface PKInk : NSCopying { [Export ("color")] UIColor Color { get; } + + [Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] + [Export("requiredContentVersion")] + PKContentVersion RequiredContentVersion { get; } } [Mac (11, 0), iOS (14, 0)] @@ -427,6 +473,10 @@ interface PKStroke : NSCopying { [Mac (13, 0), iOS (16, 0), MacCatalyst (16, 0)] [Export ("randomSeed")] uint RandomSeed { get; } + + [Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] + [Export("requiredContentVersion")] + PKContentVersion RequiredContentVersion { get; } } delegate void PKInterpolatedPointsEnumeratorHandler (PKStrokePoint strokePoint, out bool stop); @@ -483,6 +533,11 @@ interface PKStrokePoint : NSCopying { [DesignatedInitializer] NativeHandle Constructor (CGPoint location, double timeOffset, CGSize size, nfloat opacity, nfloat force, nfloat azimuth, nfloat altitude); + [Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] + [Export("initWithLocation:timeOffset:size:opacity:force:azimuth:altitude:secondaryScale:")] + [DesignatedInitializer] + NativeHandle Constructor(CGPoint location, double timeOffset, CGSize size, nfloat opacity, nfloat force, nfloat azimuth, nfloat altitude, nfloat secondaryScale); + [Export ("location")] CGPoint Location { get; } @@ -503,5 +558,9 @@ interface PKStrokePoint : NSCopying { [Export ("altitude")] nfloat Altitude { get; } + + [Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] + [Export("secondaryScale")] + nfloat SecondaryScale { get; } } } diff --git a/tests/xtro-sharpie/iOS-PencilKit.todo b/tests/xtro-sharpie/iOS-PencilKit.todo deleted file mode 100644 index a0f938ff6640..000000000000 --- a/tests/xtro-sharpie/iOS-PencilKit.todo +++ /dev/null @@ -1,15 +0,0 @@ -!missing-enum! PKContentVersion not bound -!missing-field! PKInkTypeCrayon not bound -!missing-field! PKInkTypeFountainPen not bound -!missing-field! PKInkTypeMonoline not bound -!missing-field! PKInkTypeWatercolor not bound -!missing-selector! PKCanvasView::maximumSupportedContentVersion not bound -!missing-selector! PKCanvasView::setMaximumSupportedContentVersion: not bound -!missing-selector! PKDrawing::requiredContentVersion not bound -!missing-selector! PKInk::requiredContentVersion not bound -!missing-selector! PKInkingTool::requiredContentVersion not bound -!missing-selector! PKStroke::requiredContentVersion not bound -!missing-selector! PKStrokePoint::initWithLocation:timeOffset:size:opacity:force:azimuth:altitude:secondaryScale: not bound -!missing-selector! PKStrokePoint::secondaryScale not bound -!missing-selector! PKToolPicker::maximumSupportedContentVersion not bound -!missing-selector! PKToolPicker::setMaximumSupportedContentVersion: not bound diff --git a/tests/xtro-sharpie/macOS-PencilKit.todo b/tests/xtro-sharpie/macOS-PencilKit.todo deleted file mode 100644 index 7e11ab3b1035..000000000000 --- a/tests/xtro-sharpie/macOS-PencilKit.todo +++ /dev/null @@ -1,11 +0,0 @@ -!missing-enum! PKContentVersion not bound -!missing-field! PKInkTypeCrayon not bound -!missing-field! PKInkTypeFountainPen not bound -!missing-field! PKInkTypeMonoline not bound -!missing-field! PKInkTypeWatercolor not bound -!missing-selector! PKDrawing::requiredContentVersion not bound -!missing-selector! PKInk::requiredContentVersion not bound -!missing-selector! PKInkingTool::requiredContentVersion not bound -!missing-selector! PKStroke::requiredContentVersion not bound -!missing-selector! PKStrokePoint::initWithLocation:timeOffset:size:opacity:force:azimuth:altitude:secondaryScale: not bound -!missing-selector! PKStrokePoint::secondaryScale not bound From 4fd6a3f8b708382eb844afbd2c5d648e699ce039 Mon Sep 17 00:00:00 2001 From: GitHub Actions Autoformatter Date: Fri, 18 Aug 2023 22:23:53 +0000 Subject: [PATCH 2/6] Auto-format source code --- src/pencilkit.cs | 53 ++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/src/pencilkit.cs b/src/pencilkit.cs index 5ef1208f9cdb..acc0703d3681 100644 --- a/src/pencilkit.cs +++ b/src/pencilkit.cs @@ -60,20 +60,20 @@ enum PKInkType { [Field ("PKInkTypeMarker")] Marker, - [Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] - [Field("PKInkTypeMonoline")] + [Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] + [Field ("PKInkTypeMonoline")] Monoline, - [Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] - [Field("PKInkTypeFountainPen")] + [Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] + [Field ("PKInkTypeFountainPen")] FountainPen, - [Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] - [Field("PKInkTypeWatercolor")] + [Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] + [Field ("PKInkTypeWatercolor")] Watercolor, - [Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] - [Field("PKInkTypeCrayon")] + [Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] + [Field ("PKInkTypeCrayon")] Crayon, } @@ -87,8 +87,7 @@ enum PKCanvasViewDrawingPolicy : ulong { } [Native] - public enum PKContentVersion : long - { + public enum PKContentVersion : long { PKContentVersion1 = 1, PKContentVersion2 = 2, Latest = PKContentVersion2 @@ -155,8 +154,8 @@ interface PKCanvasView : PKToolPickerObserver { [Export ("drawingPolicy", ArgumentSemantic.Assign)] PKCanvasViewDrawingPolicy DrawingPolicy { get; set; } - [iOS(17, 0), MacCatalyst(17, 0)] - [Export("maximumSupportedContentVersion", ArgumentSemantic.Assign)] + [iOS (17, 0), MacCatalyst (17, 0)] + [Export ("maximumSupportedContentVersion", ArgumentSemantic.Assign)] PKContentVersion MaximumSupportedContentVersion { get; set; } } @@ -203,8 +202,8 @@ interface PKDrawing : NSCopying, NSSecureCoding { [Export ("drawingByAppendingStrokes:")] PKDrawing GetDrawing (PKStroke [] strokes); - [Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] - [Export("requiredContentVersion")] + [Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] + [Export ("requiredContentVersion")] PKContentVersion RequiredContentVersion { get; } } @@ -299,8 +298,8 @@ interface PKInkingTool { [Export ("ink")] PKInk Ink { get; } - [Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] - [Export("requiredContentVersion")] + [Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] + [Export ("requiredContentVersion")] PKContentVersion RequiredContentVersion { get; } } @@ -392,8 +391,8 @@ interface PKToolPicker { [Export ("stateAutosaveName")] string StateAutosaveName { get; set; } - [iOS(17, 0), MacCatalyst(17, 0)] - [Export("maximumSupportedContentVersion", ArgumentSemantic.Assign)] + [iOS (17, 0), MacCatalyst (17, 0)] + [Export ("maximumSupportedContentVersion", ArgumentSemantic.Assign)] PKContentVersion MaximumSupportedContentVersion { get; set; } } @@ -420,8 +419,8 @@ interface PKInk : NSCopying { [Export ("color")] UIColor Color { get; } - [Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] - [Export("requiredContentVersion")] + [Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] + [Export ("requiredContentVersion")] PKContentVersion RequiredContentVersion { get; } } @@ -474,8 +473,8 @@ interface PKStroke : NSCopying { [Export ("randomSeed")] uint RandomSeed { get; } - [Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] - [Export("requiredContentVersion")] + [Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] + [Export ("requiredContentVersion")] PKContentVersion RequiredContentVersion { get; } } @@ -533,10 +532,10 @@ interface PKStrokePoint : NSCopying { [DesignatedInitializer] NativeHandle Constructor (CGPoint location, double timeOffset, CGSize size, nfloat opacity, nfloat force, nfloat azimuth, nfloat altitude); - [Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] - [Export("initWithLocation:timeOffset:size:opacity:force:azimuth:altitude:secondaryScale:")] + [Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] + [Export ("initWithLocation:timeOffset:size:opacity:force:azimuth:altitude:secondaryScale:")] [DesignatedInitializer] - NativeHandle Constructor(CGPoint location, double timeOffset, CGSize size, nfloat opacity, nfloat force, nfloat azimuth, nfloat altitude, nfloat secondaryScale); + NativeHandle Constructor (CGPoint location, double timeOffset, CGSize size, nfloat opacity, nfloat force, nfloat azimuth, nfloat altitude, nfloat secondaryScale); [Export ("location")] CGPoint Location { get; } @@ -559,8 +558,8 @@ interface PKStrokePoint : NSCopying { [Export ("altitude")] nfloat Altitude { get; } - [Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] - [Export("secondaryScale")] + [Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] + [Export ("secondaryScale")] nfloat SecondaryScale { get; } } } From fdf6f120b0292ad5e7b144c8e89aebe460179dec Mon Sep 17 00:00:00 2001 From: Haritha Mohan Date: Fri, 18 Aug 2023 15:30:16 -0700 Subject: [PATCH 3/6] make diff nicer --- src/pencilkit.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pencilkit.cs b/src/pencilkit.cs index acc0703d3681..7dd6657bf1f5 100644 --- a/src/pencilkit.cs +++ b/src/pencilkit.cs @@ -245,8 +245,6 @@ interface PKEraserTool { nfloat GetMaximumWidth (PKEraserType eraserType); } - - [iOS (13, 0), Mac (11, 0)] [Introduced (PlatformName.MacCatalyst, 14, 0)] [BaseType (typeof (PKTool))] From f7edc19610117c3edf8274ae92fc63fb2a4c0e5e Mon Sep 17 00:00:00 2001 From: Haritha Mohan Date: Fri, 18 Aug 2023 15:58:14 -0700 Subject: [PATCH 4/6] sharpie forgot attrs so i forgot attrs --- src/pencilkit.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pencilkit.cs b/src/pencilkit.cs index 7dd6657bf1f5..f203d8fed598 100644 --- a/src/pencilkit.cs +++ b/src/pencilkit.cs @@ -86,11 +86,13 @@ enum PKCanvasViewDrawingPolicy : ulong { PencilOnly, } + [iOS (17, 0), Mac (14, 0)] + [Introduced (PlatformName.MacCatalyst, 17, 0)] [Native] public enum PKContentVersion : long { PKContentVersion1 = 1, PKContentVersion2 = 2, - Latest = PKContentVersion2 + Latest = PKContentVersion2, } [iOS (13, 0), NoMac] From ff5fd5667a56f682df545868577c469cfd71c073 Mon Sep 17 00:00:00 2001 From: Haritha Mohan Date: Mon, 21 Aug 2023 16:51:14 -0400 Subject: [PATCH 5/6] address review and test errors --- src/pencilkit.cs | 6 +++--- .../api-annotations-dotnet/iOS-PencilKit.todo | 15 --------------- .../api-annotations-dotnet/macOS-PencilKit.todo | 11 ----------- 3 files changed, 3 insertions(+), 29 deletions(-) delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/iOS-PencilKit.todo delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/macOS-PencilKit.todo diff --git a/src/pencilkit.cs b/src/pencilkit.cs index f203d8fed598..5aaf0a65903a 100644 --- a/src/pencilkit.cs +++ b/src/pencilkit.cs @@ -90,9 +90,9 @@ enum PKCanvasViewDrawingPolicy : ulong { [Introduced (PlatformName.MacCatalyst, 17, 0)] [Native] public enum PKContentVersion : long { - PKContentVersion1 = 1, - PKContentVersion2 = 2, - Latest = PKContentVersion2, + Version1 = 1, + Version2 = 2, + Latest = Version2, } [iOS (13, 0), NoMac] diff --git a/tests/xtro-sharpie/api-annotations-dotnet/iOS-PencilKit.todo b/tests/xtro-sharpie/api-annotations-dotnet/iOS-PencilKit.todo deleted file mode 100644 index a0f938ff6640..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-PencilKit.todo +++ /dev/null @@ -1,15 +0,0 @@ -!missing-enum! PKContentVersion not bound -!missing-field! PKInkTypeCrayon not bound -!missing-field! PKInkTypeFountainPen not bound -!missing-field! PKInkTypeMonoline not bound -!missing-field! PKInkTypeWatercolor not bound -!missing-selector! PKCanvasView::maximumSupportedContentVersion not bound -!missing-selector! PKCanvasView::setMaximumSupportedContentVersion: not bound -!missing-selector! PKDrawing::requiredContentVersion not bound -!missing-selector! PKInk::requiredContentVersion not bound -!missing-selector! PKInkingTool::requiredContentVersion not bound -!missing-selector! PKStroke::requiredContentVersion not bound -!missing-selector! PKStrokePoint::initWithLocation:timeOffset:size:opacity:force:azimuth:altitude:secondaryScale: not bound -!missing-selector! PKStrokePoint::secondaryScale not bound -!missing-selector! PKToolPicker::maximumSupportedContentVersion not bound -!missing-selector! PKToolPicker::setMaximumSupportedContentVersion: not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-PencilKit.todo b/tests/xtro-sharpie/api-annotations-dotnet/macOS-PencilKit.todo deleted file mode 100644 index 7e11ab3b1035..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-PencilKit.todo +++ /dev/null @@ -1,11 +0,0 @@ -!missing-enum! PKContentVersion not bound -!missing-field! PKInkTypeCrayon not bound -!missing-field! PKInkTypeFountainPen not bound -!missing-field! PKInkTypeMonoline not bound -!missing-field! PKInkTypeWatercolor not bound -!missing-selector! PKDrawing::requiredContentVersion not bound -!missing-selector! PKInk::requiredContentVersion not bound -!missing-selector! PKInkingTool::requiredContentVersion not bound -!missing-selector! PKStroke::requiredContentVersion not bound -!missing-selector! PKStrokePoint::initWithLocation:timeOffset:size:opacity:force:azimuth:altitude:secondaryScale: not bound -!missing-selector! PKStrokePoint::secondaryScale not bound From cdc16a48f3ca8296a294be727dd4232f0137b23e Mon Sep 17 00:00:00 2001 From: Haritha Mohan Date: Tue, 22 Aug 2023 08:56:07 -0400 Subject: [PATCH 6/6] Update src/pencilkit.cs Co-authored-by: Rolf Bjarne Kvinge --- src/pencilkit.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pencilkit.cs b/src/pencilkit.cs index 5aaf0a65903a..edcb67525f83 100644 --- a/src/pencilkit.cs +++ b/src/pencilkit.cs @@ -92,7 +92,6 @@ enum PKCanvasViewDrawingPolicy : ulong { public enum PKContentVersion : long { Version1 = 1, Version2 = 2, - Latest = Version2, } [iOS (13, 0), NoMac]