objc2_sprite_kit/generated/
SKCropNode.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-app-kit")]
7#[cfg(target_os = "macos")]
8use objc2_app_kit::*;
9use objc2_foundation::*;
10
11use crate::*;
12
13extern_class!(
14    /// A SpriteKit node that masks child nodes using another node's alpha component
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/spritekit/skcropnode?language=objc)
17    #[unsafe(super(SKNode, NSResponder, NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    #[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
20    #[cfg(target_os = "macos")]
21    pub struct SKCropNode;
22);
23
24#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
25#[cfg(target_os = "macos")]
26extern_conformance!(
27    unsafe impl NSCoding for SKCropNode {}
28);
29
30#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
31#[cfg(target_os = "macos")]
32extern_conformance!(
33    unsafe impl NSCopying for SKCropNode {}
34);
35
36#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
37#[cfg(target_os = "macos")]
38unsafe impl CopyingHelper for SKCropNode {
39    type Result = Self;
40}
41
42#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
43#[cfg(target_os = "macos")]
44extern_conformance!(
45    unsafe impl NSObjectProtocol for SKCropNode {}
46);
47
48#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
49#[cfg(target_os = "macos")]
50extern_conformance!(
51    unsafe impl NSSecureCoding for SKCropNode {}
52);
53
54#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
55#[cfg(target_os = "macos")]
56impl SKCropNode {
57    extern_methods!(
58        /// SKNode to be used as the mask.
59        ///
60        /// The SKNode supplied as the mask must not be a child of another node, but it may have children. Anywhere the mask's output alpha component is less than 0.05 masks out that area for the SKCropNode's children. If the mask is nil, nothing is masked out.
61        #[unsafe(method(maskNode))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn maskNode(&self) -> Option<Retained<SKNode>>;
64
65        /// Setter for [`maskNode`][Self::maskNode].
66        #[unsafe(method(setMaskNode:))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn setMaskNode(&self, mask_node: Option<&SKNode>);
69    );
70}
71
72/// Methods declared on superclass `SKNode`.
73#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
74#[cfg(target_os = "macos")]
75impl SKCropNode {
76    extern_methods!(
77        #[unsafe(method(init))]
78        #[unsafe(method_family = init)]
79        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
80
81        /// Support coding and decoding via NSKeyedArchiver.
82        ///
83        /// # Safety
84        ///
85        /// `a_decoder` possibly has further requirements.
86        #[unsafe(method(initWithCoder:))]
87        #[unsafe(method_family = init)]
88        pub unsafe fn initWithCoder(
89            this: Allocated<Self>,
90            a_decoder: &NSCoder,
91        ) -> Option<Retained<Self>>;
92
93        #[unsafe(method(node))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn node(mtm: MainThreadMarker) -> Retained<Self>;
96
97        #[unsafe(method(nodeWithFileNamed:))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn nodeWithFileNamed(
100            filename: &NSString,
101            mtm: MainThreadMarker,
102        ) -> Option<Retained<Self>>;
103
104        /// # Safety
105        ///
106        /// `classes` generic probably has further requirements.
107        #[unsafe(method(nodeWithFileNamed:securelyWithClasses:andError:_))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn nodeWithFileNamed_securelyWithClasses_andError(
110            filename: &NSString,
111            classes: &NSSet<AnyClass>,
112            mtm: MainThreadMarker,
113        ) -> Result<Retained<Self>, Retained<NSError>>;
114    );
115}
116
117/// Methods declared on superclass `NSObject`.
118#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
119#[cfg(target_os = "macos")]
120impl SKCropNode {
121    extern_methods!(
122        #[unsafe(method(new))]
123        #[unsafe(method_family = new)]
124        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
125    );
126}