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