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!(
    /// A
    /// `GCGearShifterElement`object represents an attached gear shifter.  Both
    /// pattern and sequential gear shifters are supported.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcgearshifterelement?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct GCGearShifterElement;
);

#[cfg(feature = "GCPhysicalInputElement")]
extern_conformance!(
    unsafe impl GCPhysicalInputElement for GCGearShifterElement {}
);

extern_conformance!(
    unsafe impl NSObjectProtocol for GCGearShifterElement {}
);

impl GCGearShifterElement {
    extern_methods!(
        #[cfg(feature = "GCSwitchPositionInput")]
        /// Get the input reporting the position of the pattern gear shifter.  If this
        /// property is
        /// `nil,`the gear shifter is not a pattern gear shifter.
        ///
        /// In the returned input, a position of
        /// `-1`corresponds to the "reverse gear".
        /// A position of
        /// `0`corresponds to the neutral gear.
        #[unsafe(method(patternInput))]
        #[unsafe(method_family = none)]
        pub unsafe fn patternInput(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn GCSwitchPositionInput>>>;

        #[cfg(feature = "GCRelativeInput")]
        /// Get the input reporting changes to the sequential gear shifter.  If this
        /// property is
        /// `nil,`the gear shifter is not a sequential gear shifter.
        #[unsafe(method(sequentialInput))]
        #[unsafe(method_family = none)]
        pub unsafe fn sequentialInput(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn GCRelativeInput>>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl GCGearShifterElement {
    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>;
    );
}