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 objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcphysicalinputelementname?language=objc)
    pub unsafe trait GCPhysicalInputElementName {}
);

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcbuttonelementname?language=objc)
    pub unsafe trait GCButtonElementName: GCPhysicalInputElementName {}
);

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcaxiselementname?language=objc)
    pub unsafe trait GCAxisElementName: GCPhysicalInputElementName {}
);

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcswitchelementname?language=objc)
    pub unsafe trait GCSwitchElementName: GCPhysicalInputElementName {}
);

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcdirectionpadelementname?language=objc)
    pub unsafe trait GCDirectionPadElementName: GCPhysicalInputElementName {}
);

/// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputelementname?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
pub type GCInputElementName = NSString;

/// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputbuttonname?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
pub type GCInputButtonName = NSString;

/// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputaxisname?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
pub type GCInputAxisName = NSString;

/// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputswitchname?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
pub type GCInputSwitchName = NSString;

/// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputdirectionpadname?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
pub type GCInputDirectionPadName = NSString;

extern "C" {
    /// A set of commonly used strings that can be used to access controller buttons
    ///
    ///
    /// See: GCController.h
    ///
    /// See: GCPhysicalInputProfile.h
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputbuttona?language=objc)
    pub static GCInputButtonA: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputbuttonb?language=objc)
    pub static GCInputButtonB: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputbuttonx?language=objc)
    pub static GCInputButtonX: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputbuttony?language=objc)
    pub static GCInputButtonY: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputdirectionpad?language=objc)
    pub static GCInputDirectionPad: Option<&'static GCInputDirectionPadName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputthumbstick?language=objc)
    pub static GCInputThumbstick: Option<&'static GCInputDirectionPadName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputleftthumbstick?language=objc)
    pub static GCInputLeftThumbstick: Option<&'static GCInputDirectionPadName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputrightthumbstick?language=objc)
    pub static GCInputRightThumbstick: Option<&'static GCInputDirectionPadName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputthumbstickbutton?language=objc)
    pub static GCInputThumbstickButton: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputleftthumbstickbutton?language=objc)
    pub static GCInputLeftThumbstickButton: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputrightthumbstickbutton?language=objc)
    pub static GCInputRightThumbstickButton: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputgripbutton?language=objc)
    pub static GCInputGripButton: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputleftshoulder?language=objc)
    pub static GCInputLeftShoulder: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputrightshoulder?language=objc)
    pub static GCInputRightShoulder: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// Identifies the button element located at the top-left/right of a gamepad,
    /// between the left/right shoulder button and the gamepad's horizontal center.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputleftbumper?language=objc)
    pub static GCInputLeftBumper: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputrightbumper?language=objc)
    pub static GCInputRightBumper: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputtrigger?language=objc)
    pub static GCInputTrigger: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputlefttrigger?language=objc)
    pub static GCInputLeftTrigger: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputrighttrigger?language=objc)
    pub static GCInputRightTrigger: Option<&'static GCInputButtonName>;
}

#[inline]
pub unsafe extern "C-unwind" fn GCInputBackLeftButton(
    position: NSInteger,
) -> Option<Retained<GCInputButtonName>> {
    extern "C-unwind" {
        fn GCInputBackLeftButton(position: NSInteger) -> *mut GCInputButtonName;
    }
    let ret = unsafe { GCInputBackLeftButton(position) };
    unsafe { Retained::retain_autoreleased(ret) }
}

#[inline]
pub unsafe extern "C-unwind" fn GCInputBackRightButton(
    position: NSInteger,
) -> Option<Retained<GCInputButtonName>> {
    extern "C-unwind" {
        fn GCInputBackRightButton(position: NSInteger) -> *mut GCInputButtonName;
    }
    let ret = unsafe { GCInputBackRightButton(position) };
    unsafe { Retained::retain_autoreleased(ret) }
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputbuttonhome?language=objc)
    pub static GCInputButtonHome: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputbuttonmenu?language=objc)
    pub static GCInputButtonMenu: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputbuttonoptions?language=objc)
    pub static GCInputButtonOptions: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputbuttonshare?language=objc)
    pub static GCInputButtonShare: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// A set of strings commonly used to access Xbox buttons
    ///
    ///
    /// See: GCController.h
    ///
    /// See: GCPhysicalInputProfile.h
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputxboxpaddleone?language=objc)
    pub static GCInputXboxPaddleOne: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputxboxpaddletwo?language=objc)
    pub static GCInputXboxPaddleTwo: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputxboxpaddlethree?language=objc)
    pub static GCInputXboxPaddleThree: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputxboxpaddlefour?language=objc)
    pub static GCInputXboxPaddleFour: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// A set of strings commonly used to access DualShock buttons
    ///
    ///
    /// See: GCController.h
    ///
    /// See: GCPhysicalInputProfile.h
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputdualshocktouchpadone?language=objc)
    pub static GCInputDualShockTouchpadOne: Option<&'static GCInputDirectionPadName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputdualshocktouchpadtwo?language=objc)
    pub static GCInputDualShockTouchpadTwo: Option<&'static GCInputDirectionPadName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputdualshocktouchpadbutton?language=objc)
    pub static GCInputDualShockTouchpadButton: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// A set of strings commonly used by racing wheels.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputsteeringwheel?language=objc)
    pub static GCInputSteeringWheel: Option<&'static GCInputAxisName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputshifter?language=objc)
    pub static GCInputShifter: Option<&'static GCInputElementName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputpedalaccelerator?language=objc)
    pub static GCInputPedalAccelerator: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputpedalbrake?language=objc)
    pub static GCInputPedalBrake: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputpedalclutch?language=objc)
    pub static GCInputPedalClutch: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputleftpaddle?language=objc)
    pub static GCInputLeftPaddle: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputrightpaddle?language=objc)
    pub static GCInputRightPaddle: Option<&'static GCInputButtonName>;
}

/// Gets the name of an arcade button at a certain position.
#[inline]
pub unsafe extern "C-unwind" fn GCInputArcadeButtonName(
    row: NSInteger,
    column: NSInteger,
) -> Option<Retained<GCInputButtonName>> {
    extern "C-unwind" {
        fn GCInputArcadeButtonName(row: NSInteger, column: NSInteger) -> *mut GCInputButtonName;
    }
    let ret = unsafe { GCInputArcadeButtonName(row, column) };
    unsafe { Retained::retain_autoreleased(ret) }
}

extern "C" {
    /// The stylus tip button used to detect contact with a surface.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputstylustip?language=objc)
    pub static GCInputStylusTip: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// The stylus button used for interacting with virtual objects.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputstylusprimarybutton?language=objc)
    pub static GCInputStylusPrimaryButton: Option<&'static GCInputButtonName>;
}

extern "C" {
    /// The stylus button used for drawing and writing in air.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputstylussecondarybutton?language=objc)
    pub static GCInputStylusSecondaryButton: Option<&'static GCInputButtonName>;
}