objc2-game-controller 0.3.2

Bindings to the GameController 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 crate::*;

extern_class!(
    /// The GCDualShockGamepad profile represents any supported DualShock 4 controller.
    ///
    ///
    /// See: GCExtendedGamepad
    ///
    /// See: GCMotion
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcdualshockgamepad?language=objc)
    #[unsafe(super(GCExtendedGamepad, GCPhysicalInputProfile, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "GCExtendedGamepad", feature = "GCPhysicalInputProfile"))]
    pub struct GCDualShockGamepad;
);

#[cfg(all(feature = "GCExtendedGamepad", feature = "GCPhysicalInputProfile"))]
extern_conformance!(
    unsafe impl NSObjectProtocol for GCDualShockGamepad {}
);

#[cfg(all(feature = "GCExtendedGamepad", feature = "GCPhysicalInputProfile"))]
impl GCDualShockGamepad {
    extern_methods!(
        #[cfg(all(feature = "GCControllerButtonInput", feature = "GCControllerElement"))]
        /// DualShock controllers have a touchpad with a button and two-finger tracking.
        #[unsafe(method(touchpadButton))]
        #[unsafe(method_family = none)]
        pub unsafe fn touchpadButton(&self) -> Option<Retained<GCControllerButtonInput>>;

        #[cfg(all(feature = "GCControllerDirectionPad", feature = "GCControllerElement"))]
        #[unsafe(method(touchpadPrimary))]
        #[unsafe(method_family = none)]
        pub unsafe fn touchpadPrimary(&self) -> Option<Retained<GCControllerDirectionPad>>;

        #[cfg(all(feature = "GCControllerDirectionPad", feature = "GCControllerElement"))]
        #[unsafe(method(touchpadSecondary))]
        #[unsafe(method_family = none)]
        pub unsafe fn touchpadSecondary(&self) -> Option<Retained<GCControllerDirectionPad>>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(all(feature = "GCExtendedGamepad", feature = "GCPhysicalInputProfile"))]
impl GCDualShockGamepad {
    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>;
    );
}