objc2_game_kit/generated/
GKAccessPoint.rs1use 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
13#[repr(transparent)]
16#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
17pub struct GKAccessPointLocation(pub NSInteger);
18impl GKAccessPointLocation {
19 #[doc(alias = "GKAccessPointLocationTopLeading")]
20 pub const TopLeading: Self = Self(0);
21 #[doc(alias = "GKAccessPointLocationTopTrailing")]
22 pub const TopTrailing: Self = Self(1);
23 #[doc(alias = "GKAccessPointLocationBottomLeading")]
24 pub const BottomLeading: Self = Self(2);
25 #[doc(alias = "GKAccessPointLocationBottomTrailing")]
26 pub const BottomTrailing: Self = Self(3);
27}
28
29unsafe impl Encode for GKAccessPointLocation {
30 const ENCODING: Encoding = NSInteger::ENCODING;
31}
32
33unsafe impl RefEncode for GKAccessPointLocation {
34 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
35}
36
37extern_class!(
38 #[unsafe(super(NSObject))]
40 #[derive(Debug, PartialEq, Eq, Hash)]
41 pub struct GKAccessPoint;
42);
43
44extern_conformance!(
45 unsafe impl NSObjectProtocol for GKAccessPoint {}
46);
47
48impl GKAccessPoint {
49 extern_methods!(
50 #[unsafe(method(shared))]
51 #[unsafe(method_family = none)]
52 pub unsafe fn shared() -> Retained<GKAccessPoint>;
53
54 #[unsafe(method(isActive))]
56 #[unsafe(method_family = none)]
57 pub unsafe fn isActive(&self) -> bool;
58
59 #[unsafe(method(setActive:))]
61 #[unsafe(method_family = none)]
62 pub unsafe fn setActive(&self, active: bool);
63
64 #[unsafe(method(isFocused))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn isFocused(&self) -> bool;
68
69 #[unsafe(method(setFocused:))]
71 #[unsafe(method_family = none)]
72 pub unsafe fn setFocused(&self, focused: bool);
73
74 #[unsafe(method(isVisible))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn isVisible(&self) -> bool;
77
78 #[unsafe(method(isPresentingGameCenter))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn isPresentingGameCenter(&self) -> bool;
82
83 #[deprecated = "No longer supported"]
85 #[unsafe(method(showHighlights))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn showHighlights(&self) -> bool;
88
89 #[deprecated = "No longer supported"]
91 #[unsafe(method(setShowHighlights:))]
92 #[unsafe(method_family = none)]
93 pub unsafe fn setShowHighlights(&self, show_highlights: bool);
94
95 #[unsafe(method(location))]
97 #[unsafe(method_family = none)]
98 pub unsafe fn location(&self) -> GKAccessPointLocation;
99
100 #[unsafe(method(setLocation:))]
102 #[unsafe(method_family = none)]
103 pub unsafe fn setLocation(&self, location: GKAccessPointLocation);
104
105 #[unsafe(method(frameInScreenCoordinates))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn frameInScreenCoordinates(&self) -> NSRect;
109
110 #[cfg(feature = "objc2-app-kit")]
111 #[cfg(target_os = "macos")]
112 #[unsafe(method(parentWindow))]
114 #[unsafe(method_family = none)]
115 pub unsafe fn parentWindow(&self, mtm: MainThreadMarker) -> Option<Retained<NSWindow>>;
116
117 #[cfg(feature = "objc2-app-kit")]
118 #[cfg(target_os = "macos")]
119 #[unsafe(method(setParentWindow:))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn setParentWindow(&self, parent_window: Option<&NSWindow>);
125
126 #[cfg(feature = "block2")]
127 #[unsafe(method(triggerAccessPointWithHandler:))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn triggerAccessPointWithHandler(&self, handler: &block2::DynBlock<dyn Fn()>);
131
132 #[cfg(all(feature = "GKGameCenterViewController", feature = "block2"))]
133 #[unsafe(method(triggerAccessPointWithState:handler:))]
134 #[unsafe(method_family = none)]
135 pub unsafe fn triggerAccessPointWithState_handler(
136 &self,
137 state: GKGameCenterViewControllerState,
138 handler: &block2::DynBlock<dyn Fn()>,
139 );
140
141 #[cfg(feature = "block2")]
142 #[unsafe(method(triggerAccessPointWithAchievementID:handler:))]
143 #[unsafe(method_family = none)]
144 pub unsafe fn triggerAccessPointWithAchievementID_handler(
145 &self,
146 achievement_id: &NSString,
147 handler: Option<&block2::DynBlock<dyn Fn()>>,
148 );
149
150 #[cfg(feature = "block2")]
151 #[unsafe(method(triggerAccessPointWithLeaderboardSetID:handler:))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn triggerAccessPointWithLeaderboardSetID_handler(
154 &self,
155 leaderboard_set_id: &NSString,
156 handler: Option<&block2::DynBlock<dyn Fn()>>,
157 );
158
159 #[cfg(all(feature = "GKLeaderboard", feature = "block2"))]
160 #[unsafe(method(triggerAccessPointWithLeaderboardID:playerScope:timeScope:handler:))]
161 #[unsafe(method_family = none)]
162 pub unsafe fn triggerAccessPointWithLeaderboardID_playerScope_timeScope_handler(
163 &self,
164 leaderboard_id: &NSString,
165 player_scope: GKLeaderboardPlayerScope,
166 time_scope: GKLeaderboardTimeScope,
167 handler: Option<&block2::DynBlock<dyn Fn()>>,
168 );
169
170 #[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer", feature = "block2"))]
171 #[unsafe(method(triggerAccessPointWithPlayer:handler:))]
172 #[unsafe(method_family = none)]
173 pub unsafe fn triggerAccessPointWithPlayer_handler(
174 &self,
175 player: &GKPlayer,
176 handler: Option<&block2::DynBlock<dyn Fn()>>,
177 );
178
179 #[cfg(feature = "block2")]
180 #[unsafe(method(triggerAccessPointForPlayTogetherWithHandler:))]
182 #[unsafe(method_family = none)]
183 pub unsafe fn triggerAccessPointForPlayTogetherWithHandler(
184 &self,
185 handler: Option<&block2::DynBlock<dyn Fn()>>,
186 );
187
188 #[cfg(feature = "block2")]
189 #[unsafe(method(triggerAccessPointForChallengesWithHandler:))]
191 #[unsafe(method_family = none)]
192 pub unsafe fn triggerAccessPointForChallengesWithHandler(
193 &self,
194 handler: Option<&block2::DynBlock<dyn Fn()>>,
195 );
196
197 #[cfg(feature = "block2")]
198 #[unsafe(method(triggerAccessPointWithChallengeDefinitionID:handler:))]
200 #[unsafe(method_family = none)]
201 pub unsafe fn triggerAccessPointWithChallengeDefinitionID_handler(
202 &self,
203 challenge_definition_id: &NSString,
204 handler: Option<&block2::DynBlock<dyn Fn()>>,
205 );
206
207 #[cfg(feature = "block2")]
208 #[unsafe(method(triggerAccessPointWithGameActivityDefinitionID:handler:))]
210 #[unsafe(method_family = none)]
211 pub unsafe fn triggerAccessPointWithGameActivityDefinitionID_handler(
212 &self,
213 game_activity_definition_id: &NSString,
214 handler: Option<&block2::DynBlock<dyn Fn()>>,
215 );
216
217 #[cfg(all(feature = "GKGameActivity", feature = "block2"))]
218 #[unsafe(method(triggerAccessPointWithGameActivity:handler:))]
220 #[unsafe(method_family = none)]
221 pub unsafe fn triggerAccessPointWithGameActivity_handler(
222 &self,
223 game_activity: &GKGameActivity,
224 handler: Option<&block2::DynBlock<dyn Fn()>>,
225 );
226
227 #[cfg(feature = "block2")]
228 #[unsafe(method(triggerAccessPointForFriendingWithHandler:))]
230 #[unsafe(method_family = none)]
231 pub unsafe fn triggerAccessPointForFriendingWithHandler(
232 &self,
233 handler: Option<&block2::DynBlock<dyn Fn()>>,
234 );
235 );
236}
237
238impl GKAccessPoint {
240 extern_methods!(
241 #[unsafe(method(init))]
242 #[unsafe(method_family = init)]
243 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
244
245 #[unsafe(method(new))]
246 #[unsafe(method_family = new)]
247 pub unsafe fn new() -> Retained<Self>;
248 );
249}