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