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:))]
98 #[unsafe(method_family = init)]
99 pub unsafe fn initWithCoder(
100 this: Allocated<Self>,
101 a_decoder: &NSCoder,
102 ) -> Option<Retained<Self>>;
103
104 #[unsafe(method(referenceNodeWithURL:))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn referenceNodeWithURL(reference_url: &NSURL) -> Option<Retained<Self>>;
108
109 #[unsafe(method(referenceURL))]
111 #[unsafe(method_family = none)]
112 pub unsafe fn referenceURL(&self) -> Retained<NSURL>;
113
114 #[unsafe(method(setReferenceURL:))]
116 #[unsafe(method_family = none)]
117 pub unsafe fn setReferenceURL(&self, reference_url: &NSURL);
118
119 #[unsafe(method(loadingPolicy))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn loadingPolicy(&self) -> SCNReferenceLoadingPolicy;
123
124 #[unsafe(method(setLoadingPolicy:))]
126 #[unsafe(method_family = none)]
127 pub unsafe fn setLoadingPolicy(&self, loading_policy: SCNReferenceLoadingPolicy);
128
129 #[unsafe(method(load))]
132 #[unsafe(method_family = none)]
133 pub unsafe fn load(&self);
134
135 #[unsafe(method(unload))]
137 #[unsafe(method_family = none)]
138 pub unsafe fn unload(&self);
139
140 #[unsafe(method(isLoaded))]
142 #[unsafe(method_family = none)]
143 pub unsafe fn isLoaded(&self) -> bool;
144 );
145}
146
147#[cfg(feature = "SCNNode")]
149impl SCNReferenceNode {
150 extern_methods!(
151 #[unsafe(method(node))]
153 #[unsafe(method_family = none)]
154 pub unsafe fn node() -> Retained<Self>;
155 );
156}
157
158#[cfg(feature = "SCNNode")]
160impl SCNReferenceNode {
161 extern_methods!(
162 #[unsafe(method(init))]
163 #[unsafe(method_family = init)]
164 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
165
166 #[unsafe(method(new))]
167 #[unsafe(method_family = new)]
168 pub unsafe fn new() -> Retained<Self>;
169 );
170}