objc2-gameplay-kit 0.3.2

Bindings to the GameplayKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-scene-kit")]
use objc2_scene_kit::*;

use crate::*;

extern_class!(
    /// A component that encapsulates a SceneKit node.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/gameplaykit/gkscnnodecomponent?language=objc)
    #[unsafe(super(GKComponent, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "GKComponent")]
    pub struct GKSCNNodeComponent;
);

#[cfg(all(feature = "GKAgent", feature = "GKComponent"))]
extern_conformance!(
    unsafe impl GKAgentDelegate for GKSCNNodeComponent {}
);

#[cfg(feature = "GKComponent")]
extern_conformance!(
    unsafe impl NSCoding for GKSCNNodeComponent {}
);

#[cfg(feature = "GKComponent")]
extern_conformance!(
    unsafe impl NSCopying for GKSCNNodeComponent {}
);

#[cfg(feature = "GKComponent")]
unsafe impl CopyingHelper for GKSCNNodeComponent {
    type Result = Self;
}

#[cfg(feature = "GKComponent")]
extern_conformance!(
    unsafe impl NSObjectProtocol for GKSCNNodeComponent {}
);

#[cfg(feature = "GKComponent")]
extern_conformance!(
    unsafe impl NSSecureCoding for GKSCNNodeComponent {}
);

#[cfg(feature = "GKComponent")]
impl GKSCNNodeComponent {
    extern_methods!(
        #[cfg(feature = "objc2-scene-kit")]
        /// Creates a component that encapsulate the given SceneKit node. When the component is
        /// added to an entity, the SCNNode's entity property will be set.
        ///
        ///
        /// Parameter `node`: Node to associate with the component.
        ///
        /// See: SCNNode.entity
        #[unsafe(method(componentWithNode:))]
        #[unsafe(method_family = none)]
        pub unsafe fn componentWithNode(node: &SCNNode) -> Retained<Self>;

        #[cfg(feature = "objc2-scene-kit")]
        /// Initializes component to encapsulate the given SceneKit node. When the component is
        /// added to an entity, the SCNNode's entity property will be set.
        ///
        ///
        /// Parameter `node`: Node to associate with the component.
        ///
        /// See: SCNNode.entity
        #[unsafe(method(initWithNode:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithNode(this: Allocated<Self>, node: &SCNNode) -> Retained<Self>;

        #[cfg(feature = "objc2-scene-kit")]
        /// The SceneKit node this component encapsulates.
        #[unsafe(method(node))]
        #[unsafe(method_family = none)]
        pub unsafe fn node(&self) -> Retained<SCNNode>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "GKComponent")]
impl GKSCNNodeComponent {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}