objc2_pencil_kit/generated/
PKInk.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-app-kit")]
6#[cfg(target_os = "macos")]
7use objc2_app_kit::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// PKInk provides a description of how marks on a PKCanvas render and are created.
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/pencilkit/pkink?language=objc)
16    #[unsafe(super(NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    pub struct PKInk;
19);
20
21unsafe impl Send for PKInk {}
22
23unsafe impl Sync for PKInk {}
24
25extern_conformance!(
26    unsafe impl NSCopying for PKInk {}
27);
28
29unsafe impl CopyingHelper for PKInk {
30    type Result = Self;
31}
32
33extern_conformance!(
34    unsafe impl NSObjectProtocol for PKInk {}
35);
36
37impl PKInk {
38    extern_methods!(
39        #[cfg(all(feature = "PKInkType", feature = "objc2-app-kit"))]
40        #[cfg(target_os = "macos")]
41        #[unsafe(method(initWithInkType:color:))]
42        #[unsafe(method_family = init)]
43        pub unsafe fn initWithInkType_color(
44            this: Allocated<Self>,
45            r#type: &PKInkType,
46            color: &NSColor,
47        ) -> Retained<Self>;
48
49        #[cfg(feature = "PKInkType")]
50        /// The type of ink, eg. pen, pencil...
51        ///
52        /// This property is not atomic.
53        ///
54        /// # Safety
55        ///
56        /// This might not be thread-safe.
57        #[unsafe(method(inkType))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn inkType(&self) -> Retained<PKInkType>;
60
61        #[cfg(feature = "objc2-app-kit")]
62        #[cfg(target_os = "macos")]
63        /// This property is not atomic.
64        ///
65        /// # Safety
66        ///
67        /// This might not be thread-safe.
68        #[unsafe(method(color))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn color(&self) -> Retained<NSColor>;
71
72        #[cfg(feature = "PKContentVersion")]
73        /// The PencilKit version required to use this ink.
74        ///
75        /// This property is not atomic.
76        ///
77        /// # Safety
78        ///
79        /// This might not be thread-safe.
80        #[unsafe(method(requiredContentVersion))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn requiredContentVersion(&self) -> PKContentVersion;
83    );
84}
85
86/// Methods declared on superclass `NSObject`.
87impl PKInk {
88    extern_methods!(
89        #[unsafe(method(init))]
90        #[unsafe(method_family = init)]
91        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
92
93        #[unsafe(method(new))]
94        #[unsafe(method_family = new)]
95        pub unsafe fn new() -> Retained<Self>;
96    );
97}