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")]
46unsafe impl NSCoding for SCNReferenceNode {}
47
48#[cfg(feature = "SCNNode")]
49unsafe impl NSCopying for SCNReferenceNode {}
50
51#[cfg(feature = "SCNNode")]
52unsafe impl CopyingHelper for SCNReferenceNode {
53 type Result = Self;
54}
55
56#[cfg(feature = "SCNNode")]
57unsafe impl NSObjectProtocol for SCNReferenceNode {}
58
59#[cfg(feature = "SCNNode")]
60unsafe impl NSSecureCoding for SCNReferenceNode {}
61
62#[cfg(all(feature = "SCNAction", feature = "SCNNode"))]
63unsafe impl SCNActionable for SCNReferenceNode {}
64
65#[cfg(all(feature = "SCNAnimation", feature = "SCNNode"))]
66unsafe impl SCNAnimatable for SCNReferenceNode {}
67
68#[cfg(all(feature = "SCNBoundingVolume", feature = "SCNNode"))]
69unsafe impl SCNBoundingVolume for SCNReferenceNode {}
70
71#[cfg(feature = "SCNNode")]
72impl SCNReferenceNode {
73 extern_methods!(
74 #[unsafe(method(initWithURL:))]
76 #[unsafe(method_family = init)]
77 pub unsafe fn initWithURL(
78 this: Allocated<Self>,
79 reference_url: &NSURL,
80 ) -> Option<Retained<Self>>;
81
82 #[unsafe(method(initWithCoder:))]
84 #[unsafe(method_family = init)]
85 pub unsafe fn initWithCoder(
86 this: Allocated<Self>,
87 a_decoder: &NSCoder,
88 ) -> Option<Retained<Self>>;
89
90 #[unsafe(method(referenceNodeWithURL:))]
92 #[unsafe(method_family = none)]
93 pub unsafe fn referenceNodeWithURL(reference_url: &NSURL) -> Option<Retained<Self>>;
94
95 #[unsafe(method(referenceURL))]
97 #[unsafe(method_family = none)]
98 pub unsafe fn referenceURL(&self) -> Retained<NSURL>;
99
100 #[unsafe(method(setReferenceURL:))]
102 #[unsafe(method_family = none)]
103 pub unsafe fn setReferenceURL(&self, reference_url: &NSURL);
104
105 #[unsafe(method(loadingPolicy))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn loadingPolicy(&self) -> SCNReferenceLoadingPolicy;
109
110 #[unsafe(method(setLoadingPolicy:))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn setLoadingPolicy(&self, loading_policy: SCNReferenceLoadingPolicy);
114
115 #[unsafe(method(load))]
118 #[unsafe(method_family = none)]
119 pub unsafe fn load(&self);
120
121 #[unsafe(method(unload))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn unload(&self);
125
126 #[unsafe(method(isLoaded))]
128 #[unsafe(method_family = none)]
129 pub unsafe fn isLoaded(&self) -> bool;
130 );
131}
132
133#[cfg(feature = "SCNNode")]
135impl SCNReferenceNode {
136 extern_methods!(
137 #[unsafe(method(node))]
139 #[unsafe(method_family = none)]
140 pub unsafe fn node() -> Retained<Self>;
141 );
142}
143
144#[cfg(feature = "SCNNode")]
146impl SCNReferenceNode {
147 extern_methods!(
148 #[unsafe(method(init))]
149 #[unsafe(method_family = init)]
150 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
151
152 #[unsafe(method(new))]
153 #[unsafe(method_family = new)]
154 pub unsafe fn new() -> Retained<Self>;
155 );
156}