objc2_sprite_kit/generated/
SKTextureAtlas.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/spritekit/sktextureatlas?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct SKTextureAtlas;
15);
16
17extern_conformance!(
18    unsafe impl NSCoding for SKTextureAtlas {}
19);
20
21extern_conformance!(
22    unsafe impl NSObjectProtocol for SKTextureAtlas {}
23);
24
25extern_conformance!(
26    unsafe impl NSSecureCoding for SKTextureAtlas {}
27);
28
29impl SKTextureAtlas {
30    extern_methods!(
31        #[unsafe(method(atlasNamed:))]
32        #[unsafe(method_family = none)]
33        pub unsafe fn atlasNamed(name: &NSString) -> Retained<Self>;
34
35        #[unsafe(method(atlasWithDictionary:))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn atlasWithDictionary(
38            properties: &NSDictionary<NSString, AnyObject>,
39        ) -> Retained<Self>;
40
41        #[cfg(feature = "SKTexture")]
42        #[unsafe(method(textureNamed:))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn textureNamed(&self, name: &NSString) -> Retained<SKTexture>;
45
46        #[cfg(feature = "block2")]
47        /// Start a texture atlas preload operation on an array of texture atlas
48        ///
49        ///
50        /// Parameter `textureAtlases`: an array of SKTextureAtlas to be preloaded
51        ///
52        /// Parameter `completionHandler`: will be called upon the preload completion
53        #[unsafe(method(preloadTextureAtlases:withCompletionHandler:))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn preloadTextureAtlases_withCompletionHandler(
56            texture_atlases: &NSArray<SKTextureAtlas>,
57            completion_handler: &block2::DynBlock<dyn Fn()>,
58        );
59
60        #[cfg(feature = "block2")]
61        /// Start a texture atlas preload operation on an array of texture atlas identifiers, error == nil if all atlases were found,
62        /// else an NSError is returned and the user info will contain a list of the atlases that couldn't be found
63        /// the ones that could be found are looked up and prefetched.
64        ///
65        ///
66        /// Parameter `atlasNames`: is an array of the SKTextureAtlas, that were located and preloaded.
67        ///
68        /// Parameter `completionHandler`: will be called upon the preload completion.
69        #[unsafe(method(preloadTextureAtlasesNamed:withCompletionHandler:))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn preloadTextureAtlasesNamed_withCompletionHandler(
72            atlas_names: &NSArray<NSString>,
73            completion_handler: &block2::DynBlock<
74                dyn Fn(*mut NSError, NonNull<NSArray<SKTextureAtlas>>),
75            >,
76        );
77
78        #[cfg(feature = "block2")]
79        /// Request that this texture atlas be loaded into vram on the next render update, with a callback handler.
80        #[unsafe(method(preloadWithCompletionHandler:))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn preloadWithCompletionHandler(
83            &self,
84            completion_handler: &block2::DynBlock<dyn Fn()>,
85        );
86
87        #[unsafe(method(textureNames))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn textureNames(&self) -> Retained<NSArray<NSString>>;
90    );
91}
92
93/// Methods declared on superclass `NSObject`.
94impl SKTextureAtlas {
95    extern_methods!(
96        #[unsafe(method(init))]
97        #[unsafe(method_family = init)]
98        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
99
100        #[unsafe(method(new))]
101        #[unsafe(method_family = new)]
102        pub unsafe fn new() -> Retained<Self>;
103    );
104}