objc2_io_kit/generated/
hidsystem.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6use core::ptr::NonNull;
7#[cfg(feature = "dispatch2")]
8use dispatch2::*;
9#[cfg(feature = "objc2")]
10use objc2::__framework_prelude::*;
11use objc2_core_foundation::*;
12
13use crate::*;
14
15/// [Apple's documentation](https://developer.apple.com/documentation/iokit/event_system_version?language=objc)
16pub const EVENT_SYSTEM_VERSION: c_uint = 2;
17/// [Apple's documentation](https://developer.apple.com/documentation/iokit/knxeventdataversion?language=objc)
18pub const kNXEventDataVersion: c_uint = 2;
19/// [Apple's documentation](https://developer.apple.com/documentation/iokit/knxeventversion?language=objc)
20pub const kNXEventVersion: c_uint = 2;
21/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidkindkey?language=objc)
22pub const kIOHIDKindKey: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDKind\0") };
23/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidinterfaceidkey?language=objc)
24pub const kIOHIDInterfaceIDKey: &CStr =
25    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDInterfaceID\0") };
26/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidsubinterfaceidkey?language=objc)
27pub const kIOHIDSubinterfaceIDKey: &CStr =
28    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDSubinterfaceID\0") };
29/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidoriginalsubinterfaceidkey?language=objc)
30pub const kIOHIDOriginalSubinterfaceIDKey: &CStr =
31    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDOriginalSubinterfaceID\0") };
32/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidparameterskey?language=objc)
33pub const kIOHIDParametersKey: &CStr =
34    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDParameters\0") };
35/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidvirtualhidevice?language=objc)
36pub const kIOHIDVirtualHIDevice: &CStr =
37    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDVirtualDevice\0") };
38/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidkeyrepeatkey?language=objc)
39pub const kIOHIDKeyRepeatKey: &CStr =
40    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDKeyRepeat\0") };
41/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidinitialkeyrepeatkey?language=objc)
42pub const kIOHIDInitialKeyRepeatKey: &CStr =
43    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDInitialKeyRepeat\0") };
44/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidkeymappingkey?language=objc)
45pub const kIOHIDKeyMappingKey: &CStr =
46    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDKeyMapping\0") };
47/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidresetkeyboardkey?language=objc)
48pub const kIOHIDResetKeyboardKey: &CStr =
49    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDResetKeyboard\0") };
50/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidkeyboardmodifiermappingpairskey?language=objc)
51pub const kIOHIDKeyboardModifierMappingPairsKey: &CStr =
52    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDKeyboardModifierMappingPairs\0") };
53/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidkeyboardmodifiermappingsrckey?language=objc)
54pub const kIOHIDKeyboardModifierMappingSrcKey: &CStr =
55    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDKeyboardModifierMappingSrc\0") };
56/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidkeyboardmodifiermappingdstkey?language=objc)
57pub const kIOHIDKeyboardModifierMappingDstKey: &CStr =
58    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDKeyboardModifierMappingDst\0") };
59/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidkeyboardcapslockdoeslockkey?language=objc)
60pub const kIOHIDKeyboardCapsLockDoesLockKey: &CStr =
61    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDKeyboardCapsLockDoesLock\0") };
62/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidkeyboardsupportsf12ejectkey?language=objc)
63pub const kIOHIDKeyboardSupportsF12EjectKey: &CStr =
64    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDKeyboardSupportsF12Eject\0") };
65/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidkeyboardsupportedmodifierskey?language=objc)
66pub const kIOHIDKeyboardSupportedModifiersKey: &CStr =
67    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDKeyboardSupportedModifiers\0") };
68/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidkeyboardglobalmodifierskey?language=objc)
69pub const kIOHIDKeyboardGlobalModifiersKey: &CStr =
70    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDKeyboardGlobalModifiers\0") };
71/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidserviceglobalmodifiersusagekey?language=objc)
72pub const kIOHIDServiceGlobalModifiersUsageKey: &CStr =
73    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDServiceGlobalModifiersUsage\0") };
74/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidpointerresolutionkey?language=objc)
75pub const kIOHIDPointerResolutionKey: &CStr =
76    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDPointerResolution\0") };
77/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidresetpointerkey?language=objc)
78pub const kIOHIDResetPointerKey: &CStr =
79    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDResetPointer\0") };
80/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidpointerconvertabsolutekey?language=objc)
81pub const kIOHIDPointerConvertAbsoluteKey: &CStr =
82    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDPointerConvertAbsolute\0") };
83/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidpointercontacttomovekey?language=objc)
84pub const kIOHIDPointerContactToMoveKey: &CStr =
85    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDPointerContactToMove\0") };
86/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidpointerpressuretoclickkey?language=objc)
87pub const kIOHIDPointerPressureToClickKey: &CStr =
88    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDPointerPressureToClick\0") };
89/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidpointerbuttoncountkey?language=objc)
90pub const kIOHIDPointerButtonCountKey: &CStr =
91    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDPointerButtonCount\0") };
92/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidpointeraccelerationsettingskey?language=objc)
93pub const kIOHIDPointerAccelerationSettingsKey: &CStr =
94    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDPointerAccelerationSettings\0") };
95/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidpointeraccelerationtablekey?language=objc)
96pub const kIOHIDPointerAccelerationTableKey: &CStr =
97    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDPointerAccelerationTable\0") };
98/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidscrollresetkey?language=objc)
99pub const kIOHIDScrollResetKey: &CStr =
100    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollReset\0") };
101/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidscrollaccelerationtablekey?language=objc)
102pub const kIOHIDScrollAccelerationTableKey: &CStr =
103    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollAccelerationTable\0") };
104/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidscrollaccelerationtablexkey?language=objc)
105pub const kIOHIDScrollAccelerationTableXKey: &CStr =
106    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollAccelerationTableX\0") };
107/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidscrollaccelerationtableykey?language=objc)
108pub const kIOHIDScrollAccelerationTableYKey: &CStr =
109    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollAccelerationTableY\0") };
110/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidscrollaccelerationtablezkey?language=objc)
111pub const kIOHIDScrollAccelerationTableZKey: &CStr =
112    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollAccelerationTableZ\0") };
113/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidscrollmousebuttonkey?language=objc)
114pub const kIOHIDScrollMouseButtonKey: &CStr =
115    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollMouseButton\0") };
116/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidscrollzoommodifiermaskkey?language=objc)
117pub const kIOHIDScrollZoomModifierMaskKey: &CStr =
118    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollZoomModifierMask\0") };
119/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidclicktimekey?language=objc)
120pub const kIOHIDClickTimeKey: &CStr =
121    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDClickTime\0") };
122/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidclickspacekey?language=objc)
123pub const kIOHIDClickSpaceKey: &CStr =
124    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDClickSpace\0") };
125/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidwaitcursorframeintervalkey?language=objc)
126pub const kIOHIDWaitCursorFrameIntervalKey: &CStr =
127    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDWaitCursorFrameInterval\0") };
128/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidautodimthresholdkey?language=objc)
129pub const kIOHIDAutoDimThresholdKey: &CStr =
130    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAutoDimThreshold\0") };
131/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidautodimstatekey?language=objc)
132pub const kIOHIDAutoDimStateKey: &CStr =
133    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAutoDimState\0") };
134/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidautodimtimekey?language=objc)
135pub const kIOHIDAutoDimTimeKey: &CStr =
136    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAutoDimTime\0") };
137/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohididletimekey?language=objc)
138pub const kIOHIDIdleTimeKey: &CStr =
139    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDIdleTime\0") };
140/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidbrightnesskey?language=objc)
141pub const kIOHIDBrightnessKey: &CStr =
142    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDBrightness\0") };
143/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidautodimbrightnesskey?language=objc)
144pub const kIOHIDAutoDimBrightnessKey: &CStr =
145    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAutoDimBrightness\0") };
146/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidfkeymodekey?language=objc)
147pub const kIOHIDFKeyModeKey: &CStr =
148    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDFKeyMode\0") };
149/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidstickykeysdisabledkey?language=objc)
150pub const kIOHIDStickyKeysDisabledKey: &CStr =
151    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDStickyKeysDisabled\0") };
152/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidstickykeysonkey?language=objc)
153pub const kIOHIDStickyKeysOnKey: &CStr =
154    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDStickyKeysOn\0") };
155/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidstickykeysshifttoggleskey?language=objc)
156pub const kIOHIDStickyKeysShiftTogglesKey: &CStr =
157    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDStickyKeysShiftToggles\0") };
158/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidresetstickykeynotification?language=objc)
159pub const kIOHIDResetStickyKeyNotification: &CStr =
160    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDResetStickyKeyNotification\0") };
161/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidmousekeysoptiontoggleskey?language=objc)
162pub const kIOHIDMouseKeysOptionTogglesKey: &CStr =
163    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDMouseKeysOptionToggles\0") };
164/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidslowkeysdelaykey?language=objc)
165pub const kIOHIDSlowKeysDelayKey: &CStr =
166    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDSlowKeysDelay\0") };
167/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidf12ejectdelaykey?language=objc)
168pub const kIOHIDF12EjectDelayKey: &CStr =
169    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDF12EjectDelay\0") };
170/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidmousekeysonkey?language=objc)
171pub const kIOHIDMouseKeysOnKey: &CStr =
172    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDMouseKeysOn\0") };
173/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidusekeyswitchkey?language=objc)
174pub const kIOHIDUseKeyswitchKey: &CStr =
175    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDUseKeyswitch\0") };
176/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohiddisallowremappingofprimaryclickkey?language=objc)
177pub const kIOHIDDisallowRemappingOfPrimaryClickKey: &CStr =
178    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDDisallowRemappingOfPrimaryClick\0") };
179/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidmousekeysenablesvirtualnumpadkey?language=objc)
180pub const kIOHIDMouseKeysEnablesVirtualNumPadKey: &CStr =
181    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDMouseKeysEnablesVirtualNumPad\0") };
182/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidresetledskey?language=objc)
183pub const kIOHIDResetLEDsKey: &CStr =
184    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDResetLEDs\0") };
185/// [Apple's documentation](https://developer.apple.com/documentation/iokit/khidtrackingaccelparametriccurveskey?language=objc)
186pub const kHIDTrackingAccelParametricCurvesKey: &CStr =
187    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDTrackingAccelCurves\0") };
188/// [Apple's documentation](https://developer.apple.com/documentation/iokit/khidaccelparametriccurvesdebugkey?language=objc)
189pub const kHIDAccelParametricCurvesDebugKey: &CStr =
190    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAccelCurvesDebug\0") };
191/// [Apple's documentation](https://developer.apple.com/documentation/iokit/khidscrollaccelparametriccurvesdebugkey?language=objc)
192pub const kHIDScrollAccelParametricCurvesDebugKey: &CStr =
193    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollAccelCurvesDebug\0") };
194/// [Apple's documentation](https://developer.apple.com/documentation/iokit/khidaccelgainlinearkey?language=objc)
195pub const kHIDAccelGainLinearKey: &CStr =
196    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAccelGainLinear\0") };
197/// [Apple's documentation](https://developer.apple.com/documentation/iokit/khidaccelgainparabolickey?language=objc)
198pub const kHIDAccelGainParabolicKey: &CStr =
199    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAccelGainParabolic\0") };
200/// [Apple's documentation](https://developer.apple.com/documentation/iokit/khidaccelgaincubickey?language=objc)
201pub const kHIDAccelGainCubicKey: &CStr =
202    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAccelGainCubic\0") };
203/// [Apple's documentation](https://developer.apple.com/documentation/iokit/khidaccelgainquartickey?language=objc)
204pub const kHIDAccelGainQuarticKey: &CStr =
205    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAccelGainQuartic\0") };
206/// [Apple's documentation](https://developer.apple.com/documentation/iokit/khidacceltangentspeedlinearkey?language=objc)
207pub const kHIDAccelTangentSpeedLinearKey: &CStr =
208    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAccelTangentSpeedLinear\0") };
209/// [Apple's documentation](https://developer.apple.com/documentation/iokit/khidacceltangentspeedparabolicrootkey?language=objc)
210pub const kHIDAccelTangentSpeedParabolicRootKey: &CStr =
211    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAccelTangentSpeedParabolicRoot\0") };
212/// [Apple's documentation](https://developer.apple.com/documentation/iokit/khidacceltangentspeedcubicrootkey?language=objc)
213pub const kHIDAccelTangentSpeedCubicRootKey: &CStr =
214    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAccelTangentSpeedCubicRoot\0") };
215/// [Apple's documentation](https://developer.apple.com/documentation/iokit/khidacceltangentspeedquarticrootkey?language=objc)
216pub const kHIDAccelTangentSpeedQuarticRootKey: &CStr =
217    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAccelTangentSpeedQuarticRoot\0") };
218/// [Apple's documentation](https://developer.apple.com/documentation/iokit/khidaccelindexkey?language=objc)
219pub const kHIDAccelIndexKey: &CStr =
220    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAccelIndex\0") };
221/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidscrollcountmaxtimedeltabetweenkey?language=objc)
222pub const kIOHIDScrollCountMaxTimeDeltaBetweenKey: &CStr =
223    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollCountMaxTimeDeltaBetween\0") };
224/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidscrollcountmaxtimedeltatosustainkey?language=objc)
225pub const kIOHIDScrollCountMaxTimeDeltaToSustainKey: &CStr =
226    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollCountMaxTimeDeltaToSustain\0") };
227/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidscrollcountmindeltatostartkey?language=objc)
228pub const kIOHIDScrollCountMinDeltaToStartKey: &CStr =
229    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollCountMinDeltaToStart\0") };
230/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidscrollcountmindeltatosustainkey?language=objc)
231pub const kIOHIDScrollCountMinDeltaToSustainKey: &CStr =
232    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollCountMinDeltaToSustain\0") };
233/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidscrollcountignoremomentumscrollskey?language=objc)
234pub const kIOHIDScrollCountIgnoreMomentumScrollsKey: &CStr =
235    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollCountIgnoreMomentumScrolls\0") };
236/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidscrollcountmousecanresetkey?language=objc)
237pub const kIOHIDScrollCountMouseCanResetKey: &CStr =
238    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollCountMouseCanReset\0") };
239/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidscrollcountmaxkey?language=objc)
240pub const kIOHIDScrollCountMaxKey: &CStr =
241    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollCountMax\0") };
242/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidscrollcountaccelerationfactorkey?language=objc)
243pub const kIOHIDScrollCountAccelerationFactorKey: &CStr =
244    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollCountAccelerationFactor\0") };
245/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidscrollcountzerokey?language=objc)
246pub const kIOHIDScrollCountZeroKey: &CStr =
247    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollCountZero\0") };
248/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidscrollcountbootdefaultkey?language=objc)
249pub const kIOHIDScrollCountBootDefaultKey: &CStr =
250    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollCountBootDefault\0") };
251/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidscrollcountresetkey?language=objc)
252pub const kIOHIDScrollCountResetKey: &CStr =
253    unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollCountReset\0") };
254/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidactivityuseridlekey?language=objc)
255pub const kIOHIDActivityUserIdleKey: &CStr =
256    unsafe { CStr::from_bytes_with_nul_unchecked(b"IOHIDActivityUserIdle\0") };
257/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidsystemclass?language=objc)
258pub const kIOHIDSystemClass: &CStr =
259    unsafe { CStr::from_bytes_with_nul_unchecked(b"IOHIDSystem\0") };
260/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohikeyboardclass?language=objc)
261pub const kIOHIKeyboardClass: &CStr =
262    unsafe { CStr::from_bytes_with_nul_unchecked(b"IOHIKeyboard\0") };
263/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohipointingclass?language=objc)
264pub const kIOHIPointingClass: &CStr =
265    unsafe { CStr::from_bytes_with_nul_unchecked(b"IOHIPointing\0") };
266/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidcurrentshmemversion?language=objc)
267pub const kIOHIDCurrentShmemVersion: c_uint = 4;
268/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidlastcompatibleshmemversion?language=objc)
269pub const kIOHIDLastCompatibleShmemVersion: c_uint = 3;
270/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidmessagerelayserviceinterfaceactive?language=objc)
271pub const kIOHIDMessageRelayServiceInterfaceActive: c_uint = iokit_vendor_specific_msg!(2);
272/// [Apple's documentation](https://developer.apple.com/documentation/iokit/evsiokeymapping?language=objc)
273#[repr(C)]
274#[derive(Clone, Copy, Debug, PartialEq)]
275pub struct evsioKeymapping {
276    pub size: c_int,
277    pub mapping: *mut c_char,
278}
279
280#[cfg(feature = "objc2")]
281unsafe impl Encode for evsioKeymapping {
282    const ENCODING: Encoding = Encoding::Struct(
283        "evsioKeymapping",
284        &[<c_int>::ENCODING, <*mut c_char>::ENCODING],
285    );
286}
287
288#[cfg(feature = "objc2")]
289unsafe impl RefEncode for evsioKeymapping {
290    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
291}
292
293/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxkeymapping?language=objc)
294pub type NXKeyMapping = evsioKeymapping;
295
296/// [Apple's documentation](https://developer.apple.com/documentation/iokit/evsiomousescaling?language=objc)
297#[repr(C)]
298#[derive(Clone, Copy, Debug, PartialEq)]
299pub struct evsioMouseScaling {
300    pub numScaleLevels: c_int,
301    pub scaleThresholds: [c_short; 20],
302    pub scaleFactors: [c_short; 20],
303}
304
305#[cfg(feature = "objc2")]
306unsafe impl Encode for evsioMouseScaling {
307    const ENCODING: Encoding = Encoding::Struct(
308        "evsioMouseScaling",
309        &[
310            <c_int>::ENCODING,
311            <[c_short; 20]>::ENCODING,
312            <[c_short; 20]>::ENCODING,
313        ],
314    );
315}
316
317#[cfg(feature = "objc2")]
318unsafe impl RefEncode for evsioMouseScaling {
319    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
320}
321
322/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxmousescaling?language=objc)
323pub type NXMouseScaling = evsioMouseScaling;
324
325/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxmousebutton?language=objc)
326#[repr(transparent)]
327#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
328pub struct NXMouseButton(pub c_uint);
329impl NXMouseButton {
330    #[doc(alias = "NX_OneButton")]
331    pub const OneButton: Self = Self(0);
332    #[doc(alias = "NX_LeftButton")]
333    pub const LeftButton: Self = Self(1);
334    #[doc(alias = "NX_RightButton")]
335    pub const RightButton: Self = Self(2);
336}
337
338#[cfg(feature = "objc2")]
339unsafe impl Encode for NXMouseButton {
340    const ENCODING: Encoding = c_uint::ENCODING;
341}
342
343#[cfg(feature = "objc2")]
344unsafe impl RefEncode for NXMouseButton {
345    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
346}
347
348/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iofixedpoint32?language=objc)
349#[repr(C)]
350#[derive(Clone, Copy, Debug, PartialEq)]
351pub struct IOFixedPoint32 {
352    pub x: i32,
353    pub y: i32,
354}
355
356#[cfg(feature = "objc2")]
357unsafe impl Encode for IOFixedPoint32 {
358    const ENCODING: Encoding =
359        Encoding::Struct("__IOFixedPoint32", &[<i32>::ENCODING, <i32>::ENCODING]);
360}
361
362#[cfg(feature = "objc2")]
363unsafe impl RefEncode for IOFixedPoint32 {
364    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
365}
366
367/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxeventsysteminfotype?language=objc)
368pub type NXEventSystemInfoType = *mut c_int;
369
370/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxeventsystemdevice?language=objc)
371#[repr(C)]
372#[derive(Clone, Copy, Debug, PartialEq)]
373pub struct NXEventSystemDevice {
374    pub interface: c_int,
375    pub interface_addr: c_int,
376    pub dev_type: c_int,
377    pub id: c_int,
378}
379
380#[cfg(feature = "objc2")]
381unsafe impl Encode for NXEventSystemDevice {
382    const ENCODING: Encoding = Encoding::Struct(
383        "?",
384        &[
385            <c_int>::ENCODING,
386            <c_int>::ENCODING,
387            <c_int>::ENCODING,
388            <c_int>::ENCODING,
389        ],
390    );
391}
392
393#[cfg(feature = "objc2")]
394unsafe impl RefEncode for NXEventSystemDevice {
395    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
396}
397
398/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxeventsystemdevicelist?language=objc)
399#[repr(C)]
400#[derive(Clone, Copy, Debug, PartialEq)]
401pub struct NXEventSystemDeviceList {
402    pub dev: [NXEventSystemDevice; 16],
403}
404
405#[cfg(feature = "objc2")]
406unsafe impl Encode for NXEventSystemDeviceList {
407    const ENCODING: Encoding = Encoding::Struct("?", &[<[NXEventSystemDevice; 16]>::ENCODING]);
408}
409
410#[cfg(feature = "objc2")]
411unsafe impl RefEncode for NXEventSystemDeviceList {
412    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
413}
414
415/// [Apple's documentation](https://developer.apple.com/documentation/iokit/evcmd?language=objc)
416#[repr(transparent)]
417#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
418pub struct EvCmd(pub c_uint);
419impl EvCmd {
420    pub const EVNOP: Self = Self(0);
421    pub const EVHIDE: Self = Self(1);
422    pub const EVSHOW: Self = Self(2);
423    pub const EVMOVE: Self = Self(3);
424    pub const EVLEVEL: Self = Self(4);
425}
426
427#[cfg(feature = "objc2")]
428unsafe impl Encode for EvCmd {
429    const ENCODING: Encoding = c_uint::ENCODING;
430}
431
432#[cfg(feature = "objc2")]
433unsafe impl RefEncode for EvCmd {
434    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
435}
436
437/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxcoord?language=objc)
438pub type NXCoord = c_float;
439
440/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxpoint?language=objc)
441#[repr(C)]
442#[derive(Clone, Copy, Debug, PartialEq)]
443pub struct NXPoint {
444    pub x: NXCoord,
445    pub y: NXCoord,
446}
447
448#[cfg(feature = "objc2")]
449unsafe impl Encode for NXPoint {
450    const ENCODING: Encoding =
451        Encoding::Struct("_NXPoint", &[<NXCoord>::ENCODING, <NXCoord>::ENCODING]);
452}
453
454#[cfg(feature = "objc2")]
455unsafe impl RefEncode for NXPoint {
456    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
457}
458
459/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxsize?language=objc)
460#[repr(C)]
461#[derive(Clone, Copy, Debug, PartialEq)]
462pub struct NXSize {
463    pub width: NXCoord,
464    pub height: NXCoord,
465}
466
467#[cfg(feature = "objc2")]
468unsafe impl Encode for NXSize {
469    const ENCODING: Encoding =
470        Encoding::Struct("_NXSize", &[<NXCoord>::ENCODING, <NXCoord>::ENCODING]);
471}
472
473#[cfg(feature = "objc2")]
474unsafe impl RefEncode for NXSize {
475    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
476}
477
478/// [Apple's documentation](https://developer.apple.com/documentation/iokit/_nxtabletpointdata_tilt?language=objc)
479#[repr(C)]
480#[derive(Clone, Copy, Debug, PartialEq)]
481pub struct _NXTabletPointData_tilt {
482    pub x: i16,
483    pub y: i16,
484}
485
486#[cfg(feature = "objc2")]
487unsafe impl Encode for _NXTabletPointData_tilt {
488    const ENCODING: Encoding = Encoding::Struct("?", &[<i16>::ENCODING, <i16>::ENCODING]);
489}
490
491#[cfg(feature = "objc2")]
492unsafe impl RefEncode for _NXTabletPointData_tilt {
493    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
494}
495
496/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxtabletpointdata?language=objc)
497#[repr(C)]
498#[derive(Clone, Copy, Debug, PartialEq)]
499pub struct NXTabletPointData {
500    pub x: i32,
501    pub y: i32,
502    pub z: i32,
503    pub buttons: u16,
504    pub pressure: u16,
505    pub tilt: _NXTabletPointData_tilt,
506    pub rotation: u16,
507    pub tangentialPressure: i16,
508    pub deviceID: u16,
509    pub vendor1: i16,
510    pub vendor2: i16,
511    pub vendor3: i16,
512}
513
514#[cfg(feature = "objc2")]
515unsafe impl Encode for NXTabletPointData {
516    const ENCODING: Encoding = Encoding::Struct(
517        "_NXTabletPointData",
518        &[
519            <i32>::ENCODING,
520            <i32>::ENCODING,
521            <i32>::ENCODING,
522            <u16>::ENCODING,
523            <u16>::ENCODING,
524            <_NXTabletPointData_tilt>::ENCODING,
525            <u16>::ENCODING,
526            <i16>::ENCODING,
527            <u16>::ENCODING,
528            <i16>::ENCODING,
529            <i16>::ENCODING,
530            <i16>::ENCODING,
531        ],
532    );
533}
534
535#[cfg(feature = "objc2")]
536unsafe impl RefEncode for NXTabletPointData {
537    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
538}
539
540/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxtabletproximitydata?language=objc)
541#[repr(C, packed(4))]
542#[derive(Clone, Copy, Debug, PartialEq)]
543pub struct NXTabletProximityData {
544    pub vendorID: u16,
545    pub tabletID: u16,
546    pub pointerID: u16,
547    pub deviceID: u16,
548    pub systemTabletID: u16,
549    pub vendorPointerType: u16,
550    pub pointerSerialNumber: u32,
551    pub uniqueID: u64,
552    pub capabilityMask: u32,
553    pub pointerType: u8,
554    pub enterProximity: u8,
555    pub reserved1: i16,
556}
557
558#[cfg(feature = "objc2")]
559unsafe impl Encode for NXTabletProximityData {
560    const ENCODING: Encoding = Encoding::Struct(
561        "_NXTabletProximityData",
562        &[
563            <u16>::ENCODING,
564            <u16>::ENCODING,
565            <u16>::ENCODING,
566            <u16>::ENCODING,
567            <u16>::ENCODING,
568            <u16>::ENCODING,
569            <u32>::ENCODING,
570            <u64>::ENCODING,
571            <u32>::ENCODING,
572            <u8>::ENCODING,
573            <u8>::ENCODING,
574            <i16>::ENCODING,
575        ],
576    );
577}
578
579#[cfg(feature = "objc2")]
580unsafe impl RefEncode for NXTabletProximityData {
581    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
582}
583
584/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxeventdata_mouse_tablet?language=objc)
585#[repr(C)]
586#[derive(Clone, Copy)]
587pub union NXEventData_mouse_tablet {
588    pub point: NXTabletPointData,
589    pub proximity: NXTabletProximityData,
590}
591
592#[cfg(feature = "objc2")]
593unsafe impl Encode for NXEventData_mouse_tablet {
594    const ENCODING: Encoding = Encoding::Union(
595        "?",
596        &[
597            <NXTabletPointData>::ENCODING,
598            <NXTabletProximityData>::ENCODING,
599        ],
600    );
601}
602
603#[cfg(feature = "objc2")]
604unsafe impl RefEncode for NXEventData_mouse_tablet {
605    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
606}
607
608/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxeventdata_mouse?language=objc)
609#[repr(C)]
610#[derive(Clone, Copy)]
611pub struct NXEventData_mouse {
612    pub subx: u8,
613    pub suby: u8,
614    pub eventNum: i16,
615    pub click: i32,
616    pub pressure: u8,
617    pub buttonNumber: u8,
618    pub subType: u8,
619    pub reserved2: u8,
620    pub reserved3: i32,
621    pub tablet: NXEventData_mouse_tablet,
622}
623
624#[cfg(feature = "objc2")]
625unsafe impl Encode for NXEventData_mouse {
626    const ENCODING: Encoding = Encoding::Struct(
627        "?",
628        &[
629            <u8>::ENCODING,
630            <u8>::ENCODING,
631            <i16>::ENCODING,
632            <i32>::ENCODING,
633            <u8>::ENCODING,
634            <u8>::ENCODING,
635            <u8>::ENCODING,
636            <u8>::ENCODING,
637            <i32>::ENCODING,
638            <NXEventData_mouse_tablet>::ENCODING,
639        ],
640    );
641}
642
643#[cfg(feature = "objc2")]
644unsafe impl RefEncode for NXEventData_mouse {
645    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
646}
647
648/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxeventdata_mousemove_tablet?language=objc)
649#[repr(C)]
650#[derive(Clone, Copy)]
651pub union NXEventData_mouseMove_tablet {
652    pub point: NXTabletPointData,
653    pub proximity: NXTabletProximityData,
654}
655
656#[cfg(feature = "objc2")]
657unsafe impl Encode for NXEventData_mouseMove_tablet {
658    const ENCODING: Encoding = Encoding::Union(
659        "?",
660        &[
661            <NXTabletPointData>::ENCODING,
662            <NXTabletProximityData>::ENCODING,
663        ],
664    );
665}
666
667#[cfg(feature = "objc2")]
668unsafe impl RefEncode for NXEventData_mouseMove_tablet {
669    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
670}
671
672/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxeventdata_mousemove?language=objc)
673#[repr(C)]
674#[derive(Clone, Copy)]
675pub struct NXEventData_mouseMove {
676    pub dx: i32,
677    pub dy: i32,
678    pub subx: u8,
679    pub suby: u8,
680    pub subType: u8,
681    pub reserved1: u8,
682    pub reserved2: i32,
683    pub tablet: NXEventData_mouseMove_tablet,
684}
685
686#[cfg(feature = "objc2")]
687unsafe impl Encode for NXEventData_mouseMove {
688    const ENCODING: Encoding = Encoding::Struct(
689        "?",
690        &[
691            <i32>::ENCODING,
692            <i32>::ENCODING,
693            <u8>::ENCODING,
694            <u8>::ENCODING,
695            <u8>::ENCODING,
696            <u8>::ENCODING,
697            <i32>::ENCODING,
698            <NXEventData_mouseMove_tablet>::ENCODING,
699        ],
700    );
701}
702
703#[cfg(feature = "objc2")]
704unsafe impl RefEncode for NXEventData_mouseMove {
705    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
706}
707
708/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxeventdata_key?language=objc)
709#[repr(C)]
710#[derive(Clone, Copy, Debug, PartialEq)]
711pub struct NXEventData_key {
712    pub origCharSet: u16,
713    pub repeat: i16,
714    pub charSet: u16,
715    pub charCode: u16,
716    pub keyCode: u16,
717    pub origCharCode: u16,
718    pub reserved1: i32,
719    pub keyboardType: u32,
720    pub reserved2: i32,
721    pub reserved3: i32,
722    pub reserved4: i32,
723    pub reserved5: [i32; 4],
724}
725
726#[cfg(feature = "objc2")]
727unsafe impl Encode for NXEventData_key {
728    const ENCODING: Encoding = Encoding::Struct(
729        "?",
730        &[
731            <u16>::ENCODING,
732            <i16>::ENCODING,
733            <u16>::ENCODING,
734            <u16>::ENCODING,
735            <u16>::ENCODING,
736            <u16>::ENCODING,
737            <i32>::ENCODING,
738            <u32>::ENCODING,
739            <i32>::ENCODING,
740            <i32>::ENCODING,
741            <i32>::ENCODING,
742            <[i32; 4]>::ENCODING,
743        ],
744    );
745}
746
747#[cfg(feature = "objc2")]
748unsafe impl RefEncode for NXEventData_key {
749    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
750}
751
752/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxeventdata_tracking?language=objc)
753#[repr(C)]
754#[derive(Clone, Copy, Debug, PartialEq)]
755pub struct NXEventData_tracking {
756    pub reserved: i16,
757    pub eventNum: i16,
758    pub trackingNum: i32,
759    pub userData: i32,
760    pub reserved1: i32,
761    pub reserved2: i32,
762    pub reserved3: i32,
763    pub reserved4: i32,
764    pub reserved5: i32,
765    pub reserved6: [i32; 4],
766}
767
768#[cfg(feature = "objc2")]
769unsafe impl Encode for NXEventData_tracking {
770    const ENCODING: Encoding = Encoding::Struct(
771        "?",
772        &[
773            <i16>::ENCODING,
774            <i16>::ENCODING,
775            <i32>::ENCODING,
776            <i32>::ENCODING,
777            <i32>::ENCODING,
778            <i32>::ENCODING,
779            <i32>::ENCODING,
780            <i32>::ENCODING,
781            <i32>::ENCODING,
782            <[i32; 4]>::ENCODING,
783        ],
784    );
785}
786
787#[cfg(feature = "objc2")]
788unsafe impl RefEncode for NXEventData_tracking {
789    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
790}
791
792/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxeventdata_scrollwheel?language=objc)
793#[repr(C)]
794#[derive(Clone, Copy, Debug, PartialEq)]
795pub struct NXEventData_scrollWheel {
796    pub deltaAxis1: i16,
797    pub deltaAxis2: i16,
798    pub deltaAxis3: i16,
799    pub reserved1: i16,
800    pub fixedDeltaAxis1: i32,
801    pub fixedDeltaAxis2: i32,
802    pub fixedDeltaAxis3: i32,
803    pub pointDeltaAxis1: i32,
804    pub pointDeltaAxis2: i32,
805    pub pointDeltaAxis3: i32,
806    pub reserved8: [i32; 4],
807}
808
809#[cfg(feature = "objc2")]
810unsafe impl Encode for NXEventData_scrollWheel {
811    const ENCODING: Encoding = Encoding::Struct(
812        "?",
813        &[
814            <i16>::ENCODING,
815            <i16>::ENCODING,
816            <i16>::ENCODING,
817            <i16>::ENCODING,
818            <i32>::ENCODING,
819            <i32>::ENCODING,
820            <i32>::ENCODING,
821            <i32>::ENCODING,
822            <i32>::ENCODING,
823            <i32>::ENCODING,
824            <[i32; 4]>::ENCODING,
825        ],
826    );
827}
828
829#[cfg(feature = "objc2")]
830unsafe impl RefEncode for NXEventData_scrollWheel {
831    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
832}
833
834/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxeventdata_compound_misc?language=objc)
835#[repr(C)]
836#[derive(Clone, Copy)]
837pub union NXEventData_compound_misc {
838    pub F: [c_float; 11],
839    pub L: [i32; 11],
840    pub S: [i16; 22],
841    pub C: [c_char; 44],
842}
843
844#[cfg(feature = "objc2")]
845unsafe impl Encode for NXEventData_compound_misc {
846    const ENCODING: Encoding = Encoding::Union(
847        "?",
848        &[
849            <[c_float; 11]>::ENCODING,
850            <[i32; 11]>::ENCODING,
851            <[i16; 22]>::ENCODING,
852            <[c_char; 44]>::ENCODING,
853        ],
854    );
855}
856
857#[cfg(feature = "objc2")]
858unsafe impl RefEncode for NXEventData_compound_misc {
859    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
860}
861
862/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxeventdata_compound?language=objc)
863#[repr(C)]
864#[derive(Clone, Copy)]
865pub struct NXEventData_compound {
866    pub reserved: i16,
867    pub subType: i16,
868    pub misc: NXEventData_compound_misc,
869}
870
871#[cfg(feature = "objc2")]
872unsafe impl Encode for NXEventData_compound {
873    const ENCODING: Encoding = Encoding::Struct(
874        "?",
875        &[
876            <i16>::ENCODING,
877            <i16>::ENCODING,
878            <NXEventData_compound_misc>::ENCODING,
879        ],
880    );
881}
882
883#[cfg(feature = "objc2")]
884unsafe impl RefEncode for NXEventData_compound {
885    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
886}
887
888/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxeventdata_tablet_tilt?language=objc)
889#[repr(C)]
890#[derive(Clone, Copy, Debug, PartialEq)]
891pub struct NXEventData_tablet_tilt {
892    pub x: i16,
893    pub y: i16,
894}
895
896#[cfg(feature = "objc2")]
897unsafe impl Encode for NXEventData_tablet_tilt {
898    const ENCODING: Encoding = Encoding::Struct("?", &[<i16>::ENCODING, <i16>::ENCODING]);
899}
900
901#[cfg(feature = "objc2")]
902unsafe impl RefEncode for NXEventData_tablet_tilt {
903    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
904}
905
906/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxeventdata_tablet?language=objc)
907#[repr(C)]
908#[derive(Clone, Copy, Debug, PartialEq)]
909pub struct NXEventData_tablet {
910    pub x: i32,
911    pub y: i32,
912    pub z: i32,
913    pub buttons: u16,
914    pub pressure: u16,
915    pub tilt: NXEventData_tablet_tilt,
916    pub rotation: u16,
917    pub tangentialPressure: i16,
918    pub deviceID: u16,
919    pub vendor1: i16,
920    pub vendor2: i16,
921    pub vendor3: i16,
922    pub reserved: [i32; 4],
923}
924
925#[cfg(feature = "objc2")]
926unsafe impl Encode for NXEventData_tablet {
927    const ENCODING: Encoding = Encoding::Struct(
928        "?",
929        &[
930            <i32>::ENCODING,
931            <i32>::ENCODING,
932            <i32>::ENCODING,
933            <u16>::ENCODING,
934            <u16>::ENCODING,
935            <NXEventData_tablet_tilt>::ENCODING,
936            <u16>::ENCODING,
937            <i16>::ENCODING,
938            <u16>::ENCODING,
939            <i16>::ENCODING,
940            <i16>::ENCODING,
941            <i16>::ENCODING,
942            <[i32; 4]>::ENCODING,
943        ],
944    );
945}
946
947#[cfg(feature = "objc2")]
948unsafe impl RefEncode for NXEventData_tablet {
949    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
950}
951
952/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxeventdata_proximity?language=objc)
953#[repr(C, packed(4))]
954#[derive(Clone, Copy, Debug, PartialEq)]
955pub struct NXEventData_proximity {
956    pub vendorID: u16,
957    pub tabletID: u16,
958    pub pointerID: u16,
959    pub deviceID: u16,
960    pub systemTabletID: u16,
961    pub vendorPointerType: u16,
962    pub pointerSerialNumber: u32,
963    pub uniqueID: u64,
964    pub capabilityMask: u32,
965    pub pointerType: u8,
966    pub enterProximity: u8,
967    pub reserved1: i16,
968    pub reserved2: [i32; 4],
969}
970
971#[cfg(feature = "objc2")]
972unsafe impl Encode for NXEventData_proximity {
973    const ENCODING: Encoding = Encoding::Struct(
974        "?",
975        &[
976            <u16>::ENCODING,
977            <u16>::ENCODING,
978            <u16>::ENCODING,
979            <u16>::ENCODING,
980            <u16>::ENCODING,
981            <u16>::ENCODING,
982            <u32>::ENCODING,
983            <u64>::ENCODING,
984            <u32>::ENCODING,
985            <u8>::ENCODING,
986            <u8>::ENCODING,
987            <i16>::ENCODING,
988            <[i32; 4]>::ENCODING,
989        ],
990    );
991}
992
993#[cfg(feature = "objc2")]
994unsafe impl RefEncode for NXEventData_proximity {
995    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
996}
997
998/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxeventdata?language=objc)
999#[repr(C)]
1000#[derive(Clone, Copy)]
1001pub union NXEventData {
1002    pub mouse: NXEventData_mouse,
1003    pub mouseMove: NXEventData_mouseMove,
1004    pub key: NXEventData_key,
1005    pub tracking: NXEventData_tracking,
1006    pub scrollWheel: NXEventData_scrollWheel,
1007    pub zoom: NXEventData_scrollWheel,
1008    pub compound: NXEventData_compound,
1009    pub tablet: NXEventData_tablet,
1010    pub proximity: NXEventData_proximity,
1011}
1012
1013#[cfg(feature = "objc2")]
1014unsafe impl Encode for NXEventData {
1015    const ENCODING: Encoding = Encoding::Union(
1016        "?",
1017        &[
1018            <NXEventData_mouse>::ENCODING,
1019            <NXEventData_mouseMove>::ENCODING,
1020            <NXEventData_key>::ENCODING,
1021            <NXEventData_tracking>::ENCODING,
1022            <NXEventData_scrollWheel>::ENCODING,
1023            <NXEventData_scrollWheel>::ENCODING,
1024            <NXEventData_compound>::ENCODING,
1025            <NXEventData_tablet>::ENCODING,
1026            <NXEventData_proximity>::ENCODING,
1027        ],
1028    );
1029}
1030
1031#[cfg(feature = "objc2")]
1032unsafe impl RefEncode for NXEventData {
1033    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1034}
1035
1036/// [Apple's documentation](https://developer.apple.com/documentation/iokit/_nxevent_location?language=objc)
1037#[repr(C)]
1038#[derive(Clone, Copy, Debug, PartialEq)]
1039pub struct _NXEvent_location {
1040    pub x: i32,
1041    pub y: i32,
1042}
1043
1044#[cfg(feature = "objc2")]
1045unsafe impl Encode for _NXEvent_location {
1046    const ENCODING: Encoding = Encoding::Struct("?", &[<i32>::ENCODING, <i32>::ENCODING]);
1047}
1048
1049#[cfg(feature = "objc2")]
1050unsafe impl RefEncode for _NXEvent_location {
1051    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1052}
1053
1054/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxevent?language=objc)
1055#[repr(C, packed(4))]
1056#[derive(Clone, Copy)]
1057pub struct NXEvent {
1058    pub r#type: i32,
1059    pub location: _NXEvent_location,
1060    pub time: u64,
1061    pub flags: i32,
1062    pub window: u32,
1063    pub service_id: u64,
1064    pub ext_pid: i32,
1065    pub data: NXEventData,
1066}
1067
1068#[cfg(feature = "objc2")]
1069unsafe impl Encode for NXEvent {
1070    const ENCODING: Encoding = Encoding::Struct(
1071        "_NXEvent",
1072        &[
1073            <i32>::ENCODING,
1074            <_NXEvent_location>::ENCODING,
1075            <u64>::ENCODING,
1076            <i32>::ENCODING,
1077            <u32>::ENCODING,
1078            <u64>::ENCODING,
1079            <i32>::ENCODING,
1080            <NXEventData>::ENCODING,
1081        ],
1082    );
1083}
1084
1085#[cfg(feature = "objc2")]
1086unsafe impl RefEncode for NXEvent {
1087    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1088}
1089
1090/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iohidbuttonmodes?language=objc)
1091#[repr(transparent)]
1092#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1093pub struct IOHIDButtonModes(pub c_uint);
1094impl IOHIDButtonModes {
1095    #[doc(alias = "kIOHIDButtonMode_BothLeftClicks")]
1096    pub const BothLeftClicks: Self = Self(0);
1097    #[doc(alias = "kIOHIDButtonMode_ReverseLeftRightClicks")]
1098    pub const ReverseLeftRightClicks: Self = Self(1);
1099    #[doc(alias = "kIOHIDButtonMode_EnableRightClick")]
1100    pub const EnableRightClick: Self = Self(2);
1101}
1102
1103#[cfg(feature = "objc2")]
1104unsafe impl Encode for IOHIDButtonModes {
1105    const ENCODING: Encoding = c_uint::ENCODING;
1106}
1107
1108#[cfg(feature = "objc2")]
1109unsafe impl RefEncode for IOHIDButtonModes {
1110    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1111}
1112
1113/// [Apple's documentation](https://developer.apple.com/documentation/iokit/evsioevsioscsindices?language=objc)
1114#[repr(transparent)]
1115#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1116pub struct evsioEVSIOSCSIndices(pub c_uint);
1117impl evsioEVSIOSCSIndices {
1118    pub const EVSIOSCS_X: Self = Self(0);
1119    pub const EVSIOSCS_Y: Self = Self(1);
1120}
1121
1122#[cfg(feature = "objc2")]
1123unsafe impl Encode for evsioEVSIOSCSIndices {
1124    const ENCODING: Encoding = c_uint::ENCODING;
1125}
1126
1127#[cfg(feature = "objc2")]
1128unsafe impl RefEncode for evsioEVSIOSCSIndices {
1129    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1130}
1131
1132/// [Apple's documentation](https://developer.apple.com/documentation/iokit/evsioevsioccsindices?language=objc)
1133#[repr(transparent)]
1134#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1135pub struct evsioEVSIOCCSIndices(pub c_uint);
1136impl evsioEVSIOCCSIndices {
1137    pub const EVSIOCCS_X: Self = Self(0);
1138    pub const EVSIOCCS_Y: Self = Self(1);
1139}
1140
1141#[cfg(feature = "objc2")]
1142unsafe impl Encode for evsioEVSIOCCSIndices {
1143    const ENCODING: Encoding = c_uint::ENCODING;
1144}
1145
1146#[cfg(feature = "objc2")]
1147unsafe impl RefEncode for evsioEVSIOCCSIndices {
1148    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1149}
1150
1151/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidcapslockstate?language=objc)
1152pub const kIOHIDCapsLockState: c_uint = 0x00000001;
1153/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidnumlockstate?language=objc)
1154pub const kIOHIDNumLockState: c_uint = 0x00000002;
1155/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidactivityuseridle?language=objc)
1156pub const kIOHIDActivityUserIdle: c_uint = 0x00000003;
1157/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidactivitydisplayon?language=objc)
1158pub const kIOHIDActivityDisplayOn: c_uint = 0x00000004;
1159
1160/// ****************************************************************************
1161/// SHARED MEMORY OVERVIEW
1162///
1163/// PERSPECTIVE
1164/// The ev driver and PostScript share at least one page of wired memory.
1165/// This memory contains the low-level event queue which ev deposits events
1166/// into and PostScript reads events from. Also, this memory contains other
1167/// important data such as wait cursor state and some general cursor state.
1168/// This memory is critical for speed.  That is, we avoid having to make
1169/// system calls for common operations.
1170///
1171/// SHARED MEMORY REGIONS
1172/// There are currently three "regions" or "zones" delineated within this
1173/// shared memory.  The first zone is the EvOffsets structure. This structure
1174/// contains two offsets from the beginning of shared memory. The first offset
1175/// is to the second zone, EvGlobals. The second offset is to the third
1176/// zone, private shmem for drivers.
1177///
1178/// INITIALIZATION OF SHARED MEMORY
1179/// When the WindowServer starts up, it finds all screens that will be active.
1180/// It then opens the ev driver and calls the EVIOSSCR ioctl repeatedly for
1181/// each screen in use. This lets the ev driver set up the evScreen array
1182/// and fill in each element. This ioctl also returns to PostScript a running
1183/// total shared memory size with which to allocate. PostScript then allocates
1184/// a region of memory this size and calls evmmap to "map in" this shared
1185/// region.  Evmmap initializes and fills in the EvOffsets and EvGlobals.
1186/// Next the WindowServer calls each screen in turn to register itself with
1187/// the ev driver in the same sequence as presented to EVIOSSCR.  Each screen
1188/// driver calls ev_register_screen() which among other things allocates a
1189/// part of the private shmem (of the third shared memory zone) for the driver.
1190///
1191/// DEBUGGING NOTES
1192/// You can easily display and set this shared memory from kgdb, but usually
1193/// cannot do so from within PostScript.  Gdb (or some weird interaction
1194/// between gdb and the os) chokes on this shmem.  So if you read or write
1195/// this area of memory, copy-on-write will occur and you'll get a completely
1196/// new page for PostScript.  This will render the shared memory scheme
1197/// useless and you will have to restart PostScript.  It was my understanding
1198/// that before, we were able to "read" this area from PS, but not write to
1199/// it (the idea behind copy-on-WRITE).  However, this seems to be broken
1200/// in 2.0.  We think this is a kernel bug.
1201/// ****************************************************************************
1202///
1203/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/_evoffsets?language=objc)
1204#[repr(C)]
1205#[derive(Clone, Copy, Debug, PartialEq)]
1206pub struct _evOffsets {
1207    pub evGlobalsOffset: c_int,
1208    pub evShmemOffset: c_int,
1209}
1210
1211#[cfg(feature = "objc2")]
1212unsafe impl Encode for _evOffsets {
1213    const ENCODING: Encoding =
1214        Encoding::Struct("_evOffsets", &[<c_int>::ENCODING, <c_int>::ENCODING]);
1215}
1216
1217#[cfg(feature = "objc2")]
1218unsafe impl RefEncode for _evOffsets {
1219    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1220}
1221
1222/// ****************************************************************************
1223/// SHARED MEMORY OVERVIEW
1224///
1225/// PERSPECTIVE
1226/// The ev driver and PostScript share at least one page of wired memory.
1227/// This memory contains the low-level event queue which ev deposits events
1228/// into and PostScript reads events from. Also, this memory contains other
1229/// important data such as wait cursor state and some general cursor state.
1230/// This memory is critical for speed.  That is, we avoid having to make
1231/// system calls for common operations.
1232///
1233/// SHARED MEMORY REGIONS
1234/// There are currently three "regions" or "zones" delineated within this
1235/// shared memory.  The first zone is the EvOffsets structure. This structure
1236/// contains two offsets from the beginning of shared memory. The first offset
1237/// is to the second zone, EvGlobals. The second offset is to the third
1238/// zone, private shmem for drivers.
1239///
1240/// INITIALIZATION OF SHARED MEMORY
1241/// When the WindowServer starts up, it finds all screens that will be active.
1242/// It then opens the ev driver and calls the EVIOSSCR ioctl repeatedly for
1243/// each screen in use. This lets the ev driver set up the evScreen array
1244/// and fill in each element. This ioctl also returns to PostScript a running
1245/// total shared memory size with which to allocate. PostScript then allocates
1246/// a region of memory this size and calls evmmap to "map in" this shared
1247/// region.  Evmmap initializes and fills in the EvOffsets and EvGlobals.
1248/// Next the WindowServer calls each screen in turn to register itself with
1249/// the ev driver in the same sequence as presented to EVIOSSCR.  Each screen
1250/// driver calls ev_register_screen() which among other things allocates a
1251/// part of the private shmem (of the third shared memory zone) for the driver.
1252///
1253/// DEBUGGING NOTES
1254/// You can easily display and set this shared memory from kgdb, but usually
1255/// cannot do so from within PostScript.  Gdb (or some weird interaction
1256/// between gdb and the os) chokes on this shmem.  So if you read or write
1257/// this area of memory, copy-on-write will occur and you'll get a completely
1258/// new page for PostScript.  This will render the shared memory scheme
1259/// useless and you will have to restart PostScript.  It was my understanding
1260/// that before, we were able to "read" this area from PS, but not write to
1261/// it (the idea behind copy-on-WRITE).  However, this seems to be broken
1262/// in 2.0.  We think this is a kernel bug.
1263/// ****************************************************************************
1264///
1265/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/evoffsets?language=objc)
1266pub type EvOffsets = _evOffsets;
1267
1268/// [Apple's documentation](https://developer.apple.com/documentation/iokit/eviollevent?language=objc)
1269#[cfg(feature = "graphics")]
1270#[repr(C)]
1271#[derive(Clone, Copy)]
1272pub struct evioLLEvent {
1273    pub setCursor: c_int,
1274    pub r#type: c_int,
1275    pub location: IOGPoint,
1276    pub data: NXEventData,
1277    pub setFlags: c_int,
1278    pub flags: c_int,
1279}
1280
1281#[cfg(all(feature = "graphics", feature = "objc2"))]
1282unsafe impl Encode for evioLLEvent {
1283    const ENCODING: Encoding = Encoding::Struct(
1284        "evioLLEvent",
1285        &[
1286            <c_int>::ENCODING,
1287            <c_int>::ENCODING,
1288            <IOGPoint>::ENCODING,
1289            <NXEventData>::ENCODING,
1290            <c_int>::ENCODING,
1291            <c_int>::ENCODING,
1292        ],
1293    );
1294}
1295
1296#[cfg(all(feature = "graphics", feature = "objc2"))]
1297unsafe impl RefEncode for evioLLEvent {
1298    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1299}
1300
1301/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohideventnotification?language=objc)
1302pub const kIOHIDEventNotification: c_uint = 0;
1303
1304/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidserverconnecttype?language=objc)
1305pub const kIOHIDServerConnectType: c_uint = 0;
1306/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidparamconnecttype?language=objc)
1307pub const kIOHIDParamConnectType: c_uint = 1;
1308/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohideventsystemconnecttype?language=objc)
1309pub const kIOHIDEventSystemConnectType: c_uint = 3;
1310
1311/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidglobalmemory?language=objc)
1312pub const kIOHIDGlobalMemory: c_uint = 0;
1313
1314/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohideventqueuetypekernel?language=objc)
1315pub const kIOHIDEventQueueTypeKernel: c_uint = 0;
1316/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohideventqueuetypeuser?language=objc)
1317pub const kIOHIDEventQueueTypeUser: c_uint = 1;
1318
1319/// kIOHIDOpenedByEventSystem
1320///
1321/// option passed to open for IOHIDInterface  if opened by IOHIDEventDriver
1322///
1323/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidopenedbyeventsystem?language=objc)
1324pub const kIOHIDOpenedByEventSystem: c_uint = 0x10000;
1325/// kIOHIDOpenedByFastPathClient
1326///
1327/// option passed to open for IOHIDEventService if opened by fast path client
1328///
1329/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidopenedbyfastpathclient?language=objc)
1330pub const kIOHIDOpenedByFastPathClient: c_uint = 0x20000;
1331
1332#[cfg(feature = "libc")]
1333#[inline]
1334pub extern "C-unwind" fn IOHIDCreateSharedMemory(
1335    connect: io_connect_t,
1336    version: c_uint,
1337) -> libc::kern_return_t {
1338    extern "C-unwind" {
1339        fn IOHIDCreateSharedMemory(connect: io_connect_t, version: c_uint) -> libc::kern_return_t;
1340    }
1341    unsafe { IOHIDCreateSharedMemory(connect, version) }
1342}
1343
1344#[cfg(feature = "libc")]
1345#[inline]
1346pub extern "C-unwind" fn IOHIDSetEventsEnable(
1347    connect: io_connect_t,
1348    enable: bool,
1349) -> libc::kern_return_t {
1350    extern "C-unwind" {
1351        fn IOHIDSetEventsEnable(
1352            connect: io_connect_t,
1353            enable: libc::boolean_t,
1354        ) -> libc::kern_return_t;
1355    }
1356    unsafe { IOHIDSetEventsEnable(connect, enable as _) }
1357}
1358
1359#[cfg(feature = "libc")]
1360#[deprecated]
1361#[inline]
1362pub extern "C-unwind" fn IOHIDSetCursorEnable(
1363    connect: io_connect_t,
1364    enable: bool,
1365) -> libc::kern_return_t {
1366    extern "C-unwind" {
1367        fn IOHIDSetCursorEnable(
1368            connect: io_connect_t,
1369            enable: libc::boolean_t,
1370        ) -> libc::kern_return_t;
1371    }
1372    unsafe { IOHIDSetCursorEnable(connect, enable as _) }
1373}
1374
1375/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidsetglobaleventflags?language=objc)
1376pub const kIOHIDSetGlobalEventFlags: c_uint = 0x00000001;
1377/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidsetcursorposition?language=objc)
1378pub const kIOHIDSetCursorPosition: c_uint = 0x00000002;
1379/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidsetrelativecursorposition?language=objc)
1380pub const kIOHIDSetRelativeCursorPosition: c_uint = 0x00000004;
1381/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidposthidmanagerevent?language=objc)
1382pub const kIOHIDPostHIDManagerEvent: c_uint = 0x00000008;
1383
1384extern "C-unwind" {
1385    /// # Safety
1386    ///
1387    /// `event_data` must be a valid pointer.
1388    #[cfg(all(feature = "graphics", feature = "libc"))]
1389    #[deprecated = "Use CGSEventTap for posting HID events, IOHIDUserDevice for simulating HID device, IOPMAssertionDeclareUserActivity for reporting user activity"]
1390    pub fn IOHIDPostEvent(
1391        connect: io_connect_t,
1392        event_type: u32,
1393        location: IOGPoint,
1394        event_data: *const NXEventData,
1395        event_data_version: u32,
1396        event_flags: IOOptionBits,
1397        options: IOOptionBits,
1398    ) -> libc::kern_return_t;
1399}
1400
1401#[cfg(feature = "libc")]
1402#[deprecated]
1403#[inline]
1404pub extern "C-unwind" fn IOHIDSetMouseLocation(
1405    connect: io_connect_t,
1406    x: c_int,
1407    y: c_int,
1408) -> libc::kern_return_t {
1409    extern "C-unwind" {
1410        fn IOHIDSetMouseLocation(connect: io_connect_t, x: c_int, y: c_int) -> libc::kern_return_t;
1411    }
1412    unsafe { IOHIDSetMouseLocation(connect, x, y) }
1413}
1414
1415extern "C-unwind" {
1416    /// # Safety
1417    ///
1418    /// `event_num` must be a valid pointer.
1419    #[cfg(feature = "libc")]
1420    #[deprecated]
1421    pub fn IOHIDGetButtonEventNum(
1422        connect: io_connect_t,
1423        button: NXMouseButton,
1424        event_num: *mut c_int,
1425    ) -> libc::kern_return_t;
1426}
1427
1428extern "C-unwind" {
1429    /// # Safety
1430    ///
1431    /// `acceleration` must be a valid pointer.
1432    #[cfg(feature = "libc")]
1433    #[deprecated]
1434    pub fn IOHIDGetScrollAcceleration(
1435        handle: io_connect_t,
1436        acceleration: *mut c_double,
1437    ) -> libc::kern_return_t;
1438}
1439
1440#[cfg(feature = "libc")]
1441#[deprecated]
1442#[inline]
1443pub extern "C-unwind" fn IOHIDSetScrollAcceleration(
1444    handle: io_connect_t,
1445    acceleration: c_double,
1446) -> libc::kern_return_t {
1447    extern "C-unwind" {
1448        fn IOHIDSetScrollAcceleration(
1449            handle: io_connect_t,
1450            acceleration: c_double,
1451        ) -> libc::kern_return_t;
1452    }
1453    unsafe { IOHIDSetScrollAcceleration(handle, acceleration) }
1454}
1455
1456extern "C-unwind" {
1457    /// # Safety
1458    ///
1459    /// `acceleration` must be a valid pointer.
1460    #[cfg(feature = "libc")]
1461    #[deprecated]
1462    pub fn IOHIDGetMouseAcceleration(
1463        handle: io_connect_t,
1464        acceleration: *mut c_double,
1465    ) -> libc::kern_return_t;
1466}
1467
1468#[cfg(feature = "libc")]
1469#[deprecated]
1470#[inline]
1471pub extern "C-unwind" fn IOHIDSetMouseAcceleration(
1472    handle: io_connect_t,
1473    acceleration: c_double,
1474) -> libc::kern_return_t {
1475    extern "C-unwind" {
1476        fn IOHIDSetMouseAcceleration(
1477            handle: io_connect_t,
1478            acceleration: c_double,
1479        ) -> libc::kern_return_t;
1480    }
1481    unsafe { IOHIDSetMouseAcceleration(handle, acceleration) }
1482}
1483
1484extern "C-unwind" {
1485    /// # Safety
1486    ///
1487    /// `mode` must be a valid pointer.
1488    #[cfg(feature = "libc")]
1489    #[deprecated]
1490    pub fn IOHIDGetMouseButtonMode(handle: io_connect_t, mode: *mut c_int) -> libc::kern_return_t;
1491}
1492
1493#[cfg(feature = "libc")]
1494#[deprecated]
1495#[inline]
1496pub extern "C-unwind" fn IOHIDSetMouseButtonMode(
1497    handle: io_connect_t,
1498    mode: c_int,
1499) -> libc::kern_return_t {
1500    extern "C-unwind" {
1501        fn IOHIDSetMouseButtonMode(handle: io_connect_t, mode: c_int) -> libc::kern_return_t;
1502    }
1503    unsafe { IOHIDSetMouseButtonMode(handle, mode) }
1504}
1505
1506extern "C-unwind" {
1507    /// # Safety
1508    ///
1509    /// - `key` might not allow `None`.
1510    /// - `acceleration` must be a valid pointer.
1511    #[cfg(feature = "libc")]
1512    #[deprecated]
1513    pub fn IOHIDGetAccelerationWithKey(
1514        handle: io_connect_t,
1515        key: Option<&CFString>,
1516        acceleration: *mut c_double,
1517    ) -> libc::kern_return_t;
1518}
1519
1520extern "C-unwind" {
1521    /// # Safety
1522    ///
1523    /// `key` might not allow `None`.
1524    #[cfg(feature = "libc")]
1525    #[deprecated]
1526    pub fn IOHIDSetAccelerationWithKey(
1527        handle: io_connect_t,
1528        key: Option<&CFString>,
1529        acceleration: c_double,
1530    ) -> libc::kern_return_t;
1531}
1532
1533extern "C-unwind" {
1534    /// # Safety
1535    ///
1536    /// - `key` might not allow `None`.
1537    /// - `bytes` must be a valid pointer.
1538    /// - `actual_size` must be a valid pointer.
1539    #[cfg(feature = "libc")]
1540    #[deprecated]
1541    pub fn IOHIDGetParameter(
1542        handle: io_connect_t,
1543        key: Option<&CFString>,
1544        max_size: IOByteCount,
1545        bytes: *mut c_void,
1546        actual_size: *mut IOByteCount,
1547    ) -> libc::kern_return_t;
1548}
1549
1550extern "C-unwind" {
1551    /// # Safety
1552    ///
1553    /// - `key` might not allow `None`.
1554    /// - `bytes` must be a valid pointer.
1555    #[cfg(feature = "libc")]
1556    #[deprecated]
1557    pub fn IOHIDSetParameter(
1558        handle: io_connect_t,
1559        key: Option<&CFString>,
1560        bytes: *const c_void,
1561        size: IOByteCount,
1562    ) -> libc::kern_return_t;
1563}
1564
1565extern "C-unwind" {
1566    /// # Safety
1567    ///
1568    /// - `key` might not allow `None`.
1569    /// - `parameter` must be a valid pointer.
1570    #[cfg(feature = "libc")]
1571    pub fn IOHIDCopyCFTypeParameter(
1572        handle: io_connect_t,
1573        key: Option<&CFString>,
1574        parameter: *mut *const CFType,
1575    ) -> libc::kern_return_t;
1576}
1577
1578extern "C-unwind" {
1579    /// # Safety
1580    ///
1581    /// - `key` might not allow `None`.
1582    /// - `parameter` should be of the correct type.
1583    /// - `parameter` might not allow `None`.
1584    #[cfg(feature = "libc")]
1585    pub fn IOHIDSetCFTypeParameter(
1586        handle: io_connect_t,
1587        key: Option<&CFString>,
1588        parameter: Option<&CFType>,
1589    ) -> libc::kern_return_t;
1590}
1591
1592extern "C-unwind" {
1593    /// # Safety
1594    ///
1595    /// `state` must be a valid pointer.
1596    #[cfg(feature = "libc")]
1597    pub fn IOHIDGetStateForSelector(
1598        handle: io_connect_t,
1599        selector: c_int,
1600        state: *mut u32,
1601    ) -> libc::kern_return_t;
1602}
1603
1604#[cfg(feature = "libc")]
1605#[inline]
1606pub extern "C-unwind" fn IOHIDSetStateForSelector(
1607    handle: io_connect_t,
1608    selector: c_int,
1609    state: u32,
1610) -> libc::kern_return_t {
1611    extern "C-unwind" {
1612        fn IOHIDSetStateForSelector(
1613            handle: io_connect_t,
1614            selector: c_int,
1615            state: u32,
1616        ) -> libc::kern_return_t;
1617    }
1618    unsafe { IOHIDSetStateForSelector(handle, selector, state) }
1619}
1620
1621extern "C-unwind" {
1622    /// # Safety
1623    ///
1624    /// `state` must be a valid pointer.
1625    #[cfg(feature = "libc")]
1626    pub fn IOHIDGetModifierLockState(
1627        handle: io_connect_t,
1628        selector: c_int,
1629        state: *mut bool,
1630    ) -> libc::kern_return_t;
1631}
1632
1633#[cfg(feature = "libc")]
1634#[inline]
1635pub extern "C-unwind" fn IOHIDSetModifierLockState(
1636    handle: io_connect_t,
1637    selector: c_int,
1638    state: bool,
1639) -> libc::kern_return_t {
1640    extern "C-unwind" {
1641        fn IOHIDSetModifierLockState(
1642            handle: io_connect_t,
1643            selector: c_int,
1644            state: bool,
1645        ) -> libc::kern_return_t;
1646    }
1647    unsafe { IOHIDSetModifierLockState(handle, selector, state) }
1648}
1649
1650extern "C-unwind" {
1651    /// # Safety
1652    ///
1653    /// `display_token` must be a valid pointer.
1654    #[cfg(feature = "libc")]
1655    #[deprecated]
1656    pub fn IOHIDRegisterVirtualDisplay(
1657        handle: io_connect_t,
1658        display_token: *mut u32,
1659    ) -> libc::kern_return_t;
1660}
1661
1662#[cfg(feature = "libc")]
1663#[deprecated]
1664#[inline]
1665pub extern "C-unwind" fn IOHIDUnregisterVirtualDisplay(
1666    handle: io_connect_t,
1667    display_token: u32,
1668) -> libc::kern_return_t {
1669    extern "C-unwind" {
1670        fn IOHIDUnregisterVirtualDisplay(
1671            handle: io_connect_t,
1672            display_token: u32,
1673        ) -> libc::kern_return_t;
1674    }
1675    unsafe { IOHIDUnregisterVirtualDisplay(handle, display_token) }
1676}
1677
1678extern "C-unwind" {
1679    /// # Safety
1680    ///
1681    /// `bounds` must be a valid pointer.
1682    #[cfg(all(feature = "graphics", feature = "libc"))]
1683    #[deprecated]
1684    pub fn IOHIDSetVirtualDisplayBounds(
1685        handle: io_connect_t,
1686        display_token: u32,
1687        bounds: *const IOGBounds,
1688    ) -> libc::kern_return_t;
1689}
1690
1691extern "C-unwind" {
1692    /// # Safety
1693    ///
1694    /// `hid_activity_idle` must be a valid pointer.
1695    #[cfg(feature = "libc")]
1696    #[deprecated]
1697    pub fn IOHIDGetActivityState(
1698        handle: io_connect_t,
1699        hid_activity_idle: *mut bool,
1700    ) -> libc::kern_return_t;
1701}
1702
1703/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iohidrequesttype?language=objc)
1704#[repr(transparent)]
1705#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1706pub struct IOHIDRequestType(pub c_uint);
1707impl IOHIDRequestType {
1708    #[doc(alias = "kIOHIDRequestTypePostEvent")]
1709    pub const PostEvent: Self = Self(0);
1710    #[doc(alias = "kIOHIDRequestTypeListenEvent")]
1711    pub const ListenEvent: Self = Self(1);
1712}
1713
1714#[cfg(feature = "objc2")]
1715unsafe impl Encode for IOHIDRequestType {
1716    const ENCODING: Encoding = c_uint::ENCODING;
1717}
1718
1719#[cfg(feature = "objc2")]
1720unsafe impl RefEncode for IOHIDRequestType {
1721    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1722}
1723
1724/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iohidaccesstype?language=objc)
1725#[repr(transparent)]
1726#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1727pub struct IOHIDAccessType(pub c_uint);
1728impl IOHIDAccessType {
1729    #[doc(alias = "kIOHIDAccessTypeGranted")]
1730    pub const Granted: Self = Self(0);
1731    #[doc(alias = "kIOHIDAccessTypeDenied")]
1732    pub const Denied: Self = Self(1);
1733    #[doc(alias = "kIOHIDAccessTypeUnknown")]
1734    pub const Unknown: Self = Self(2);
1735}
1736
1737#[cfg(feature = "objc2")]
1738unsafe impl Encode for IOHIDAccessType {
1739    const ENCODING: Encoding = c_uint::ENCODING;
1740}
1741
1742#[cfg(feature = "objc2")]
1743unsafe impl RefEncode for IOHIDAccessType {
1744    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1745}
1746
1747/// Checks if the process has access to a specific IOHIDRequestType. A process
1748/// may request access by calling the IOHIDRequestAccess function.
1749///
1750///
1751/// Parameter `requestType`: The request type defined in the IOHIDRequestType enumerator.
1752///
1753///
1754/// Returns: Returns an access type defined in the IOHIDAccessType enumerator.
1755#[inline]
1756pub extern "C-unwind" fn IOHIDCheckAccess(request_type: IOHIDRequestType) -> IOHIDAccessType {
1757    extern "C-unwind" {
1758        fn IOHIDCheckAccess(request_type: IOHIDRequestType) -> IOHIDAccessType;
1759    }
1760    unsafe { IOHIDCheckAccess(request_type) }
1761}
1762
1763/// Requests access from the user for a specific IOHIDRequestType.
1764///
1765///
1766/// Processes that wish to post events through the IOHIDPostEvent API, or receive
1767/// reports through the IOHIDManager/IOHIDDevice API must be granted access first
1768/// by the user. If you do not call this API, it will be called on your behalf
1769/// when the API are used.
1770///
1771///
1772/// Parameter `requestType`: The request type defined in the IOHIDRequestType enumerator.
1773///
1774///
1775/// Returns: Returns true if access was granted.
1776#[inline]
1777pub extern "C-unwind" fn IOHIDRequestAccess(request_type: IOHIDRequestType) -> bool {
1778    extern "C-unwind" {
1779        fn IOHIDRequestAccess(request_type: IOHIDRequestType) -> bool;
1780    }
1781    unsafe { IOHIDRequestAccess(request_type) }
1782}
1783
1784/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxeventhandle?language=objc)
1785#[cfg(feature = "libc")]
1786pub type NXEventHandle = libc::mach_port_t;
1787
1788#[cfg(feature = "libc")]
1789#[deprecated]
1790#[inline]
1791pub extern "C-unwind" fn NXOpenEventStatus() -> NXEventHandle {
1792    extern "C-unwind" {
1793        fn NXOpenEventStatus() -> NXEventHandle;
1794    }
1795    unsafe { NXOpenEventStatus() }
1796}
1797
1798#[cfg(feature = "libc")]
1799#[deprecated]
1800#[inline]
1801pub extern "C-unwind" fn NXCloseEventStatus(handle: NXEventHandle) {
1802    extern "C-unwind" {
1803        fn NXCloseEventStatus(handle: NXEventHandle);
1804    }
1805    unsafe { NXCloseEventStatus(handle) }
1806}
1807
1808extern "C-unwind" {
1809    /// # Safety
1810    ///
1811    /// - `flavor` must be a valid pointer.
1812    /// - `evs_info` must be a valid pointer.
1813    /// - `evs_info_cnt` must be a valid pointer.
1814    #[cfg(feature = "libc")]
1815    #[deprecated]
1816    pub fn NXEventSystemInfo(
1817        handle: NXEventHandle,
1818        flavor: *mut c_char,
1819        evs_info: *mut c_int,
1820        evs_info_cnt: *mut c_uint,
1821    ) -> NXEventSystemInfoType;
1822}
1823
1824#[cfg(feature = "libc")]
1825#[deprecated]
1826#[inline]
1827pub extern "C-unwind" fn NXSetKeyRepeatInterval(handle: NXEventHandle, seconds: c_double) {
1828    extern "C-unwind" {
1829        fn NXSetKeyRepeatInterval(handle: NXEventHandle, seconds: c_double);
1830    }
1831    unsafe { NXSetKeyRepeatInterval(handle, seconds) }
1832}
1833
1834#[cfg(feature = "libc")]
1835#[deprecated]
1836#[inline]
1837pub extern "C-unwind" fn NXKeyRepeatInterval(handle: NXEventHandle) -> c_double {
1838    extern "C-unwind" {
1839        fn NXKeyRepeatInterval(handle: NXEventHandle) -> c_double;
1840    }
1841    unsafe { NXKeyRepeatInterval(handle) }
1842}
1843
1844#[cfg(feature = "libc")]
1845#[deprecated]
1846#[inline]
1847pub extern "C-unwind" fn NXSetKeyRepeatThreshold(handle: NXEventHandle, threshold: c_double) {
1848    extern "C-unwind" {
1849        fn NXSetKeyRepeatThreshold(handle: NXEventHandle, threshold: c_double);
1850    }
1851    unsafe { NXSetKeyRepeatThreshold(handle, threshold) }
1852}
1853
1854#[cfg(feature = "libc")]
1855#[deprecated]
1856#[inline]
1857pub extern "C-unwind" fn NXKeyRepeatThreshold(handle: NXEventHandle) -> c_double {
1858    extern "C-unwind" {
1859        fn NXKeyRepeatThreshold(handle: NXEventHandle) -> c_double;
1860    }
1861    unsafe { NXKeyRepeatThreshold(handle) }
1862}
1863
1864#[cfg(feature = "libc")]
1865#[deprecated]
1866#[inline]
1867pub extern "C-unwind" fn NXResetKeyboard(handle: NXEventHandle) {
1868    extern "C-unwind" {
1869        fn NXResetKeyboard(handle: NXEventHandle);
1870    }
1871    unsafe { NXResetKeyboard(handle) }
1872}
1873
1874#[cfg(feature = "libc")]
1875#[deprecated]
1876#[inline]
1877pub extern "C-unwind" fn NXSetClickTime(handle: NXEventHandle, seconds: c_double) {
1878    extern "C-unwind" {
1879        fn NXSetClickTime(handle: NXEventHandle, seconds: c_double);
1880    }
1881    unsafe { NXSetClickTime(handle, seconds) }
1882}
1883
1884#[cfg(feature = "libc")]
1885#[deprecated]
1886#[inline]
1887pub extern "C-unwind" fn NXClickTime(handle: NXEventHandle) -> c_double {
1888    extern "C-unwind" {
1889        fn NXClickTime(handle: NXEventHandle) -> c_double;
1890    }
1891    unsafe { NXClickTime(handle) }
1892}
1893
1894extern "C-unwind" {
1895    /// # Safety
1896    ///
1897    /// `area` must be a valid pointer.
1898    #[cfg(feature = "libc")]
1899    #[deprecated]
1900    pub fn NXSetClickSpace(handle: NXEventHandle, area: *mut NXSize);
1901}
1902
1903extern "C-unwind" {
1904    /// # Safety
1905    ///
1906    /// `area` must be a valid pointer.
1907    #[cfg(feature = "libc")]
1908    #[deprecated]
1909    pub fn NXGetClickSpace(handle: NXEventHandle, area: *mut NXSize);
1910}
1911
1912#[cfg(feature = "libc")]
1913#[deprecated]
1914#[inline]
1915pub extern "C-unwind" fn NXResetMouse(handle: NXEventHandle) {
1916    extern "C-unwind" {
1917        fn NXResetMouse(handle: NXEventHandle);
1918    }
1919    unsafe { NXResetMouse(handle) }
1920}
1921
1922/// [Apple's documentation](https://developer.apple.com/documentation/iokit/_nxparsedkeymapping_?language=objc)
1923#[repr(C)]
1924#[derive(Clone, Copy, Debug, PartialEq)]
1925pub struct _NXParsedKeyMapping_ {
1926    pub shorts: c_short,
1927    pub keyBits: [c_char; 256],
1928    pub maxMod: c_int,
1929    pub modDefs: [*mut c_uchar; 16],
1930    pub numDefs: c_int,
1931    pub keyDefs: [*mut c_uchar; 256],
1932    pub numSeqs: c_int,
1933    pub seqDefs: [*mut c_uchar; 128],
1934    pub numSpecialKeys: c_int,
1935    pub specialKeys: [c_ushort; 24],
1936    pub mapping: *const c_uchar,
1937    pub mappingLen: c_int,
1938}
1939
1940#[cfg(feature = "objc2")]
1941unsafe impl Encode for _NXParsedKeyMapping_ {
1942    const ENCODING: Encoding = Encoding::Struct(
1943        "_NXParsedKeyMapping_",
1944        &[
1945            <c_short>::ENCODING,
1946            <[c_char; 256]>::ENCODING,
1947            <c_int>::ENCODING,
1948            <[*mut c_uchar; 16]>::ENCODING,
1949            <c_int>::ENCODING,
1950            <[*mut c_uchar; 256]>::ENCODING,
1951            <c_int>::ENCODING,
1952            <[*mut c_uchar; 128]>::ENCODING,
1953            <c_int>::ENCODING,
1954            <[c_ushort; 24]>::ENCODING,
1955            <*const c_uchar>::ENCODING,
1956            <c_int>::ENCODING,
1957        ],
1958    );
1959}
1960
1961#[cfg(feature = "objc2")]
1962unsafe impl RefEncode for _NXParsedKeyMapping_ {
1963    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1964}
1965
1966/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxparsedkeymapping?language=objc)
1967pub type NXParsedKeyMapping = _NXParsedKeyMapping_;
1968
1969/// IOHIDEventSystemClient
1970///
1971/// IOHIDEventSystemClient serves as a client that can be used
1972/// for reading/writing specific properties of the HID event system, as
1973/// well as getting services of the HID event system. A list of accessible
1974/// properties can be found in
1975/// <code>
1976/// IOKit/hid/IOHIDProperties.h
1977/// </code>
1978/// .
1979///
1980///
1981/// See also: IOKit/hidsystem/IOHIDServiceClient.h
1982///
1983/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iohideventsystemclient?language=objc)
1984#[doc(alias = "IOHIDEventSystemClientRef")]
1985#[repr(C)]
1986pub struct IOHIDEventSystemClient {
1987    inner: [u8; 0],
1988    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
1989}
1990
1991cf_type!(
1992    unsafe impl IOHIDEventSystemClient {}
1993);
1994#[cfg(feature = "objc2")]
1995cf_objc2_type!(
1996    unsafe impl RefEncode<"__IOHIDEventSystemClient"> for IOHIDEventSystemClient {}
1997);
1998
1999impl IOHIDEventSystemClient {
2000    /// Creates a client of the HID event system that has to ability to read/write certain
2001    /// properties.
2002    ///
2003    ///
2004    /// Certain properties have the ability to be set/read by clients, see
2005    /// <code>
2006    /// IOHIDProperties.h
2007    /// </code>
2008    /// for a list of these properties.
2009    ///
2010    ///
2011    /// Parameter `allocator`: a custom allocator reference to be used for allocation of the result.
2012    ///
2013    ///
2014    /// Returns: Returns a
2015    /// <code>
2016    /// IOHIDEventSystemClientRef
2017    /// </code>
2018    /// on success.
2019    /// Caller should CFRelease the client when they are finished with it, or keep a
2020    /// reference to the client if multiple properties need to be set/read.
2021    #[doc(alias = "IOHIDEventSystemClientCreateSimpleClient")]
2022    #[inline]
2023    pub fn new_simple_client(
2024        allocator: Option<&CFAllocator>,
2025    ) -> CFRetained<IOHIDEventSystemClient> {
2026        extern "C-unwind" {
2027            fn IOHIDEventSystemClientCreateSimpleClient(
2028                allocator: Option<&CFAllocator>,
2029            ) -> Option<NonNull<IOHIDEventSystemClient>>;
2030        }
2031        let ret = unsafe { IOHIDEventSystemClientCreateSimpleClient(allocator) };
2032        let ret =
2033            ret.expect("function was marked as returning non-null, but actually returned NULL");
2034        unsafe { CFRetained::from_raw(ret) }
2035    }
2036
2037    /// Sets a property on the HID event system.
2038    ///
2039    ///
2040    /// Parameter `client`: the HID client that created via
2041    /// <code>
2042    /// IOHIDEventSystemClientCreateSimpleClient()
2043    /// </code>
2044    /// .
2045    ///
2046    ///
2047    /// Parameter `key`: the property key to set. A list of keys can be found in
2048    /// <code>
2049    /// HIDProperties.h
2050    /// </code>
2051    /// .
2052    ///
2053    ///
2054    /// Parameter `property`: the value to set the property.
2055    ///
2056    ///
2057    /// Returns: Returns true on success.
2058    ///
2059    /// # Safety
2060    ///
2061    /// `property` should be of the correct type.
2062    #[doc(alias = "IOHIDEventSystemClientSetProperty")]
2063    #[inline]
2064    pub unsafe fn set_property(&self, key: &CFString, property: &CFType) -> bool {
2065        extern "C-unwind" {
2066            fn IOHIDEventSystemClientSetProperty(
2067                client: &IOHIDEventSystemClient,
2068                key: &CFString,
2069                property: &CFType,
2070            ) -> Boolean;
2071        }
2072        let ret = unsafe { IOHIDEventSystemClientSetProperty(self, key, property) };
2073        ret != 0
2074    }
2075
2076    /// Copies a property from the HID event system.
2077    ///
2078    ///
2079    /// Parameter `client`: the HID client created via
2080    /// <code>
2081    /// IOHIDEventSystemClientCreateSimpleClient()
2082    /// </code>
2083    /// .
2084    ///
2085    ///
2086    /// Parameter `key`: the property key to copy. A list of keys can be found in
2087    /// <code>
2088    /// HIDProperties.h
2089    /// </code>
2090    /// .
2091    ///
2092    ///
2093    /// Returns: Returns a CFTypeRef of the property to be copied on success, otherwise NULL.
2094    /// Caller is responsible for calling CFRelease on the property.
2095    #[doc(alias = "IOHIDEventSystemClientCopyProperty")]
2096    #[inline]
2097    pub fn property(&self, key: &CFString) -> Option<CFRetained<CFType>> {
2098        extern "C-unwind" {
2099            fn IOHIDEventSystemClientCopyProperty(
2100                client: &IOHIDEventSystemClient,
2101                key: &CFString,
2102            ) -> Option<NonNull<CFType>>;
2103        }
2104        let ret = unsafe { IOHIDEventSystemClientCopyProperty(self, key) };
2105        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2106    }
2107}
2108
2109unsafe impl ConcreteType for IOHIDEventSystemClient {
2110    /// Returns: Returns the CFTypeID of the
2111    /// <code>
2112    /// IOHIDEventSystemClient
2113    /// </code>
2114    /// class.
2115    #[doc(alias = "IOHIDEventSystemClientGetTypeID")]
2116    #[inline]
2117    fn type_id() -> CFTypeID {
2118        extern "C-unwind" {
2119            fn IOHIDEventSystemClientGetTypeID() -> CFTypeID;
2120        }
2121        unsafe { IOHIDEventSystemClientGetTypeID() }
2122    }
2123}
2124
2125impl IOHIDEventSystemClient {
2126    /// Copies all services available to the client.
2127    ///
2128    ///
2129    /// Useful for seeing services that are available. Clients can further probe
2130    /// the services with the APIs available in
2131    /// <code>
2132    /// IOHIDServiceClient.h
2133    /// </code>
2134    /// .
2135    ///
2136    ///
2137    /// Parameter `client`: the HID client that created via
2138    /// <code>
2139    /// IOHIDEventSystemClientCreateSimpleClient()
2140    /// </code>
2141    /// .
2142    ///
2143    ///
2144    /// Returns: On success, returns a CFArrayRef of
2145    /// <code>
2146    /// IOHIDServiceClientRefs
2147    /// </code>
2148    /// that are
2149    /// available to the client. Caller is responsible for releasing the array.
2150    #[doc(alias = "IOHIDEventSystemClientCopyServices")]
2151    #[inline]
2152    pub fn services(&self) -> Option<CFRetained<CFArray>> {
2153        extern "C-unwind" {
2154            fn IOHIDEventSystemClientCopyServices(
2155                client: &IOHIDEventSystemClient,
2156            ) -> Option<NonNull<CFArray>>;
2157        }
2158        let ret = unsafe { IOHIDEventSystemClientCopyServices(self) };
2159        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2160    }
2161}
2162
2163/// IOHIDServiceClient
2164///
2165/// IOHIDServiceClient serves as a client to the HID event system
2166/// services. Users are able to copy/set specific properties (defined in
2167/// <code>
2168/// IOKit/hid/IOHIDProperties.h
2169/// </code>
2170/// ), and gather more information
2171/// about the services available in the HID event system.
2172///
2173/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iohidserviceclient?language=objc)
2174#[doc(alias = "IOHIDServiceClientRef")]
2175#[repr(C)]
2176pub struct IOHIDServiceClient {
2177    inner: [u8; 0],
2178    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
2179}
2180
2181cf_type!(
2182    unsafe impl IOHIDServiceClient {}
2183);
2184#[cfg(feature = "objc2")]
2185cf_objc2_type!(
2186    unsafe impl RefEncode<"__IOHIDServiceClient"> for IOHIDServiceClient {}
2187);
2188
2189impl IOHIDServiceClient {
2190    /// Sets a property on the HID service.
2191    ///
2192    ///
2193    /// Parameter `service`: the HID service to set the property on.
2194    ///
2195    ///
2196    /// Parameter `key`: the property key to set. A list of keys can be found in
2197    /// <code>
2198    /// HIDProperties.h
2199    /// </code>
2200    /// .
2201    ///
2202    ///
2203    /// Parameter `property`: the value to set the property.
2204    ///
2205    ///
2206    /// Returns: Returns true on success.
2207    ///
2208    /// # Safety
2209    ///
2210    /// `property` should be of the correct type.
2211    #[doc(alias = "IOHIDServiceClientSetProperty")]
2212    #[inline]
2213    pub unsafe fn set_property(&self, key: &CFString, property: &CFType) -> bool {
2214        extern "C-unwind" {
2215            fn IOHIDServiceClientSetProperty(
2216                service: &IOHIDServiceClient,
2217                key: &CFString,
2218                property: &CFType,
2219            ) -> Boolean;
2220        }
2221        let ret = unsafe { IOHIDServiceClientSetProperty(self, key, property) };
2222        ret != 0
2223    }
2224
2225    /// Copies a property from the HID service.
2226    ///
2227    ///
2228    /// Parameter `service`: the HID service to copy the property from.
2229    ///
2230    ///
2231    /// Parameter `key`: the property key to copy. A list of keys can be found in
2232    /// <code>
2233    /// HIDProperties.h
2234    /// </code>
2235    /// .
2236    ///
2237    ///
2238    /// Returns: Returns a CFTypeRef of the property to be copied on success, otherwise NULL.
2239    /// Caller is responsible for calling CFRelease on the property.
2240    #[doc(alias = "IOHIDServiceClientCopyProperty")]
2241    #[inline]
2242    pub fn property(&self, key: &CFString) -> Option<CFRetained<CFType>> {
2243        extern "C-unwind" {
2244            fn IOHIDServiceClientCopyProperty(
2245                service: &IOHIDServiceClient,
2246                key: &CFString,
2247            ) -> Option<NonNull<CFType>>;
2248        }
2249        let ret = unsafe { IOHIDServiceClientCopyProperty(self, key) };
2250        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2251    }
2252}
2253
2254unsafe impl ConcreteType for IOHIDServiceClient {
2255    /// Returns: Returns the CFTypeID of the
2256    /// <code>
2257    /// IOHIDServiceClient
2258    /// </code>
2259    /// class.
2260    #[doc(alias = "IOHIDServiceClientGetTypeID")]
2261    #[inline]
2262    fn type_id() -> CFTypeID {
2263        extern "C-unwind" {
2264            fn IOHIDServiceClientGetTypeID() -> CFTypeID;
2265        }
2266        unsafe { IOHIDServiceClientGetTypeID() }
2267    }
2268}
2269
2270impl IOHIDServiceClient {
2271    /// Parameter `service`: the HID service to get the registry ID for.
2272    ///
2273    ///
2274    /// Returns: Returns a CFTypeRef containing the registry ID for the service.
2275    #[doc(alias = "IOHIDServiceClientGetRegistryID")]
2276    #[inline]
2277    pub fn registry_id(&self) -> CFRetained<CFType> {
2278        extern "C-unwind" {
2279            fn IOHIDServiceClientGetRegistryID(
2280                service: &IOHIDServiceClient,
2281            ) -> Option<NonNull<CFType>>;
2282        }
2283        let ret = unsafe { IOHIDServiceClientGetRegistryID(self) };
2284        let ret =
2285            ret.expect("function was marked as returning non-null, but actually returned NULL");
2286        unsafe { CFRetained::retain(ret) }
2287    }
2288
2289    /// Determines if a HID service conforms to a specific usage page and usage.
2290    ///
2291    ///
2292    /// Parameter `usagePage`: A usage page defined in
2293    /// <code>
2294    /// IOHIDUsageTables.h
2295    /// </code>
2296    /// .
2297    ///
2298    ///
2299    /// Parameter `usage`: A usage defined in
2300    /// <code>
2301    /// IOHIDUsageTables.h
2302    /// </code>
2303    /// .
2304    ///
2305    ///
2306    /// Returns: Returns true if the service conforms to the provided usage page and usage.
2307    #[doc(alias = "IOHIDServiceClientConformsTo")]
2308    #[cfg(feature = "libc")]
2309    #[inline]
2310    pub fn conforms_to(&self, usage_page: u32, usage: u32) -> bool {
2311        extern "C-unwind" {
2312            fn IOHIDServiceClientConformsTo(
2313                service: &IOHIDServiceClient,
2314                usage_page: u32,
2315                usage: u32,
2316            ) -> libc::boolean_t;
2317        }
2318        let ret = unsafe { IOHIDServiceClientConformsTo(self, usage_page, usage) };
2319        ret != 0
2320    }
2321}
2322
2323/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iohiduserdevice?language=objc)
2324#[doc(alias = "IOHIDUserDeviceRef")]
2325#[repr(C)]
2326pub struct IOHIDUserDevice {
2327    inner: [u8; 0],
2328    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
2329}
2330
2331cf_type!(
2332    unsafe impl IOHIDUserDevice {}
2333);
2334#[cfg(feature = "objc2")]
2335cf_objc2_type!(
2336    unsafe impl RefEncode<"__IOHIDUserDevice"> for IOHIDUserDevice {}
2337);
2338
2339/// The type block used for IOHIDUserDevice set report calls.
2340///
2341///
2342/// Parameter `type`: The report type.
2343///
2344///
2345/// Parameter `reportID`: The report ID.
2346///
2347///
2348/// Parameter `report`: The report bytes.
2349///
2350///
2351/// Parameter `reportLength`: The length of the report being passed in.
2352///
2353/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iohiduserdevicesetreportblock?language=objc)
2354#[cfg(all(feature = "block2", feature = "hid"))]
2355pub type IOHIDUserDeviceSetReportBlock =
2356    *mut block2::DynBlock<dyn Fn(IOHIDReportType, u32, NonNull<u8>, CFIndex) -> IOReturn>;
2357
2358/// The type block used for IOHIDUserDevice get report calls.
2359///
2360///
2361/// Parameter `type`: The report type.
2362///
2363///
2364/// Parameter `reportID`: The report ID.
2365///
2366///
2367/// Parameter `report`: A buffer to be filled in by the implementor with the report.
2368///
2369///
2370/// Parameter `reportLength`: The length of the report buffer being passed in. The implementor of this
2371/// block may update the reportLength variable to reflect the actual length of
2372/// the returned report.
2373///
2374/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iohiduserdevicegetreportblock?language=objc)
2375#[cfg(all(feature = "block2", feature = "hid"))]
2376pub type IOHIDUserDeviceGetReportBlock =
2377    *mut block2::DynBlock<dyn Fn(IOHIDReportType, u32, NonNull<u8>, NonNull<CFIndex>) -> IOReturn>;
2378
2379/// Enumerator of IOHIDUserDeviceOptions to be passed in to
2380/// IOHIDUserDeviceCreateWithOptions.
2381///
2382/// Field: IOHIDUserDeviceOptionsCreateOnActivate
2383/// Specifies that the kernel HID device should not be created until the call
2384/// to IOHIDUserDeviceActivate. This may be useful for preventing dropped get/set
2385/// report calls to the user device.
2386///
2387/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iohiduserdeviceoptions?language=objc)
2388// NS_ENUM
2389#[repr(transparent)]
2390#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2391pub struct IOHIDUserDeviceOptions(pub IOOptionBits);
2392impl IOHIDUserDeviceOptions {
2393    #[doc(alias = "IOHIDUserDeviceOptionsCreateOnActivate")]
2394    pub const CreateOnActivate: Self = Self(1 << 0);
2395}
2396
2397#[cfg(feature = "objc2")]
2398unsafe impl Encode for IOHIDUserDeviceOptions {
2399    const ENCODING: Encoding = IOOptionBits::ENCODING;
2400}
2401
2402#[cfg(feature = "objc2")]
2403unsafe impl RefEncode for IOHIDUserDeviceOptions {
2404    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2405}
2406
2407unsafe impl ConcreteType for IOHIDUserDevice {
2408    /// Returns the type identifier of all IOHIDUserDevice instances.
2409    #[doc(alias = "IOHIDUserDeviceGetTypeID")]
2410    #[inline]
2411    fn type_id() -> CFTypeID {
2412        extern "C-unwind" {
2413            fn IOHIDUserDeviceGetTypeID() -> CFTypeID;
2414        }
2415        unsafe { IOHIDUserDeviceGetTypeID() }
2416    }
2417}
2418
2419impl IOHIDUserDevice {
2420    /// Creates a virtual IOHIDDevice in the kernel.
2421    ///
2422    ///
2423    /// The IOHIDUserDeviceRef represents a virtual IOHIDDevice. In order to create
2424    /// the device, the entitlement "com.apple.developer.hid.virtual.device" is
2425    /// required to validate the source of the device.
2426    ///
2427    ///
2428    /// Parameter `allocator`: Allocator to be used during creation.
2429    ///
2430    ///
2431    /// Parameter `properties`: Dictionary containing device properties indexed by keys defined in
2432    /// IOHIDKeys.h. At the bare minimum, the kIOHIDReportDescriptorKey key must be
2433    /// provided, where the value represents a CFData representation of the device's
2434    /// report descriptor.
2435    ///
2436    ///
2437    /// Parameter `options`: Options to be used when creating the device.
2438    ///
2439    ///
2440    /// Returns: Returns a IOHIDUserDeviceRef on success.
2441    ///
2442    /// # Safety
2443    ///
2444    /// `properties` generics must be of the correct type.
2445    #[doc(alias = "IOHIDUserDeviceCreateWithProperties")]
2446    #[inline]
2447    pub unsafe fn with_properties(
2448        allocator: Option<&CFAllocator>,
2449        properties: &CFDictionary,
2450        options: IOOptionBits,
2451    ) -> Option<CFRetained<IOHIDUserDevice>> {
2452        extern "C-unwind" {
2453            fn IOHIDUserDeviceCreateWithProperties(
2454                allocator: Option<&CFAllocator>,
2455                properties: &CFDictionary,
2456                options: IOOptionBits,
2457            ) -> Option<NonNull<IOHIDUserDevice>>;
2458        }
2459        let ret = unsafe { IOHIDUserDeviceCreateWithProperties(allocator, properties, options) };
2460        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2461    }
2462
2463    /// Registers a block to receive get report requests.
2464    ///
2465    ///
2466    /// The call to IOHIDUserDeviceRegisterGetReportBlock should be made before the
2467    /// device is activated. The device must be activated in order to receive
2468    /// get report requests.
2469    ///
2470    ///
2471    /// Parameter `device`: Reference to a IOHIDUserDeviceRef
2472    ///
2473    ///
2474    /// Parameter `block`: The block to be invoked for get report calls.
2475    ///
2476    /// # Safety
2477    ///
2478    /// `block` must be a valid pointer.
2479    #[doc(alias = "IOHIDUserDeviceRegisterGetReportBlock")]
2480    #[cfg(all(feature = "block2", feature = "hid"))]
2481    #[inline]
2482    pub unsafe fn register_get_report_block(&self, block: IOHIDUserDeviceGetReportBlock) {
2483        extern "C-unwind" {
2484            fn IOHIDUserDeviceRegisterGetReportBlock(
2485                device: &IOHIDUserDevice,
2486                block: IOHIDUserDeviceGetReportBlock,
2487            );
2488        }
2489        unsafe { IOHIDUserDeviceRegisterGetReportBlock(self, block) }
2490    }
2491
2492    /// Registers a block to receive set report requests.
2493    ///
2494    ///
2495    /// The call to IOHIDUserDeviceRegisterSetReportBlock should be made before the
2496    /// device is activated. The device must be activated in order to receive set
2497    /// report requests.
2498    ///
2499    ///
2500    /// Parameter `device`: Reference to a IOHIDUserDeviceRef
2501    ///
2502    ///
2503    /// Parameter `block`: The block to be invoked for set report calls.
2504    ///
2505    /// # Safety
2506    ///
2507    /// `block` must be a valid pointer.
2508    #[doc(alias = "IOHIDUserDeviceRegisterSetReportBlock")]
2509    #[cfg(all(feature = "block2", feature = "hid"))]
2510    #[inline]
2511    pub unsafe fn register_set_report_block(&self, block: IOHIDUserDeviceSetReportBlock) {
2512        extern "C-unwind" {
2513            fn IOHIDUserDeviceRegisterSetReportBlock(
2514                device: &IOHIDUserDevice,
2515                block: IOHIDUserDeviceSetReportBlock,
2516            );
2517        }
2518        unsafe { IOHIDUserDeviceRegisterSetReportBlock(self, block) }
2519    }
2520
2521    /// Sets the dispatch queue to be associated with the IOHIDUserDevice.
2522    /// This is necessary in order to receive asynchronous events from the kernel.
2523    ///
2524    ///
2525    /// A call to IOHIDUserDeviceSetDispatchQueue should only be made once.
2526    ///
2527    /// After a dispatch queue is set, the IOHIDUserDevice must make a call to
2528    /// activate via IOHIDUserDeviceActivate and cancel via IOHIDUserDeviceCancel.
2529    /// All calls to "Register" functions should be done before activation and not
2530    /// after cancellation.
2531    ///
2532    ///
2533    /// Parameter `device`: Reference to an IOHIDUserDevice
2534    ///
2535    ///
2536    /// Parameter `queue`: The dispatch queue to which the event handler block will be submitted.
2537    ///
2538    /// # Safety
2539    ///
2540    /// `queue` possibly has additional threading requirements.
2541    #[doc(alias = "IOHIDUserDeviceSetDispatchQueue")]
2542    #[cfg(feature = "dispatch2")]
2543    #[inline]
2544    pub unsafe fn set_dispatch_queue(&self, queue: &DispatchQueue) {
2545        extern "C-unwind" {
2546            fn IOHIDUserDeviceSetDispatchQueue(device: &IOHIDUserDevice, queue: &DispatchQueue);
2547        }
2548        unsafe { IOHIDUserDeviceSetDispatchQueue(self, queue) }
2549    }
2550
2551    /// Sets a cancellation handler for the dispatch queue associated with
2552    /// IOHIDUserDeviceScheduleWithDispatchQueue.
2553    ///
2554    ///
2555    /// The cancellation handler (if specified) will be submitted to the device's
2556    /// dispatch queue in response to a call to to IOHIDUserDeviceCancel
2557    /// after all the events have been handled.
2558    ///
2559    /// The IOHIDUserDeviceRef should only be released after the device has been
2560    /// cancelled, and the cancel handler has been called. This is to ensure all
2561    /// asynchronous objects are released. For example:
2562    ///
2563    /// dispatch_block_t cancelHandler = dispatch_block_create(0, ^{
2564    /// CFRelease(device);
2565    /// });
2566    /// IOHIDUserDeviceSetCancelHandler(device, cancelHandler);
2567    /// IOHIDUserDeviceActivate(device);
2568    /// IOHIDUserDeviceCancel(device);
2569    ///
2570    ///
2571    /// Parameter `device`: Reference to an IOHIDUserDevice.
2572    ///
2573    ///
2574    /// Parameter `handler`: The cancellation handler block to be associated with the dispatch queue.
2575    ///
2576    /// # Safety
2577    ///
2578    /// `handler` must be a valid pointer.
2579    #[doc(alias = "IOHIDUserDeviceSetCancelHandler")]
2580    #[cfg(feature = "dispatch2")]
2581    #[inline]
2582    pub unsafe fn set_cancel_handler(&self, handler: dispatch_block_t) {
2583        extern "C-unwind" {
2584            fn IOHIDUserDeviceSetCancelHandler(device: &IOHIDUserDevice, handler: dispatch_block_t);
2585        }
2586        unsafe { IOHIDUserDeviceSetCancelHandler(self, handler) }
2587    }
2588
2589    /// Activates the IOHIDUserDevice object.
2590    ///
2591    ///
2592    /// An IOHIDUserDevice object associated with a dispatch queue is created
2593    /// in an inactive state. The object must be activated in order to
2594    /// receive asynchronous events from the kernel.
2595    ///
2596    /// A dispatch queue must be set via IOHIDUserDeviceSetDispatchQueue before
2597    /// activation.
2598    ///
2599    /// An activated device must be cancelled via IOHIDUserDeviceCancel. All calls
2600    /// to "Register" functions should be done before activation and not after
2601    /// cancellation.
2602    ///
2603    /// Calling IOHIDUserDeviceActivate on an active IOHIDUserDevice has no effect.
2604    ///
2605    ///
2606    /// Parameter `device`: Reference to an IOHIDUserDevice.
2607    #[doc(alias = "IOHIDUserDeviceActivate")]
2608    #[inline]
2609    pub fn activate(&self) {
2610        extern "C-unwind" {
2611            fn IOHIDUserDeviceActivate(device: &IOHIDUserDevice);
2612        }
2613        unsafe { IOHIDUserDeviceActivate(self) }
2614    }
2615
2616    /// Cancels the IOHIDUserDevice preventing any further invocation of its event
2617    /// handler block.
2618    ///
2619    ///
2620    /// Cancelling prevents any further invocation of the event handler block for
2621    /// the specified dispatch queue, but does not interrupt an event handler block
2622    /// that is already in progress.
2623    ///
2624    /// Explicit cancellation of the IOHIDUserDevice is required, no implicit
2625    /// cancellation takes place.
2626    ///
2627    /// Calling IOHIDUserDeviceCancel on an already cancelled queue has no effect.
2628    ///
2629    /// The IOHIDUserDeviceRef should only be released after the device has been
2630    /// cancelled, and the cancel handler has been called. This is to ensure all
2631    /// asynchronous objects are released. For example:
2632    ///
2633    /// dispatch_block_t cancelHandler = dispatch_block_create(0, ^{
2634    /// CFRelease(device);
2635    /// });
2636    /// IOHIDUserDeviceSetCancelHandler(device, cancelHandler);
2637    /// IOHIDUserDeviceActivate(device);
2638    /// IOHIDUserDeviceCancel(device);
2639    ///
2640    ///
2641    /// Parameter `device`: Reference to an IOHIDUserDevice
2642    #[doc(alias = "IOHIDUserDeviceCancel")]
2643    #[inline]
2644    pub fn cancel(&self) {
2645        extern "C-unwind" {
2646            fn IOHIDUserDeviceCancel(device: &IOHIDUserDevice);
2647        }
2648        unsafe { IOHIDUserDeviceCancel(self) }
2649    }
2650
2651    /// Obtains a property from the device.
2652    ///
2653    ///
2654    /// Parameter `key`: The property key.
2655    ///
2656    ///
2657    /// Returns: Returns the property on success.
2658    #[doc(alias = "IOHIDUserDeviceCopyProperty")]
2659    #[inline]
2660    pub fn property(&self, key: &CFString) -> Option<CFRetained<CFType>> {
2661        extern "C-unwind" {
2662            fn IOHIDUserDeviceCopyProperty(
2663                device: &IOHIDUserDevice,
2664                key: &CFString,
2665            ) -> Option<NonNull<CFType>>;
2666        }
2667        let ret = unsafe { IOHIDUserDeviceCopyProperty(self, key) };
2668        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2669    }
2670
2671    /// Sets a property on the device.
2672    ///
2673    ///
2674    /// Parameter `key`: The property key.
2675    ///
2676    ///
2677    /// Parameter `value`: The value of the property.
2678    ///
2679    ///
2680    /// Returns: Returns true on success.
2681    ///
2682    /// # Safety
2683    ///
2684    /// `property` should be of the correct type.
2685    #[doc(alias = "IOHIDUserDeviceSetProperty")]
2686    #[inline]
2687    pub unsafe fn set_property(&self, key: &CFString, property: &CFType) -> bool {
2688        extern "C-unwind" {
2689            fn IOHIDUserDeviceSetProperty(
2690                device: &IOHIDUserDevice,
2691                key: &CFString,
2692                property: &CFType,
2693            ) -> Boolean;
2694        }
2695        let ret = unsafe { IOHIDUserDeviceSetProperty(self, key, property) };
2696        ret != 0
2697    }
2698
2699    /// Dispatches a report on behalf of the device.
2700    ///
2701    ///
2702    /// Parameter `device`: Reference to a IOHIDUserDeviceRef.
2703    ///
2704    ///
2705    /// Parameter `timestamp`: mach_absolute_time() based timestamp.
2706    ///
2707    ///
2708    /// Parameter `report`: Buffer containing a HID report.
2709    ///
2710    ///
2711    /// Parameter `reportLength`: The report buffer length.
2712    ///
2713    ///
2714    /// Returns: Returns kIOReturnSuccess on success.
2715    ///
2716    /// # Safety
2717    ///
2718    /// `report` must be a valid pointer.
2719    #[doc(alias = "IOHIDUserDeviceHandleReportWithTimeStamp")]
2720    #[inline]
2721    pub unsafe fn handle_report_with_time_stamp(
2722        &self,
2723        timestamp: u64,
2724        report: NonNull<u8>,
2725        report_length: CFIndex,
2726    ) -> IOReturn {
2727        extern "C-unwind" {
2728            fn IOHIDUserDeviceHandleReportWithTimeStamp(
2729                device: &IOHIDUserDevice,
2730                timestamp: u64,
2731                report: NonNull<u8>,
2732                report_length: CFIndex,
2733            ) -> IOReturn;
2734        }
2735        unsafe { IOHIDUserDeviceHandleReportWithTimeStamp(self, timestamp, report, report_length) }
2736    }
2737}
2738
2739#[deprecated = "renamed to `IOHIDEventSystemClient::new_simple_client`"]
2740#[inline]
2741pub extern "C-unwind" fn IOHIDEventSystemClientCreateSimpleClient(
2742    allocator: Option<&CFAllocator>,
2743) -> CFRetained<IOHIDEventSystemClient> {
2744    extern "C-unwind" {
2745        fn IOHIDEventSystemClientCreateSimpleClient(
2746            allocator: Option<&CFAllocator>,
2747        ) -> Option<NonNull<IOHIDEventSystemClient>>;
2748    }
2749    let ret = unsafe { IOHIDEventSystemClientCreateSimpleClient(allocator) };
2750    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
2751    unsafe { CFRetained::from_raw(ret) }
2752}
2753
2754#[deprecated = "renamed to `IOHIDEventSystemClient::set_property`"]
2755#[inline]
2756pub unsafe extern "C-unwind" fn IOHIDEventSystemClientSetProperty(
2757    client: &IOHIDEventSystemClient,
2758    key: &CFString,
2759    property: &CFType,
2760) -> bool {
2761    extern "C-unwind" {
2762        fn IOHIDEventSystemClientSetProperty(
2763            client: &IOHIDEventSystemClient,
2764            key: &CFString,
2765            property: &CFType,
2766        ) -> Boolean;
2767    }
2768    let ret = unsafe { IOHIDEventSystemClientSetProperty(client, key, property) };
2769    ret != 0
2770}
2771
2772#[deprecated = "renamed to `IOHIDEventSystemClient::property`"]
2773#[inline]
2774pub extern "C-unwind" fn IOHIDEventSystemClientCopyProperty(
2775    client: &IOHIDEventSystemClient,
2776    key: &CFString,
2777) -> Option<CFRetained<CFType>> {
2778    extern "C-unwind" {
2779        fn IOHIDEventSystemClientCopyProperty(
2780            client: &IOHIDEventSystemClient,
2781            key: &CFString,
2782        ) -> Option<NonNull<CFType>>;
2783    }
2784    let ret = unsafe { IOHIDEventSystemClientCopyProperty(client, key) };
2785    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2786}
2787
2788#[deprecated = "renamed to `IOHIDEventSystemClient::services`"]
2789#[inline]
2790pub extern "C-unwind" fn IOHIDEventSystemClientCopyServices(
2791    client: &IOHIDEventSystemClient,
2792) -> Option<CFRetained<CFArray>> {
2793    extern "C-unwind" {
2794        fn IOHIDEventSystemClientCopyServices(
2795            client: &IOHIDEventSystemClient,
2796        ) -> Option<NonNull<CFArray>>;
2797    }
2798    let ret = unsafe { IOHIDEventSystemClientCopyServices(client) };
2799    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2800}
2801
2802#[deprecated = "renamed to `IOHIDServiceClient::set_property`"]
2803#[inline]
2804pub unsafe extern "C-unwind" fn IOHIDServiceClientSetProperty(
2805    service: &IOHIDServiceClient,
2806    key: &CFString,
2807    property: &CFType,
2808) -> bool {
2809    extern "C-unwind" {
2810        fn IOHIDServiceClientSetProperty(
2811            service: &IOHIDServiceClient,
2812            key: &CFString,
2813            property: &CFType,
2814        ) -> Boolean;
2815    }
2816    let ret = unsafe { IOHIDServiceClientSetProperty(service, key, property) };
2817    ret != 0
2818}
2819
2820#[deprecated = "renamed to `IOHIDServiceClient::property`"]
2821#[inline]
2822pub extern "C-unwind" fn IOHIDServiceClientCopyProperty(
2823    service: &IOHIDServiceClient,
2824    key: &CFString,
2825) -> Option<CFRetained<CFType>> {
2826    extern "C-unwind" {
2827        fn IOHIDServiceClientCopyProperty(
2828            service: &IOHIDServiceClient,
2829            key: &CFString,
2830        ) -> Option<NonNull<CFType>>;
2831    }
2832    let ret = unsafe { IOHIDServiceClientCopyProperty(service, key) };
2833    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2834}
2835
2836#[deprecated = "renamed to `IOHIDServiceClient::registry_id`"]
2837#[inline]
2838pub extern "C-unwind" fn IOHIDServiceClientGetRegistryID(
2839    service: &IOHIDServiceClient,
2840) -> CFRetained<CFType> {
2841    extern "C-unwind" {
2842        fn IOHIDServiceClientGetRegistryID(service: &IOHIDServiceClient)
2843            -> Option<NonNull<CFType>>;
2844    }
2845    let ret = unsafe { IOHIDServiceClientGetRegistryID(service) };
2846    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
2847    unsafe { CFRetained::retain(ret) }
2848}
2849
2850#[cfg(feature = "libc")]
2851#[deprecated = "renamed to `IOHIDServiceClient::conforms_to`"]
2852#[inline]
2853pub extern "C-unwind" fn IOHIDServiceClientConformsTo(
2854    service: &IOHIDServiceClient,
2855    usage_page: u32,
2856    usage: u32,
2857) -> bool {
2858    extern "C-unwind" {
2859        fn IOHIDServiceClientConformsTo(
2860            service: &IOHIDServiceClient,
2861            usage_page: u32,
2862            usage: u32,
2863        ) -> libc::boolean_t;
2864    }
2865    let ret = unsafe { IOHIDServiceClientConformsTo(service, usage_page, usage) };
2866    ret != 0
2867}
2868
2869#[deprecated = "renamed to `IOHIDUserDevice::with_properties`"]
2870#[inline]
2871pub unsafe extern "C-unwind" fn IOHIDUserDeviceCreateWithProperties(
2872    allocator: Option<&CFAllocator>,
2873    properties: &CFDictionary,
2874    options: IOOptionBits,
2875) -> Option<CFRetained<IOHIDUserDevice>> {
2876    extern "C-unwind" {
2877        fn IOHIDUserDeviceCreateWithProperties(
2878            allocator: Option<&CFAllocator>,
2879            properties: &CFDictionary,
2880            options: IOOptionBits,
2881        ) -> Option<NonNull<IOHIDUserDevice>>;
2882    }
2883    let ret = unsafe { IOHIDUserDeviceCreateWithProperties(allocator, properties, options) };
2884    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2885}
2886
2887extern "C-unwind" {
2888    #[cfg(all(feature = "block2", feature = "hid"))]
2889    #[deprecated = "renamed to `IOHIDUserDevice::register_get_report_block`"]
2890    pub fn IOHIDUserDeviceRegisterGetReportBlock(
2891        device: &IOHIDUserDevice,
2892        block: IOHIDUserDeviceGetReportBlock,
2893    );
2894}
2895
2896extern "C-unwind" {
2897    #[cfg(all(feature = "block2", feature = "hid"))]
2898    #[deprecated = "renamed to `IOHIDUserDevice::register_set_report_block`"]
2899    pub fn IOHIDUserDeviceRegisterSetReportBlock(
2900        device: &IOHIDUserDevice,
2901        block: IOHIDUserDeviceSetReportBlock,
2902    );
2903}
2904
2905extern "C-unwind" {
2906    #[cfg(feature = "dispatch2")]
2907    #[deprecated = "renamed to `IOHIDUserDevice::set_dispatch_queue`"]
2908    pub fn IOHIDUserDeviceSetDispatchQueue(device: &IOHIDUserDevice, queue: &DispatchQueue);
2909}
2910
2911extern "C-unwind" {
2912    #[cfg(feature = "dispatch2")]
2913    #[deprecated = "renamed to `IOHIDUserDevice::set_cancel_handler`"]
2914    pub fn IOHIDUserDeviceSetCancelHandler(device: &IOHIDUserDevice, handler: dispatch_block_t);
2915}
2916
2917#[deprecated = "renamed to `IOHIDUserDevice::activate`"]
2918#[inline]
2919pub extern "C-unwind" fn IOHIDUserDeviceActivate(device: &IOHIDUserDevice) {
2920    extern "C-unwind" {
2921        fn IOHIDUserDeviceActivate(device: &IOHIDUserDevice);
2922    }
2923    unsafe { IOHIDUserDeviceActivate(device) }
2924}
2925
2926#[deprecated = "renamed to `IOHIDUserDevice::cancel`"]
2927#[inline]
2928pub extern "C-unwind" fn IOHIDUserDeviceCancel(device: &IOHIDUserDevice) {
2929    extern "C-unwind" {
2930        fn IOHIDUserDeviceCancel(device: &IOHIDUserDevice);
2931    }
2932    unsafe { IOHIDUserDeviceCancel(device) }
2933}
2934
2935#[deprecated = "renamed to `IOHIDUserDevice::property`"]
2936#[inline]
2937pub extern "C-unwind" fn IOHIDUserDeviceCopyProperty(
2938    device: &IOHIDUserDevice,
2939    key: &CFString,
2940) -> Option<CFRetained<CFType>> {
2941    extern "C-unwind" {
2942        fn IOHIDUserDeviceCopyProperty(
2943            device: &IOHIDUserDevice,
2944            key: &CFString,
2945        ) -> Option<NonNull<CFType>>;
2946    }
2947    let ret = unsafe { IOHIDUserDeviceCopyProperty(device, key) };
2948    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2949}
2950
2951#[deprecated = "renamed to `IOHIDUserDevice::set_property`"]
2952#[inline]
2953pub unsafe extern "C-unwind" fn IOHIDUserDeviceSetProperty(
2954    device: &IOHIDUserDevice,
2955    key: &CFString,
2956    property: &CFType,
2957) -> bool {
2958    extern "C-unwind" {
2959        fn IOHIDUserDeviceSetProperty(
2960            device: &IOHIDUserDevice,
2961            key: &CFString,
2962            property: &CFType,
2963        ) -> Boolean;
2964    }
2965    let ret = unsafe { IOHIDUserDeviceSetProperty(device, key, property) };
2966    ret != 0
2967}
2968
2969extern "C-unwind" {
2970    #[deprecated = "renamed to `IOHIDUserDevice::handle_report_with_time_stamp`"]
2971    pub fn IOHIDUserDeviceHandleReportWithTimeStamp(
2972        device: &IOHIDUserDevice,
2973        timestamp: u64,
2974        report: NonNull<u8>,
2975        report_length: CFIndex,
2976    ) -> IOReturn;
2977}