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