objc2_game_controller/generated/
GCControllerDirectionPad.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9#[cfg(all(feature = "GCControllerElement", feature = "block2"))]
20pub type GCControllerDirectionPadValueChangedHandler =
21 *mut block2::DynBlock<dyn Fn(NonNull<GCControllerDirectionPad>, c_float, c_float)>;
22
23extern_class!(
24 #[unsafe(super(GCControllerElement, NSObject))]
29 #[derive(Debug, PartialEq, Eq, Hash)]
30 #[cfg(feature = "GCControllerElement")]
31 pub struct GCControllerDirectionPad;
32);
33
34#[cfg(feature = "GCControllerElement")]
35extern_conformance!(
36 unsafe impl NSObjectProtocol for GCControllerDirectionPad {}
37);
38
39#[cfg(feature = "GCControllerElement")]
40impl GCControllerDirectionPad {
41 extern_methods!(
42 #[cfg(feature = "block2")]
43 #[unsafe(method(valueChangedHandler))]
47 #[unsafe(method_family = none)]
48 pub unsafe fn valueChangedHandler(&self) -> GCControllerDirectionPadValueChangedHandler;
49
50 #[cfg(feature = "block2")]
51 #[unsafe(method(setValueChangedHandler:))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn setValueChangedHandler(
61 &self,
62 value_changed_handler: GCControllerDirectionPadValueChangedHandler,
63 );
64
65 #[cfg(feature = "GCControllerAxisInput")]
66 #[unsafe(method(xAxis))]
67 #[unsafe(method_family = none)]
68 pub unsafe fn xAxis(&self) -> Retained<GCControllerAxisInput>;
69
70 #[cfg(feature = "GCControllerAxisInput")]
71 #[unsafe(method(yAxis))]
72 #[unsafe(method_family = none)]
73 pub unsafe fn yAxis(&self) -> Retained<GCControllerAxisInput>;
74
75 #[cfg(feature = "GCControllerButtonInput")]
76 #[unsafe(method(up))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn up(&self) -> Retained<GCControllerButtonInput>;
79
80 #[cfg(feature = "GCControllerButtonInput")]
81 #[unsafe(method(down))]
82 #[unsafe(method_family = none)]
83 pub unsafe fn down(&self) -> Retained<GCControllerButtonInput>;
84
85 #[cfg(feature = "GCControllerButtonInput")]
86 #[unsafe(method(left))]
87 #[unsafe(method_family = none)]
88 pub unsafe fn left(&self) -> Retained<GCControllerButtonInput>;
89
90 #[cfg(feature = "GCControllerButtonInput")]
91 #[unsafe(method(right))]
92 #[unsafe(method_family = none)]
93 pub unsafe fn right(&self) -> Retained<GCControllerButtonInput>;
94
95 #[unsafe(method(setValueForXAxis:yAxis:))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn setValueForXAxis_yAxis(&self, x_axis: c_float, y_axis: c_float);
110 );
111}
112
113#[cfg(feature = "GCControllerElement")]
115impl GCControllerDirectionPad {
116 extern_methods!(
117 #[unsafe(method(init))]
118 #[unsafe(method_family = init)]
119 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
120
121 #[unsafe(method(new))]
122 #[unsafe(method_family = new)]
123 pub unsafe fn new() -> Retained<Self>;
124 );
125}