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