objc2_game_controller/generated/
GCDualSenseGamepad.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5
6use crate::*;
7
8extern_class!(
9    /// The GCDualSenseGamepad profile represents any supported DualSense controller.
10    ///
11    ///
12    /// See: GCExtendedGamepad
13    ///
14    /// See: GCMotion
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcdualsensegamepad?language=objc)
17    #[unsafe(super(GCExtendedGamepad, GCPhysicalInputProfile, NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    #[cfg(all(feature = "GCExtendedGamepad", feature = "GCPhysicalInputProfile"))]
20    pub struct GCDualSenseGamepad;
21);
22
23#[cfg(all(feature = "GCExtendedGamepad", feature = "GCPhysicalInputProfile"))]
24extern_conformance!(
25    unsafe impl NSObjectProtocol for GCDualSenseGamepad {}
26);
27
28#[cfg(all(feature = "GCExtendedGamepad", feature = "GCPhysicalInputProfile"))]
29impl GCDualSenseGamepad {
30    extern_methods!(
31        #[cfg(all(feature = "GCControllerButtonInput", feature = "GCControllerElement"))]
32        /// DualSense controllers have a touchpad with a button and two-finger tracking.
33        #[unsafe(method(touchpadButton))]
34        #[unsafe(method_family = none)]
35        pub unsafe fn touchpadButton(&self) -> Retained<GCControllerButtonInput>;
36
37        #[cfg(all(feature = "GCControllerDirectionPad", feature = "GCControllerElement"))]
38        #[unsafe(method(touchpadPrimary))]
39        #[unsafe(method_family = none)]
40        pub unsafe fn touchpadPrimary(&self) -> Retained<GCControllerDirectionPad>;
41
42        #[cfg(all(feature = "GCControllerDirectionPad", feature = "GCControllerElement"))]
43        #[unsafe(method(touchpadSecondary))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn touchpadSecondary(&self) -> Retained<GCControllerDirectionPad>;
46
47        #[cfg(all(
48            feature = "GCControllerButtonInput",
49            feature = "GCControllerElement",
50            feature = "GCDualSenseAdaptiveTrigger"
51        ))]
52        /// Triggers are required to be analog inputs. Common uses would be acceleration and decelleration in a driving game for example.
53        ///
54        /// The DualSense has adaptive triggers, allowing you to specify a dynamic resistance force that is applied when pulling the trigger. This can,
55        /// for example, be used to emulate the feeling of pulling back a bow string, firing a weapon, or pulling a lever.
56        #[unsafe(method(leftTrigger))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn leftTrigger(&self) -> Retained<GCDualSenseAdaptiveTrigger>;
59
60        #[cfg(all(
61            feature = "GCControllerButtonInput",
62            feature = "GCControllerElement",
63            feature = "GCDualSenseAdaptiveTrigger"
64        ))]
65        #[unsafe(method(rightTrigger))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn rightTrigger(&self) -> Retained<GCDualSenseAdaptiveTrigger>;
68    );
69}
70
71/// Methods declared on superclass `NSObject`.
72#[cfg(all(feature = "GCExtendedGamepad", feature = "GCPhysicalInputProfile"))]
73impl GCDualSenseGamepad {
74    extern_methods!(
75        #[unsafe(method(init))]
76        #[unsafe(method_family = init)]
77        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
78
79        #[unsafe(method(new))]
80        #[unsafe(method_family = new)]
81        pub unsafe fn new() -> Retained<Self>;
82    );
83}