use core::cell::UnsafeCell;
use core::ffi::*;
use core::marker::{PhantomData, PhantomPinned};
use core::ptr::NonNull;
#[cfg(feature = "dispatch2")]
use dispatch2::*;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
use objc2_core_foundation::*;
use crate::*;
pub const EVENT_SYSTEM_VERSION: c_uint = 2;
pub const kNXEventDataVersion: c_uint = 2;
pub const kNXEventVersion: c_uint = 2;
pub const kIOHIDKindKey: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDKind\0") };
pub const kIOHIDInterfaceIDKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDInterfaceID\0") };
pub const kIOHIDSubinterfaceIDKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDSubinterfaceID\0") };
pub const kIOHIDOriginalSubinterfaceIDKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDOriginalSubinterfaceID\0") };
pub const kIOHIDParametersKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDParameters\0") };
pub const kIOHIDVirtualHIDevice: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDVirtualDevice\0") };
pub const kIOHIDKeyRepeatKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDKeyRepeat\0") };
pub const kIOHIDInitialKeyRepeatKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDInitialKeyRepeat\0") };
pub const kIOHIDKeyMappingKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDKeyMapping\0") };
pub const kIOHIDResetKeyboardKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDResetKeyboard\0") };
pub const kIOHIDKeyboardModifierMappingPairsKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDKeyboardModifierMappingPairs\0") };
pub const kIOHIDKeyboardModifierMappingSrcKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDKeyboardModifierMappingSrc\0") };
pub const kIOHIDKeyboardModifierMappingDstKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDKeyboardModifierMappingDst\0") };
pub const kIOHIDKeyboardCapsLockDoesLockKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDKeyboardCapsLockDoesLock\0") };
pub const kIOHIDKeyboardSupportsF12EjectKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDKeyboardSupportsF12Eject\0") };
pub const kIOHIDKeyboardSupportedModifiersKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDKeyboardSupportedModifiers\0") };
pub const kIOHIDKeyboardGlobalModifiersKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDKeyboardGlobalModifiers\0") };
pub const kIOHIDServiceGlobalModifiersUsageKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDServiceGlobalModifiersUsage\0") };
pub const kIOHIDPointerResolutionKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDPointerResolution\0") };
pub const kIOHIDResetPointerKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDResetPointer\0") };
pub const kIOHIDPointerConvertAbsoluteKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDPointerConvertAbsolute\0") };
pub const kIOHIDPointerContactToMoveKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDPointerContactToMove\0") };
pub const kIOHIDPointerPressureToClickKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDPointerPressureToClick\0") };
pub const kIOHIDPointerButtonCountKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDPointerButtonCount\0") };
pub const kIOHIDPointerAccelerationSettingsKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDPointerAccelerationSettings\0") };
pub const kIOHIDPointerAccelerationTableKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDPointerAccelerationTable\0") };
pub const kIOHIDScrollResetKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollReset\0") };
pub const kIOHIDScrollAccelerationTableKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollAccelerationTable\0") };
pub const kIOHIDScrollAccelerationTableXKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollAccelerationTableX\0") };
pub const kIOHIDScrollAccelerationTableYKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollAccelerationTableY\0") };
pub const kIOHIDScrollAccelerationTableZKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollAccelerationTableZ\0") };
pub const kIOHIDScrollMouseButtonKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollMouseButton\0") };
pub const kIOHIDScrollZoomModifierMaskKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollZoomModifierMask\0") };
pub const kIOHIDClickTimeKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDClickTime\0") };
pub const kIOHIDClickSpaceKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDClickSpace\0") };
pub const kIOHIDWaitCursorFrameIntervalKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDWaitCursorFrameInterval\0") };
pub const kIOHIDAutoDimThresholdKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAutoDimThreshold\0") };
pub const kIOHIDAutoDimStateKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAutoDimState\0") };
pub const kIOHIDAutoDimTimeKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAutoDimTime\0") };
pub const kIOHIDIdleTimeKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDIdleTime\0") };
pub const kIOHIDBrightnessKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDBrightness\0") };
pub const kIOHIDAutoDimBrightnessKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAutoDimBrightness\0") };
pub const kIOHIDFKeyModeKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDFKeyMode\0") };
pub const kIOHIDStickyKeysDisabledKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDStickyKeysDisabled\0") };
pub const kIOHIDStickyKeysOnKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDStickyKeysOn\0") };
pub const kIOHIDStickyKeysShiftTogglesKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDStickyKeysShiftToggles\0") };
pub const kIOHIDResetStickyKeyNotification: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDResetStickyKeyNotification\0") };
pub const kIOHIDMouseKeysOptionTogglesKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDMouseKeysOptionToggles\0") };
pub const kIOHIDSlowKeysDelayKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDSlowKeysDelay\0") };
pub const kIOHIDF12EjectDelayKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDF12EjectDelay\0") };
pub const kIOHIDMouseKeysOnKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDMouseKeysOn\0") };
pub const kIOHIDUseKeyswitchKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDUseKeyswitch\0") };
pub const kIOHIDDisallowRemappingOfPrimaryClickKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDDisallowRemappingOfPrimaryClick\0") };
pub const kIOHIDMouseKeysEnablesVirtualNumPadKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDMouseKeysEnablesVirtualNumPad\0") };
pub const kIOHIDResetLEDsKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDResetLEDs\0") };
pub const kHIDTrackingAccelParametricCurvesKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDTrackingAccelCurves\0") };
pub const kHIDAccelParametricCurvesDebugKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAccelCurvesDebug\0") };
pub const kHIDScrollAccelParametricCurvesDebugKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollAccelCurvesDebug\0") };
pub const kHIDAccelGainLinearKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAccelGainLinear\0") };
pub const kHIDAccelGainParabolicKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAccelGainParabolic\0") };
pub const kHIDAccelGainCubicKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAccelGainCubic\0") };
pub const kHIDAccelGainQuarticKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAccelGainQuartic\0") };
pub const kHIDAccelTangentSpeedLinearKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAccelTangentSpeedLinear\0") };
pub const kHIDAccelTangentSpeedParabolicRootKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAccelTangentSpeedParabolicRoot\0") };
pub const kHIDAccelTangentSpeedCubicRootKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAccelTangentSpeedCubicRoot\0") };
pub const kHIDAccelTangentSpeedQuarticRootKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAccelTangentSpeedQuarticRoot\0") };
pub const kHIDAccelIndexKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDAccelIndex\0") };
pub const kIOHIDScrollCountMaxTimeDeltaBetweenKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollCountMaxTimeDeltaBetween\0") };
pub const kIOHIDScrollCountMaxTimeDeltaToSustainKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollCountMaxTimeDeltaToSustain\0") };
pub const kIOHIDScrollCountMinDeltaToStartKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollCountMinDeltaToStart\0") };
pub const kIOHIDScrollCountMinDeltaToSustainKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollCountMinDeltaToSustain\0") };
pub const kIOHIDScrollCountIgnoreMomentumScrollsKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollCountIgnoreMomentumScrolls\0") };
pub const kIOHIDScrollCountMouseCanResetKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollCountMouseCanReset\0") };
pub const kIOHIDScrollCountMaxKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollCountMax\0") };
pub const kIOHIDScrollCountAccelerationFactorKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollCountAccelerationFactor\0") };
pub const kIOHIDScrollCountZeroKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollCountZero\0") };
pub const kIOHIDScrollCountBootDefaultKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollCountBootDefault\0") };
pub const kIOHIDScrollCountResetKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"HIDScrollCountReset\0") };
pub const kIOHIDActivityUserIdleKey: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"IOHIDActivityUserIdle\0") };
pub const kIOHIDSystemClass: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"IOHIDSystem\0") };
pub const kIOHIKeyboardClass: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"IOHIKeyboard\0") };
pub const kIOHIPointingClass: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"IOHIPointing\0") };
pub const kIOHIDCurrentShmemVersion: c_uint = 4;
pub const kIOHIDLastCompatibleShmemVersion: c_uint = 3;
pub const kIOHIDMessageRelayServiceInterfaceActive: c_uint = iokit_vendor_specific_msg!(2);
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct evsioKeymapping {
pub size: c_int,
pub mapping: *mut c_char,
}
#[cfg(feature = "objc2")]
unsafe impl Encode for evsioKeymapping {
const ENCODING: Encoding = Encoding::Struct(
"evsioKeymapping",
&[<c_int>::ENCODING, <*mut c_char>::ENCODING],
);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for evsioKeymapping {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub type NXKeyMapping = evsioKeymapping;
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct evsioMouseScaling {
pub numScaleLevels: c_int,
pub scaleThresholds: [c_short; 20],
pub scaleFactors: [c_short; 20],
}
#[cfg(feature = "objc2")]
unsafe impl Encode for evsioMouseScaling {
const ENCODING: Encoding = Encoding::Struct(
"evsioMouseScaling",
&[
<c_int>::ENCODING,
<[c_short; 20]>::ENCODING,
<[c_short; 20]>::ENCODING,
],
);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for evsioMouseScaling {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub type NXMouseScaling = evsioMouseScaling;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NXMouseButton(pub c_uint);
impl NXMouseButton {
#[doc(alias = "NX_OneButton")]
pub const OneButton: Self = Self(0);
#[doc(alias = "NX_LeftButton")]
pub const LeftButton: Self = Self(1);
#[doc(alias = "NX_RightButton")]
pub const RightButton: Self = Self(2);
}
#[cfg(feature = "objc2")]
unsafe impl Encode for NXMouseButton {
const ENCODING: Encoding = c_uint::ENCODING;
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for NXMouseButton {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct IOFixedPoint32 {
pub x: i32,
pub y: i32,
}
#[cfg(feature = "objc2")]
unsafe impl Encode for IOFixedPoint32 {
const ENCODING: Encoding =
Encoding::Struct("__IOFixedPoint32", &[<i32>::ENCODING, <i32>::ENCODING]);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for IOFixedPoint32 {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub type NXEventSystemInfoType = *mut c_int;
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct NXEventSystemDevice {
pub interface: c_int,
pub interface_addr: c_int,
pub dev_type: c_int,
pub id: c_int,
}
#[cfg(feature = "objc2")]
unsafe impl Encode for NXEventSystemDevice {
const ENCODING: Encoding = Encoding::Struct(
"?",
&[
<c_int>::ENCODING,
<c_int>::ENCODING,
<c_int>::ENCODING,
<c_int>::ENCODING,
],
);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for NXEventSystemDevice {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct NXEventSystemDeviceList {
pub dev: [NXEventSystemDevice; 16],
}
#[cfg(feature = "objc2")]
unsafe impl Encode for NXEventSystemDeviceList {
const ENCODING: Encoding = Encoding::Struct("?", &[<[NXEventSystemDevice; 16]>::ENCODING]);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for NXEventSystemDeviceList {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct EvCmd(pub c_uint);
impl EvCmd {
pub const EVNOP: Self = Self(0);
pub const EVHIDE: Self = Self(1);
pub const EVSHOW: Self = Self(2);
pub const EVMOVE: Self = Self(3);
pub const EVLEVEL: Self = Self(4);
}
#[cfg(feature = "objc2")]
unsafe impl Encode for EvCmd {
const ENCODING: Encoding = c_uint::ENCODING;
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for EvCmd {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub type NXCoord = c_float;
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct NXPoint {
pub x: NXCoord,
pub y: NXCoord,
}
#[cfg(feature = "objc2")]
unsafe impl Encode for NXPoint {
const ENCODING: Encoding =
Encoding::Struct("_NXPoint", &[<NXCoord>::ENCODING, <NXCoord>::ENCODING]);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for NXPoint {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct NXSize {
pub width: NXCoord,
pub height: NXCoord,
}
#[cfg(feature = "objc2")]
unsafe impl Encode for NXSize {
const ENCODING: Encoding =
Encoding::Struct("_NXSize", &[<NXCoord>::ENCODING, <NXCoord>::ENCODING]);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for NXSize {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct _NXTabletPointData_tilt {
pub x: i16,
pub y: i16,
}
#[cfg(feature = "objc2")]
unsafe impl Encode for _NXTabletPointData_tilt {
const ENCODING: Encoding = Encoding::Struct("?", &[<i16>::ENCODING, <i16>::ENCODING]);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for _NXTabletPointData_tilt {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct NXTabletPointData {
pub x: i32,
pub y: i32,
pub z: i32,
pub buttons: u16,
pub pressure: u16,
pub tilt: _NXTabletPointData_tilt,
pub rotation: u16,
pub tangentialPressure: i16,
pub deviceID: u16,
pub vendor1: i16,
pub vendor2: i16,
pub vendor3: i16,
}
#[cfg(feature = "objc2")]
unsafe impl Encode for NXTabletPointData {
const ENCODING: Encoding = Encoding::Struct(
"_NXTabletPointData",
&[
<i32>::ENCODING,
<i32>::ENCODING,
<i32>::ENCODING,
<u16>::ENCODING,
<u16>::ENCODING,
<_NXTabletPointData_tilt>::ENCODING,
<u16>::ENCODING,
<i16>::ENCODING,
<u16>::ENCODING,
<i16>::ENCODING,
<i16>::ENCODING,
<i16>::ENCODING,
],
);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for NXTabletPointData {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(C, packed(4))]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct NXTabletProximityData {
pub vendorID: u16,
pub tabletID: u16,
pub pointerID: u16,
pub deviceID: u16,
pub systemTabletID: u16,
pub vendorPointerType: u16,
pub pointerSerialNumber: u32,
pub uniqueID: u64,
pub capabilityMask: u32,
pub pointerType: u8,
pub enterProximity: u8,
pub reserved1: i16,
}
#[cfg(feature = "objc2")]
unsafe impl Encode for NXTabletProximityData {
const ENCODING: Encoding = Encoding::Struct(
"_NXTabletProximityData",
&[
<u16>::ENCODING,
<u16>::ENCODING,
<u16>::ENCODING,
<u16>::ENCODING,
<u16>::ENCODING,
<u16>::ENCODING,
<u32>::ENCODING,
<u64>::ENCODING,
<u32>::ENCODING,
<u8>::ENCODING,
<u8>::ENCODING,
<i16>::ENCODING,
],
);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for NXTabletProximityData {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(C)]
#[derive(Clone, Copy)]
pub union NXEventData_mouse_tablet {
pub point: NXTabletPointData,
pub proximity: NXTabletProximityData,
}
#[cfg(feature = "objc2")]
unsafe impl Encode for NXEventData_mouse_tablet {
const ENCODING: Encoding = Encoding::Union(
"?",
&[
<NXTabletPointData>::ENCODING,
<NXTabletProximityData>::ENCODING,
],
);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for NXEventData_mouse_tablet {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct NXEventData_mouse {
pub subx: u8,
pub suby: u8,
pub eventNum: i16,
pub click: i32,
pub pressure: u8,
pub buttonNumber: u8,
pub subType: u8,
pub reserved2: u8,
pub reserved3: i32,
pub tablet: NXEventData_mouse_tablet,
}
#[cfg(feature = "objc2")]
unsafe impl Encode for NXEventData_mouse {
const ENCODING: Encoding = Encoding::Struct(
"?",
&[
<u8>::ENCODING,
<u8>::ENCODING,
<i16>::ENCODING,
<i32>::ENCODING,
<u8>::ENCODING,
<u8>::ENCODING,
<u8>::ENCODING,
<u8>::ENCODING,
<i32>::ENCODING,
<NXEventData_mouse_tablet>::ENCODING,
],
);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for NXEventData_mouse {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(C)]
#[derive(Clone, Copy)]
pub union NXEventData_mouseMove_tablet {
pub point: NXTabletPointData,
pub proximity: NXTabletProximityData,
}
#[cfg(feature = "objc2")]
unsafe impl Encode for NXEventData_mouseMove_tablet {
const ENCODING: Encoding = Encoding::Union(
"?",
&[
<NXTabletPointData>::ENCODING,
<NXTabletProximityData>::ENCODING,
],
);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for NXEventData_mouseMove_tablet {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct NXEventData_mouseMove {
pub dx: i32,
pub dy: i32,
pub subx: u8,
pub suby: u8,
pub subType: u8,
pub reserved1: u8,
pub reserved2: i32,
pub tablet: NXEventData_mouseMove_tablet,
}
#[cfg(feature = "objc2")]
unsafe impl Encode for NXEventData_mouseMove {
const ENCODING: Encoding = Encoding::Struct(
"?",
&[
<i32>::ENCODING,
<i32>::ENCODING,
<u8>::ENCODING,
<u8>::ENCODING,
<u8>::ENCODING,
<u8>::ENCODING,
<i32>::ENCODING,
<NXEventData_mouseMove_tablet>::ENCODING,
],
);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for NXEventData_mouseMove {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct NXEventData_key {
pub origCharSet: u16,
pub repeat: i16,
pub charSet: u16,
pub charCode: u16,
pub keyCode: u16,
pub origCharCode: u16,
pub reserved1: i32,
pub keyboardType: u32,
pub reserved2: i32,
pub reserved3: i32,
pub reserved4: i32,
pub reserved5: [i32; 4],
}
#[cfg(feature = "objc2")]
unsafe impl Encode for NXEventData_key {
const ENCODING: Encoding = Encoding::Struct(
"?",
&[
<u16>::ENCODING,
<i16>::ENCODING,
<u16>::ENCODING,
<u16>::ENCODING,
<u16>::ENCODING,
<u16>::ENCODING,
<i32>::ENCODING,
<u32>::ENCODING,
<i32>::ENCODING,
<i32>::ENCODING,
<i32>::ENCODING,
<[i32; 4]>::ENCODING,
],
);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for NXEventData_key {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct NXEventData_tracking {
pub reserved: i16,
pub eventNum: i16,
pub trackingNum: i32,
pub userData: i32,
pub reserved1: i32,
pub reserved2: i32,
pub reserved3: i32,
pub reserved4: i32,
pub reserved5: i32,
pub reserved6: [i32; 4],
}
#[cfg(feature = "objc2")]
unsafe impl Encode for NXEventData_tracking {
const ENCODING: Encoding = Encoding::Struct(
"?",
&[
<i16>::ENCODING,
<i16>::ENCODING,
<i32>::ENCODING,
<i32>::ENCODING,
<i32>::ENCODING,
<i32>::ENCODING,
<i32>::ENCODING,
<i32>::ENCODING,
<i32>::ENCODING,
<[i32; 4]>::ENCODING,
],
);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for NXEventData_tracking {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct NXEventData_scrollWheel {
pub deltaAxis1: i16,
pub deltaAxis2: i16,
pub deltaAxis3: i16,
pub reserved1: i16,
pub fixedDeltaAxis1: i32,
pub fixedDeltaAxis2: i32,
pub fixedDeltaAxis3: i32,
pub pointDeltaAxis1: i32,
pub pointDeltaAxis2: i32,
pub pointDeltaAxis3: i32,
pub reserved8: [i32; 4],
}
#[cfg(feature = "objc2")]
unsafe impl Encode for NXEventData_scrollWheel {
const ENCODING: Encoding = Encoding::Struct(
"?",
&[
<i16>::ENCODING,
<i16>::ENCODING,
<i16>::ENCODING,
<i16>::ENCODING,
<i32>::ENCODING,
<i32>::ENCODING,
<i32>::ENCODING,
<i32>::ENCODING,
<i32>::ENCODING,
<i32>::ENCODING,
<[i32; 4]>::ENCODING,
],
);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for NXEventData_scrollWheel {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(C)]
#[derive(Clone, Copy)]
pub union NXEventData_compound_misc {
pub F: [c_float; 11],
pub L: [i32; 11],
pub S: [i16; 22],
pub C: [c_char; 44],
}
#[cfg(feature = "objc2")]
unsafe impl Encode for NXEventData_compound_misc {
const ENCODING: Encoding = Encoding::Union(
"?",
&[
<[c_float; 11]>::ENCODING,
<[i32; 11]>::ENCODING,
<[i16; 22]>::ENCODING,
<[c_char; 44]>::ENCODING,
],
);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for NXEventData_compound_misc {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct NXEventData_compound {
pub reserved: i16,
pub subType: i16,
pub misc: NXEventData_compound_misc,
}
#[cfg(feature = "objc2")]
unsafe impl Encode for NXEventData_compound {
const ENCODING: Encoding = Encoding::Struct(
"?",
&[
<i16>::ENCODING,
<i16>::ENCODING,
<NXEventData_compound_misc>::ENCODING,
],
);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for NXEventData_compound {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct NXEventData_tablet_tilt {
pub x: i16,
pub y: i16,
}
#[cfg(feature = "objc2")]
unsafe impl Encode for NXEventData_tablet_tilt {
const ENCODING: Encoding = Encoding::Struct("?", &[<i16>::ENCODING, <i16>::ENCODING]);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for NXEventData_tablet_tilt {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct NXEventData_tablet {
pub x: i32,
pub y: i32,
pub z: i32,
pub buttons: u16,
pub pressure: u16,
pub tilt: NXEventData_tablet_tilt,
pub rotation: u16,
pub tangentialPressure: i16,
pub deviceID: u16,
pub vendor1: i16,
pub vendor2: i16,
pub vendor3: i16,
pub reserved: [i32; 4],
}
#[cfg(feature = "objc2")]
unsafe impl Encode for NXEventData_tablet {
const ENCODING: Encoding = Encoding::Struct(
"?",
&[
<i32>::ENCODING,
<i32>::ENCODING,
<i32>::ENCODING,
<u16>::ENCODING,
<u16>::ENCODING,
<NXEventData_tablet_tilt>::ENCODING,
<u16>::ENCODING,
<i16>::ENCODING,
<u16>::ENCODING,
<i16>::ENCODING,
<i16>::ENCODING,
<i16>::ENCODING,
<[i32; 4]>::ENCODING,
],
);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for NXEventData_tablet {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(C, packed(4))]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct NXEventData_proximity {
pub vendorID: u16,
pub tabletID: u16,
pub pointerID: u16,
pub deviceID: u16,
pub systemTabletID: u16,
pub vendorPointerType: u16,
pub pointerSerialNumber: u32,
pub uniqueID: u64,
pub capabilityMask: u32,
pub pointerType: u8,
pub enterProximity: u8,
pub reserved1: i16,
pub reserved2: [i32; 4],
}
#[cfg(feature = "objc2")]
unsafe impl Encode for NXEventData_proximity {
const ENCODING: Encoding = Encoding::Struct(
"?",
&[
<u16>::ENCODING,
<u16>::ENCODING,
<u16>::ENCODING,
<u16>::ENCODING,
<u16>::ENCODING,
<u16>::ENCODING,
<u32>::ENCODING,
<u64>::ENCODING,
<u32>::ENCODING,
<u8>::ENCODING,
<u8>::ENCODING,
<i16>::ENCODING,
<[i32; 4]>::ENCODING,
],
);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for NXEventData_proximity {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(C)]
#[derive(Clone, Copy)]
pub union NXEventData {
pub mouse: NXEventData_mouse,
pub mouseMove: NXEventData_mouseMove,
pub key: NXEventData_key,
pub tracking: NXEventData_tracking,
pub scrollWheel: NXEventData_scrollWheel,
pub zoom: NXEventData_scrollWheel,
pub compound: NXEventData_compound,
pub tablet: NXEventData_tablet,
pub proximity: NXEventData_proximity,
}
#[cfg(feature = "objc2")]
unsafe impl Encode for NXEventData {
const ENCODING: Encoding = Encoding::Union(
"?",
&[
<NXEventData_mouse>::ENCODING,
<NXEventData_mouseMove>::ENCODING,
<NXEventData_key>::ENCODING,
<NXEventData_tracking>::ENCODING,
<NXEventData_scrollWheel>::ENCODING,
<NXEventData_scrollWheel>::ENCODING,
<NXEventData_compound>::ENCODING,
<NXEventData_tablet>::ENCODING,
<NXEventData_proximity>::ENCODING,
],
);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for NXEventData {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct _NXEvent_location {
pub x: i32,
pub y: i32,
}
#[cfg(feature = "objc2")]
unsafe impl Encode for _NXEvent_location {
const ENCODING: Encoding = Encoding::Struct("?", &[<i32>::ENCODING, <i32>::ENCODING]);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for _NXEvent_location {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(C, packed(4))]
#[derive(Clone, Copy)]
pub struct NXEvent {
pub r#type: i32,
pub location: _NXEvent_location,
pub time: u64,
pub flags: i32,
pub window: u32,
pub service_id: u64,
pub ext_pid: i32,
pub data: NXEventData,
}
#[cfg(feature = "objc2")]
unsafe impl Encode for NXEvent {
const ENCODING: Encoding = Encoding::Struct(
"_NXEvent",
&[
<i32>::ENCODING,
<_NXEvent_location>::ENCODING,
<u64>::ENCODING,
<i32>::ENCODING,
<u32>::ENCODING,
<u64>::ENCODING,
<i32>::ENCODING,
<NXEventData>::ENCODING,
],
);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for NXEvent {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct IOHIDButtonModes(pub c_uint);
impl IOHIDButtonModes {
#[doc(alias = "kIOHIDButtonMode_BothLeftClicks")]
pub const BothLeftClicks: Self = Self(0);
#[doc(alias = "kIOHIDButtonMode_ReverseLeftRightClicks")]
pub const ReverseLeftRightClicks: Self = Self(1);
#[doc(alias = "kIOHIDButtonMode_EnableRightClick")]
pub const EnableRightClick: Self = Self(2);
}
#[cfg(feature = "objc2")]
unsafe impl Encode for IOHIDButtonModes {
const ENCODING: Encoding = c_uint::ENCODING;
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for IOHIDButtonModes {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct evsioEVSIOSCSIndices(pub c_uint);
impl evsioEVSIOSCSIndices {
pub const EVSIOSCS_X: Self = Self(0);
pub const EVSIOSCS_Y: Self = Self(1);
}
#[cfg(feature = "objc2")]
unsafe impl Encode for evsioEVSIOSCSIndices {
const ENCODING: Encoding = c_uint::ENCODING;
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for evsioEVSIOSCSIndices {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct evsioEVSIOCCSIndices(pub c_uint);
impl evsioEVSIOCCSIndices {
pub const EVSIOCCS_X: Self = Self(0);
pub const EVSIOCCS_Y: Self = Self(1);
}
#[cfg(feature = "objc2")]
unsafe impl Encode for evsioEVSIOCCSIndices {
const ENCODING: Encoding = c_uint::ENCODING;
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for evsioEVSIOCCSIndices {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub const kIOHIDCapsLockState: c_uint = 0x00000001;
pub const kIOHIDNumLockState: c_uint = 0x00000002;
pub const kIOHIDActivityUserIdle: c_uint = 0x00000003;
pub const kIOHIDActivityDisplayOn: c_uint = 0x00000004;
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct _evOffsets {
pub evGlobalsOffset: c_int,
pub evShmemOffset: c_int,
}
#[cfg(feature = "objc2")]
unsafe impl Encode for _evOffsets {
const ENCODING: Encoding =
Encoding::Struct("_evOffsets", &[<c_int>::ENCODING, <c_int>::ENCODING]);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for _evOffsets {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub type EvOffsets = _evOffsets;
#[cfg(feature = "graphics")]
#[repr(C)]
#[derive(Clone, Copy)]
pub struct evioLLEvent {
pub setCursor: c_int,
pub r#type: c_int,
pub location: IOGPoint,
pub data: NXEventData,
pub setFlags: c_int,
pub flags: c_int,
}
#[cfg(all(feature = "graphics", feature = "objc2"))]
unsafe impl Encode for evioLLEvent {
const ENCODING: Encoding = Encoding::Struct(
"evioLLEvent",
&[
<c_int>::ENCODING,
<c_int>::ENCODING,
<IOGPoint>::ENCODING,
<NXEventData>::ENCODING,
<c_int>::ENCODING,
<c_int>::ENCODING,
],
);
}
#[cfg(all(feature = "graphics", feature = "objc2"))]
unsafe impl RefEncode for evioLLEvent {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub const kIOHIDEventNotification: c_uint = 0;
pub const kIOHIDServerConnectType: c_uint = 0;
pub const kIOHIDParamConnectType: c_uint = 1;
pub const kIOHIDEventSystemConnectType: c_uint = 3;
pub const kIOHIDGlobalMemory: c_uint = 0;
pub const kIOHIDEventQueueTypeKernel: c_uint = 0;
pub const kIOHIDEventQueueTypeUser: c_uint = 1;
pub const kIOHIDOpenedByEventSystem: c_uint = 0x10000;
pub const kIOHIDOpenedByFastPathClient: c_uint = 0x20000;
#[cfg(feature = "libc")]
#[inline]
pub extern "C-unwind" fn IOHIDCreateSharedMemory(
connect: io_connect_t,
version: c_uint,
) -> libc::kern_return_t {
extern "C-unwind" {
fn IOHIDCreateSharedMemory(connect: io_connect_t, version: c_uint) -> libc::kern_return_t;
}
unsafe { IOHIDCreateSharedMemory(connect, version) }
}
#[cfg(feature = "libc")]
#[inline]
pub extern "C-unwind" fn IOHIDSetEventsEnable(
connect: io_connect_t,
enable: bool,
) -> libc::kern_return_t {
extern "C-unwind" {
fn IOHIDSetEventsEnable(
connect: io_connect_t,
enable: libc::boolean_t,
) -> libc::kern_return_t;
}
unsafe { IOHIDSetEventsEnable(connect, enable as _) }
}
#[cfg(feature = "libc")]
#[deprecated]
#[inline]
pub extern "C-unwind" fn IOHIDSetCursorEnable(
connect: io_connect_t,
enable: bool,
) -> libc::kern_return_t {
extern "C-unwind" {
fn IOHIDSetCursorEnable(
connect: io_connect_t,
enable: libc::boolean_t,
) -> libc::kern_return_t;
}
unsafe { IOHIDSetCursorEnable(connect, enable as _) }
}
pub const kIOHIDSetGlobalEventFlags: c_uint = 0x00000001;
pub const kIOHIDSetCursorPosition: c_uint = 0x00000002;
pub const kIOHIDSetRelativeCursorPosition: c_uint = 0x00000004;
pub const kIOHIDPostHIDManagerEvent: c_uint = 0x00000008;
extern "C-unwind" {
#[cfg(all(feature = "graphics", feature = "libc"))]
#[deprecated = "Use CGSEventTap for posting HID events, IOHIDUserDevice for simulating HID device, IOPMAssertionDeclareUserActivity for reporting user activity"]
pub fn IOHIDPostEvent(
connect: io_connect_t,
event_type: u32,
location: IOGPoint,
event_data: *const NXEventData,
event_data_version: u32,
event_flags: IOOptionBits,
options: IOOptionBits,
) -> libc::kern_return_t;
}
#[cfg(feature = "libc")]
#[deprecated]
#[inline]
pub extern "C-unwind" fn IOHIDSetMouseLocation(
connect: io_connect_t,
x: c_int,
y: c_int,
) -> libc::kern_return_t {
extern "C-unwind" {
fn IOHIDSetMouseLocation(connect: io_connect_t, x: c_int, y: c_int) -> libc::kern_return_t;
}
unsafe { IOHIDSetMouseLocation(connect, x, y) }
}
extern "C-unwind" {
#[cfg(feature = "libc")]
#[deprecated]
pub fn IOHIDGetButtonEventNum(
connect: io_connect_t,
button: NXMouseButton,
event_num: *mut c_int,
) -> libc::kern_return_t;
}
extern "C-unwind" {
#[cfg(feature = "libc")]
#[deprecated]
pub fn IOHIDGetScrollAcceleration(
handle: io_connect_t,
acceleration: *mut c_double,
) -> libc::kern_return_t;
}
#[cfg(feature = "libc")]
#[deprecated]
#[inline]
pub extern "C-unwind" fn IOHIDSetScrollAcceleration(
handle: io_connect_t,
acceleration: c_double,
) -> libc::kern_return_t {
extern "C-unwind" {
fn IOHIDSetScrollAcceleration(
handle: io_connect_t,
acceleration: c_double,
) -> libc::kern_return_t;
}
unsafe { IOHIDSetScrollAcceleration(handle, acceleration) }
}
extern "C-unwind" {
#[cfg(feature = "libc")]
#[deprecated]
pub fn IOHIDGetMouseAcceleration(
handle: io_connect_t,
acceleration: *mut c_double,
) -> libc::kern_return_t;
}
#[cfg(feature = "libc")]
#[deprecated]
#[inline]
pub extern "C-unwind" fn IOHIDSetMouseAcceleration(
handle: io_connect_t,
acceleration: c_double,
) -> libc::kern_return_t {
extern "C-unwind" {
fn IOHIDSetMouseAcceleration(
handle: io_connect_t,
acceleration: c_double,
) -> libc::kern_return_t;
}
unsafe { IOHIDSetMouseAcceleration(handle, acceleration) }
}
extern "C-unwind" {
#[cfg(feature = "libc")]
#[deprecated]
pub fn IOHIDGetMouseButtonMode(handle: io_connect_t, mode: *mut c_int) -> libc::kern_return_t;
}
#[cfg(feature = "libc")]
#[deprecated]
#[inline]
pub extern "C-unwind" fn IOHIDSetMouseButtonMode(
handle: io_connect_t,
mode: c_int,
) -> libc::kern_return_t {
extern "C-unwind" {
fn IOHIDSetMouseButtonMode(handle: io_connect_t, mode: c_int) -> libc::kern_return_t;
}
unsafe { IOHIDSetMouseButtonMode(handle, mode) }
}
extern "C-unwind" {
#[cfg(feature = "libc")]
#[deprecated]
pub fn IOHIDGetAccelerationWithKey(
handle: io_connect_t,
key: Option<&CFString>,
acceleration: *mut c_double,
) -> libc::kern_return_t;
}
extern "C-unwind" {
#[cfg(feature = "libc")]
#[deprecated]
pub fn IOHIDSetAccelerationWithKey(
handle: io_connect_t,
key: Option<&CFString>,
acceleration: c_double,
) -> libc::kern_return_t;
}
extern "C-unwind" {
#[cfg(feature = "libc")]
#[deprecated]
pub fn IOHIDGetParameter(
handle: io_connect_t,
key: Option<&CFString>,
max_size: IOByteCount,
bytes: *mut c_void,
actual_size: *mut IOByteCount,
) -> libc::kern_return_t;
}
extern "C-unwind" {
#[cfg(feature = "libc")]
#[deprecated]
pub fn IOHIDSetParameter(
handle: io_connect_t,
key: Option<&CFString>,
bytes: *const c_void,
size: IOByteCount,
) -> libc::kern_return_t;
}
extern "C-unwind" {
#[cfg(feature = "libc")]
pub fn IOHIDCopyCFTypeParameter(
handle: io_connect_t,
key: Option<&CFString>,
parameter: *mut *const CFType,
) -> libc::kern_return_t;
}
extern "C-unwind" {
#[cfg(feature = "libc")]
pub fn IOHIDSetCFTypeParameter(
handle: io_connect_t,
key: Option<&CFString>,
parameter: Option<&CFType>,
) -> libc::kern_return_t;
}
extern "C-unwind" {
#[cfg(feature = "libc")]
pub fn IOHIDGetStateForSelector(
handle: io_connect_t,
selector: c_int,
state: *mut u32,
) -> libc::kern_return_t;
}
#[cfg(feature = "libc")]
#[inline]
pub extern "C-unwind" fn IOHIDSetStateForSelector(
handle: io_connect_t,
selector: c_int,
state: u32,
) -> libc::kern_return_t {
extern "C-unwind" {
fn IOHIDSetStateForSelector(
handle: io_connect_t,
selector: c_int,
state: u32,
) -> libc::kern_return_t;
}
unsafe { IOHIDSetStateForSelector(handle, selector, state) }
}
extern "C-unwind" {
#[cfg(feature = "libc")]
pub fn IOHIDGetModifierLockState(
handle: io_connect_t,
selector: c_int,
state: *mut bool,
) -> libc::kern_return_t;
}
#[cfg(feature = "libc")]
#[inline]
pub extern "C-unwind" fn IOHIDSetModifierLockState(
handle: io_connect_t,
selector: c_int,
state: bool,
) -> libc::kern_return_t {
extern "C-unwind" {
fn IOHIDSetModifierLockState(
handle: io_connect_t,
selector: c_int,
state: bool,
) -> libc::kern_return_t;
}
unsafe { IOHIDSetModifierLockState(handle, selector, state) }
}
extern "C-unwind" {
#[cfg(feature = "libc")]
#[deprecated]
pub fn IOHIDRegisterVirtualDisplay(
handle: io_connect_t,
display_token: *mut u32,
) -> libc::kern_return_t;
}
#[cfg(feature = "libc")]
#[deprecated]
#[inline]
pub extern "C-unwind" fn IOHIDUnregisterVirtualDisplay(
handle: io_connect_t,
display_token: u32,
) -> libc::kern_return_t {
extern "C-unwind" {
fn IOHIDUnregisterVirtualDisplay(
handle: io_connect_t,
display_token: u32,
) -> libc::kern_return_t;
}
unsafe { IOHIDUnregisterVirtualDisplay(handle, display_token) }
}
extern "C-unwind" {
#[cfg(all(feature = "graphics", feature = "libc"))]
#[deprecated]
pub fn IOHIDSetVirtualDisplayBounds(
handle: io_connect_t,
display_token: u32,
bounds: *const IOGBounds,
) -> libc::kern_return_t;
}
extern "C-unwind" {
#[cfg(feature = "libc")]
#[deprecated]
pub fn IOHIDGetActivityState(
handle: io_connect_t,
hid_activity_idle: *mut bool,
) -> libc::kern_return_t;
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct IOHIDRequestType(pub c_uint);
impl IOHIDRequestType {
#[doc(alias = "kIOHIDRequestTypePostEvent")]
pub const PostEvent: Self = Self(0);
#[doc(alias = "kIOHIDRequestTypeListenEvent")]
pub const ListenEvent: Self = Self(1);
}
#[cfg(feature = "objc2")]
unsafe impl Encode for IOHIDRequestType {
const ENCODING: Encoding = c_uint::ENCODING;
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for IOHIDRequestType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct IOHIDAccessType(pub c_uint);
impl IOHIDAccessType {
#[doc(alias = "kIOHIDAccessTypeGranted")]
pub const Granted: Self = Self(0);
#[doc(alias = "kIOHIDAccessTypeDenied")]
pub const Denied: Self = Self(1);
#[doc(alias = "kIOHIDAccessTypeUnknown")]
pub const Unknown: Self = Self(2);
}
#[cfg(feature = "objc2")]
unsafe impl Encode for IOHIDAccessType {
const ENCODING: Encoding = c_uint::ENCODING;
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for IOHIDAccessType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[inline]
pub extern "C-unwind" fn IOHIDCheckAccess(request_type: IOHIDRequestType) -> IOHIDAccessType {
extern "C-unwind" {
fn IOHIDCheckAccess(request_type: IOHIDRequestType) -> IOHIDAccessType;
}
unsafe { IOHIDCheckAccess(request_type) }
}
#[inline]
pub extern "C-unwind" fn IOHIDRequestAccess(request_type: IOHIDRequestType) -> bool {
extern "C-unwind" {
fn IOHIDRequestAccess(request_type: IOHIDRequestType) -> bool;
}
unsafe { IOHIDRequestAccess(request_type) }
}
#[cfg(feature = "libc")]
pub type NXEventHandle = libc::mach_port_t;
#[cfg(feature = "libc")]
#[deprecated]
#[inline]
pub extern "C-unwind" fn NXOpenEventStatus() -> NXEventHandle {
extern "C-unwind" {
fn NXOpenEventStatus() -> NXEventHandle;
}
unsafe { NXOpenEventStatus() }
}
#[cfg(feature = "libc")]
#[deprecated]
#[inline]
pub extern "C-unwind" fn NXCloseEventStatus(handle: NXEventHandle) {
extern "C-unwind" {
fn NXCloseEventStatus(handle: NXEventHandle);
}
unsafe { NXCloseEventStatus(handle) }
}
extern "C-unwind" {
#[cfg(feature = "libc")]
#[deprecated]
pub fn NXEventSystemInfo(
handle: NXEventHandle,
flavor: *mut c_char,
evs_info: *mut c_int,
evs_info_cnt: *mut c_uint,
) -> NXEventSystemInfoType;
}
#[cfg(feature = "libc")]
#[deprecated]
#[inline]
pub extern "C-unwind" fn NXSetKeyRepeatInterval(handle: NXEventHandle, seconds: c_double) {
extern "C-unwind" {
fn NXSetKeyRepeatInterval(handle: NXEventHandle, seconds: c_double);
}
unsafe { NXSetKeyRepeatInterval(handle, seconds) }
}
#[cfg(feature = "libc")]
#[deprecated]
#[inline]
pub extern "C-unwind" fn NXKeyRepeatInterval(handle: NXEventHandle) -> c_double {
extern "C-unwind" {
fn NXKeyRepeatInterval(handle: NXEventHandle) -> c_double;
}
unsafe { NXKeyRepeatInterval(handle) }
}
#[cfg(feature = "libc")]
#[deprecated]
#[inline]
pub extern "C-unwind" fn NXSetKeyRepeatThreshold(handle: NXEventHandle, threshold: c_double) {
extern "C-unwind" {
fn NXSetKeyRepeatThreshold(handle: NXEventHandle, threshold: c_double);
}
unsafe { NXSetKeyRepeatThreshold(handle, threshold) }
}
#[cfg(feature = "libc")]
#[deprecated]
#[inline]
pub extern "C-unwind" fn NXKeyRepeatThreshold(handle: NXEventHandle) -> c_double {
extern "C-unwind" {
fn NXKeyRepeatThreshold(handle: NXEventHandle) -> c_double;
}
unsafe { NXKeyRepeatThreshold(handle) }
}
#[cfg(feature = "libc")]
#[deprecated]
#[inline]
pub extern "C-unwind" fn NXResetKeyboard(handle: NXEventHandle) {
extern "C-unwind" {
fn NXResetKeyboard(handle: NXEventHandle);
}
unsafe { NXResetKeyboard(handle) }
}
#[cfg(feature = "libc")]
#[deprecated]
#[inline]
pub extern "C-unwind" fn NXSetClickTime(handle: NXEventHandle, seconds: c_double) {
extern "C-unwind" {
fn NXSetClickTime(handle: NXEventHandle, seconds: c_double);
}
unsafe { NXSetClickTime(handle, seconds) }
}
#[cfg(feature = "libc")]
#[deprecated]
#[inline]
pub extern "C-unwind" fn NXClickTime(handle: NXEventHandle) -> c_double {
extern "C-unwind" {
fn NXClickTime(handle: NXEventHandle) -> c_double;
}
unsafe { NXClickTime(handle) }
}
extern "C-unwind" {
#[cfg(feature = "libc")]
#[deprecated]
pub fn NXSetClickSpace(handle: NXEventHandle, area: *mut NXSize);
}
extern "C-unwind" {
#[cfg(feature = "libc")]
#[deprecated]
pub fn NXGetClickSpace(handle: NXEventHandle, area: *mut NXSize);
}
#[cfg(feature = "libc")]
#[deprecated]
#[inline]
pub extern "C-unwind" fn NXResetMouse(handle: NXEventHandle) {
extern "C-unwind" {
fn NXResetMouse(handle: NXEventHandle);
}
unsafe { NXResetMouse(handle) }
}
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct _NXParsedKeyMapping_ {
pub shorts: c_short,
pub keyBits: [c_char; 256],
pub maxMod: c_int,
pub modDefs: [*mut c_uchar; 16],
pub numDefs: c_int,
pub keyDefs: [*mut c_uchar; 256],
pub numSeqs: c_int,
pub seqDefs: [*mut c_uchar; 128],
pub numSpecialKeys: c_int,
pub specialKeys: [c_ushort; 24],
pub mapping: *const c_uchar,
pub mappingLen: c_int,
}
#[cfg(feature = "objc2")]
unsafe impl Encode for _NXParsedKeyMapping_ {
const ENCODING: Encoding = Encoding::Struct(
"_NXParsedKeyMapping_",
&[
<c_short>::ENCODING,
<[c_char; 256]>::ENCODING,
<c_int>::ENCODING,
<[*mut c_uchar; 16]>::ENCODING,
<c_int>::ENCODING,
<[*mut c_uchar; 256]>::ENCODING,
<c_int>::ENCODING,
<[*mut c_uchar; 128]>::ENCODING,
<c_int>::ENCODING,
<[c_ushort; 24]>::ENCODING,
<*const c_uchar>::ENCODING,
<c_int>::ENCODING,
],
);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for _NXParsedKeyMapping_ {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub type NXParsedKeyMapping = _NXParsedKeyMapping_;
#[doc(alias = "IOHIDEventSystemClientRef")]
#[repr(C)]
pub struct IOHIDEventSystemClient {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
cf_type!(
unsafe impl IOHIDEventSystemClient {}
);
#[cfg(feature = "objc2")]
cf_objc2_type!(
unsafe impl RefEncode<"__IOHIDEventSystemClient"> for IOHIDEventSystemClient {}
);
impl IOHIDEventSystemClient {
#[doc(alias = "IOHIDEventSystemClientCreateSimpleClient")]
#[inline]
pub fn new_simple_client(
allocator: Option<&CFAllocator>,
) -> CFRetained<IOHIDEventSystemClient> {
extern "C-unwind" {
fn IOHIDEventSystemClientCreateSimpleClient(
allocator: Option<&CFAllocator>,
) -> Option<NonNull<IOHIDEventSystemClient>>;
}
let ret = unsafe { IOHIDEventSystemClientCreateSimpleClient(allocator) };
let ret =
ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
#[doc(alias = "IOHIDEventSystemClientSetProperty")]
#[inline]
pub unsafe fn set_property(&self, key: &CFString, property: &CFType) -> bool {
extern "C-unwind" {
fn IOHIDEventSystemClientSetProperty(
client: &IOHIDEventSystemClient,
key: &CFString,
property: &CFType,
) -> Boolean;
}
let ret = unsafe { IOHIDEventSystemClientSetProperty(self, key, property) };
ret != 0
}
#[doc(alias = "IOHIDEventSystemClientCopyProperty")]
#[inline]
pub fn property(&self, key: &CFString) -> Option<CFRetained<CFType>> {
extern "C-unwind" {
fn IOHIDEventSystemClientCopyProperty(
client: &IOHIDEventSystemClient,
key: &CFString,
) -> Option<NonNull<CFType>>;
}
let ret = unsafe { IOHIDEventSystemClientCopyProperty(self, key) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
}
unsafe impl ConcreteType for IOHIDEventSystemClient {
#[doc(alias = "IOHIDEventSystemClientGetTypeID")]
#[inline]
fn type_id() -> CFTypeID {
extern "C-unwind" {
fn IOHIDEventSystemClientGetTypeID() -> CFTypeID;
}
unsafe { IOHIDEventSystemClientGetTypeID() }
}
}
impl IOHIDEventSystemClient {
#[doc(alias = "IOHIDEventSystemClientCopyServices")]
#[inline]
pub fn services(&self) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn IOHIDEventSystemClientCopyServices(
client: &IOHIDEventSystemClient,
) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { IOHIDEventSystemClientCopyServices(self) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
}
#[doc(alias = "IOHIDServiceClientRef")]
#[repr(C)]
pub struct IOHIDServiceClient {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
cf_type!(
unsafe impl IOHIDServiceClient {}
);
#[cfg(feature = "objc2")]
cf_objc2_type!(
unsafe impl RefEncode<"__IOHIDServiceClient"> for IOHIDServiceClient {}
);
impl IOHIDServiceClient {
#[doc(alias = "IOHIDServiceClientSetProperty")]
#[inline]
pub unsafe fn set_property(&self, key: &CFString, property: &CFType) -> bool {
extern "C-unwind" {
fn IOHIDServiceClientSetProperty(
service: &IOHIDServiceClient,
key: &CFString,
property: &CFType,
) -> Boolean;
}
let ret = unsafe { IOHIDServiceClientSetProperty(self, key, property) };
ret != 0
}
#[doc(alias = "IOHIDServiceClientCopyProperty")]
#[inline]
pub fn property(&self, key: &CFString) -> Option<CFRetained<CFType>> {
extern "C-unwind" {
fn IOHIDServiceClientCopyProperty(
service: &IOHIDServiceClient,
key: &CFString,
) -> Option<NonNull<CFType>>;
}
let ret = unsafe { IOHIDServiceClientCopyProperty(self, key) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
}
unsafe impl ConcreteType for IOHIDServiceClient {
#[doc(alias = "IOHIDServiceClientGetTypeID")]
#[inline]
fn type_id() -> CFTypeID {
extern "C-unwind" {
fn IOHIDServiceClientGetTypeID() -> CFTypeID;
}
unsafe { IOHIDServiceClientGetTypeID() }
}
}
impl IOHIDServiceClient {
#[doc(alias = "IOHIDServiceClientGetRegistryID")]
#[inline]
pub fn registry_id(&self) -> CFRetained<CFType> {
extern "C-unwind" {
fn IOHIDServiceClientGetRegistryID(
service: &IOHIDServiceClient,
) -> Option<NonNull<CFType>>;
}
let ret = unsafe { IOHIDServiceClientGetRegistryID(self) };
let ret =
ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::retain(ret) }
}
#[doc(alias = "IOHIDServiceClientConformsTo")]
#[cfg(feature = "libc")]
#[inline]
pub fn conforms_to(&self, usage_page: u32, usage: u32) -> bool {
extern "C-unwind" {
fn IOHIDServiceClientConformsTo(
service: &IOHIDServiceClient,
usage_page: u32,
usage: u32,
) -> libc::boolean_t;
}
let ret = unsafe { IOHIDServiceClientConformsTo(self, usage_page, usage) };
ret != 0
}
}
#[doc(alias = "IOHIDUserDeviceRef")]
#[repr(C)]
pub struct IOHIDUserDevice {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
cf_type!(
unsafe impl IOHIDUserDevice {}
);
#[cfg(feature = "objc2")]
cf_objc2_type!(
unsafe impl RefEncode<"__IOHIDUserDevice"> for IOHIDUserDevice {}
);
#[cfg(all(feature = "block2", feature = "hid"))]
pub type IOHIDUserDeviceSetReportBlock =
*mut block2::DynBlock<dyn Fn(IOHIDReportType, u32, NonNull<u8>, CFIndex) -> IOReturn>;
#[cfg(all(feature = "block2", feature = "hid"))]
pub type IOHIDUserDeviceGetReportBlock =
*mut block2::DynBlock<dyn Fn(IOHIDReportType, u32, NonNull<u8>, NonNull<CFIndex>) -> IOReturn>;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct IOHIDUserDeviceOptions(pub IOOptionBits);
impl IOHIDUserDeviceOptions {
#[doc(alias = "IOHIDUserDeviceOptionsCreateOnActivate")]
pub const CreateOnActivate: Self = Self(1 << 0);
}
#[cfg(feature = "objc2")]
unsafe impl Encode for IOHIDUserDeviceOptions {
const ENCODING: Encoding = IOOptionBits::ENCODING;
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for IOHIDUserDeviceOptions {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
unsafe impl ConcreteType for IOHIDUserDevice {
#[doc(alias = "IOHIDUserDeviceGetTypeID")]
#[inline]
fn type_id() -> CFTypeID {
extern "C-unwind" {
fn IOHIDUserDeviceGetTypeID() -> CFTypeID;
}
unsafe { IOHIDUserDeviceGetTypeID() }
}
}
impl IOHIDUserDevice {
#[doc(alias = "IOHIDUserDeviceCreateWithProperties")]
#[inline]
pub unsafe fn with_properties(
allocator: Option<&CFAllocator>,
properties: &CFDictionary,
options: IOOptionBits,
) -> Option<CFRetained<IOHIDUserDevice>> {
extern "C-unwind" {
fn IOHIDUserDeviceCreateWithProperties(
allocator: Option<&CFAllocator>,
properties: &CFDictionary,
options: IOOptionBits,
) -> Option<NonNull<IOHIDUserDevice>>;
}
let ret = unsafe { IOHIDUserDeviceCreateWithProperties(allocator, properties, options) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "IOHIDUserDeviceRegisterGetReportBlock")]
#[cfg(all(feature = "block2", feature = "hid"))]
#[inline]
pub unsafe fn register_get_report_block(&self, block: IOHIDUserDeviceGetReportBlock) {
extern "C-unwind" {
fn IOHIDUserDeviceRegisterGetReportBlock(
device: &IOHIDUserDevice,
block: IOHIDUserDeviceGetReportBlock,
);
}
unsafe { IOHIDUserDeviceRegisterGetReportBlock(self, block) }
}
#[doc(alias = "IOHIDUserDeviceRegisterSetReportBlock")]
#[cfg(all(feature = "block2", feature = "hid"))]
#[inline]
pub unsafe fn register_set_report_block(&self, block: IOHIDUserDeviceSetReportBlock) {
extern "C-unwind" {
fn IOHIDUserDeviceRegisterSetReportBlock(
device: &IOHIDUserDevice,
block: IOHIDUserDeviceSetReportBlock,
);
}
unsafe { IOHIDUserDeviceRegisterSetReportBlock(self, block) }
}
#[doc(alias = "IOHIDUserDeviceSetDispatchQueue")]
#[cfg(feature = "dispatch2")]
#[inline]
pub unsafe fn set_dispatch_queue(&self, queue: &DispatchQueue) {
extern "C-unwind" {
fn IOHIDUserDeviceSetDispatchQueue(device: &IOHIDUserDevice, queue: &DispatchQueue);
}
unsafe { IOHIDUserDeviceSetDispatchQueue(self, queue) }
}
#[doc(alias = "IOHIDUserDeviceSetCancelHandler")]
#[cfg(feature = "dispatch2")]
#[inline]
pub unsafe fn set_cancel_handler(&self, handler: dispatch_block_t) {
extern "C-unwind" {
fn IOHIDUserDeviceSetCancelHandler(device: &IOHIDUserDevice, handler: dispatch_block_t);
}
unsafe { IOHIDUserDeviceSetCancelHandler(self, handler) }
}
#[doc(alias = "IOHIDUserDeviceActivate")]
#[inline]
pub fn activate(&self) {
extern "C-unwind" {
fn IOHIDUserDeviceActivate(device: &IOHIDUserDevice);
}
unsafe { IOHIDUserDeviceActivate(self) }
}
#[doc(alias = "IOHIDUserDeviceCancel")]
#[inline]
pub fn cancel(&self) {
extern "C-unwind" {
fn IOHIDUserDeviceCancel(device: &IOHIDUserDevice);
}
unsafe { IOHIDUserDeviceCancel(self) }
}
#[doc(alias = "IOHIDUserDeviceCopyProperty")]
#[inline]
pub fn property(&self, key: &CFString) -> Option<CFRetained<CFType>> {
extern "C-unwind" {
fn IOHIDUserDeviceCopyProperty(
device: &IOHIDUserDevice,
key: &CFString,
) -> Option<NonNull<CFType>>;
}
let ret = unsafe { IOHIDUserDeviceCopyProperty(self, key) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "IOHIDUserDeviceSetProperty")]
#[inline]
pub unsafe fn set_property(&self, key: &CFString, property: &CFType) -> bool {
extern "C-unwind" {
fn IOHIDUserDeviceSetProperty(
device: &IOHIDUserDevice,
key: &CFString,
property: &CFType,
) -> Boolean;
}
let ret = unsafe { IOHIDUserDeviceSetProperty(self, key, property) };
ret != 0
}
#[doc(alias = "IOHIDUserDeviceHandleReportWithTimeStamp")]
#[inline]
pub unsafe fn handle_report_with_time_stamp(
&self,
timestamp: u64,
report: NonNull<u8>,
report_length: CFIndex,
) -> IOReturn {
extern "C-unwind" {
fn IOHIDUserDeviceHandleReportWithTimeStamp(
device: &IOHIDUserDevice,
timestamp: u64,
report: NonNull<u8>,
report_length: CFIndex,
) -> IOReturn;
}
unsafe { IOHIDUserDeviceHandleReportWithTimeStamp(self, timestamp, report, report_length) }
}
}
#[deprecated = "renamed to `IOHIDEventSystemClient::new_simple_client`"]
#[inline]
pub extern "C-unwind" fn IOHIDEventSystemClientCreateSimpleClient(
allocator: Option<&CFAllocator>,
) -> CFRetained<IOHIDEventSystemClient> {
extern "C-unwind" {
fn IOHIDEventSystemClientCreateSimpleClient(
allocator: Option<&CFAllocator>,
) -> Option<NonNull<IOHIDEventSystemClient>>;
}
let ret = unsafe { IOHIDEventSystemClientCreateSimpleClient(allocator) };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
#[deprecated = "renamed to `IOHIDEventSystemClient::set_property`"]
#[inline]
pub unsafe extern "C-unwind" fn IOHIDEventSystemClientSetProperty(
client: &IOHIDEventSystemClient,
key: &CFString,
property: &CFType,
) -> bool {
extern "C-unwind" {
fn IOHIDEventSystemClientSetProperty(
client: &IOHIDEventSystemClient,
key: &CFString,
property: &CFType,
) -> Boolean;
}
let ret = unsafe { IOHIDEventSystemClientSetProperty(client, key, property) };
ret != 0
}
#[deprecated = "renamed to `IOHIDEventSystemClient::property`"]
#[inline]
pub extern "C-unwind" fn IOHIDEventSystemClientCopyProperty(
client: &IOHIDEventSystemClient,
key: &CFString,
) -> Option<CFRetained<CFType>> {
extern "C-unwind" {
fn IOHIDEventSystemClientCopyProperty(
client: &IOHIDEventSystemClient,
key: &CFString,
) -> Option<NonNull<CFType>>;
}
let ret = unsafe { IOHIDEventSystemClientCopyProperty(client, key) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `IOHIDEventSystemClient::services`"]
#[inline]
pub extern "C-unwind" fn IOHIDEventSystemClientCopyServices(
client: &IOHIDEventSystemClient,
) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn IOHIDEventSystemClientCopyServices(
client: &IOHIDEventSystemClient,
) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { IOHIDEventSystemClientCopyServices(client) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `IOHIDServiceClient::set_property`"]
#[inline]
pub unsafe extern "C-unwind" fn IOHIDServiceClientSetProperty(
service: &IOHIDServiceClient,
key: &CFString,
property: &CFType,
) -> bool {
extern "C-unwind" {
fn IOHIDServiceClientSetProperty(
service: &IOHIDServiceClient,
key: &CFString,
property: &CFType,
) -> Boolean;
}
let ret = unsafe { IOHIDServiceClientSetProperty(service, key, property) };
ret != 0
}
#[deprecated = "renamed to `IOHIDServiceClient::property`"]
#[inline]
pub extern "C-unwind" fn IOHIDServiceClientCopyProperty(
service: &IOHIDServiceClient,
key: &CFString,
) -> Option<CFRetained<CFType>> {
extern "C-unwind" {
fn IOHIDServiceClientCopyProperty(
service: &IOHIDServiceClient,
key: &CFString,
) -> Option<NonNull<CFType>>;
}
let ret = unsafe { IOHIDServiceClientCopyProperty(service, key) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `IOHIDServiceClient::registry_id`"]
#[inline]
pub extern "C-unwind" fn IOHIDServiceClientGetRegistryID(
service: &IOHIDServiceClient,
) -> CFRetained<CFType> {
extern "C-unwind" {
fn IOHIDServiceClientGetRegistryID(service: &IOHIDServiceClient)
-> Option<NonNull<CFType>>;
}
let ret = unsafe { IOHIDServiceClientGetRegistryID(service) };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::retain(ret) }
}
#[cfg(feature = "libc")]
#[deprecated = "renamed to `IOHIDServiceClient::conforms_to`"]
#[inline]
pub extern "C-unwind" fn IOHIDServiceClientConformsTo(
service: &IOHIDServiceClient,
usage_page: u32,
usage: u32,
) -> bool {
extern "C-unwind" {
fn IOHIDServiceClientConformsTo(
service: &IOHIDServiceClient,
usage_page: u32,
usage: u32,
) -> libc::boolean_t;
}
let ret = unsafe { IOHIDServiceClientConformsTo(service, usage_page, usage) };
ret != 0
}
#[deprecated = "renamed to `IOHIDUserDevice::with_properties`"]
#[inline]
pub unsafe extern "C-unwind" fn IOHIDUserDeviceCreateWithProperties(
allocator: Option<&CFAllocator>,
properties: &CFDictionary,
options: IOOptionBits,
) -> Option<CFRetained<IOHIDUserDevice>> {
extern "C-unwind" {
fn IOHIDUserDeviceCreateWithProperties(
allocator: Option<&CFAllocator>,
properties: &CFDictionary,
options: IOOptionBits,
) -> Option<NonNull<IOHIDUserDevice>>;
}
let ret = unsafe { IOHIDUserDeviceCreateWithProperties(allocator, properties, options) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
extern "C-unwind" {
#[cfg(all(feature = "block2", feature = "hid"))]
#[deprecated = "renamed to `IOHIDUserDevice::register_get_report_block`"]
pub fn IOHIDUserDeviceRegisterGetReportBlock(
device: &IOHIDUserDevice,
block: IOHIDUserDeviceGetReportBlock,
);
}
extern "C-unwind" {
#[cfg(all(feature = "block2", feature = "hid"))]
#[deprecated = "renamed to `IOHIDUserDevice::register_set_report_block`"]
pub fn IOHIDUserDeviceRegisterSetReportBlock(
device: &IOHIDUserDevice,
block: IOHIDUserDeviceSetReportBlock,
);
}
extern "C-unwind" {
#[cfg(feature = "dispatch2")]
#[deprecated = "renamed to `IOHIDUserDevice::set_dispatch_queue`"]
pub fn IOHIDUserDeviceSetDispatchQueue(device: &IOHIDUserDevice, queue: &DispatchQueue);
}
extern "C-unwind" {
#[cfg(feature = "dispatch2")]
#[deprecated = "renamed to `IOHIDUserDevice::set_cancel_handler`"]
pub fn IOHIDUserDeviceSetCancelHandler(device: &IOHIDUserDevice, handler: dispatch_block_t);
}
#[deprecated = "renamed to `IOHIDUserDevice::activate`"]
#[inline]
pub extern "C-unwind" fn IOHIDUserDeviceActivate(device: &IOHIDUserDevice) {
extern "C-unwind" {
fn IOHIDUserDeviceActivate(device: &IOHIDUserDevice);
}
unsafe { IOHIDUserDeviceActivate(device) }
}
#[deprecated = "renamed to `IOHIDUserDevice::cancel`"]
#[inline]
pub extern "C-unwind" fn IOHIDUserDeviceCancel(device: &IOHIDUserDevice) {
extern "C-unwind" {
fn IOHIDUserDeviceCancel(device: &IOHIDUserDevice);
}
unsafe { IOHIDUserDeviceCancel(device) }
}
#[deprecated = "renamed to `IOHIDUserDevice::property`"]
#[inline]
pub extern "C-unwind" fn IOHIDUserDeviceCopyProperty(
device: &IOHIDUserDevice,
key: &CFString,
) -> Option<CFRetained<CFType>> {
extern "C-unwind" {
fn IOHIDUserDeviceCopyProperty(
device: &IOHIDUserDevice,
key: &CFString,
) -> Option<NonNull<CFType>>;
}
let ret = unsafe { IOHIDUserDeviceCopyProperty(device, key) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `IOHIDUserDevice::set_property`"]
#[inline]
pub unsafe extern "C-unwind" fn IOHIDUserDeviceSetProperty(
device: &IOHIDUserDevice,
key: &CFString,
property: &CFType,
) -> bool {
extern "C-unwind" {
fn IOHIDUserDeviceSetProperty(
device: &IOHIDUserDevice,
key: &CFString,
property: &CFType,
) -> Boolean;
}
let ret = unsafe { IOHIDUserDeviceSetProperty(device, key, property) };
ret != 0
}
extern "C-unwind" {
#[deprecated = "renamed to `IOHIDUserDevice::handle_report_with_time_stamp`"]
pub fn IOHIDUserDeviceHandleReportWithTimeStamp(
device: &IOHIDUserDevice,
timestamp: u64,
report: NonNull<u8>,
report_length: CFIndex,
) -> IOReturn;
}