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
100 changes: 97 additions & 3 deletions src/pencilkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ enum PKInkType {
[Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Field ("PKInkTypeCrayon")]
Crayon,

[iOS (26, 0), Mac (26, 0), MacCatalyst (26, 0)]
[Field ("PKInkTypeReed")]
Reed,
}

[iOS (14, 0), NoMac]
Expand All @@ -92,6 +96,8 @@ public enum PKContentVersion : long {
Version2 = 2,
[iOS (17, 4), Mac (14, 4), MacCatalyst (17, 4)]
Version3 = 3,
[iOS (26, 0), Mac (26, 0), MacCatalyst (26, 0)]
Version4 = 4,
}

[iOS (13, 0), NoMac]
Expand All @@ -112,9 +118,11 @@ interface PKCanvasViewDelegate : UIScrollViewDelegate {
[Export ("canvasViewDidEndUsingTool:")]
void EndUsingTool (PKCanvasView canvasView);

#if !XAMCORE_5_0
[iOS (18, 1), NoMacCatalyst]
[Export ("canvasView:didRefineStrokes:withNewStrokes:")]
void DidRefineStrokes (PKCanvasView canvasView, PKStroke [] strokes, PKStroke [] newStrokes);
#endif
}

interface IPKCanvasViewDelegate { }
Expand Down Expand Up @@ -265,6 +273,11 @@ interface PKInkingTool {
[Export ("initWithInkType:color:")]
NativeHandle Constructor ([BindAs (typeof (PKInkType))] NSString type, UIColor color);

[Mac (26, 0), iOS (26, 0), MacCatalyst (26, 0)]
[Export ("initWithInkType:color:width:azimuth:")]
[DesignatedInitializer]
NativeHandle Constructor ([BindAs (typeof (PKInkType))] NSString type, UIColor color, nfloat width, nfloat azimuth);

[iOS (14, 0)]
[MacCatalyst (14, 0)]
[Export ("initWithInk:width:")]
Expand Down Expand Up @@ -298,6 +311,10 @@ interface PKInkingTool {
[Export ("width")]
nfloat Width { get; }

[Mac (26, 0), iOS (26, 0), MacCatalyst (26, 0)]
[Export ("azimuth")]
nfloat Azimuth { get; }

[iOS (14, 0)]
[MacCatalyst (14, 0)]
[Export ("ink")]
Expand All @@ -306,6 +323,11 @@ interface PKInkingTool {
[Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("requiredContentVersion")]
PKContentVersion RequiredContentVersion { get; }

[iOS (26, 0), Mac (26, 0), MacCatalyst (26, 0)]
[Static]
[Export ("invertColor:")]
CGColor InvertColor (CGColor color);
}

[iOS (13, 0)]
Expand Down Expand Up @@ -436,6 +458,14 @@ interface PKToolPicker {
[Wrap ("WeakDelegate"), NullAllowed]
IPKToolPickerDelegate Delegate { get; set; }

[iOS (26, 0), MacCatalyst (26, 0)]
[Static]
[Export ("defaultToolItems")]
PKToolPickerItem [] DefaultToolItems { get; }

[iOS (26, 0), MacCatalyst (26, 0)]
[Export ("colorMaximumLinearExposure")]
nfloat ColorMaximumLinearExposure { get; set; }
}

[iOS (14, 0)]
Expand Down Expand Up @@ -579,6 +609,11 @@ interface PKStrokePoint : NSCopying {
[DesignatedInitializer]
NativeHandle Constructor (CGPoint location, double timeOffset, CGSize size, nfloat opacity, nfloat force, nfloat azimuth, nfloat altitude, nfloat secondaryScale);

[Mac (26, 0), iOS (26, 0), MacCatalyst (26, 0)]
[Export ("initWithLocation:timeOffset:size:opacity:force:azimuth:altitude:secondaryScale:threshold:")]
[DesignatedInitializer]
NativeHandle Constructor (CGPoint location, double timeOffset, CGSize size, nfloat opacity, nfloat force, nfloat azimuth, nfloat altitude, nfloat secondaryScale, nfloat threshold);

[Export ("location")]
CGPoint Location { get; }

Expand All @@ -603,6 +638,10 @@ interface PKStrokePoint : NSCopying {
[Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("secondaryScale")]
nfloat SecondaryScale { get; }

[Mac (26, 0), iOS (26, 0), MacCatalyst (26, 0)]
[Export ("threshold")]
nfloat Threshold { get; }
}

[iOS (18, 0), MacCatalyst (18, 0), NoMac]
Expand Down Expand Up @@ -666,7 +705,7 @@ interface PKToolPickerCustomItemConfiguration : NSCopying {
PKToolPickerCustomItemControlOptions ToolAttributeControls { get; set; }
}

[iOS (18, 0), MacCatalyst (18, 0), NoMac]
[iOS (18, 0), MacCatalyst (18, 0), Mac (26, 0)]
[BaseType (typeof (PKToolPickerItem))]
[DisableDefaultCtor]
interface PKToolPickerEraserItem {
Expand All @@ -680,38 +719,66 @@ interface PKToolPickerEraserItem {
PKEraserTool EraserTool { get; }
}

[iOS (18, 0), MacCatalyst (18, 0), NoMac]
[iOS (18, 0), MacCatalyst (18, 0), Mac (26, 0)]
[BaseType (typeof (PKToolPickerItem))]
[DisableDefaultCtor]
interface PKToolPickerInkingItem {
[Export ("initWithInkType:")]
NativeHandle Constructor (NSString inkType);

[Wrap ("this (inkType.GetConstant ()!)")]
NativeHandle Constructor (PKInkType inkType);

[Export ("initWithInkType:color:")]
NativeHandle Constructor (NSString inkType, UIColor color);

[Wrap ("this (inkType.GetConstant ()!, color)")]
NativeHandle Constructor (PKInkType inkType, UIColor color);

[Export ("initWithInkType:width:")]
NativeHandle Constructor (NSString inkType, nfloat width);

[Wrap ("this (inkType.GetConstant ()!, width)")]
NativeHandle Constructor (PKInkType inkType, nfloat width);

[Export ("initWithInkType:color:width:")]
NativeHandle Constructor (NSString inkType, UIColor color, nfloat width);

[Wrap ("this (inkType.GetConstant ()!, color, width)")]
NativeHandle Constructor (PKInkType inkType, UIColor color, nfloat width);

[Export ("initWithInkType:color:width:identifier:")]
NativeHandle Constructor (NSString inkType, UIColor color, nfloat width, [NullAllowed] string identifier);

[Wrap ("this (inkType.GetConstant ()!, color, width, identifier)")]
NativeHandle Constructor (PKInkType inkType, UIColor color, nfloat width, [NullAllowed] string identifier);

[iOS (26, 0), Mac (26, 0), MacCatalyst (26, 0)]
[Export ("initWithInkType:color:width:azimuth:identifier:")]
NativeHandle Constructor (NSString inkType, UIColor color, nfloat width, nfloat azimuth, [NullAllowed] string identifier);

[iOS (26, 0), Mac (26, 0), MacCatalyst (26, 0)]
[Wrap ("this (inkType.GetConstant ()!, color, width, azimuth, identifier)")]
NativeHandle Constructor (PKInkType inkType, UIColor color, nfloat width, nfloat azimuth, [NullAllowed] string identifier);

[Export ("inkingTool")]
PKInkingTool InkingTool { get; }

[Export ("allowsColorSelection", ArgumentSemantic.Assign)]
bool AllowsColorSelection { get; set; }
}

[iOS (18, 0), MacCatalyst (18, 0), NoMac]
[iOS (18, 0), MacCatalyst (18, 0), Mac (26, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface PKToolPickerItem : NSCopying {
[Export ("identifier")]
string Identifier { get; }

[iOS (26, 0), Mac (26, 0), MacCatalyst (26, 0)]
[Export ("tool")]
[NullAllowed]
PKTool Tool { get; }
}

[iOS (18, 0), MacCatalyst (18, 0), NoMac]
Expand Down Expand Up @@ -747,4 +814,31 @@ enum PKToolPickerCustomItemControlOptions : ulong {
Width = 1 << 0,
Opacity = 1 << 1,
}

[iOS (26, 0), NoMac, MacCatalyst (26, 0)]
[Native]
public enum PKToolPickerVisibility : long {
Inherited,
Inactive,
Hidden,
Visible,
}

[iOS (26, 0), NoMac, MacCatalyst (26, 0)]
[BaseType (typeof (NSObject))]
interface PKResponderState {
[Export ("toolPickerVisibility", ArgumentSemantic.Assign)]
PKToolPickerVisibility ToolPickerVisibility { get; set; }

[NullAllowed, Export ("activeToolPicker", ArgumentSemantic.Strong)]
PKToolPicker ActiveToolPicker { get; set; }
}

[iOS (26, 0), NoMac, MacCatalyst (26, 0)]
[Category]
[BaseType (typeof (UIResponder))]
interface UIResponder_PKResponderState {
[Export ("pencilKitResponderState")]
PKResponderState GetPencilKitResponderState ();
}
}
19 changes: 19 additions & 0 deletions tests/cecil-tests/Documentation.KnownFailures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5550,6 +5550,7 @@ F:PencilKit.PKCanvasViewDrawingPolicy.PencilOnly
F:PencilKit.PKContentVersion.Version1
F:PencilKit.PKContentVersion.Version2
F:PencilKit.PKContentVersion.Version3
F:PencilKit.PKContentVersion.Version4
F:PencilKit.PKEraserType.Bitmap
F:PencilKit.PKEraserType.FixedWidthBitmap
F:PencilKit.PKEraserType.Vector
Expand All @@ -5559,10 +5560,15 @@ F:PencilKit.PKInkType.Marker
F:PencilKit.PKInkType.Monoline
F:PencilKit.PKInkType.Pen
F:PencilKit.PKInkType.Pencil
F:PencilKit.PKInkType.Reed
F:PencilKit.PKInkType.Watercolor
F:PencilKit.PKToolPickerCustomItemControlOptions.None
F:PencilKit.PKToolPickerCustomItemControlOptions.Opacity
F:PencilKit.PKToolPickerCustomItemControlOptions.Width
F:PencilKit.PKToolPickerVisibility.Hidden
F:PencilKit.PKToolPickerVisibility.Inactive
F:PencilKit.PKToolPickerVisibility.Inherited
F:PencilKit.PKToolPickerVisibility.Visible
F:Phase.PhaseAssetError.AlreadyExists
F:Phase.PhaseAssetError.BadParameters
F:Phase.PhaseAssetError.FailedToLoad
Expand Down Expand Up @@ -15677,11 +15683,22 @@ M:PencilKit.PKCanvasViewDelegate.DidRefineStrokes(PencilKit.PKCanvasView,PencilK
M:PencilKit.PKInk.#ctor(PencilKit.PKInkType,AppKit.NSColor)
M:PencilKit.PKInk.#ctor(PencilKit.PKInkType,UIKit.UIColor)
M:PencilKit.PKToolPicker.Dispose(System.Boolean)
M:PencilKit.PKToolPickerInkingItem.#ctor(PencilKit.PKInkType,AppKit.NSColor,System.Runtime.InteropServices.NFloat,System.Runtime.InteropServices.NFloat,System.String)
M:PencilKit.PKToolPickerInkingItem.#ctor(PencilKit.PKInkType,AppKit.NSColor,System.Runtime.InteropServices.NFloat,System.String)
M:PencilKit.PKToolPickerInkingItem.#ctor(PencilKit.PKInkType,AppKit.NSColor,System.Runtime.InteropServices.NFloat)
M:PencilKit.PKToolPickerInkingItem.#ctor(PencilKit.PKInkType,AppKit.NSColor)
M:PencilKit.PKToolPickerInkingItem.#ctor(PencilKit.PKInkType,System.Runtime.InteropServices.NFloat)
M:PencilKit.PKToolPickerInkingItem.#ctor(PencilKit.PKInkType,UIKit.UIColor,System.Runtime.InteropServices.NFloat,System.Runtime.InteropServices.NFloat,System.String)
M:PencilKit.PKToolPickerInkingItem.#ctor(PencilKit.PKInkType,UIKit.UIColor,System.Runtime.InteropServices.NFloat,System.String)
M:PencilKit.PKToolPickerInkingItem.#ctor(PencilKit.PKInkType,UIKit.UIColor,System.Runtime.InteropServices.NFloat)
M:PencilKit.PKToolPickerInkingItem.#ctor(PencilKit.PKInkType,UIKit.UIColor)
M:PencilKit.PKToolPickerInkingItem.#ctor(PencilKit.PKInkType)
M:PencilKit.PKToolPickerObserver_Extensions.FramesObscuredDidChange(PencilKit.IPKToolPickerObserver,PencilKit.PKToolPicker)
M:PencilKit.PKToolPickerObserver_Extensions.IsRulerActiveDidChange(PencilKit.IPKToolPickerObserver,PencilKit.PKToolPicker)
M:PencilKit.PKToolPickerObserver_Extensions.SelectedToolDidChange(PencilKit.IPKToolPickerObserver,PencilKit.PKToolPicker)
M:PencilKit.PKToolPickerObserver_Extensions.SelectedToolItemDidChange(PencilKit.IPKToolPickerObserver,PencilKit.PKToolPicker)
M:PencilKit.PKToolPickerObserver_Extensions.VisibilityDidChange(PencilKit.IPKToolPickerObserver,PencilKit.PKToolPicker)
M:PencilKit.UIResponder_PKResponderState.GetPencilKitResponderState(UIKit.UIResponder)
M:Phase.PhaseAmbientMixerDefinition.#ctor(AVFoundation.AVAudioChannelLayout,System.Numerics.Quaternion,Foundation.NSString)
M:Phase.PhaseAmbientMixerDefinition.#ctor(AVFoundation.AVAudioChannelLayout,System.Numerics.Quaternion)
M:Phase.PhaseAssetRegistry.GetAsset(System.String)
Expand Down Expand Up @@ -28631,6 +28648,8 @@ T:PencilKit.PKInterpolatedPointsEnumeratorHandler
T:PencilKit.PKToolPickerCustomItemConfigurationImageProviderCallback
T:PencilKit.PKToolPickerCustomItemConfigurationViewControllerProvider
T:PencilKit.PKToolPickerCustomItemControlOptions
T:PencilKit.PKToolPickerVisibility
T:PencilKit.UIResponder_PKResponderState
T:Phase.PhaseAmbientMixerDefinition
T:Phase.PhaseAsset
T:Phase.PhaseAssetError
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# adding these since weak delegate exists in base class
!missing-selector! PKCanvasView::delegate not bound
!missing-selector! PKCanvasView::setDelegate: not bound

# removed in XAMCORE_5_0
!extra-protocol-member! unexpected selector PKCanvasViewDelegate::canvasView:didRefineStrokes:withNewStrokes: found
19 changes: 0 additions & 19 deletions tests/xtro-sharpie/api-annotations-dotnet/iOS-PencilKit.todo

This file was deleted.

24 changes: 0 additions & 24 deletions tests/xtro-sharpie/api-annotations-dotnet/macOS-PencilKit.todo

This file was deleted.