1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern "C" {
/// Use these constants with NSNotificationCenter to listen to connection and disconnection events.
///
/// Use GCRacingWheelDidConnectNotification for observing connections of racing wheels.
/// Use GCRacingWheelDidDisconnectNotification for observing disconnections of racing wheels.
///
/// Connections and disconnections of racing wheels will also be reflected in the connectedRacingWheels array
/// of the GCRacingWheel class.
///
/// The 'object' property of the notification will contain the GCRacingWheel that was connected or disconnected.
/// For example:
///
/// - (void)wheelDidConnect:(NSNotification *)note {
/// GCRacingWheel *controller = note.object;
/// ....
/// }
///
///
/// See: NSNotificationCenter
///
/// See: GCRacingWheel.connectedRacingWheels
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcracingwheeldidconnectnotification?language=objc)
pub static GCRacingWheelDidConnectNotification: &'static NSString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcracingwheeldiddisconnectnotification?language=objc)
pub static GCRacingWheelDidDisconnectNotification: &'static NSString;
}
extern_class!(
/// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcracingwheel?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct GCRacingWheel;
);
#[cfg(feature = "GCDevice")]
extern_conformance!(
unsafe impl GCDevice for GCRacingWheel {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for GCRacingWheel {}
);
impl GCRacingWheel {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
/// Get the collection of racing wheels currently attached to the system.
///
///
/// See: GCRacingWheelDidConnectNotification
///
/// See: GCRacingWheelDidDisconnectNotification
#[unsafe(method(connectedRacingWheels))]
#[unsafe(method_family = none)]
pub unsafe fn connectedRacingWheels() -> Retained<NSSet<GCRacingWheel>>;
/// A GCRacingWheel must be acquired before your application can begin receiving
/// events from it. Prior to acquisition, your application may only query the
/// properties of the racing wheel. Acquisition is exclusive and may fail.
#[unsafe(method(acquireDeviceWithError:_))]
#[unsafe(method_family = none)]
pub unsafe fn acquireDeviceWithError(&self) -> Result<(), Retained<NSError>>;
/// Releases a previous acquisition of the racing wheel.
#[unsafe(method(relinquishDevice))]
#[unsafe(method_family = none)]
pub unsafe fn relinquishDevice(&self);
/// Checks if the racing wheel has been acquired by the application.
///
/// This property is observable.
#[unsafe(method(isAcquired))]
#[unsafe(method_family = none)]
pub unsafe fn isAcquired(&self) -> bool;
#[cfg(feature = "GCRacingWheelInput")]
/// Get the physical input profile for the racing wheel.
#[unsafe(method(wheelInput))]
#[unsafe(method_family = none)]
pub unsafe fn wheelInput(&self) -> Retained<GCRacingWheelInput>;
/// A GCRacingWheel may represent a real device managed by the operating system,
/// or a snapshot created by the developer.
///
///
/// See: capture
#[unsafe(method(isSnapshot))]
#[unsafe(method_family = none)]
pub unsafe fn isSnapshot(&self) -> bool;
/// Polls the state vector of the racing wheel and saves it to a new instance of
/// GCRacingWheel.
///
/// If your application is heavily multithreaded this may also be useful to
/// guarantee atomicity of input handling as a snapshot will not change based on
/// user input once it is taken.
///
///
/// See: snapshot
///
/// Returns: A new racing wheel with the duplicated state vector of the receiver.
#[unsafe(method(capture))]
#[unsafe(method_family = none)]
pub unsafe fn capture(&self) -> Retained<GCRacingWheel>;
);
}
/// Methods declared on superclass `NSObject`.
impl GCRacingWheel {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}