objc2_game_controller/generated/
GCGamepad.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9#[cfg(all(
20 feature = "GCControllerElement",
21 feature = "GCPhysicalInputProfile",
22 feature = "block2"
23))]
24pub type GCGamepadValueChangedHandler =
25 *mut block2::DynBlock<dyn Fn(NonNull<GCGamepad>, NonNull<GCControllerElement>)>;
26
27extern_class!(
28 #[unsafe(super(GCPhysicalInputProfile, NSObject))]
30 #[derive(Debug, PartialEq, Eq, Hash)]
31 #[cfg(feature = "GCPhysicalInputProfile")]
32 #[deprecated]
33 pub struct GCGamepad;
34);
35
36#[cfg(feature = "GCPhysicalInputProfile")]
37extern_conformance!(
38 unsafe impl NSObjectProtocol for GCGamepad {}
39);
40
41#[cfg(feature = "GCPhysicalInputProfile")]
42impl GCGamepad {
43 extern_methods!(
44 #[cfg(feature = "GCController")]
45 #[deprecated]
47 #[unsafe(method(controller))]
48 #[unsafe(method_family = none)]
49 pub unsafe fn controller(&self) -> Option<Retained<GCController>>;
50
51 #[cfg(all(feature = "GCControllerElement", feature = "block2"))]
52 #[deprecated]
53 #[unsafe(method(valueChangedHandler))]
54 #[unsafe(method_family = none)]
55 pub unsafe fn valueChangedHandler(&self) -> GCGamepadValueChangedHandler;
56
57 #[cfg(all(feature = "GCControllerElement", feature = "block2"))]
58 #[deprecated]
60 #[unsafe(method(setValueChangedHandler:))]
61 #[unsafe(method_family = none)]
62 pub unsafe fn setValueChangedHandler(
63 &self,
64 value_changed_handler: GCGamepadValueChangedHandler,
65 );
66
67 #[cfg(feature = "GCGamepadSnapshot")]
68 #[deprecated]
75 #[unsafe(method(saveSnapshot))]
76 #[unsafe(method_family = none)]
77 pub unsafe fn saveSnapshot(&self) -> Retained<GCGamepadSnapshot>;
78
79 #[cfg(all(feature = "GCControllerDirectionPad", feature = "GCControllerElement"))]
80 #[deprecated]
82 #[unsafe(method(dpad))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn dpad(&self) -> Retained<GCControllerDirectionPad>;
85
86 #[cfg(all(feature = "GCControllerButtonInput", feature = "GCControllerElement"))]
87 #[deprecated]
98 #[unsafe(method(buttonA))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn buttonA(&self) -> Retained<GCControllerButtonInput>;
101
102 #[cfg(all(feature = "GCControllerButtonInput", feature = "GCControllerElement"))]
103 #[deprecated]
104 #[unsafe(method(buttonB))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn buttonB(&self) -> Retained<GCControllerButtonInput>;
107
108 #[cfg(all(feature = "GCControllerButtonInput", feature = "GCControllerElement"))]
109 #[deprecated]
110 #[unsafe(method(buttonX))]
111 #[unsafe(method_family = none)]
112 pub unsafe fn buttonX(&self) -> Retained<GCControllerButtonInput>;
113
114 #[cfg(all(feature = "GCControllerButtonInput", feature = "GCControllerElement"))]
115 #[deprecated]
116 #[unsafe(method(buttonY))]
117 #[unsafe(method_family = none)]
118 pub unsafe fn buttonY(&self) -> Retained<GCControllerButtonInput>;
119
120 #[cfg(all(feature = "GCControllerButtonInput", feature = "GCControllerElement"))]
121 #[deprecated]
123 #[unsafe(method(leftShoulder))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn leftShoulder(&self) -> Retained<GCControllerButtonInput>;
126
127 #[cfg(all(feature = "GCControllerButtonInput", feature = "GCControllerElement"))]
128 #[deprecated]
130 #[unsafe(method(rightShoulder))]
131 #[unsafe(method_family = none)]
132 pub unsafe fn rightShoulder(&self) -> Retained<GCControllerButtonInput>;
133 );
134}
135
136#[cfg(feature = "GCPhysicalInputProfile")]
138impl GCGamepad {
139 extern_methods!(
140 #[unsafe(method(init))]
141 #[unsafe(method_family = init)]
142 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
143
144 #[unsafe(method(new))]
145 #[unsafe(method_family = new)]
146 pub unsafe fn new() -> Retained<Self>;
147 );
148}