engage/generated/unity_engine/
androidjavaobject.rs1#[cfg(feature = "unity_engine-androidjavaobject-types")]
4mod __types {
5 #[allow(unused_imports)] use ::unity::prelude::*;
6
7 use super::*;
8 use crate::system::object::{IObject, Object};
9
10 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/unity_engine/androidjavaobject/AndroidJavaObject.md"))]
11 #[::unity::class(namespace = "UnityEngine", name = "AndroidJavaObject")]
12 #[parent(crate::system::object::Object)]
13 pub struct AndroidJavaObject {
14 #[static_field]
15 #[rename(name = "enableDebugPrints")]
16 pub enable_debug_prints: bool,
17 #[offset(16)]
18 #[rename(name = "m_jobject")]
19 pub m_jobject: crate::unity_engine::globaljavaobjectref::GlobalJavaObjectRef,
20 #[offset(24)]
21 #[rename(name = "m_jclass")]
22 pub m_jclass: crate::unity_engine::globaljavaobjectref::GlobalJavaObjectRef,
23 }
24}
25
26#[cfg(feature = "unity_engine-androidjavaobject-types")]
27pub use __types::*;
28
29#[cfg(feature = "unity_engine-androidjavaobject")]
30impl AndroidJavaObject {
31 #[doc = "`AndroidJavaObjectDeleteLocalRef(::unity::IntPtr)` overload"]
32 pub fn android_java_object_delete_local_ref(
33 jobject: impl ::core::convert::Into<::unity::IntPtr>,
34 ) -> crate::unity_engine::androidjavaobject::AndroidJavaObject {
35 unsafe {
36 ::unity::il2cpp_call!((::unity::module_base()+0x3f126e0usize)as*mut u8,crate::unity_engine::androidjavaobject::AndroidJavaObject;
37(::unity::IntPtr)::core::convert::Into::into(jobject))
38 }
39 }
40
41 #[doc = "`AndroidJavaClassDeleteLocalRef(::unity::IntPtr)` overload"]
42 pub fn android_java_class_delete_local_ref(
43 jclass: impl ::core::convert::Into<::unity::IntPtr>,
44 ) -> crate::unity_engine::androidjavaclass::AndroidJavaClass {
45 unsafe {
46 ::unity::il2cpp_call!((::unity::module_base()+0x3f12820usize)as*mut u8,crate::unity_engine::androidjavaclass::AndroidJavaClass;
47(::unity::IntPtr)::core::convert::Into::into(jclass))
48 }
49 }
50
51 #[doc = "`.cctor()` overload"]
52 pub fn cctor() -> () {
53 unsafe {
54 ::unity::il2cpp_call!((::unity::module_base()+0x3f12960usize)as*mut u8,();
55 )
56 }
57 }
58}
59
60#[cfg(feature = "unity_engine-androidjavaobject")]
61pub trait IAndroidJavaObjectMethods: IAndroidJavaObject {
62 #[doc = "`.ctor(::unity::Il2CppString, ::unity::Array<crate::system::object::Object>)` overload"]
63 fn ctor(
64 self,
65 class_name: impl ::core::convert::Into<::unity::Il2CppString>,
66 args: impl ::core::convert::Into<::unity::Array<crate::system::object::Object>>,
67 ) -> () {
68 unsafe {
69 let __receiver = <AndroidJavaObject as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
70 ::unity::il2cpp_call!((::unity::module_base()+0x3f11e50usize)as*mut u8,();
71(AndroidJavaObject)__receiver,(::unity::Il2CppString)::core::convert::Into::into(class_name),(::unity::Array<crate::system::object::Object>)::core::convert::Into::into(args))
72 }
73 }
74 #[doc = "`Dispose()` overload"]
75 fn dispose(self) -> () {
76 unsafe {
77 let __receiver = <AndroidJavaObject as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
78 {
79 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
80 let __vi = *__vt.get(4usize).unwrap_or_else(|| {
81 panic!(
82 "unity: virtual slot {}
83 out of range (vtable len {}
84) on the runtime class behind {}
85 (method `{}
86`)",
87 4usize,
88 __vt.len(),
89 <AndroidJavaObject as ::unity::ClassIdentity>::NAME,
90 "Dispose",
91 )
92 });
93 let __inner: extern "C" fn(AndroidJavaObject, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__vi.method_ptr);
94 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
95 __inner(__receiver, __mi)
96 }
97 }
98 }
99 #[doc = "`GetRawObject()` overload"]
100 fn get_raw_object(self) -> ::unity::IntPtr {
101 unsafe {
102 let __receiver = <AndroidJavaObject as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
103 ::unity::il2cpp_call!((::unity::module_base()+0x3f12260usize)as*mut u8, ::unity::IntPtr;
104(AndroidJavaObject)__receiver)
105 }
106 }
107 #[doc = "`GetRawClass()` overload"]
108 fn get_raw_class(self) -> ::unity::IntPtr {
109 unsafe {
110 let __receiver = <AndroidJavaObject as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
111 ::unity::il2cpp_call!((::unity::module_base()+0x3f12280usize)as*mut u8, ::unity::IntPtr;
112(AndroidJavaObject)__receiver)
113 }
114 }
115 fn call<M0: ::unity::IlType + ::core::marker::Copy + ::unity::ClassIdentity>(
116 self,
117 method_name: impl ::core::convert::Into<::unity::Il2CppString>,
118 args: impl ::core::convert::Into<::unity::Array<crate::system::object::Object>>,
119 ) -> M0 {
120 static OPEN: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> =
121 ::std::sync::LazyLock::new(|| ::unity::lookup::method_info_on_class(<AndroidJavaObject as ::unity::ClassIdentity>::class(), "Call", 2));
122 #[allow(clippy::type_complexity)]
123 static CACHE: ::std::sync::OnceLock<::std::sync::Mutex<::std::collections::HashMap<usize, &'static ::unity::il2cpp::MethodInfo>>> =
124 ::std::sync::OnceLock::new();
125 let _ = false;
126 let __open: &'static ::unity::il2cpp::MethodInfo = match &*OPEN {
127 ::core::result::Result::Ok(mi) => *mi,
128 ::core::result::Result::Err(e) => {
129 panic!(
130 "method lookup failed: {}
131::{}
132: {}
133",
134 <AndroidJavaObject as ::unity::ClassIdentity>::NAME,
135 "Call",
136 e
137 )
138 },
139 };
140 let __cache = CACHE.get_or_init(|| ::std::sync::Mutex::new(::std::collections::HashMap::new()));
141 let __key: usize = <M0 as ::unity::IlType>::il_type() as *const _ as usize;
142 let __inflated: &'static ::unity::il2cpp::MethodInfo = {
143 let mut __guard = __cache.lock().unwrap();
144 *__guard
145 .entry(__key)
146 .or_insert_with(|| ::unity::il2cpp::generic::create_generic_method_info(__open, &[<M0 as ::unity::IlType>::il_type()]))
147 };
148 unsafe {
149 let __receiver = <AndroidJavaObject as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
150 let __f: extern "C" fn(
151 AndroidJavaObject,
152 ::unity::Il2CppString,
153 ::unity::Array<crate::system::object::Object>,
154 ::unity::OptionalMethod,
155 ) -> M0 = ::core::mem::transmute(__inflated.method_ptr);
156 let __mi_opaque: &'static () = &*(__inflated as *const _ as *const ());
157 __f(
158 __receiver,
159 ::core::convert::Into::into(method_name),
160 ::core::convert::Into::into(args),
161 ::core::option::Option::Some(__mi_opaque),
162 )
163 }
164 }
165 fn call_static<M0: ::unity::IlType + ::core::marker::Copy + ::unity::ClassIdentity>(
166 self,
167 method_name: impl ::core::convert::Into<::unity::Il2CppString>,
168 args: impl ::core::convert::Into<::unity::Array<crate::system::object::Object>>,
169 ) -> M0 {
170 static OPEN: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
171 ::unity::lookup::method_info_on_class(<AndroidJavaObject as ::unity::ClassIdentity>::class(), "CallStatic", 2)
172 });
173 #[allow(clippy::type_complexity)]
174 static CACHE: ::std::sync::OnceLock<::std::sync::Mutex<::std::collections::HashMap<usize, &'static ::unity::il2cpp::MethodInfo>>> =
175 ::std::sync::OnceLock::new();
176 let _ = false;
177 let __open: &'static ::unity::il2cpp::MethodInfo = match &*OPEN {
178 ::core::result::Result::Ok(mi) => *mi,
179 ::core::result::Result::Err(e) => {
180 panic!(
181 "method lookup failed: {}
182::{}
183: {}
184",
185 <AndroidJavaObject as ::unity::ClassIdentity>::NAME,
186 "CallStatic",
187 e
188 )
189 },
190 };
191 let __cache = CACHE.get_or_init(|| ::std::sync::Mutex::new(::std::collections::HashMap::new()));
192 let __key: usize = <M0 as ::unity::IlType>::il_type() as *const _ as usize;
193 let __inflated: &'static ::unity::il2cpp::MethodInfo = {
194 let mut __guard = __cache.lock().unwrap();
195 *__guard
196 .entry(__key)
197 .or_insert_with(|| ::unity::il2cpp::generic::create_generic_method_info(__open, &[<M0 as ::unity::IlType>::il_type()]))
198 };
199 unsafe {
200 let __receiver = <AndroidJavaObject as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
201 let __f: extern "C" fn(
202 AndroidJavaObject,
203 ::unity::Il2CppString,
204 ::unity::Array<crate::system::object::Object>,
205 ::unity::OptionalMethod,
206 ) -> M0 = ::core::mem::transmute(__inflated.method_ptr);
207 let __mi_opaque: &'static () = &*(__inflated as *const _ as *const ());
208 __f(
209 __receiver,
210 ::core::convert::Into::into(method_name),
211 ::core::convert::Into::into(args),
212 ::core::option::Option::Some(__mi_opaque),
213 )
214 }
215 }
216 #[doc = "`DebugPrint(::unity::Il2CppString)` overload"]
217 fn debug_print(self, msg: impl ::core::convert::Into<::unity::Il2CppString>) -> () {
218 unsafe {
219 let __receiver = <AndroidJavaObject as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
220 ::unity::il2cpp_call!((::unity::module_base()+0x3f11a90usize)as*mut u8,();
221(AndroidJavaObject)__receiver,(::unity::Il2CppString)::core::convert::Into::into(msg))
222 }
223 }
224 #[doc = "`_AndroidJavaObject(::unity::Il2CppString, ::unity::Array<crate::system::object::Object>)` overload"]
225 fn android_java_object(
226 self,
227 class_name: impl ::core::convert::Into<::unity::Il2CppString>,
228 args: impl ::core::convert::Into<::unity::Array<crate::system::object::Object>>,
229 ) -> () {
230 unsafe {
231 let __receiver = <AndroidJavaObject as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
232 ::unity::il2cpp_call!((::unity::module_base()+0x3f11e90usize)as*mut u8,();
233(AndroidJavaObject)__receiver,(::unity::Il2CppString)::core::convert::Into::into(class_name),(::unity::Array<crate::system::object::Object>)::core::convert::Into::into(args))
234 }
235 }
236 #[doc = "`.ctor(::unity::IntPtr)` overload"]
237 fn ctor_2(self, jobject: impl ::core::convert::Into<::unity::IntPtr>) -> () {
238 unsafe {
239 let __receiver = <AndroidJavaObject as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
240 ::unity::il2cpp_call!((::unity::module_base()+0x3f122b0usize)as*mut u8,();
241(AndroidJavaObject)__receiver,(::unity::IntPtr)::core::convert::Into::into(jobject))
242 }
243 }
244 #[doc = "`.ctor()` overload"]
245 fn ctor_3(self) -> () {
246 unsafe {
247 let __receiver = <AndroidJavaObject as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
248 ::unity::il2cpp_call!((::unity::module_base()+0x3f11840usize)as*mut u8,();
249(AndroidJavaObject)__receiver)
250 }
251 }
252 #[doc = "`Finalize()` overload"]
253 fn finalize(self) -> () {
254 unsafe {
255 let __receiver = <AndroidJavaObject as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
256 {
257 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
258 let __vi = *__vt.get(1usize).unwrap_or_else(|| {
259 panic!(
260 "unity: virtual slot {}
261 out of range (vtable len {}
262) on the runtime class behind {}
263 (method `{}
264`)",
265 1usize,
266 __vt.len(),
267 <AndroidJavaObject as ::unity::ClassIdentity>::NAME,
268 "Finalize",
269 )
270 });
271 let __inner: extern "C" fn(AndroidJavaObject, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__vi.method_ptr);
272 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
273 __inner(__receiver, __mi)
274 }
275 }
276 }
277 #[doc = "`Dispose(bool)` overload"]
278 fn dispose_2(self, disposing: impl ::core::convert::Into<bool>) -> () {
279 unsafe {
280 let __receiver = <AndroidJavaObject as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
281 {
282 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
283 let __vi = *__vt.get(5usize).unwrap_or_else(|| {
284 panic!(
285 "unity: virtual slot {}
286 out of range (vtable len {}
287) on the runtime class behind {}
288 (method `{}
289`)",
290 5usize,
291 __vt.len(),
292 <AndroidJavaObject as ::unity::ClassIdentity>::NAME,
293 "Dispose",
294 )
295 });
296 let __inner: extern "C" fn(AndroidJavaObject, bool, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__vi.method_ptr);
297 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
298 __inner(__receiver, ::core::convert::Into::into(disposing), __mi)
299 }
300 }
301 }
302}
303
304#[cfg(feature = "unity_engine-androidjavaobject")]
305impl<__T: IAndroidJavaObject> IAndroidJavaObjectMethods for __T {}
306
307#[cfg(feature = "unity_engine-androidjavaobject")]
308impl AndroidJavaObject {
309 pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
310 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
311 }
312
313 pub fn dispose_method_info() -> &'static ::unity::il2cpp::MethodInfo {
314 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
315 }
316
317 pub fn get_raw_object_method_info() -> &'static ::unity::il2cpp::MethodInfo {
318 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
319 }
320
321 pub fn get_raw_class_method_info() -> &'static ::unity::il2cpp::MethodInfo {
322 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
323 }
324
325 pub fn debug_print_method_info() -> &'static ::unity::il2cpp::MethodInfo {
326 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[6]
327 }
328
329 pub fn android_java_object_method_info() -> &'static ::unity::il2cpp::MethodInfo {
330 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[7]
331 }
332
333 pub fn ctor_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
334 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[8]
335 }
336
337 pub fn ctor_3_method_info() -> &'static ::unity::il2cpp::MethodInfo {
338 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[9]
339 }
340
341 pub fn finalize_method_info() -> &'static ::unity::il2cpp::MethodInfo {
342 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[10]
343 }
344
345 pub fn dispose_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
346 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[11]
347 }
348
349 pub fn android_java_object_delete_local_ref_method_info() -> &'static ::unity::il2cpp::MethodInfo {
350 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[14]
351 }
352
353 pub fn android_java_class_delete_local_ref_method_info() -> &'static ::unity::il2cpp::MethodInfo {
354 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[15]
355 }
356
357 pub fn cctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
358 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[18]
359 }
360}
361
362#[cfg(feature = "unity_engine-androidjavaobject")]
363impl AndroidJavaObject {
364 #[doc = "Direct (non-virtual) call to `AndroidJavaObject`'s own `Dispose`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
365 pub unsafe fn dispose(this: impl ::core::convert::Into<::unity::IlInstance>) -> () {
366 let __mi = Self::dispose_method_info();
367 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__mi.method_ptr);
368 __inner(this.into(), ::core::option::Option::None)
369 }
370
371 #[doc = "Direct (non-virtual) call to `AndroidJavaObject`'s own `Finalize`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
372 pub unsafe fn finalize(this: impl ::core::convert::Into<::unity::IlInstance>) -> () {
373 let __mi = Self::finalize_method_info();
374 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__mi.method_ptr);
375 __inner(this.into(), ::core::option::Option::None)
376 }
377
378 #[doc = "Direct (non-virtual) call to `AndroidJavaObject`'s own `Dispose`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
379 pub unsafe fn dispose_2(this: impl ::core::convert::Into<::unity::IlInstance>, disposing: bool) -> () {
380 let __mi = Self::dispose_2_method_info();
381 let __inner: extern "C" fn(::unity::IlInstance, bool, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__mi.method_ptr);
382 __inner(this.into(), disposing, ::core::option::Option::None)
383 }
384}
385
386#[cfg(feature = "unity_engine-androidjavaobject")]
387impl AndroidJavaObject {
388 #[doc = "`.ctor(::unity::Il2CppString, ::unity::Array<crate::system::object::Object>)` — overload selector"]
389 pub fn new(class_name: ::unity::Il2CppString, args: ::unity::Array<crate::system::object::Object>) -> Self {
390 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
391 panic!(
392 "{}
393::{}
394 failed to instantiate",
395 ::core::stringify!(AndroidJavaObject),
396 ::core::stringify!(new),
397 )
398 });
399 <Self as IAndroidJavaObjectMethods>::ctor(this, class_name, args);
400 this
401 }
402
403 #[doc = "`.ctor(::unity::IntPtr)` — overload selector"]
404 pub fn new_2(jobject: ::unity::IntPtr) -> Self {
405 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
406 panic!(
407 "{}
408::{}
409 failed to instantiate",
410 ::core::stringify!(AndroidJavaObject),
411 ::core::stringify!(new_2),
412 )
413 });
414 <Self as IAndroidJavaObjectMethods>::ctor_2(this, jobject);
415 this
416 }
417
418 #[doc = "`.ctor()` — no args"]
419 pub fn new_3() -> Self {
420 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
421 panic!(
422 "{}
423::{}
424 failed to instantiate",
425 ::core::stringify!(AndroidJavaObject),
426 ::core::stringify!(new_3),
427 )
428 });
429 <Self as IAndroidJavaObjectMethods>::ctor_3(this);
430 this
431 }
432}
433
434#[cfg(feature = "unity_engine-androidjavaobject")]
435#[doc(hidden)]
436pub mod prelude {
437 pub use super::{AndroidJavaObject, IAndroidJavaObject, IAndroidJavaObjectMethods};
438 pub use crate::system::object::IObject;
439 #[cfg(feature = "system-object")]
440 pub use crate::system::object::IObjectMethods;
441}