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
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_protocol!(
/// An object conforming to
/// `GCDevicePhysicalInputState`contains the state of
/// a device's physical inputs. This may be either the "live" physical input
/// state if the same object also conforms to
/// `GCDevicePhysicalInput,`or a
/// snapshot of the physical input state.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcdevicephysicalinputstate?language=objc)
pub unsafe trait GCDevicePhysicalInputState: NSObjectProtocol {
#[cfg(feature = "GCDevice")]
/// The device that this profile is mapping input from.
#[unsafe(method(device))]
#[unsafe(method_family = none)]
unsafe fn device(&self) -> Option<Retained<ProtocolObject<dyn GCDevice>>>;
/// The internal time stamp of the last event.
///
/// This time interval is not relative to any specific point in time. Your
/// application can subtract a previous timestamp from the returned timestamp to
/// determine the time (in seconds) between events. The
/// `lastEventTimestamp`of
/// the inputs from two different devices can be compared to determine which event
/// occurred first.
#[unsafe(method(lastEventTimestamp))]
#[unsafe(method_family = none)]
unsafe fn lastEventTimestamp(&self) -> NSTimeInterval;
/// The interval (in seconds) between the timestamp of the last event and the
/// current time.
///
/// This value should be treated as a lower bound of the event latency. It may
/// not include (wired or wireless) transmission latency, or latency accrued on
/// the device before the event was transmitted to the host.
///
///
/// Note: If the system has gone to sleep between when the event occurred and when this
/// property is read, the returned value may not reflect the true latency.
#[unsafe(method(lastEventLatency))]
#[unsafe(method_family = none)]
unsafe fn lastEventLatency(&self) -> NSTimeInterval;
#[cfg(all(feature = "GCInputNames", feature = "GCPhysicalInputElement"))]
/// The following properties allow for runtime lookup of any input element on a
/// profile, when provided with a valid alias.
#[unsafe(method(elements))]
#[unsafe(method_family = none)]
unsafe fn elements(
&self,
) -> Retained<
GCPhysicalInputElementCollection<NSString, ProtocolObject<dyn GCPhysicalInputElement>>,
>;
#[cfg(all(
feature = "GCButtonElement",
feature = "GCInputNames",
feature = "GCPhysicalInputElement"
))]
#[unsafe(method(buttons))]
#[unsafe(method_family = none)]
unsafe fn buttons(
&self,
) -> Retained<GCPhysicalInputElementCollection<NSString, ProtocolObject<dyn GCButtonElement>>>;
#[cfg(all(
feature = "GCAxisElement",
feature = "GCInputNames",
feature = "GCPhysicalInputElement"
))]
#[unsafe(method(axes))]
#[unsafe(method_family = none)]
unsafe fn axes(
&self,
) -> Retained<GCPhysicalInputElementCollection<NSString, ProtocolObject<dyn GCAxisElement>>>;
#[cfg(all(
feature = "GCInputNames",
feature = "GCPhysicalInputElement",
feature = "GCSwitchElement"
))]
#[unsafe(method(switches))]
#[unsafe(method_family = none)]
unsafe fn switches(
&self,
) -> Retained<GCPhysicalInputElementCollection<NSString, ProtocolObject<dyn GCSwitchElement>>>;
#[cfg(all(
feature = "GCDirectionPadElement",
feature = "GCInputNames",
feature = "GCPhysicalInputElement"
))]
#[unsafe(method(dpads))]
#[unsafe(method_family = none)]
unsafe fn dpads(
&self,
) -> Retained<
GCPhysicalInputElementCollection<NSString, ProtocolObject<dyn GCDirectionPadElement>>,
>;
#[cfg(feature = "GCPhysicalInputElement")]
/// Profile elements can be accessed using keyed subscript notation, with a valid alias of its inputs.
///
///
///
///
/// Note: Equivalent to -elements
#[unsafe(method(objectForKeyedSubscript:))]
#[unsafe(method_family = none)]
unsafe fn objectForKeyedSubscript(
&self,
key: &NSString,
) -> Option<Retained<ProtocolObject<dyn GCPhysicalInputElement>>>;
}
);