objc2_sprite_kit/generated/
SKReferenceNode.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    /// [Apple's documentation](https://developer.apple.com/documentation/spritekit/skreferencenode?language=objc)
15    #[unsafe(super(SKNode, NSResponder, NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    #[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
18    #[cfg(target_os = "macos")]
19    pub struct SKReferenceNode;
20);
21
22#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
23#[cfg(target_os = "macos")]
24unsafe impl NSCoding for SKReferenceNode {}
25
26#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
27#[cfg(target_os = "macos")]
28unsafe impl NSCopying for SKReferenceNode {}
29
30#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
31#[cfg(target_os = "macos")]
32unsafe impl CopyingHelper for SKReferenceNode {
33    type Result = Self;
34}
35
36#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
37#[cfg(target_os = "macos")]
38unsafe impl NSObjectProtocol for SKReferenceNode {}
39
40#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
41#[cfg(target_os = "macos")]
42unsafe impl NSSecureCoding for SKReferenceNode {}
43
44#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
45#[cfg(target_os = "macos")]
46impl SKReferenceNode {
47    extern_methods!(
48        /// Create a reference node with a url
49        #[unsafe(method(initWithURL:))]
50        #[unsafe(method_family = init)]
51        pub unsafe fn initWithURL(this: Allocated<Self>, url: Option<&NSURL>) -> Retained<Self>;
52
53        /// Create a reference node with a url
54        #[unsafe(method(initWithFileNamed:))]
55        #[unsafe(method_family = init)]
56        pub unsafe fn initWithFileNamed(
57            this: Allocated<Self>,
58            file_name: Option<&NSString>,
59        ) -> Retained<Self>;
60
61        /// Support coding and decoding via NSKeyedArchiver.
62        #[unsafe(method(initWithCoder:))]
63        #[unsafe(method_family = init)]
64        pub unsafe fn initWithCoder(
65            this: Allocated<Self>,
66            a_decoder: &NSCoder,
67        ) -> Option<Retained<Self>>;
68
69        /// Create a reference node with a url
70        #[unsafe(method(referenceNodeWithFileNamed:))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn referenceNodeWithFileNamed(
73            file_name: &NSString,
74            mtm: MainThreadMarker,
75        ) -> Retained<Self>;
76
77        /// Create a reference node with a url
78        #[unsafe(method(referenceNodeWithURL:))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn referenceNodeWithURL(
81            reference_url: &NSURL,
82            mtm: MainThreadMarker,
83        ) -> Retained<Self>;
84
85        /// called each time the url is loaded, after it has been added as a child
86        #[unsafe(method(didLoadReferenceNode:))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn didLoadReferenceNode(&self, node: Option<&SKNode>);
89
90        /// Force the reference to be reloaded. The resolved node will added
91        /// as a child of this node. If the resolved node has not yet been loaded,
92        /// it will be automatically loaded when the resolved node is queryed or
93        /// the refenece node is rendered.
94        #[unsafe(method(resolveReferenceNode))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn resolveReferenceNode(&self);
97    );
98}
99
100/// Methods declared on superclass `SKNode`.
101#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
102#[cfg(target_os = "macos")]
103impl SKReferenceNode {
104    extern_methods!(
105        #[unsafe(method(init))]
106        #[unsafe(method_family = init)]
107        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
108
109        #[unsafe(method(node))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn node(mtm: MainThreadMarker) -> Retained<Self>;
112
113        #[unsafe(method(nodeWithFileNamed:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn nodeWithFileNamed(
116            filename: &NSString,
117            mtm: MainThreadMarker,
118        ) -> Option<Retained<Self>>;
119
120        #[unsafe(method(nodeWithFileNamed:securelyWithClasses:andError:_))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn nodeWithFileNamed_securelyWithClasses_andError(
123            filename: &NSString,
124            classes: &NSSet<AnyClass>,
125            mtm: MainThreadMarker,
126        ) -> Result<Retained<Self>, Retained<NSError>>;
127    );
128}
129
130/// Methods declared on superclass `NSObject`.
131#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
132#[cfg(target_os = "macos")]
133impl SKReferenceNode {
134    extern_methods!(
135        #[unsafe(method(new))]
136        #[unsafe(method_family = new)]
137        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
138    );
139}