objc2_pencil_kit/generated/
PKEraserTool.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-core-foundation")]
6use objc2_core_foundation::*;
7use objc2_foundation::*;
8
9use crate::*;
10
11#[repr(transparent)]
14#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
15pub struct PKEraserType(pub NSInteger);
16impl PKEraserType {
17 #[doc(alias = "PKEraserTypeVector")]
18 pub const Vector: Self = Self(0);
19 #[doc(alias = "PKEraserTypeBitmap")]
20 pub const Bitmap: Self = Self(1);
21 #[doc(alias = "PKEraserTypeFixedWidthBitmap")]
22 pub const FixedWidthBitmap: Self = Self(2);
23}
24
25unsafe impl Encode for PKEraserType {
26 const ENCODING: Encoding = NSInteger::ENCODING;
27}
28
29unsafe impl RefEncode for PKEraserType {
30 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
31}
32
33extern_class!(
34 #[unsafe(super(PKTool, NSObject))]
38 #[derive(Debug, PartialEq, Eq, Hash)]
39 #[cfg(feature = "PKTool")]
40 pub struct PKEraserTool;
41);
42
43#[cfg(feature = "PKTool")]
44unsafe impl Send for PKEraserTool {}
45
46#[cfg(feature = "PKTool")]
47unsafe impl Sync for PKEraserTool {}
48
49#[cfg(feature = "PKTool")]
50extern_conformance!(
51 unsafe impl NSCopying for PKEraserTool {}
52);
53
54#[cfg(feature = "PKTool")]
55unsafe impl CopyingHelper for PKEraserTool {
56 type Result = Self;
57}
58
59#[cfg(feature = "PKTool")]
60extern_conformance!(
61 unsafe impl NSObjectProtocol for PKEraserTool {}
62);
63
64#[cfg(feature = "PKTool")]
65impl PKEraserTool {
66 extern_methods!(
67 #[unsafe(method(eraserType))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn eraserType(&self) -> PKEraserType;
77
78 #[unsafe(method(initWithEraserType:))]
79 #[unsafe(method_family = init)]
80 pub unsafe fn initWithEraserType(
81 this: Allocated<Self>,
82 eraser_type: PKEraserType,
83 ) -> Retained<Self>;
84
85 #[cfg(feature = "objc2-core-foundation")]
86 #[unsafe(method(initWithEraserType:width:))]
92 #[unsafe(method_family = init)]
93 pub unsafe fn initWithEraserType_width(
94 this: Allocated<Self>,
95 eraser_type: PKEraserType,
96 width: CGFloat,
97 ) -> Retained<Self>;
98
99 #[cfg(feature = "objc2-core-foundation")]
100 #[unsafe(method(width))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn width(&self) -> CGFloat;
110
111 #[cfg(feature = "objc2-core-foundation")]
112 #[unsafe(method(defaultWidthForEraserType:))]
114 #[unsafe(method_family = none)]
115 pub unsafe fn defaultWidthForEraserType(eraser_type: PKEraserType) -> CGFloat;
116
117 #[cfg(feature = "objc2-core-foundation")]
118 #[unsafe(method(minimumWidthForEraserType:))]
120 #[unsafe(method_family = none)]
121 pub unsafe fn minimumWidthForEraserType(eraser_type: PKEraserType) -> CGFloat;
122
123 #[cfg(feature = "objc2-core-foundation")]
124 #[unsafe(method(maximumWidthForEraserType:))]
126 #[unsafe(method_family = none)]
127 pub unsafe fn maximumWidthForEraserType(eraser_type: PKEraserType) -> CGFloat;
128 );
129}
130
131#[cfg(feature = "PKTool")]
133impl PKEraserTool {
134 extern_methods!(
135 #[unsafe(method(init))]
136 #[unsafe(method_family = init)]
137 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
138 );
139}
140
141#[cfg(feature = "PKTool")]
143impl PKEraserTool {
144 extern_methods!(
145 #[unsafe(method(new))]
146 #[unsafe(method_family = new)]
147 pub unsafe fn new() -> Retained<Self>;
148 );
149}