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)]
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)]
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)]
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
1332extern "C-unwind" {
1333    #[cfg(feature = "libc")]
1334    pub fn IOHIDCreateSharedMemory(connect: io_connect_t, version: c_uint) -> libc::kern_return_t;
1335}
1336
1337#[cfg(feature = "libc")]
1338#[inline]
1339pub unsafe extern "C-unwind" fn IOHIDSetEventsEnable(
1340    connect: io_connect_t,
1341    enable: bool,
1342) -> libc::kern_return_t {
1343    extern "C-unwind" {
1344        fn IOHIDSetEventsEnable(
1345            connect: io_connect_t,
1346            enable: libc::boolean_t,
1347        ) -> libc::kern_return_t;
1348    }
1349    unsafe { IOHIDSetEventsEnable(connect, enable as _) }
1350}
1351
1352#[cfg(feature = "libc")]
1353#[deprecated]
1354#[inline]
1355pub unsafe extern "C-unwind" fn IOHIDSetCursorEnable(
1356    connect: io_connect_t,
1357    enable: bool,
1358) -> libc::kern_return_t {
1359    extern "C-unwind" {
1360        fn IOHIDSetCursorEnable(
1361            connect: io_connect_t,
1362            enable: libc::boolean_t,
1363        ) -> libc::kern_return_t;
1364    }
1365    unsafe { IOHIDSetCursorEnable(connect, enable as _) }
1366}
1367
1368/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidsetglobaleventflags?language=objc)
1369pub const kIOHIDSetGlobalEventFlags: c_uint = 0x00000001;
1370/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidsetcursorposition?language=objc)
1371pub const kIOHIDSetCursorPosition: c_uint = 0x00000002;
1372/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidsetrelativecursorposition?language=objc)
1373pub const kIOHIDSetRelativeCursorPosition: c_uint = 0x00000004;
1374/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiohidposthidmanagerevent?language=objc)
1375pub const kIOHIDPostHIDManagerEvent: c_uint = 0x00000008;
1376
1377extern "C-unwind" {
1378    #[cfg(all(feature = "graphics", feature = "libc"))]
1379    #[deprecated = "Use CGSEventTap for posting HID events, IOHIDUserDevice for simulating HID device, IOPMAssertionDeclareUserActivity for reporting user activity"]
1380    pub fn IOHIDPostEvent(
1381        connect: io_connect_t,
1382        event_type: u32,
1383        location: IOGPoint,
1384        event_data: *const NXEventData,
1385        event_data_version: u32,
1386        event_flags: IOOptionBits,
1387        options: IOOptionBits,
1388    ) -> libc::kern_return_t;
1389}
1390
1391extern "C-unwind" {
1392    #[cfg(feature = "libc")]
1393    #[deprecated]
1394    pub fn IOHIDSetMouseLocation(connect: io_connect_t, x: c_int, y: c_int) -> libc::kern_return_t;
1395}
1396
1397extern "C-unwind" {
1398    #[cfg(feature = "libc")]
1399    pub fn IOHIDGetButtonEventNum(
1400        connect: io_connect_t,
1401        button: NXMouseButton,
1402        event_num: *mut c_int,
1403    ) -> libc::kern_return_t;
1404}
1405
1406extern "C-unwind" {
1407    #[cfg(feature = "libc")]
1408    #[deprecated]
1409    pub fn IOHIDGetScrollAcceleration(
1410        handle: io_connect_t,
1411        acceleration: *mut c_double,
1412    ) -> libc::kern_return_t;
1413}
1414
1415extern "C-unwind" {
1416    #[cfg(feature = "libc")]
1417    #[deprecated]
1418    pub fn IOHIDSetScrollAcceleration(
1419        handle: io_connect_t,
1420        acceleration: c_double,
1421    ) -> libc::kern_return_t;
1422}
1423
1424extern "C-unwind" {
1425    #[cfg(feature = "libc")]
1426    #[deprecated]
1427    pub fn IOHIDGetMouseAcceleration(
1428        handle: io_connect_t,
1429        acceleration: *mut c_double,
1430    ) -> libc::kern_return_t;
1431}
1432
1433extern "C-unwind" {
1434    #[cfg(feature = "libc")]
1435    #[deprecated]
1436    pub fn IOHIDSetMouseAcceleration(
1437        handle: io_connect_t,
1438        acceleration: c_double,
1439    ) -> libc::kern_return_t;
1440}
1441
1442extern "C-unwind" {
1443    #[cfg(feature = "libc")]
1444    #[deprecated]
1445    pub fn IOHIDGetMouseButtonMode(handle: io_connect_t, mode: *mut c_int) -> libc::kern_return_t;
1446}
1447
1448extern "C-unwind" {
1449    #[cfg(feature = "libc")]
1450    #[deprecated]
1451    pub fn IOHIDSetMouseButtonMode(handle: io_connect_t, mode: c_int) -> libc::kern_return_t;
1452}
1453
1454extern "C-unwind" {
1455    #[cfg(feature = "libc")]
1456    #[deprecated]
1457    pub fn IOHIDGetAccelerationWithKey(
1458        handle: io_connect_t,
1459        key: Option<&CFString>,
1460        acceleration: *mut c_double,
1461    ) -> libc::kern_return_t;
1462}
1463
1464extern "C-unwind" {
1465    #[cfg(feature = "libc")]
1466    #[deprecated]
1467    pub fn IOHIDSetAccelerationWithKey(
1468        handle: io_connect_t,
1469        key: Option<&CFString>,
1470        acceleration: c_double,
1471    ) -> libc::kern_return_t;
1472}
1473
1474extern "C-unwind" {
1475    #[cfg(feature = "libc")]
1476    #[deprecated]
1477    pub fn IOHIDGetParameter(
1478        handle: io_connect_t,
1479        key: Option<&CFString>,
1480        max_size: IOByteCount,
1481        bytes: *mut c_void,
1482        actual_size: *mut IOByteCount,
1483    ) -> libc::kern_return_t;
1484}
1485
1486extern "C-unwind" {
1487    #[cfg(feature = "libc")]
1488    #[deprecated]
1489    pub fn IOHIDSetParameter(
1490        handle: io_connect_t,
1491        key: Option<&CFString>,
1492        bytes: *const c_void,
1493        size: IOByteCount,
1494    ) -> libc::kern_return_t;
1495}
1496
1497extern "C-unwind" {
1498    #[cfg(feature = "libc")]
1499    pub fn IOHIDCopyCFTypeParameter(
1500        handle: io_connect_t,
1501        key: Option<&CFString>,
1502        parameter: *mut *const CFType,
1503    ) -> libc::kern_return_t;
1504}
1505
1506extern "C-unwind" {
1507    #[cfg(feature = "libc")]
1508    pub fn IOHIDSetCFTypeParameter(
1509        handle: io_connect_t,
1510        key: Option<&CFString>,
1511        parameter: Option<&CFType>,
1512    ) -> libc::kern_return_t;
1513}
1514
1515extern "C-unwind" {
1516    #[cfg(feature = "libc")]
1517    pub fn IOHIDGetStateForSelector(
1518        handle: io_connect_t,
1519        selector: c_int,
1520        state: *mut u32,
1521    ) -> libc::kern_return_t;
1522}
1523
1524extern "C-unwind" {
1525    #[cfg(feature = "libc")]
1526    pub fn IOHIDSetStateForSelector(
1527        handle: io_connect_t,
1528        selector: c_int,
1529        state: u32,
1530    ) -> libc::kern_return_t;
1531}
1532
1533extern "C-unwind" {
1534    #[cfg(feature = "libc")]
1535    pub fn IOHIDGetModifierLockState(
1536        handle: io_connect_t,
1537        selector: c_int,
1538        state: *mut bool,
1539    ) -> libc::kern_return_t;
1540}
1541
1542extern "C-unwind" {
1543    #[cfg(feature = "libc")]
1544    pub fn IOHIDSetModifierLockState(
1545        handle: io_connect_t,
1546        selector: c_int,
1547        state: bool,
1548    ) -> libc::kern_return_t;
1549}
1550
1551extern "C-unwind" {
1552    #[cfg(feature = "libc")]
1553    #[deprecated]
1554    pub fn IOHIDRegisterVirtualDisplay(
1555        handle: io_connect_t,
1556        display_token: *mut u32,
1557    ) -> libc::kern_return_t;
1558}
1559
1560extern "C-unwind" {
1561    #[cfg(feature = "libc")]
1562    #[deprecated]
1563    pub fn IOHIDUnregisterVirtualDisplay(
1564        handle: io_connect_t,
1565        display_token: u32,
1566    ) -> libc::kern_return_t;
1567}
1568
1569extern "C-unwind" {
1570    #[cfg(all(feature = "graphics", feature = "libc"))]
1571    #[deprecated]
1572    pub fn IOHIDSetVirtualDisplayBounds(
1573        handle: io_connect_t,
1574        display_token: u32,
1575        bounds: *const IOGBounds,
1576    ) -> libc::kern_return_t;
1577}
1578
1579extern "C-unwind" {
1580    #[cfg(feature = "libc")]
1581    #[deprecated]
1582    pub fn IOHIDGetActivityState(
1583        handle: io_connect_t,
1584        hid_activity_idle: *mut bool,
1585    ) -> libc::kern_return_t;
1586}
1587
1588/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iohidrequesttype?language=objc)
1589#[repr(transparent)]
1590#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1591pub struct IOHIDRequestType(pub c_uint);
1592impl IOHIDRequestType {
1593    #[doc(alias = "kIOHIDRequestTypePostEvent")]
1594    pub const PostEvent: Self = Self(0);
1595    #[doc(alias = "kIOHIDRequestTypeListenEvent")]
1596    pub const ListenEvent: Self = Self(1);
1597}
1598
1599#[cfg(feature = "objc2")]
1600unsafe impl Encode for IOHIDRequestType {
1601    const ENCODING: Encoding = c_uint::ENCODING;
1602}
1603
1604#[cfg(feature = "objc2")]
1605unsafe impl RefEncode for IOHIDRequestType {
1606    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1607}
1608
1609/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iohidaccesstype?language=objc)
1610#[repr(transparent)]
1611#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1612pub struct IOHIDAccessType(pub c_uint);
1613impl IOHIDAccessType {
1614    #[doc(alias = "kIOHIDAccessTypeGranted")]
1615    pub const Granted: Self = Self(0);
1616    #[doc(alias = "kIOHIDAccessTypeDenied")]
1617    pub const Denied: Self = Self(1);
1618    #[doc(alias = "kIOHIDAccessTypeUnknown")]
1619    pub const Unknown: Self = Self(2);
1620}
1621
1622#[cfg(feature = "objc2")]
1623unsafe impl Encode for IOHIDAccessType {
1624    const ENCODING: Encoding = c_uint::ENCODING;
1625}
1626
1627#[cfg(feature = "objc2")]
1628unsafe impl RefEncode for IOHIDAccessType {
1629    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1630}
1631
1632extern "C-unwind" {
1633    /// Checks if the process has access to a specific IOHIDRequestType. A process
1634    /// may request access by calling the IOHIDRequestAccess function.
1635    ///
1636    ///
1637    /// Parameter `requestType`: The request type defined in the IOHIDRequestType enumerator.
1638    ///
1639    ///
1640    /// Returns: Returns an access type defined in the IOHIDAccessType enumerator.
1641    pub fn IOHIDCheckAccess(request_type: IOHIDRequestType) -> IOHIDAccessType;
1642}
1643
1644extern "C-unwind" {
1645    /// Requests access from the user for a specific IOHIDRequestType.
1646    ///
1647    ///
1648    /// Processes that wish to post events through the IOHIDPostEvent API, or receive
1649    /// reports through the IOHIDManager/IOHIDDevice API must be granted access first
1650    /// by the user. If you do not call this API, it will be called on your behalf
1651    /// when the API are used.
1652    ///
1653    ///
1654    /// Parameter `requestType`: The request type defined in the IOHIDRequestType enumerator.
1655    ///
1656    ///
1657    /// Returns: Returns true if access was granted.
1658    pub fn IOHIDRequestAccess(request_type: IOHIDRequestType) -> bool;
1659}
1660
1661/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxeventhandle?language=objc)
1662#[cfg(feature = "libc")]
1663pub type NXEventHandle = libc::mach_port_t;
1664
1665extern "C-unwind" {
1666    #[cfg(feature = "libc")]
1667    #[deprecated]
1668    pub fn NXOpenEventStatus() -> NXEventHandle;
1669}
1670
1671extern "C-unwind" {
1672    #[cfg(feature = "libc")]
1673    #[deprecated]
1674    pub fn NXCloseEventStatus(handle: NXEventHandle);
1675}
1676
1677extern "C-unwind" {
1678    #[cfg(feature = "libc")]
1679    pub fn NXEventSystemInfo(
1680        handle: NXEventHandle,
1681        flavor: *mut c_char,
1682        evs_info: *mut c_int,
1683        evs_info_cnt: *mut c_uint,
1684    ) -> NXEventSystemInfoType;
1685}
1686
1687extern "C-unwind" {
1688    #[cfg(feature = "libc")]
1689    #[deprecated]
1690    pub fn NXSetKeyRepeatInterval(handle: NXEventHandle, seconds: c_double);
1691}
1692
1693extern "C-unwind" {
1694    #[cfg(feature = "libc")]
1695    #[deprecated]
1696    pub fn NXKeyRepeatInterval(handle: NXEventHandle) -> c_double;
1697}
1698
1699extern "C-unwind" {
1700    #[cfg(feature = "libc")]
1701    #[deprecated]
1702    pub fn NXSetKeyRepeatThreshold(handle: NXEventHandle, threshold: c_double);
1703}
1704
1705extern "C-unwind" {
1706    #[cfg(feature = "libc")]
1707    #[deprecated]
1708    pub fn NXKeyRepeatThreshold(handle: NXEventHandle) -> c_double;
1709}
1710
1711extern "C-unwind" {
1712    #[cfg(feature = "libc")]
1713    pub fn NXResetKeyboard(handle: NXEventHandle);
1714}
1715
1716extern "C-unwind" {
1717    #[cfg(feature = "libc")]
1718    #[deprecated]
1719    pub fn NXSetClickTime(handle: NXEventHandle, seconds: c_double);
1720}
1721
1722extern "C-unwind" {
1723    #[cfg(feature = "libc")]
1724    #[deprecated]
1725    pub fn NXClickTime(handle: NXEventHandle) -> c_double;
1726}
1727
1728extern "C-unwind" {
1729    #[cfg(feature = "libc")]
1730    #[deprecated]
1731    pub fn NXSetClickSpace(handle: NXEventHandle, area: *mut NXSize);
1732}
1733
1734extern "C-unwind" {
1735    #[cfg(feature = "libc")]
1736    #[deprecated]
1737    pub fn NXGetClickSpace(handle: NXEventHandle, area: *mut NXSize);
1738}
1739
1740extern "C-unwind" {
1741    #[cfg(feature = "libc")]
1742    pub fn NXResetMouse(handle: NXEventHandle);
1743}
1744
1745/// [Apple's documentation](https://developer.apple.com/documentation/iokit/_nxparsedkeymapping_?language=objc)
1746#[repr(C)]
1747#[derive(Clone, Copy, Debug, PartialEq)]
1748pub struct _NXParsedKeyMapping_ {
1749    pub shorts: c_short,
1750    pub keyBits: [c_char; 256],
1751    pub maxMod: c_int,
1752    pub modDefs: [*mut c_uchar; 16],
1753    pub numDefs: c_int,
1754    pub keyDefs: [*mut c_uchar; 256],
1755    pub numSeqs: c_int,
1756    pub seqDefs: [*mut c_uchar; 128],
1757    pub numSpecialKeys: c_int,
1758    pub specialKeys: [c_ushort; 24],
1759    pub mapping: *const c_uchar,
1760    pub mappingLen: c_int,
1761}
1762
1763#[cfg(feature = "objc2")]
1764unsafe impl Encode for _NXParsedKeyMapping_ {
1765    const ENCODING: Encoding = Encoding::Struct(
1766        "_NXParsedKeyMapping_",
1767        &[
1768            <c_short>::ENCODING,
1769            <[c_char; 256]>::ENCODING,
1770            <c_int>::ENCODING,
1771            <[*mut c_uchar; 16]>::ENCODING,
1772            <c_int>::ENCODING,
1773            <[*mut c_uchar; 256]>::ENCODING,
1774            <c_int>::ENCODING,
1775            <[*mut c_uchar; 128]>::ENCODING,
1776            <c_int>::ENCODING,
1777            <[c_ushort; 24]>::ENCODING,
1778            <*const c_uchar>::ENCODING,
1779            <c_int>::ENCODING,
1780        ],
1781    );
1782}
1783
1784#[cfg(feature = "objc2")]
1785unsafe impl RefEncode for _NXParsedKeyMapping_ {
1786    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1787}
1788
1789/// [Apple's documentation](https://developer.apple.com/documentation/iokit/nxparsedkeymapping?language=objc)
1790pub type NXParsedKeyMapping = _NXParsedKeyMapping_;
1791
1792/// IOHIDEventSystemClient
1793///
1794/// IOHIDEventSystemClient serves as a client that can be used
1795/// for reading/writing specific properties of the HID event system, as
1796/// well as getting services of the HID event system. A list of accessible
1797/// properties can be found in
1798/// <code>
1799/// IOKit/hid/IOHIDProperties.h
1800/// </code>
1801/// .
1802///
1803///
1804/// See also: IOKit/hidsystem/IOHIDServiceClient.h
1805///
1806/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iohideventsystemclient?language=objc)
1807#[repr(C)]
1808pub struct IOHIDEventSystemClient {
1809    inner: [u8; 0],
1810    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
1811}
1812
1813cf_type!(
1814    unsafe impl IOHIDEventSystemClient {}
1815);
1816#[cfg(feature = "objc2")]
1817cf_objc2_type!(
1818    unsafe impl RefEncode<"__IOHIDEventSystemClient"> for IOHIDEventSystemClient {}
1819);
1820
1821impl IOHIDEventSystemClient {
1822    /// Creates a client of the HID event system that has to ability to read/write certain
1823    /// properties.
1824    ///
1825    ///
1826    /// Certain properties have the ability to be set/read by clients, see
1827    /// <code>
1828    /// IOHIDProperties.h
1829    /// </code>
1830    /// for a list of these properties.
1831    ///
1832    ///
1833    /// Parameter `allocator`: a custom allocator reference to be used for allocation of the result.
1834    ///
1835    ///
1836    /// Returns: Returns a
1837    /// <code>
1838    /// IOHIDEventSystemClientRef
1839    /// </code>
1840    /// on success.
1841    /// Caller should CFRelease the client when they are finished with it, or keep a
1842    /// reference to the client if multiple properties need to be set/read.
1843    #[doc(alias = "IOHIDEventSystemClientCreateSimpleClient")]
1844    #[inline]
1845    pub unsafe fn new_simple_client(
1846        allocator: Option<&CFAllocator>,
1847    ) -> CFRetained<IOHIDEventSystemClient> {
1848        extern "C-unwind" {
1849            fn IOHIDEventSystemClientCreateSimpleClient(
1850                allocator: Option<&CFAllocator>,
1851            ) -> Option<NonNull<IOHIDEventSystemClient>>;
1852        }
1853        let ret = unsafe { IOHIDEventSystemClientCreateSimpleClient(allocator) };
1854        let ret =
1855            ret.expect("function was marked as returning non-null, but actually returned NULL");
1856        unsafe { CFRetained::from_raw(ret) }
1857    }
1858
1859    /// Sets a property on the HID event system.
1860    ///
1861    ///
1862    /// Parameter `client`: the HID client that created via
1863    /// <code>
1864    /// IOHIDEventSystemClientCreateSimpleClient()
1865    /// </code>
1866    /// .
1867    ///
1868    ///
1869    /// Parameter `key`: the property key to set. A list of keys can be found in
1870    /// <code>
1871    /// HIDProperties.h
1872    /// </code>
1873    /// .
1874    ///
1875    ///
1876    /// Parameter `property`: the value to set the property.
1877    ///
1878    ///
1879    /// Returns: Returns true on success.
1880    #[doc(alias = "IOHIDEventSystemClientSetProperty")]
1881    #[inline]
1882    pub unsafe fn set_property(
1883        self: &IOHIDEventSystemClient,
1884        key: &CFString,
1885        property: &CFType,
1886    ) -> bool {
1887        extern "C-unwind" {
1888            fn IOHIDEventSystemClientSetProperty(
1889                client: &IOHIDEventSystemClient,
1890                key: &CFString,
1891                property: &CFType,
1892            ) -> Boolean;
1893        }
1894        let ret = unsafe { IOHIDEventSystemClientSetProperty(self, key, property) };
1895        ret != 0
1896    }
1897
1898    /// Copies a property from the HID event system.
1899    ///
1900    ///
1901    /// Parameter `client`: the HID client created via
1902    /// <code>
1903    /// IOHIDEventSystemClientCreateSimpleClient()
1904    /// </code>
1905    /// .
1906    ///
1907    ///
1908    /// Parameter `key`: the property key to copy. A list of keys can be found in
1909    /// <code>
1910    /// HIDProperties.h
1911    /// </code>
1912    /// .
1913    ///
1914    ///
1915    /// Returns: Returns a CFTypeRef of the property to be copied on success, otherwise NULL.
1916    /// Caller is responsible for calling CFRelease on the property.
1917    #[doc(alias = "IOHIDEventSystemClientCopyProperty")]
1918    #[inline]
1919    pub unsafe fn property(
1920        self: &IOHIDEventSystemClient,
1921        key: &CFString,
1922    ) -> Option<CFRetained<CFType>> {
1923        extern "C-unwind" {
1924            fn IOHIDEventSystemClientCopyProperty(
1925                client: &IOHIDEventSystemClient,
1926                key: &CFString,
1927            ) -> Option<NonNull<CFType>>;
1928        }
1929        let ret = unsafe { IOHIDEventSystemClientCopyProperty(self, key) };
1930        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1931    }
1932}
1933
1934unsafe impl ConcreteType for IOHIDEventSystemClient {
1935    /// Returns: Returns the CFTypeID of the
1936    /// <code>
1937    /// IOHIDEventSystemClient
1938    /// </code>
1939    /// class.
1940    #[doc(alias = "IOHIDEventSystemClientGetTypeID")]
1941    #[inline]
1942    fn type_id() -> CFTypeID {
1943        extern "C-unwind" {
1944            fn IOHIDEventSystemClientGetTypeID() -> CFTypeID;
1945        }
1946        unsafe { IOHIDEventSystemClientGetTypeID() }
1947    }
1948}
1949
1950impl IOHIDEventSystemClient {
1951    /// Copies all services available to the client.
1952    ///
1953    ///
1954    /// Useful for seeing services that are available. Clients can further probe
1955    /// the services with the APIs available in
1956    /// <code>
1957    /// IOHIDServiceClient.h
1958    /// </code>
1959    /// .
1960    ///
1961    ///
1962    /// Parameter `client`: the HID client that created via
1963    /// <code>
1964    /// IOHIDEventSystemClientCreateSimpleClient()
1965    /// </code>
1966    /// .
1967    ///
1968    ///
1969    /// Returns: On success, returns a CFArrayRef of
1970    /// <code>
1971    /// IOHIDServiceClientRefs
1972    /// </code>
1973    /// that are
1974    /// available to the client. Caller is responsible for releasing the array.
1975    #[doc(alias = "IOHIDEventSystemClientCopyServices")]
1976    #[inline]
1977    pub unsafe fn services(self: &IOHIDEventSystemClient) -> Option<CFRetained<CFArray>> {
1978        extern "C-unwind" {
1979            fn IOHIDEventSystemClientCopyServices(
1980                client: &IOHIDEventSystemClient,
1981            ) -> Option<NonNull<CFArray>>;
1982        }
1983        let ret = unsafe { IOHIDEventSystemClientCopyServices(self) };
1984        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1985    }
1986}
1987
1988/// IOHIDServiceClient
1989///
1990/// IOHIDServiceClient serves as a client to the HID event system
1991/// services. Users are able to copy/set specific properties (defined in
1992/// <code>
1993/// IOKit/hid/IOHIDProperties.h
1994/// </code>
1995/// ), and gather more information
1996/// about the services available in the HID event system.
1997///
1998/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iohidserviceclient?language=objc)
1999#[repr(C)]
2000pub struct IOHIDServiceClient {
2001    inner: [u8; 0],
2002    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
2003}
2004
2005cf_type!(
2006    unsafe impl IOHIDServiceClient {}
2007);
2008#[cfg(feature = "objc2")]
2009cf_objc2_type!(
2010    unsafe impl RefEncode<"__IOHIDServiceClient"> for IOHIDServiceClient {}
2011);
2012
2013impl IOHIDServiceClient {
2014    /// Sets a property on the HID service.
2015    ///
2016    ///
2017    /// Parameter `service`: the HID service to set the property on.
2018    ///
2019    ///
2020    /// Parameter `key`: the property key to set. A list of keys can be found in
2021    /// <code>
2022    /// HIDProperties.h
2023    /// </code>
2024    /// .
2025    ///
2026    ///
2027    /// Parameter `property`: the value to set the property.
2028    ///
2029    ///
2030    /// Returns: Returns true on success.
2031    #[doc(alias = "IOHIDServiceClientSetProperty")]
2032    #[inline]
2033    pub unsafe fn set_property(
2034        self: &IOHIDServiceClient,
2035        key: &CFString,
2036        property: &CFType,
2037    ) -> bool {
2038        extern "C-unwind" {
2039            fn IOHIDServiceClientSetProperty(
2040                service: &IOHIDServiceClient,
2041                key: &CFString,
2042                property: &CFType,
2043            ) -> Boolean;
2044        }
2045        let ret = unsafe { IOHIDServiceClientSetProperty(self, key, property) };
2046        ret != 0
2047    }
2048
2049    /// Copies a property from the HID service.
2050    ///
2051    ///
2052    /// Parameter `service`: the HID service to copy the property from.
2053    ///
2054    ///
2055    /// Parameter `key`: the property key to copy. A list of keys can be found in
2056    /// <code>
2057    /// HIDProperties.h
2058    /// </code>
2059    /// .
2060    ///
2061    ///
2062    /// Returns: Returns a CFTypeRef of the property to be copied on success, otherwise NULL.
2063    /// Caller is responsible for calling CFRelease on the property.
2064    #[doc(alias = "IOHIDServiceClientCopyProperty")]
2065    #[inline]
2066    pub unsafe fn property(
2067        self: &IOHIDServiceClient,
2068        key: &CFString,
2069    ) -> Option<CFRetained<CFType>> {
2070        extern "C-unwind" {
2071            fn IOHIDServiceClientCopyProperty(
2072                service: &IOHIDServiceClient,
2073                key: &CFString,
2074            ) -> Option<NonNull<CFType>>;
2075        }
2076        let ret = unsafe { IOHIDServiceClientCopyProperty(self, key) };
2077        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2078    }
2079}
2080
2081unsafe impl ConcreteType for IOHIDServiceClient {
2082    /// Returns: Returns the CFTypeID of the
2083    /// <code>
2084    /// IOHIDServiceClient
2085    /// </code>
2086    /// class.
2087    #[doc(alias = "IOHIDServiceClientGetTypeID")]
2088    #[inline]
2089    fn type_id() -> CFTypeID {
2090        extern "C-unwind" {
2091            fn IOHIDServiceClientGetTypeID() -> CFTypeID;
2092        }
2093        unsafe { IOHIDServiceClientGetTypeID() }
2094    }
2095}
2096
2097impl IOHIDServiceClient {
2098    /// Parameter `service`: the HID service to get the registry ID for.
2099    ///
2100    ///
2101    /// Returns: Returns a CFTypeRef containing the registry ID for the service.
2102    #[doc(alias = "IOHIDServiceClientGetRegistryID")]
2103    #[inline]
2104    pub unsafe fn registry_id(self: &IOHIDServiceClient) -> CFRetained<CFType> {
2105        extern "C-unwind" {
2106            fn IOHIDServiceClientGetRegistryID(
2107                service: &IOHIDServiceClient,
2108            ) -> Option<NonNull<CFType>>;
2109        }
2110        let ret = unsafe { IOHIDServiceClientGetRegistryID(self) };
2111        let ret =
2112            ret.expect("function was marked as returning non-null, but actually returned NULL");
2113        unsafe { CFRetained::retain(ret) }
2114    }
2115
2116    /// Determines if a HID service conforms to a specific usage page and usage.
2117    ///
2118    ///
2119    /// Parameter `usagePage`: A usage page defined in
2120    /// <code>
2121    /// IOHIDUsageTables.h
2122    /// </code>
2123    /// .
2124    ///
2125    ///
2126    /// Parameter `usage`: A usage defined in
2127    /// <code>
2128    /// IOHIDUsageTables.h
2129    /// </code>
2130    /// .
2131    ///
2132    ///
2133    /// Returns: Returns true if the service conforms to the provided usage page and usage.
2134    #[doc(alias = "IOHIDServiceClientConformsTo")]
2135    #[cfg(feature = "libc")]
2136    #[inline]
2137    pub unsafe fn conforms_to(self: &IOHIDServiceClient, usage_page: u32, usage: u32) -> bool {
2138        extern "C-unwind" {
2139            fn IOHIDServiceClientConformsTo(
2140                service: &IOHIDServiceClient,
2141                usage_page: u32,
2142                usage: u32,
2143            ) -> libc::boolean_t;
2144        }
2145        let ret = unsafe { IOHIDServiceClientConformsTo(self, usage_page, usage) };
2146        ret != 0
2147    }
2148}
2149
2150/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iohiduserdevice?language=objc)
2151#[repr(C)]
2152pub struct IOHIDUserDevice {
2153    inner: [u8; 0],
2154    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
2155}
2156
2157cf_type!(
2158    unsafe impl IOHIDUserDevice {}
2159);
2160#[cfg(feature = "objc2")]
2161cf_objc2_type!(
2162    unsafe impl RefEncode<"__IOHIDUserDevice"> for IOHIDUserDevice {}
2163);
2164
2165/// The type block used for IOHIDUserDevice set report calls.
2166///
2167///
2168/// Parameter `type`: The report type.
2169///
2170///
2171/// Parameter `reportID`: The report ID.
2172///
2173///
2174/// Parameter `report`: The report bytes.
2175///
2176///
2177/// Parameter `reportLength`: The length of the report being passed in.
2178///
2179/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iohiduserdevicesetreportblock?language=objc)
2180#[cfg(all(feature = "block2", feature = "hid"))]
2181pub type IOHIDUserDeviceSetReportBlock =
2182    *mut block2::DynBlock<dyn Fn(IOHIDReportType, u32, NonNull<u8>, CFIndex) -> IOReturn>;
2183
2184/// The type block used for IOHIDUserDevice get report calls.
2185///
2186///
2187/// Parameter `type`: The report type.
2188///
2189///
2190/// Parameter `reportID`: The report ID.
2191///
2192///
2193/// Parameter `report`: A buffer to be filled in by the implementor with the report.
2194///
2195///
2196/// Parameter `reportLength`: The length of the report buffer being passed in. The implementor of this
2197/// block may update the reportLength variable to reflect the actual length of
2198/// the returned report.
2199///
2200/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iohiduserdevicegetreportblock?language=objc)
2201#[cfg(all(feature = "block2", feature = "hid"))]
2202pub type IOHIDUserDeviceGetReportBlock =
2203    *mut block2::DynBlock<dyn Fn(IOHIDReportType, u32, NonNull<u8>, NonNull<CFIndex>) -> IOReturn>;
2204
2205/// Enumerator of IOHIDUserDeviceOptions to be passed in to
2206/// IOHIDUserDeviceCreateWithOptions.
2207///
2208/// Field: IOHIDUserDeviceOptionsCreateOnActivate
2209/// Specifies that the kernel HID device should not be created until the call
2210/// to IOHIDUserDeviceActivate. This may be useful for preventing dropped get/set
2211/// report calls to the user device.
2212///
2213/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iohiduserdeviceoptions?language=objc)
2214// NS_ENUM
2215#[repr(transparent)]
2216#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2217pub struct IOHIDUserDeviceOptions(pub IOOptionBits);
2218impl IOHIDUserDeviceOptions {
2219    #[doc(alias = "IOHIDUserDeviceOptionsCreateOnActivate")]
2220    pub const CreateOnActivate: Self = Self(1 << 0);
2221}
2222
2223#[cfg(feature = "objc2")]
2224unsafe impl Encode for IOHIDUserDeviceOptions {
2225    const ENCODING: Encoding = IOOptionBits::ENCODING;
2226}
2227
2228#[cfg(feature = "objc2")]
2229unsafe impl RefEncode for IOHIDUserDeviceOptions {
2230    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2231}
2232
2233unsafe impl ConcreteType for IOHIDUserDevice {
2234    /// Returns the type identifier of all IOHIDUserDevice instances.
2235    #[doc(alias = "IOHIDUserDeviceGetTypeID")]
2236    #[inline]
2237    fn type_id() -> CFTypeID {
2238        extern "C-unwind" {
2239            fn IOHIDUserDeviceGetTypeID() -> CFTypeID;
2240        }
2241        unsafe { IOHIDUserDeviceGetTypeID() }
2242    }
2243}
2244
2245impl IOHIDUserDevice {
2246    /// Creates a virtual IOHIDDevice in the kernel.
2247    ///
2248    ///
2249    /// The IOHIDUserDeviceRef represents a virtual IOHIDDevice. In order to create
2250    /// the device, the entitlement "com.apple.developer.hid.virtual.device" is
2251    /// required to validate the source of the device.
2252    ///
2253    ///
2254    /// Parameter `allocator`: Allocator to be used during creation.
2255    ///
2256    ///
2257    /// Parameter `properties`: Dictionary containing device properties indexed by keys defined in
2258    /// IOHIDKeys.h. At the bare minimum, the kIOHIDReportDescriptorKey key must be
2259    /// provided, where the value represents a CFData representation of the device's
2260    /// report descriptor.
2261    ///
2262    ///
2263    /// Parameter `options`: Options to be used when creating the device.
2264    ///
2265    ///
2266    /// Returns: Returns a IOHIDUserDeviceRef on success.
2267    #[doc(alias = "IOHIDUserDeviceCreateWithProperties")]
2268    #[inline]
2269    pub unsafe fn with_properties(
2270        allocator: Option<&CFAllocator>,
2271        properties: &CFDictionary,
2272        options: IOOptionBits,
2273    ) -> Option<CFRetained<IOHIDUserDevice>> {
2274        extern "C-unwind" {
2275            fn IOHIDUserDeviceCreateWithProperties(
2276                allocator: Option<&CFAllocator>,
2277                properties: &CFDictionary,
2278                options: IOOptionBits,
2279            ) -> Option<NonNull<IOHIDUserDevice>>;
2280        }
2281        let ret = unsafe { IOHIDUserDeviceCreateWithProperties(allocator, properties, options) };
2282        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2283    }
2284
2285    /// Registers a block to receive get report requests.
2286    ///
2287    ///
2288    /// The call to IOHIDUserDeviceRegisterGetReportBlock should be made before the
2289    /// device is activated. The device must be activated in order to receive
2290    /// get report requests.
2291    ///
2292    ///
2293    /// Parameter `device`: Reference to a IOHIDUserDeviceRef
2294    ///
2295    ///
2296    /// Parameter `block`: The block to be invoked for get report calls.
2297    #[doc(alias = "IOHIDUserDeviceRegisterGetReportBlock")]
2298    #[cfg(all(feature = "block2", feature = "hid"))]
2299    #[inline]
2300    pub unsafe fn register_get_report_block(
2301        self: &IOHIDUserDevice,
2302        block: IOHIDUserDeviceGetReportBlock,
2303    ) {
2304        extern "C-unwind" {
2305            fn IOHIDUserDeviceRegisterGetReportBlock(
2306                device: &IOHIDUserDevice,
2307                block: IOHIDUserDeviceGetReportBlock,
2308            );
2309        }
2310        unsafe { IOHIDUserDeviceRegisterGetReportBlock(self, block) }
2311    }
2312
2313    /// Registers a block to receive set report requests.
2314    ///
2315    ///
2316    /// The call to IOHIDUserDeviceRegisterSetReportBlock should be made before the
2317    /// device is activated. The device must be activated in order to receive set
2318    /// report requests.
2319    ///
2320    ///
2321    /// Parameter `device`: Reference to a IOHIDUserDeviceRef
2322    ///
2323    ///
2324    /// Parameter `block`: The block to be invoked for set report calls.
2325    #[doc(alias = "IOHIDUserDeviceRegisterSetReportBlock")]
2326    #[cfg(all(feature = "block2", feature = "hid"))]
2327    #[inline]
2328    pub unsafe fn register_set_report_block(
2329        self: &IOHIDUserDevice,
2330        block: IOHIDUserDeviceSetReportBlock,
2331    ) {
2332        extern "C-unwind" {
2333            fn IOHIDUserDeviceRegisterSetReportBlock(
2334                device: &IOHIDUserDevice,
2335                block: IOHIDUserDeviceSetReportBlock,
2336            );
2337        }
2338        unsafe { IOHIDUserDeviceRegisterSetReportBlock(self, block) }
2339    }
2340
2341    /// Sets the dispatch queue to be associated with the IOHIDUserDevice.
2342    /// This is necessary in order to receive asynchronous events from the kernel.
2343    ///
2344    ///
2345    /// A call to IOHIDUserDeviceSetDispatchQueue should only be made once.
2346    ///
2347    /// After a dispatch queue is set, the IOHIDUserDevice must make a call to
2348    /// activate via IOHIDUserDeviceActivate and cancel via IOHIDUserDeviceCancel.
2349    /// All calls to "Register" functions should be done before activation and not
2350    /// after cancellation.
2351    ///
2352    ///
2353    /// Parameter `device`: Reference to an IOHIDUserDevice
2354    ///
2355    ///
2356    /// Parameter `queue`: The dispatch queue to which the event handler block will be submitted.
2357    #[doc(alias = "IOHIDUserDeviceSetDispatchQueue")]
2358    #[cfg(feature = "dispatch2")]
2359    #[inline]
2360    pub unsafe fn set_dispatch_queue(self: &IOHIDUserDevice, queue: &DispatchQueue) {
2361        extern "C-unwind" {
2362            fn IOHIDUserDeviceSetDispatchQueue(device: &IOHIDUserDevice, queue: &DispatchQueue);
2363        }
2364        unsafe { IOHIDUserDeviceSetDispatchQueue(self, queue) }
2365    }
2366
2367    /// Sets a cancellation handler for the dispatch queue associated with
2368    /// IOHIDUserDeviceScheduleWithDispatchQueue.
2369    ///
2370    ///
2371    /// The cancellation handler (if specified) will be submitted to the device's
2372    /// dispatch queue in response to a call to to IOHIDUserDeviceCancel
2373    /// after all the events have been handled.
2374    ///
2375    /// The IOHIDUserDeviceRef should only be released after the device has been
2376    /// cancelled, and the cancel handler has been called. This is to ensure all
2377    /// asynchronous objects are released. For example:
2378    ///
2379    /// dispatch_block_t cancelHandler = dispatch_block_create(0, ^{
2380    /// CFRelease(device);
2381    /// });
2382    /// IOHIDUserDeviceSetCancelHandler(device, cancelHandler);
2383    /// IOHIDUserDeviceActivate(device);
2384    /// IOHIDUserDeviceCancel(device);
2385    ///
2386    ///
2387    /// Parameter `device`: Reference to an IOHIDUserDevice.
2388    ///
2389    ///
2390    /// Parameter `handler`: The cancellation handler block to be associated with the dispatch queue.
2391    #[doc(alias = "IOHIDUserDeviceSetCancelHandler")]
2392    #[cfg(feature = "dispatch2")]
2393    #[inline]
2394    pub unsafe fn set_cancel_handler(self: &IOHIDUserDevice, handler: dispatch_block_t) {
2395        extern "C-unwind" {
2396            fn IOHIDUserDeviceSetCancelHandler(device: &IOHIDUserDevice, handler: dispatch_block_t);
2397        }
2398        unsafe { IOHIDUserDeviceSetCancelHandler(self, handler) }
2399    }
2400
2401    /// Activates the IOHIDUserDevice object.
2402    ///
2403    ///
2404    /// An IOHIDUserDevice object associated with a dispatch queue is created
2405    /// in an inactive state. The object must be activated in order to
2406    /// receive asynchronous events from the kernel.
2407    ///
2408    /// A dispatch queue must be set via IOHIDUserDeviceSetDispatchQueue before
2409    /// activation.
2410    ///
2411    /// An activated device must be cancelled via IOHIDUserDeviceCancel. All calls
2412    /// to "Register" functions should be done before activation and not after
2413    /// cancellation.
2414    ///
2415    /// Calling IOHIDUserDeviceActivate on an active IOHIDUserDevice has no effect.
2416    ///
2417    ///
2418    /// Parameter `device`: Reference to an IOHIDUserDevice.
2419    #[doc(alias = "IOHIDUserDeviceActivate")]
2420    #[inline]
2421    pub unsafe fn activate(self: &IOHIDUserDevice) {
2422        extern "C-unwind" {
2423            fn IOHIDUserDeviceActivate(device: &IOHIDUserDevice);
2424        }
2425        unsafe { IOHIDUserDeviceActivate(self) }
2426    }
2427
2428    /// Cancels the IOHIDUserDevice preventing any further invocation of its event
2429    /// handler block.
2430    ///
2431    ///
2432    /// Cancelling prevents any further invocation of the event handler block for
2433    /// the specified dispatch queue, but does not interrupt an event handler block
2434    /// that is already in progress.
2435    ///
2436    /// Explicit cancellation of the IOHIDUserDevice is required, no implicit
2437    /// cancellation takes place.
2438    ///
2439    /// Calling IOHIDUserDeviceCancel on an already cancelled queue has no effect.
2440    ///
2441    /// The IOHIDUserDeviceRef should only be released after the device has been
2442    /// cancelled, and the cancel handler has been called. This is to ensure all
2443    /// asynchronous objects are released. For example:
2444    ///
2445    /// dispatch_block_t cancelHandler = dispatch_block_create(0, ^{
2446    /// CFRelease(device);
2447    /// });
2448    /// IOHIDUserDeviceSetCancelHandler(device, cancelHandler);
2449    /// IOHIDUserDeviceActivate(device);
2450    /// IOHIDUserDeviceCancel(device);
2451    ///
2452    ///
2453    /// Parameter `device`: Reference to an IOHIDUserDevice
2454    #[doc(alias = "IOHIDUserDeviceCancel")]
2455    #[inline]
2456    pub unsafe fn cancel(self: &IOHIDUserDevice) {
2457        extern "C-unwind" {
2458            fn IOHIDUserDeviceCancel(device: &IOHIDUserDevice);
2459        }
2460        unsafe { IOHIDUserDeviceCancel(self) }
2461    }
2462
2463    /// Obtains a property from the device.
2464    ///
2465    ///
2466    /// Parameter `key`: The property key.
2467    ///
2468    ///
2469    /// Returns: Returns the property on success.
2470    #[doc(alias = "IOHIDUserDeviceCopyProperty")]
2471    #[inline]
2472    pub unsafe fn property(self: &IOHIDUserDevice, key: &CFString) -> Option<CFRetained<CFType>> {
2473        extern "C-unwind" {
2474            fn IOHIDUserDeviceCopyProperty(
2475                device: &IOHIDUserDevice,
2476                key: &CFString,
2477            ) -> Option<NonNull<CFType>>;
2478        }
2479        let ret = unsafe { IOHIDUserDeviceCopyProperty(self, key) };
2480        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2481    }
2482
2483    /// Sets a property on the device.
2484    ///
2485    ///
2486    /// Parameter `key`: The property key.
2487    ///
2488    ///
2489    /// Parameter `value`: The value of the property.
2490    ///
2491    ///
2492    /// Returns: Returns true on success.
2493    #[doc(alias = "IOHIDUserDeviceSetProperty")]
2494    #[inline]
2495    pub unsafe fn set_property(self: &IOHIDUserDevice, key: &CFString, property: &CFType) -> bool {
2496        extern "C-unwind" {
2497            fn IOHIDUserDeviceSetProperty(
2498                device: &IOHIDUserDevice,
2499                key: &CFString,
2500                property: &CFType,
2501            ) -> Boolean;
2502        }
2503        let ret = unsafe { IOHIDUserDeviceSetProperty(self, key, property) };
2504        ret != 0
2505    }
2506
2507    /// Dispatches a report on behalf of the device.
2508    ///
2509    ///
2510    /// Parameter `device`: Reference to a IOHIDUserDeviceRef.
2511    ///
2512    ///
2513    /// Parameter `timestamp`: mach_absolute_time() based timestamp.
2514    ///
2515    ///
2516    /// Parameter `report`: Buffer containing a HID report.
2517    ///
2518    ///
2519    /// Parameter `reportLength`: The report buffer length.
2520    ///
2521    ///
2522    /// Returns: Returns kIOReturnSuccess on success.
2523    #[doc(alias = "IOHIDUserDeviceHandleReportWithTimeStamp")]
2524    #[inline]
2525    pub unsafe fn handle_report_with_time_stamp(
2526        self: &IOHIDUserDevice,
2527        timestamp: u64,
2528        report: NonNull<u8>,
2529        report_length: CFIndex,
2530    ) -> IOReturn {
2531        extern "C-unwind" {
2532            fn IOHIDUserDeviceHandleReportWithTimeStamp(
2533                device: &IOHIDUserDevice,
2534                timestamp: u64,
2535                report: NonNull<u8>,
2536                report_length: CFIndex,
2537            ) -> IOReturn;
2538        }
2539        unsafe { IOHIDUserDeviceHandleReportWithTimeStamp(self, timestamp, report, report_length) }
2540    }
2541}
2542
2543#[deprecated = "renamed to `IOHIDEventSystemClient::new_simple_client`"]
2544#[inline]
2545pub unsafe extern "C-unwind" fn IOHIDEventSystemClientCreateSimpleClient(
2546    allocator: Option<&CFAllocator>,
2547) -> CFRetained<IOHIDEventSystemClient> {
2548    extern "C-unwind" {
2549        fn IOHIDEventSystemClientCreateSimpleClient(
2550            allocator: Option<&CFAllocator>,
2551        ) -> Option<NonNull<IOHIDEventSystemClient>>;
2552    }
2553    let ret = unsafe { IOHIDEventSystemClientCreateSimpleClient(allocator) };
2554    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
2555    unsafe { CFRetained::from_raw(ret) }
2556}
2557
2558#[deprecated = "renamed to `IOHIDEventSystemClient::set_property`"]
2559#[inline]
2560pub unsafe extern "C-unwind" fn IOHIDEventSystemClientSetProperty(
2561    client: &IOHIDEventSystemClient,
2562    key: &CFString,
2563    property: &CFType,
2564) -> bool {
2565    extern "C-unwind" {
2566        fn IOHIDEventSystemClientSetProperty(
2567            client: &IOHIDEventSystemClient,
2568            key: &CFString,
2569            property: &CFType,
2570        ) -> Boolean;
2571    }
2572    let ret = unsafe { IOHIDEventSystemClientSetProperty(client, key, property) };
2573    ret != 0
2574}
2575
2576#[deprecated = "renamed to `IOHIDEventSystemClient::property`"]
2577#[inline]
2578pub unsafe extern "C-unwind" fn IOHIDEventSystemClientCopyProperty(
2579    client: &IOHIDEventSystemClient,
2580    key: &CFString,
2581) -> Option<CFRetained<CFType>> {
2582    extern "C-unwind" {
2583        fn IOHIDEventSystemClientCopyProperty(
2584            client: &IOHIDEventSystemClient,
2585            key: &CFString,
2586        ) -> Option<NonNull<CFType>>;
2587    }
2588    let ret = unsafe { IOHIDEventSystemClientCopyProperty(client, key) };
2589    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2590}
2591
2592#[deprecated = "renamed to `IOHIDEventSystemClient::services`"]
2593#[inline]
2594pub unsafe extern "C-unwind" fn IOHIDEventSystemClientCopyServices(
2595    client: &IOHIDEventSystemClient,
2596) -> Option<CFRetained<CFArray>> {
2597    extern "C-unwind" {
2598        fn IOHIDEventSystemClientCopyServices(
2599            client: &IOHIDEventSystemClient,
2600        ) -> Option<NonNull<CFArray>>;
2601    }
2602    let ret = unsafe { IOHIDEventSystemClientCopyServices(client) };
2603    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2604}
2605
2606#[deprecated = "renamed to `IOHIDServiceClient::set_property`"]
2607#[inline]
2608pub unsafe extern "C-unwind" fn IOHIDServiceClientSetProperty(
2609    service: &IOHIDServiceClient,
2610    key: &CFString,
2611    property: &CFType,
2612) -> bool {
2613    extern "C-unwind" {
2614        fn IOHIDServiceClientSetProperty(
2615            service: &IOHIDServiceClient,
2616            key: &CFString,
2617            property: &CFType,
2618        ) -> Boolean;
2619    }
2620    let ret = unsafe { IOHIDServiceClientSetProperty(service, key, property) };
2621    ret != 0
2622}
2623
2624#[deprecated = "renamed to `IOHIDServiceClient::property`"]
2625#[inline]
2626pub unsafe extern "C-unwind" fn IOHIDServiceClientCopyProperty(
2627    service: &IOHIDServiceClient,
2628    key: &CFString,
2629) -> Option<CFRetained<CFType>> {
2630    extern "C-unwind" {
2631        fn IOHIDServiceClientCopyProperty(
2632            service: &IOHIDServiceClient,
2633            key: &CFString,
2634        ) -> Option<NonNull<CFType>>;
2635    }
2636    let ret = unsafe { IOHIDServiceClientCopyProperty(service, key) };
2637    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2638}
2639
2640#[deprecated = "renamed to `IOHIDServiceClient::registry_id`"]
2641#[inline]
2642pub unsafe extern "C-unwind" fn IOHIDServiceClientGetRegistryID(
2643    service: &IOHIDServiceClient,
2644) -> CFRetained<CFType> {
2645    extern "C-unwind" {
2646        fn IOHIDServiceClientGetRegistryID(service: &IOHIDServiceClient)
2647            -> Option<NonNull<CFType>>;
2648    }
2649    let ret = unsafe { IOHIDServiceClientGetRegistryID(service) };
2650    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
2651    unsafe { CFRetained::retain(ret) }
2652}
2653
2654#[cfg(feature = "libc")]
2655#[deprecated = "renamed to `IOHIDServiceClient::conforms_to`"]
2656#[inline]
2657pub unsafe extern "C-unwind" fn IOHIDServiceClientConformsTo(
2658    service: &IOHIDServiceClient,
2659    usage_page: u32,
2660    usage: u32,
2661) -> bool {
2662    extern "C-unwind" {
2663        fn IOHIDServiceClientConformsTo(
2664            service: &IOHIDServiceClient,
2665            usage_page: u32,
2666            usage: u32,
2667        ) -> libc::boolean_t;
2668    }
2669    let ret = unsafe { IOHIDServiceClientConformsTo(service, usage_page, usage) };
2670    ret != 0
2671}
2672
2673#[deprecated = "renamed to `IOHIDUserDevice::with_properties`"]
2674#[inline]
2675pub unsafe extern "C-unwind" fn IOHIDUserDeviceCreateWithProperties(
2676    allocator: Option<&CFAllocator>,
2677    properties: &CFDictionary,
2678    options: IOOptionBits,
2679) -> Option<CFRetained<IOHIDUserDevice>> {
2680    extern "C-unwind" {
2681        fn IOHIDUserDeviceCreateWithProperties(
2682            allocator: Option<&CFAllocator>,
2683            properties: &CFDictionary,
2684            options: IOOptionBits,
2685        ) -> Option<NonNull<IOHIDUserDevice>>;
2686    }
2687    let ret = unsafe { IOHIDUserDeviceCreateWithProperties(allocator, properties, options) };
2688    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2689}
2690
2691extern "C-unwind" {
2692    #[cfg(all(feature = "block2", feature = "hid"))]
2693    #[deprecated = "renamed to `IOHIDUserDevice::register_get_report_block`"]
2694    pub fn IOHIDUserDeviceRegisterGetReportBlock(
2695        device: &IOHIDUserDevice,
2696        block: IOHIDUserDeviceGetReportBlock,
2697    );
2698}
2699
2700extern "C-unwind" {
2701    #[cfg(all(feature = "block2", feature = "hid"))]
2702    #[deprecated = "renamed to `IOHIDUserDevice::register_set_report_block`"]
2703    pub fn IOHIDUserDeviceRegisterSetReportBlock(
2704        device: &IOHIDUserDevice,
2705        block: IOHIDUserDeviceSetReportBlock,
2706    );
2707}
2708
2709extern "C-unwind" {
2710    #[cfg(feature = "dispatch2")]
2711    #[deprecated = "renamed to `IOHIDUserDevice::set_dispatch_queue`"]
2712    pub fn IOHIDUserDeviceSetDispatchQueue(device: &IOHIDUserDevice, queue: &DispatchQueue);
2713}
2714
2715extern "C-unwind" {
2716    #[cfg(feature = "dispatch2")]
2717    #[deprecated = "renamed to `IOHIDUserDevice::set_cancel_handler`"]
2718    pub fn IOHIDUserDeviceSetCancelHandler(device: &IOHIDUserDevice, handler: dispatch_block_t);
2719}
2720
2721extern "C-unwind" {
2722    #[deprecated = "renamed to `IOHIDUserDevice::activate`"]
2723    pub fn IOHIDUserDeviceActivate(device: &IOHIDUserDevice);
2724}
2725
2726extern "C-unwind" {
2727    #[deprecated = "renamed to `IOHIDUserDevice::cancel`"]
2728    pub fn IOHIDUserDeviceCancel(device: &IOHIDUserDevice);
2729}
2730
2731#[deprecated = "renamed to `IOHIDUserDevice::property`"]
2732#[inline]
2733pub unsafe extern "C-unwind" fn IOHIDUserDeviceCopyProperty(
2734    device: &IOHIDUserDevice,
2735    key: &CFString,
2736) -> Option<CFRetained<CFType>> {
2737    extern "C-unwind" {
2738        fn IOHIDUserDeviceCopyProperty(
2739            device: &IOHIDUserDevice,
2740            key: &CFString,
2741        ) -> Option<NonNull<CFType>>;
2742    }
2743    let ret = unsafe { IOHIDUserDeviceCopyProperty(device, key) };
2744    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2745}
2746
2747#[deprecated = "renamed to `IOHIDUserDevice::set_property`"]
2748#[inline]
2749pub unsafe extern "C-unwind" fn IOHIDUserDeviceSetProperty(
2750    device: &IOHIDUserDevice,
2751    key: &CFString,
2752    property: &CFType,
2753) -> bool {
2754    extern "C-unwind" {
2755        fn IOHIDUserDeviceSetProperty(
2756            device: &IOHIDUserDevice,
2757            key: &CFString,
2758            property: &CFType,
2759        ) -> Boolean;
2760    }
2761    let ret = unsafe { IOHIDUserDeviceSetProperty(device, key, property) };
2762    ret != 0
2763}
2764
2765extern "C-unwind" {
2766    #[deprecated = "renamed to `IOHIDUserDevice::handle_report_with_time_stamp`"]
2767    pub fn IOHIDUserDeviceHandleReportWithTimeStamp(
2768        device: &IOHIDUserDevice,
2769        timestamp: u64,
2770        report: NonNull<u8>,
2771        report_length: CFIndex,
2772    ) -> IOReturn;
2773}