objc2_game_controller/generated/
GCDirectionPadElement.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_protocol!(
9    /// An object conforming to
10    /// `GCDirectionPadElement`represents a four-way
11    /// directional control element.
12    ///
13    /// A direction pad element contains a common grouping of 2 axis inputs, which can
14    /// also be interpreted as 2 sets of mutually exclusive button pairs. Only one
15    /// button in each pair, {up, down} and {left, right}, can be pressed at any
16    /// given time.
17    ///
18    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcdirectionpadelement?language=objc)
19    #[cfg(feature = "GCPhysicalInputElement")]
20    pub unsafe trait GCDirectionPadElement: GCPhysicalInputElement {
21        #[cfg(feature = "GCAxis2DInput")]
22        /// The x,y position of the dpad input.
23        #[unsafe(method(xyAxes))]
24        #[unsafe(method_family = none)]
25        unsafe fn xyAxes(&self) -> Retained<ProtocolObject<dyn GCAxis2DInput>>;
26
27        #[cfg(feature = "GCAxisInput")]
28        /// The horizontal/x-component of the dpad input.
29        #[unsafe(method(xAxis))]
30        #[unsafe(method_family = none)]
31        unsafe fn xAxis(&self) -> Retained<ProtocolObject<dyn GCAxisInput>>;
32
33        #[cfg(feature = "GCAxisInput")]
34        /// The vertical/y-component of the dpad input.
35        #[unsafe(method(yAxis))]
36        #[unsafe(method_family = none)]
37        unsafe fn yAxis(&self) -> Retained<ProtocolObject<dyn GCAxisInput>>;
38
39        #[cfg(all(feature = "GCLinearInput", feature = "GCPressedStateInput"))]
40        /// The positive y-component of the dpad input.
41        #[unsafe(method(up))]
42        #[unsafe(method_family = none)]
43        unsafe fn up(&self) -> Retained<AnyObject /* GCLinearInput+ GCPressedStateInput */>;
44
45        #[cfg(all(feature = "GCLinearInput", feature = "GCPressedStateInput"))]
46        /// The negative y-component of the dpad input.
47        #[unsafe(method(down))]
48        #[unsafe(method_family = none)]
49        unsafe fn down(&self) -> Retained<AnyObject /* GCLinearInput+ GCPressedStateInput */>;
50
51        #[cfg(all(feature = "GCLinearInput", feature = "GCPressedStateInput"))]
52        /// The negative x-component of the dpad input.
53        #[unsafe(method(left))]
54        #[unsafe(method_family = none)]
55        unsafe fn left(&self) -> Retained<AnyObject /* GCLinearInput+ GCPressedStateInput */>;
56
57        #[cfg(all(feature = "GCLinearInput", feature = "GCPressedStateInput"))]
58        /// The positive x-component of the dpad input.
59        #[unsafe(method(right))]
60        #[unsafe(method_family = none)]
61        unsafe fn right(&self) -> Retained<AnyObject /* GCLinearInput+ GCPressedStateInput */>;
62    }
63);