objc2_game_controller/generated/
GCDualShockGamepad.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 GCDualShockGamepad profile represents any supported DualShock 4 controller.
10    ///
11    ///
12    /// See: GCExtendedGamepad
13    ///
14    /// See: GCMotion
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcdualshockgamepad?language=objc)
17    #[unsafe(super(GCExtendedGamepad, GCPhysicalInputProfile, NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    #[cfg(all(feature = "GCExtendedGamepad", feature = "GCPhysicalInputProfile"))]
20    pub struct GCDualShockGamepad;
21);
22
23#[cfg(all(feature = "GCExtendedGamepad", feature = "GCPhysicalInputProfile"))]
24extern_conformance!(
25    unsafe impl NSObjectProtocol for GCDualShockGamepad {}
26);
27
28#[cfg(all(feature = "GCExtendedGamepad", feature = "GCPhysicalInputProfile"))]
29impl GCDualShockGamepad {
30    extern_methods!(
31        #[cfg(all(feature = "GCControllerButtonInput", feature = "GCControllerElement"))]
32        /// DualShock 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) -> Option<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) -> Option<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) -> Option<Retained<GCControllerDirectionPad>>;
46    );
47}
48
49/// Methods declared on superclass `NSObject`.
50#[cfg(all(feature = "GCExtendedGamepad", feature = "GCPhysicalInputProfile"))]
51impl GCDualShockGamepad {
52    extern_methods!(
53        #[unsafe(method(init))]
54        #[unsafe(method_family = init)]
55        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
56
57        #[unsafe(method(new))]
58        #[unsafe(method_family = new)]
59        pub unsafe fn new() -> Retained<Self>;
60    );
61}