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        #[unsafe(method(initWithCoder:))]
83        #[unsafe(method_family = init)]
84        pub unsafe fn initWithCoder(
85            this: Allocated<Self>,
86            a_decoder: &NSCoder,
87        ) -> Option<Retained<Self>>;
88
89        #[unsafe(method(node))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn node(mtm: MainThreadMarker) -> Retained<Self>;
92
93        #[unsafe(method(nodeWithFileNamed:))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn nodeWithFileNamed(
96            filename: &NSString,
97            mtm: MainThreadMarker,
98        ) -> Option<Retained<Self>>;
99
100        #[unsafe(method(nodeWithFileNamed:securelyWithClasses:andError:_))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn nodeWithFileNamed_securelyWithClasses_andError(
103            filename: &NSString,
104            classes: &NSSet<AnyClass>,
105            mtm: MainThreadMarker,
106        ) -> Result<Retained<Self>, Retained<NSError>>;
107    );
108}
109
110/// Methods declared on superclass `NSObject`.
111#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
112#[cfg(target_os = "macos")]
113impl SKCropNode {
114    extern_methods!(
115        #[unsafe(method(new))]
116        #[unsafe(method_family = new)]
117        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
118    );
119}