objc2_game_controller/generated/GCDirectionalGamepad.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::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern "C" {
10 /// The primary directional input surface for the directional gamepad
11 ///
12 ///
13 /// Note: Equivalent to microgamepad.dpad
14 ///
15 ///
16 /// Note: For the 2021 2nd generation Siri Remote, this represents touching anywhere on the entire touch surface - including the inner and outer rings.
17 ///
18 /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputdirectionaldpad?language=objc)
19 pub static GCInputDirectionalDpad: &'static NSString;
20}
21
22extern "C" {
23 /// The button corresponding to pressing anywhere on the primary directional input surface for the directional gamepad
24 ///
25 ///
26 /// Note: Equivalent to microgamepad.buttonA
27 ///
28 ///
29 /// Note: For the 2021 2nd generation Siri Remote, this represents pressing anywhere the entire touch surface - including the inner and outer rings.
30 ///
31 /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputdirectionaltouchsurfacebutton?language=objc)
32 pub static GCInputDirectionalTouchSurfaceButton: &'static NSString;
33}
34
35extern "C" {
36 /// An optional secondary directional input surface for the directional gamepad. This input is guaranteed to be an 8-way digital dpad with physical Up, Down, Left, Right butttons.
37 ///
38 ///
39 /// Note: For the 2021 2nd generation Siri Remote, this represents pressing on the outer ring of the touch surface.
40 ///
41 /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputdirectionalcardinaldpad?language=objc)
42 pub static GCInputDirectionalCardinalDpad: &'static NSString;
43}
44
45extern "C" {
46 /// An optional button for the directional gamepad. This input represents the center button of the cardinal dpad.
47 ///
48 ///
49 /// Note: For the 2021 2nd generation Siri Remote, this represents pressing anywhere on the inner ring of the touch surface.
50 ///
51 /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcinputdirectionalcenterbutton?language=objc)
52 pub static GCInputDirectionalCenterButton: &'static NSString;
53}
54
55extern_class!(
56 /// Directional Gamepad profile.
57 ///
58 /// All controller profiles provide a base level of information about the controller they belong to. A directional gamepad
59 /// features a subset of the possible inputs on a micro gamepad. It guarantees:
60 /// - The gamepad does not support motion, meaning
61 /// - -[GCController motion] is always nil
62 /// - -[GCDirectionalGamepad allowsRotation] is always NO
63 ///
64 /// Additionally, the gamepad may have a digital or analog dpad.
65 /// - -[GCDirectionalGamepad dpad].analog may be YES or NO
66 /// - If -[GCDirectionalGamepad dpad].analog is NO, then -[GCDirectionalGamepad reportsAbsoluteDpadValues] is always YES
67 ///
68 /// A profile maps the hardware notion of a controller into a logical controller. One that a developer can design for
69 /// and depend on, no matter the underlying hardware. If your game supports GCMicroGamepad, but does not need
70 /// the motion and analog dpad functionality of GCMicroGamepad, be sure to add Directional Gamepad to your project's
71 /// supported Game Controller capabilities.
72 ///
73 ///
74 /// See: GCMicroGamepad
75 ///
76 ///
77 /// Note: If you want to use the additional functionality of GCDirectionalGamepad, you should set GCSupportsMultipleMicroGamepads to YES and handle microgamepad connections separately.
78 ///
79 ///
80 /// Note: This profile represents the 2021 2nd generation Siri Remote. Make sure you set GCSupportsMultipleMicroGamepads to YES to properly support the remote.
81 ///
82 /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gcdirectionalgamepad?language=objc)
83 #[unsafe(super(GCMicroGamepad, GCPhysicalInputProfile, NSObject))]
84 #[derive(Debug, PartialEq, Eq, Hash)]
85 #[cfg(all(feature = "GCMicroGamepad", feature = "GCPhysicalInputProfile"))]
86 pub struct GCDirectionalGamepad;
87);
88
89#[cfg(all(feature = "GCMicroGamepad", feature = "GCPhysicalInputProfile"))]
90extern_conformance!(
91 unsafe impl NSObjectProtocol for GCDirectionalGamepad {}
92);
93
94#[cfg(all(feature = "GCMicroGamepad", feature = "GCPhysicalInputProfile"))]
95impl GCDirectionalGamepad {
96 extern_methods!();
97}
98
99/// Methods declared on superclass `NSObject`.
100#[cfg(all(feature = "GCMicroGamepad", feature = "GCPhysicalInputProfile"))]
101impl GCDirectionalGamepad {
102 extern_methods!(
103 #[unsafe(method(init))]
104 #[unsafe(method_family = init)]
105 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
106
107 #[unsafe(method(new))]
108 #[unsafe(method_family = new)]
109 pub unsafe fn new() -> Retained<Self>;
110 );
111}