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_protocol!(
    /// An object conforming to
    /// `GCButtonElement`represents a momentary switch,
    /// such as a push button.  A button's input only asserts while the user is
    /// interacting with it, and then returns to a preferred state (not pressed, not
    /// touched).
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcbuttonelement?language=objc)
    #[cfg(feature = "GCPhysicalInputElement")]
    pub unsafe trait GCButtonElement: GCPhysicalInputElement {
        #[cfg(all(feature = "GCLinearInput", feature = "GCPressedStateInput"))]
        /// Get the input containing the pressed state of the button.
        #[unsafe(method(pressedInput))]
        #[unsafe(method_family = none)]
        unsafe fn pressedInput(
            &self,
        ) -> Retained<AnyObject /* GCPressedStateInput+ GCLinearInput */>;

        #[cfg(feature = "GCTouchedStateInput")]
        /// Get the input containing the touched state of the button.
        ///
        /// Some buttons feature capacitive touch capabilities where the user can touch the
        /// button without pressing it.
        #[unsafe(method(touchedInput))]
        #[unsafe(method_family = none)]
        unsafe fn touchedInput(&self) -> Option<Retained<ProtocolObject<dyn GCTouchedStateInput>>>;

        #[cfg(feature = "GCLinearInput")]
        /// Get the input containing the measured force applied to the button.
        ///
        /// Some buttons feature load cells (also known as button force transducers)
        /// capable of measuring applied mechanical force.
        #[unsafe(method(forceInput))]
        #[unsafe(method_family = none)]
        unsafe fn forceInput(&self) -> Option<Retained<ProtocolObject<dyn GCLinearInput>>>;
    }
);