objc2_game_controller/generated/
GCControllerInput.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    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gccontrollerinputstate?language=objc)
10    #[unsafe(super(NSObject))]
11    #[derive(Debug, PartialEq, Eq, Hash)]
12    pub struct GCControllerInputState;
13);
14
15#[cfg(feature = "GCDevicePhysicalInputState")]
16extern_conformance!(
17    unsafe impl GCDevicePhysicalInputState for GCControllerInputState {}
18);
19
20extern_conformance!(
21    unsafe impl NSObjectProtocol for GCControllerInputState {}
22);
23
24impl GCControllerInputState {
25    extern_methods!();
26}
27
28/// Methods declared on superclass `NSObject`.
29impl GCControllerInputState {
30    extern_methods!(
31        #[unsafe(method(init))]
32        #[unsafe(method_family = init)]
33        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
34
35        #[unsafe(method(new))]
36        #[unsafe(method_family = new)]
37        pub unsafe fn new() -> Retained<Self>;
38    );
39}
40
41extern_class!(
42    /// [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gccontrollerliveinput?language=objc)
43    #[unsafe(super(GCControllerInputState, NSObject))]
44    #[derive(Debug, PartialEq, Eq, Hash)]
45    pub struct GCControllerLiveInput;
46);
47
48#[cfg(all(
49    feature = "GCDevicePhysicalInput",
50    feature = "GCDevicePhysicalInputState"
51))]
52extern_conformance!(
53    unsafe impl GCDevicePhysicalInput for GCControllerLiveInput {}
54);
55
56#[cfg(feature = "GCDevicePhysicalInputState")]
57extern_conformance!(
58    unsafe impl GCDevicePhysicalInputState for GCControllerLiveInput {}
59);
60
61extern_conformance!(
62    unsafe impl NSObjectProtocol for GCControllerLiveInput {}
63);
64
65impl GCControllerLiveInput {
66    extern_methods!(
67        /// Get a view of the controller's input without any system-level control
68        /// remapping applied.
69        ///
70        /// Developers should avoid implementing their own control remapping
71        /// functionality and to instead direct users to the system game controller
72        /// settings to remap controls.  If you choose to implement your own
73        /// control remapping functionality, or if your app streams controller input
74        /// to a remote device that implements control remapping functionality, you
75        /// should access controller physical input through this interface.
76        #[unsafe(method(unmappedInput))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn unmappedInput(&self) -> Option<Retained<GCControllerLiveInput>>;
79
80        #[unsafe(method(capture))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn capture(&self) -> Retained<GCControllerInputState>;
83
84        #[cfg(feature = "GCDevicePhysicalInputStateDiff")]
85        #[unsafe(method(nextInputState))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn nextInputState(&self) -> Option<Retained<GCControllerInputState>>;
88    );
89}
90
91/// Methods declared on superclass `NSObject`.
92impl GCControllerLiveInput {
93    extern_methods!(
94        #[unsafe(method(init))]
95        #[unsafe(method_family = init)]
96        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
97
98        #[unsafe(method(new))]
99        #[unsafe(method_family = new)]
100        pub unsafe fn new() -> Retained<Self>;
101    );
102}