objc2_gameplay_kit/generated/
GKSKNodeComponent.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#[cfg(feature = "objc2-sprite-kit")]
8use objc2_sprite_kit::*;
9
10use crate::*;
11
12extern_class!(
13    /// A component that encapsulates a SpriteKit node.
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/gameplaykit/gksknodecomponent?language=objc)
16    #[unsafe(super(GKComponent, NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    #[cfg(feature = "GKComponent")]
19    pub struct GKSKNodeComponent;
20);
21
22#[cfg(all(feature = "GKAgent", feature = "GKComponent"))]
23extern_conformance!(
24    unsafe impl GKAgentDelegate for GKSKNodeComponent {}
25);
26
27#[cfg(feature = "GKComponent")]
28extern_conformance!(
29    unsafe impl NSCoding for GKSKNodeComponent {}
30);
31
32#[cfg(feature = "GKComponent")]
33extern_conformance!(
34    unsafe impl NSCopying for GKSKNodeComponent {}
35);
36
37#[cfg(feature = "GKComponent")]
38unsafe impl CopyingHelper for GKSKNodeComponent {
39    type Result = Self;
40}
41
42#[cfg(feature = "GKComponent")]
43extern_conformance!(
44    unsafe impl NSObjectProtocol for GKSKNodeComponent {}
45);
46
47#[cfg(feature = "GKComponent")]
48extern_conformance!(
49    unsafe impl NSSecureCoding for GKSKNodeComponent {}
50);
51
52#[cfg(feature = "GKComponent")]
53impl GKSKNodeComponent {
54    extern_methods!(
55        #[cfg(feature = "objc2-sprite-kit")]
56        #[cfg(target_os = "macos")]
57        /// Creates a component that encapsulate the given SpriteKit node. When the component is
58        /// added to an entity, the SKNode's entity property will be set.
59        ///
60        ///
61        /// Parameter `node`: Node to associate with the component.
62        ///
63        /// See: SKNode.entity
64        #[unsafe(method(componentWithNode:))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn componentWithNode(node: &SKNode) -> Retained<Self>;
67
68        #[cfg(feature = "objc2-sprite-kit")]
69        #[cfg(target_os = "macos")]
70        /// Initializes component to encapsulate the given SpriteKit node. When the component is
71        /// added to an entity, the SKNode's entity property will be set.
72        ///
73        ///
74        /// Parameter `node`: Node to associate with the component.
75        ///
76        /// See: SKNode.entity
77        #[unsafe(method(initWithNode:))]
78        #[unsafe(method_family = init)]
79        pub unsafe fn initWithNode(this: Allocated<Self>, node: &SKNode) -> Retained<Self>;
80
81        #[cfg(feature = "objc2-sprite-kit")]
82        #[cfg(target_os = "macos")]
83        /// The SpriteKit node this component encapsulates.
84        #[unsafe(method(node))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn node(&self, mtm: MainThreadMarker) -> Retained<SKNode>;
87
88        #[cfg(feature = "objc2-sprite-kit")]
89        #[cfg(target_os = "macos")]
90        /// Setter for [`node`][Self::node].
91        #[unsafe(method(setNode:))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn setNode(&self, node: &SKNode);
94    );
95}
96
97/// Methods declared on superclass `NSObject`.
98#[cfg(feature = "GKComponent")]
99impl GKSKNodeComponent {
100    extern_methods!(
101        #[unsafe(method(init))]
102        #[unsafe(method_family = init)]
103        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
104
105        #[unsafe(method(new))]
106        #[unsafe(method_family = new)]
107        pub unsafe fn new() -> Retained<Self>;
108    );
109}