objc2_game_controller/generated/
GCDeviceHaptics.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// A GCHapticsLocality represents the locations of haptic actuators on a controller. You can create a haptic engine with a given
11/// GCHapticsLocality, and any patterns you send to that engine will play on all specified actuators.
12///
13/// ```text
14/// CHHapticEngine *engine = [controller.haptics createEngineWithLocality:GCHapticsLocalityDefault];
15/// ```
16///
17///
18/// See: GCDeviceHaptics
19///
20/// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gchapticslocality?language=objc)
21// NS_TYPED_ENUM
22pub type GCHapticsLocality = NSString;
23
24extern "C" {
25    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gchapticslocalitydefault?language=objc)
26    pub static GCHapticsLocalityDefault: &'static GCHapticsLocality;
27}
28
29extern "C" {
30    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gchapticslocalityall?language=objc)
31    pub static GCHapticsLocalityAll: &'static GCHapticsLocality;
32}
33
34extern "C" {
35    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gchapticslocalityhandles?language=objc)
36    pub static GCHapticsLocalityHandles: &'static GCHapticsLocality;
37}
38
39extern "C" {
40    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gchapticslocalitylefthandle?language=objc)
41    pub static GCHapticsLocalityLeftHandle: &'static GCHapticsLocality;
42}
43
44extern "C" {
45    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gchapticslocalityrighthandle?language=objc)
46    pub static GCHapticsLocalityRightHandle: &'static GCHapticsLocality;
47}
48
49extern "C" {
50    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gchapticslocalitytriggers?language=objc)
51    pub static GCHapticsLocalityTriggers: &'static GCHapticsLocality;
52}
53
54extern "C" {
55    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gchapticslocalitylefttrigger?language=objc)
56    pub static GCHapticsLocalityLeftTrigger: &'static GCHapticsLocality;
57}
58
59extern "C" {
60    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gchapticslocalityrighttrigger?language=objc)
61    pub static GCHapticsLocalityRightTrigger: &'static GCHapticsLocality;
62}
63
64extern "C" {
65    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gchapticdurationinfinite?language=objc)
66    pub static GCHapticDurationInfinite: c_float;
67}
68
69extern_class!(
70    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcdevicehaptics?language=objc)
71    #[unsafe(super(NSObject))]
72    #[derive(Debug, PartialEq, Eq, Hash)]
73    pub struct GCDeviceHaptics;
74);
75
76extern_conformance!(
77    unsafe impl NSObjectProtocol for GCDeviceHaptics {}
78);
79
80impl GCDeviceHaptics {
81    extern_methods!(
82        /// The set of supported haptic localities for this device - representing the locations of its haptic actuators.
83        ///
84        ///
85        /// Note: GCHapticsLocalityDefault and GCHapticsLocalityAll are guaranteed to be supported - and they may be equivalent.
86        ///
87        ///
88        /// See: GCHapticsLocality
89        #[unsafe(method(supportedLocalities))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn supportedLocalities(&self) -> Retained<NSSet<GCHapticsLocality>>;
92
93        #[unsafe(method(init))]
94        #[unsafe(method_family = init)]
95        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
96    );
97}
98
99/// Methods declared on superclass `NSObject`.
100impl GCDeviceHaptics {
101    extern_methods!(
102        #[unsafe(method(new))]
103        #[unsafe(method_family = new)]
104        pub unsafe fn new() -> Retained<Self>;
105    );
106}