objc2_scene_kit/generated/
SCNReferenceNode.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
18#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
19pub struct SCNReferenceLoadingPolicy(pub NSInteger);
20impl SCNReferenceLoadingPolicy {
21 #[doc(alias = "SCNReferenceLoadingPolicyImmediate")]
22 pub const Immediate: Self = Self(0);
23 #[doc(alias = "SCNReferenceLoadingPolicyOnDemand")]
24 pub const OnDemand: Self = Self(1);
25}
26
27unsafe impl Encode for SCNReferenceLoadingPolicy {
28 const ENCODING: Encoding = NSInteger::ENCODING;
29}
30
31unsafe impl RefEncode for SCNReferenceLoadingPolicy {
32 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
33}
34
35extern_class!(
36 #[unsafe(super(SCNNode, NSObject))]
40 #[derive(Debug, PartialEq, Eq, Hash)]
41 #[cfg(feature = "SCNNode")]
42 pub struct SCNReferenceNode;
43);
44
45#[cfg(feature = "SCNNode")]
46extern_conformance!(
47 unsafe impl NSCoding for SCNReferenceNode {}
48);
49
50#[cfg(feature = "SCNNode")]
51extern_conformance!(
52 unsafe impl NSCopying for SCNReferenceNode {}
53);
54
55#[cfg(feature = "SCNNode")]
56unsafe impl CopyingHelper for SCNReferenceNode {
57 type Result = Self;
58}
59
60#[cfg(feature = "SCNNode")]
61extern_conformance!(
62 unsafe impl NSObjectProtocol for SCNReferenceNode {}
63);
64
65#[cfg(feature = "SCNNode")]
66extern_conformance!(
67 unsafe impl NSSecureCoding for SCNReferenceNode {}
68);
69
70#[cfg(all(feature = "SCNAction", feature = "SCNNode"))]
71extern_conformance!(
72 unsafe impl SCNActionable for SCNReferenceNode {}
73);
74
75#[cfg(all(feature = "SCNAnimation", feature = "SCNNode"))]
76extern_conformance!(
77 unsafe impl SCNAnimatable for SCNReferenceNode {}
78);
79
80#[cfg(all(feature = "SCNBoundingVolume", feature = "SCNNode"))]
81extern_conformance!(
82 unsafe impl SCNBoundingVolume for SCNReferenceNode {}
83);
84
85#[cfg(feature = "SCNNode")]
86impl SCNReferenceNode {
87 extern_methods!(
88 #[unsafe(method(initWithURL:))]
90 #[unsafe(method_family = init)]
91 pub unsafe fn initWithURL(
92 this: Allocated<Self>,
93 reference_url: &NSURL,
94 ) -> Option<Retained<Self>>;
95
96 #[unsafe(method(initWithCoder:))]
102 #[unsafe(method_family = init)]
103 pub unsafe fn initWithCoder(
104 this: Allocated<Self>,
105 a_decoder: &NSCoder,
106 ) -> Option<Retained<Self>>;
107
108 #[unsafe(method(referenceNodeWithURL:))]
110 #[unsafe(method_family = none)]
111 pub unsafe fn referenceNodeWithURL(reference_url: &NSURL) -> Option<Retained<Self>>;
112
113 #[unsafe(method(referenceURL))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn referenceURL(&self) -> Retained<NSURL>;
117
118 #[unsafe(method(setReferenceURL:))]
122 #[unsafe(method_family = none)]
123 pub unsafe fn setReferenceURL(&self, reference_url: &NSURL);
124
125 #[unsafe(method(loadingPolicy))]
127 #[unsafe(method_family = none)]
128 pub unsafe fn loadingPolicy(&self) -> SCNReferenceLoadingPolicy;
129
130 #[unsafe(method(setLoadingPolicy:))]
132 #[unsafe(method_family = none)]
133 pub unsafe fn setLoadingPolicy(&self, loading_policy: SCNReferenceLoadingPolicy);
134
135 #[unsafe(method(load))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn load(&self);
140
141 #[unsafe(method(unload))]
143 #[unsafe(method_family = none)]
144 pub unsafe fn unload(&self);
145
146 #[unsafe(method(isLoaded))]
148 #[unsafe(method_family = none)]
149 pub unsafe fn isLoaded(&self) -> bool;
150 );
151}
152
153#[cfg(feature = "SCNNode")]
155impl SCNReferenceNode {
156 extern_methods!(
157 #[unsafe(method(node))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn node() -> Retained<Self>;
161 );
162}
163
164#[cfg(feature = "SCNNode")]
166impl SCNReferenceNode {
167 extern_methods!(
168 #[unsafe(method(init))]
169 #[unsafe(method_family = init)]
170 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
171
172 #[unsafe(method(new))]
173 #[unsafe(method_family = new)]
174 pub unsafe fn new() -> Retained<Self>;
175 );
176}