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