objc2_sprite_kit/generated/
SKReferenceNode.rs1use 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 #[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 #[unsafe(method(initWithURL:))]
50 #[unsafe(method_family = init)]
51 pub unsafe fn initWithURL(this: Allocated<Self>, url: Option<&NSURL>) -> Retained<Self>;
52
53 #[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 #[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 #[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 #[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 #[unsafe(method(didLoadReferenceNode:))]
87 #[unsafe(method_family = none)]
88 pub unsafe fn didLoadReferenceNode(&self, node: Option<&SKNode>);
89
90 #[unsafe(method(resolveReferenceNode))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn resolveReferenceNode(&self);
97 );
98}
99
100#[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#[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}