objc2_game_controller/generated/
GCRacingWheelInput.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5
6use crate::*;
7
8extern_class!(
9    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcracingwheelinputstate?language=objc)
10    #[unsafe(super(NSObject))]
11    #[derive(Debug, PartialEq, Eq, Hash)]
12    pub struct GCRacingWheelInputState;
13);
14
15#[cfg(feature = "GCDevicePhysicalInputState")]
16extern_conformance!(
17    unsafe impl GCDevicePhysicalInputState for GCRacingWheelInputState {}
18);
19
20extern_conformance!(
21    unsafe impl NSObjectProtocol for GCRacingWheelInputState {}
22);
23
24impl GCRacingWheelInputState {
25    extern_methods!(
26        #[cfg(feature = "GCSteeringWheelElement")]
27        /// The steering wheel element.
28        #[unsafe(method(wheel))]
29        #[unsafe(method_family = none)]
30        pub unsafe fn wheel(&self) -> Retained<GCSteeringWheelElement>;
31
32        #[cfg(all(feature = "GCButtonElement", feature = "GCPhysicalInputElement"))]
33        #[unsafe(method(acceleratorPedal))]
34        #[unsafe(method_family = none)]
35        pub unsafe fn acceleratorPedal(
36            &self,
37        ) -> Option<Retained<ProtocolObject<dyn GCButtonElement>>>;
38
39        #[cfg(all(feature = "GCButtonElement", feature = "GCPhysicalInputElement"))]
40        #[unsafe(method(brakePedal))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn brakePedal(&self) -> Option<Retained<ProtocolObject<dyn GCButtonElement>>>;
43
44        #[cfg(all(feature = "GCButtonElement", feature = "GCPhysicalInputElement"))]
45        #[unsafe(method(clutchPedal))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn clutchPedal(&self) -> Option<Retained<ProtocolObject<dyn GCButtonElement>>>;
48
49        #[cfg(feature = "GCGearShifterElement")]
50        /// The element representing an attached gear shifter accessory.
51        ///
52        /// Note that this element only represents an external gear shifter accessory.
53        /// Many racing wheels have a pair of built in paddle buttons that can be used for
54        /// sequential gear shifting.  Those buttons are can be looked up with the
55        /// `GCInputLeftPaddle`and
56        /// `GCInputRightPaddle`input names.
57        #[unsafe(method(shifter))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn shifter(&self) -> Option<Retained<GCGearShifterElement>>;
60    );
61}
62
63/// Methods declared on superclass `NSObject`.
64impl GCRacingWheelInputState {
65    extern_methods!(
66        #[unsafe(method(init))]
67        #[unsafe(method_family = init)]
68        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
69
70        #[unsafe(method(new))]
71        #[unsafe(method_family = new)]
72        pub unsafe fn new() -> Retained<Self>;
73    );
74}
75
76extern_class!(
77    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcracingwheelinput?language=objc)
78    #[unsafe(super(GCRacingWheelInputState, NSObject))]
79    #[derive(Debug, PartialEq, Eq, Hash)]
80    pub struct GCRacingWheelInput;
81);
82
83#[cfg(all(
84    feature = "GCDevicePhysicalInput",
85    feature = "GCDevicePhysicalInputState"
86))]
87extern_conformance!(
88    unsafe impl GCDevicePhysicalInput for GCRacingWheelInput {}
89);
90
91#[cfg(feature = "GCDevicePhysicalInputState")]
92extern_conformance!(
93    unsafe impl GCDevicePhysicalInputState for GCRacingWheelInput {}
94);
95
96extern_conformance!(
97    unsafe impl NSObjectProtocol for GCRacingWheelInput {}
98);
99
100impl GCRacingWheelInput {
101    extern_methods!(
102        /// Polls the current state vector of the racing wheel input and saves it to a new
103        /// instance.
104        #[unsafe(method(capture))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn capture(&self) -> Retained<GCRacingWheelInputState>;
107
108        #[cfg(feature = "GCDevicePhysicalInputStateDiff")]
109        #[unsafe(method(nextInputState))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn nextInputState(&self) -> Option<Retained<GCRacingWheelInputState>>;
112    );
113}
114
115/// Methods declared on superclass `NSObject`.
116impl GCRacingWheelInput {
117    extern_methods!(
118        #[unsafe(method(init))]
119        #[unsafe(method_family = init)]
120        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
121
122        #[unsafe(method(new))]
123        #[unsafe(method_family = new)]
124        pub unsafe fn new() -> Retained<Self>;
125    );
126}