objc2_game_controller/generated/
GCEventViewController.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-app-kit")]
7#[cfg(target_os = "macos")]
8use objc2_app_kit::*;
9use objc2_foundation::*;
10
11use crate::*;
12
13extern_class!(
14    /// A view controller subclass that allows fine grained control of the user interface system's handling
15    /// of game controller events. Set an instance of this class as your root view controller if you intend
16    /// to use GCController APIs for handling game controllers.
17    ///
18    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gceventviewcontroller?language=objc)
19    #[unsafe(super(NSViewController, NSResponder, NSObject))]
20    #[derive(Debug, PartialEq, Eq, Hash)]
21    #[cfg(feature = "objc2-app-kit")]
22    #[cfg(target_os = "macos")]
23    pub struct GCEventViewController;
24);
25
26#[cfg(feature = "objc2-app-kit")]
27#[cfg(target_os = "macos")]
28extern_conformance!(
29    unsafe impl NSCoding for GCEventViewController {}
30);
31
32#[cfg(feature = "objc2-app-kit")]
33#[cfg(target_os = "macos")]
34extern_conformance!(
35    unsafe impl NSEditor for GCEventViewController {}
36);
37
38#[cfg(feature = "objc2-app-kit")]
39#[cfg(target_os = "macos")]
40extern_conformance!(
41    unsafe impl NSObjectProtocol for GCEventViewController {}
42);
43
44#[cfg(feature = "objc2-app-kit")]
45#[cfg(target_os = "macos")]
46extern_conformance!(
47    unsafe impl NSSeguePerforming for GCEventViewController {}
48);
49
50#[cfg(feature = "objc2-app-kit")]
51#[cfg(target_os = "macos")]
52extern_conformance!(
53    unsafe impl NSUserInterfaceItemIdentification for GCEventViewController {}
54);
55
56#[cfg(feature = "objc2-app-kit")]
57#[cfg(target_os = "macos")]
58impl GCEventViewController {
59    extern_methods!(
60        /// Controllers can be used to control the general UIKit user interface and for many views that is
61        /// the default behavior. By using a controller event view controller you get fine grained control
62        /// over whether the controller events go trough the UIEvent
63        /// &
64        /// UIResponder chain, or if they are
65        /// decoupled from the UI and all incoming data is served via GCController.
66        ///
67        /// Defaults to NO - suppressing UIEvents from game controllers and presenting them via the GCController
68        /// API whilst this controller's view or any of it's subviews are the first responders. If you are not
69        /// using any UIView components or UIEvents in your application you should leave this as NO and process
70        /// your game controller events via the normal GCController API.
71        ///
72        /// If set to YES the controller input will start flowing through UIEvent and the UIResponder
73        /// chain will be used. This gives you fine grained control over the event handling of the
74        /// controlled view and its subviews. You should stop using GCController instances and the corresponding
75        /// profiles if you no longer need to read input from them.
76        ///
77        /// Note that unlike UIView.userInteractionEnabled this only controls the flow of game controller events.
78        ///
79        ///
80        /// See: GCController
81        ///
82        /// See: UIView.userInteractionEnabled
83        #[unsafe(method(controllerUserInteractionEnabled))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn controllerUserInteractionEnabled(&self) -> bool;
86
87        /// Setter for [`controllerUserInteractionEnabled`][Self::controllerUserInteractionEnabled].
88        #[unsafe(method(setControllerUserInteractionEnabled:))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn setControllerUserInteractionEnabled(
91            &self,
92            controller_user_interaction_enabled: bool,
93        );
94    );
95}
96
97/// Methods declared on superclass `NSViewController`.
98#[cfg(feature = "objc2-app-kit")]
99#[cfg(target_os = "macos")]
100impl GCEventViewController {
101    extern_methods!(
102        #[unsafe(method(initWithNibName:bundle:))]
103        #[unsafe(method_family = init)]
104        pub unsafe fn initWithNibName_bundle(
105            this: Allocated<Self>,
106            nib_name_or_nil: Option<&NSNibName>,
107            nib_bundle_or_nil: Option<&NSBundle>,
108        ) -> Retained<Self>;
109
110        #[unsafe(method(initWithCoder:))]
111        #[unsafe(method_family = init)]
112        pub unsafe fn initWithCoder(
113            this: Allocated<Self>,
114            coder: &NSCoder,
115        ) -> Option<Retained<Self>>;
116    );
117}
118
119/// Methods declared on superclass `NSResponder`.
120#[cfg(feature = "objc2-app-kit")]
121#[cfg(target_os = "macos")]
122impl GCEventViewController {
123    extern_methods!(
124        #[unsafe(method(init))]
125        #[unsafe(method_family = init)]
126        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
127    );
128}
129
130/// Methods declared on superclass `NSObject`.
131#[cfg(feature = "objc2-app-kit")]
132#[cfg(target_os = "macos")]
133impl GCEventViewController {
134    extern_methods!(
135        #[unsafe(method(new))]
136        #[unsafe(method_family = new)]
137        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
138    );
139}