objc2_game_controller/generated/
GCXboxGamepad.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 GCXboxGamepad profile represents any supported Xbox controller.
10    ///
11    ///
12    /// See: GCExtendedGamepad
13    ///
14    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcxboxgamepad?language=objc)
15    #[unsafe(super(GCExtendedGamepad, GCPhysicalInputProfile, NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    #[cfg(all(feature = "GCExtendedGamepad", feature = "GCPhysicalInputProfile"))]
18    pub struct GCXboxGamepad;
19);
20
21#[cfg(all(feature = "GCExtendedGamepad", feature = "GCPhysicalInputProfile"))]
22unsafe impl NSObjectProtocol for GCXboxGamepad {}
23
24#[cfg(all(feature = "GCExtendedGamepad", feature = "GCPhysicalInputProfile"))]
25impl GCXboxGamepad {
26    extern_methods!(
27        #[cfg(all(feature = "GCControllerButtonInput", feature = "GCControllerElement"))]
28        /// Some Xbox controller variants can support up to four additional buttons.
29        ///
30        ///
31        ///
32        ///
33        /// Note: The four extra digital buttons on the Xbox Elite Wireless Controller are only directly addressable when the controller
34        /// is on its default mapping profile. Otherwise, the paddle buttons are directly bound to other inputs on the controller.
35        #[unsafe(method(paddleButton1))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn paddleButton1(&self) -> Option<Retained<GCControllerButtonInput>>;
38
39        #[cfg(all(feature = "GCControllerButtonInput", feature = "GCControllerElement"))]
40        #[unsafe(method(paddleButton2))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn paddleButton2(&self) -> Option<Retained<GCControllerButtonInput>>;
43
44        #[cfg(all(feature = "GCControllerButtonInput", feature = "GCControllerElement"))]
45        #[unsafe(method(paddleButton3))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn paddleButton3(&self) -> Option<Retained<GCControllerButtonInput>>;
48
49        #[cfg(all(feature = "GCControllerButtonInput", feature = "GCControllerElement"))]
50        #[unsafe(method(paddleButton4))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn paddleButton4(&self) -> Option<Retained<GCControllerButtonInput>>;
53
54        #[cfg(all(feature = "GCControllerButtonInput", feature = "GCControllerElement"))]
55        /// Some Xbox controller variants feature a Share button.
56        ///
57        ///
58        /// has a Share button.
59        ///
60        ///
61        /// Note: The Share button is reserved by the system for screenshot and video recording gestures. If you wish to disable these
62        /// gestures in your app and take control of the Share button, set buttonShare.preferredSystemGestureState to
63        /// GCSystemGestureStateDisabled.
64        #[unsafe(method(buttonShare))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn buttonShare(&self) -> Option<Retained<GCControllerButtonInput>>;
67    );
68}
69
70/// Methods declared on superclass `NSObject`.
71#[cfg(all(feature = "GCExtendedGamepad", feature = "GCPhysicalInputProfile"))]
72impl GCXboxGamepad {
73    extern_methods!(
74        #[unsafe(method(init))]
75        #[unsafe(method_family = init)]
76        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
77
78        #[unsafe(method(new))]
79        #[unsafe(method_family = new)]
80        pub unsafe fn new() -> Retained<Self>;
81    );
82}