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