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