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::Block<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")]
35unsafe impl NSObjectProtocol for GCControllerDirectionPad {}
36
37#[cfg(feature = "GCControllerElement")]
38impl GCControllerDirectionPad {
39 extern_methods!(
40 #[cfg(feature = "block2")]
41 #[unsafe(method(valueChangedHandler))]
42 #[unsafe(method_family = none)]
43 pub unsafe fn valueChangedHandler(&self) -> GCControllerDirectionPadValueChangedHandler;
44
45 #[cfg(feature = "block2")]
46 #[unsafe(method(setValueChangedHandler:))]
48 #[unsafe(method_family = none)]
49 pub unsafe fn setValueChangedHandler(
50 &self,
51 value_changed_handler: GCControllerDirectionPadValueChangedHandler,
52 );
53
54 #[cfg(feature = "GCControllerAxisInput")]
55 #[unsafe(method(xAxis))]
56 #[unsafe(method_family = none)]
57 pub unsafe fn xAxis(&self) -> Retained<GCControllerAxisInput>;
58
59 #[cfg(feature = "GCControllerAxisInput")]
60 #[unsafe(method(yAxis))]
61 #[unsafe(method_family = none)]
62 pub unsafe fn yAxis(&self) -> Retained<GCControllerAxisInput>;
63
64 #[cfg(feature = "GCControllerButtonInput")]
65 #[unsafe(method(up))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn up(&self) -> Retained<GCControllerButtonInput>;
68
69 #[cfg(feature = "GCControllerButtonInput")]
70 #[unsafe(method(down))]
71 #[unsafe(method_family = none)]
72 pub unsafe fn down(&self) -> Retained<GCControllerButtonInput>;
73
74 #[cfg(feature = "GCControllerButtonInput")]
75 #[unsafe(method(left))]
76 #[unsafe(method_family = none)]
77 pub unsafe fn left(&self) -> Retained<GCControllerButtonInput>;
78
79 #[cfg(feature = "GCControllerButtonInput")]
80 #[unsafe(method(right))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn right(&self) -> Retained<GCControllerButtonInput>;
83
84 #[unsafe(method(setValueForXAxis:yAxis:))]
97 #[unsafe(method_family = none)]
98 pub unsafe fn setValueForXAxis_yAxis(&self, x_axis: c_float, y_axis: c_float);
99 );
100}
101
102#[cfg(feature = "GCControllerElement")]
104impl GCControllerDirectionPad {
105 extern_methods!(
106 #[unsafe(method(init))]
107 #[unsafe(method_family = init)]
108 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
109
110 #[unsafe(method(new))]
111 #[unsafe(method_family = new)]
112 pub unsafe fn new() -> Retained<Self>;
113 );
114}