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 GCXboxGamepad profile represents any supported Xbox controller.
    ///
    ///
    /// See: GCExtendedGamepad
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcxboxgamepad?language=objc)
    #[unsafe(super(GCExtendedGamepad, GCPhysicalInputProfile, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "GCExtendedGamepad", feature = "GCPhysicalInputProfile"))]
    pub struct GCXboxGamepad;
);

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

#[cfg(all(feature = "GCExtendedGamepad", feature = "GCPhysicalInputProfile"))]
impl GCXboxGamepad {
    extern_methods!(
        #[cfg(all(feature = "GCControllerButtonInput", feature = "GCControllerElement"))]
        /// Some Xbox controller variants can support up to four additional buttons.
        ///
        ///
        ///
        ///
        /// Note: The four extra digital buttons on the Xbox Elite Wireless Controller are only directly addressable when the controller
        /// is on its default mapping profile. Otherwise, the paddle buttons are directly bound to other inputs on the controller.
        #[unsafe(method(paddleButton1))]
        #[unsafe(method_family = none)]
        pub unsafe fn paddleButton1(&self) -> Option<Retained<GCControllerButtonInput>>;

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

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

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

        #[cfg(all(feature = "GCControllerButtonInput", feature = "GCControllerElement"))]
        /// Some Xbox controller variants feature a Share button.
        ///
        ///
        /// has a Share button.
        ///
        ///
        /// Note: The Share button is reserved by the system for screenshot and video recording gestures. If you wish to disable these
        /// gestures in your app and take control of the Share button, set buttonShare.preferredSystemGestureState to
        /// GCSystemGestureStateDisabled.
        #[unsafe(method(buttonShare))]
        #[unsafe(method_family = none)]
        pub unsafe fn buttonShare(&self) -> Option<Retained<GCControllerButtonInput>>;
    );
}

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