objc2_game_controller/generated/
GCInputNames.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use objc2::__framework_prelude::*;
4
5use crate::*;
6
7extern_protocol!(
8    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcphysicalinputelementname?language=objc)
9    pub unsafe trait GCPhysicalInputElementName {}
10);
11
12extern_protocol!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcbuttonelementname?language=objc)
14    pub unsafe trait GCButtonElementName: GCPhysicalInputElementName {}
15);
16
17extern_protocol!(
18    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcaxiselementname?language=objc)
19    pub unsafe trait GCAxisElementName: GCPhysicalInputElementName {}
20);
21
22extern_protocol!(
23    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcswitchelementname?language=objc)
24    pub unsafe trait GCSwitchElementName: GCPhysicalInputElementName {}
25);
26
27extern_protocol!(
28    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcdirectionpadelementname?language=objc)
29    pub unsafe trait GCDirectionPadElementName: GCPhysicalInputElementName {}
30);
31
32extern "C" {
33    /// Identifies the button element located at the top-left/right of a gamepad,
34    /// between the left/right shoulder button and the gamepad's horizontal center.
35    ///
36    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputleftbumper?language=objc)
37    pub static GCInputLeftBumper: Option<&'static GCInputButtonName>;
38}
39
40extern "C" {
41    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputrightbumper?language=objc)
42    pub static GCInputRightBumper: Option<&'static GCInputButtonName>;
43}
44
45#[inline]
46pub unsafe extern "C-unwind" fn GCInputBackLeftButton(
47    position: NSInteger,
48) -> Option<Retained<GCInputButtonName>> {
49    extern "C-unwind" {
50        fn GCInputBackLeftButton(position: NSInteger) -> *mut GCInputButtonName;
51    }
52    let ret = unsafe { GCInputBackLeftButton(position) };
53    unsafe { Retained::retain_autoreleased(ret) }
54}
55
56#[inline]
57pub unsafe extern "C-unwind" fn GCInputBackRightButton(
58    position: NSInteger,
59) -> Option<Retained<GCInputButtonName>> {
60    extern "C-unwind" {
61        fn GCInputBackRightButton(position: NSInteger) -> *mut GCInputButtonName;
62    }
63    let ret = unsafe { GCInputBackRightButton(position) };
64    unsafe { Retained::retain_autoreleased(ret) }
65}