objc2_screen_capture_kit/generated/
SCShareableContent.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8#[cfg(feature = "objc2-core-graphics")]
9use objc2_core_graphics::*;
10use objc2_foundation::*;
11
12use crate::*;
13
14#[repr(transparent)]
19#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
20pub struct SCShareableContentStyle(pub NSInteger);
21impl SCShareableContentStyle {
22 #[doc(alias = "SCShareableContentStyleNone")]
23 pub const None: Self = Self(0);
24 #[doc(alias = "SCShareableContentStyleWindow")]
25 pub const Window: Self = Self(1);
26 #[doc(alias = "SCShareableContentStyleDisplay")]
27 pub const Display: Self = Self(2);
28 #[doc(alias = "SCShareableContentStyleApplication")]
29 pub const Application: Self = Self(3);
30}
31
32unsafe impl Encode for SCShareableContentStyle {
33 const ENCODING: Encoding = NSInteger::ENCODING;
34}
35
36unsafe impl RefEncode for SCShareableContentStyle {
37 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
38}
39
40extern_class!(
41 #[unsafe(super(NSObject))]
43 #[derive(Debug, PartialEq, Eq, Hash)]
44 pub struct SCRunningApplication;
45);
46
47extern_conformance!(
48 unsafe impl NSObjectProtocol for SCRunningApplication {}
49);
50
51impl SCRunningApplication {
52 extern_methods!(
53 #[unsafe(method(bundleIdentifier))]
55 #[unsafe(method_family = none)]
56 pub unsafe fn bundleIdentifier(&self) -> Retained<NSString>;
57
58 #[unsafe(method(applicationName))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn applicationName(&self) -> Retained<NSString>;
62
63 #[cfg(feature = "libc")]
64 #[unsafe(method(processID))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn processID(&self) -> libc::pid_t;
68
69 #[unsafe(method(init))]
70 #[unsafe(method_family = init)]
71 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
72
73 #[unsafe(method(new))]
74 #[unsafe(method_family = new)]
75 pub unsafe fn new() -> Retained<Self>;
76 );
77}
78
79extern_class!(
80 #[unsafe(super(NSObject))]
82 #[derive(Debug, PartialEq, Eq, Hash)]
83 pub struct SCWindow;
84);
85
86extern_conformance!(
87 unsafe impl NSObjectProtocol for SCWindow {}
88);
89
90impl SCWindow {
91 extern_methods!(
92 #[cfg(feature = "objc2-core-graphics")]
93 #[unsafe(method(windowID))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn windowID(&self) -> CGWindowID;
97
98 #[cfg(feature = "objc2-core-foundation")]
99 #[unsafe(method(frame))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn frame(&self) -> CGRect;
103
104 #[unsafe(method(title))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn title(&self) -> Option<Retained<NSString>>;
108
109 #[unsafe(method(windowLayer))]
111 #[unsafe(method_family = none)]
112 pub unsafe fn windowLayer(&self) -> NSInteger;
113
114 #[unsafe(method(owningApplication))]
116 #[unsafe(method_family = none)]
117 pub unsafe fn owningApplication(&self) -> Option<Retained<SCRunningApplication>>;
118
119 #[unsafe(method(isOnScreen))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn isOnScreen(&self) -> bool;
123
124 #[unsafe(method(isActive))]
126 #[unsafe(method_family = none)]
127 pub unsafe fn isActive(&self) -> bool;
128
129 #[unsafe(method(init))]
130 #[unsafe(method_family = init)]
131 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
132
133 #[unsafe(method(new))]
134 #[unsafe(method_family = new)]
135 pub unsafe fn new() -> Retained<Self>;
136 );
137}
138
139extern_class!(
140 #[unsafe(super(NSObject))]
142 #[derive(Debug, PartialEq, Eq, Hash)]
143 pub struct SCDisplay;
144);
145
146extern_conformance!(
147 unsafe impl NSObjectProtocol for SCDisplay {}
148);
149
150impl SCDisplay {
151 extern_methods!(
152 #[cfg(feature = "objc2-core-graphics")]
153 #[unsafe(method(displayID))]
155 #[unsafe(method_family = none)]
156 pub unsafe fn displayID(&self) -> CGDirectDisplayID;
157
158 #[unsafe(method(width))]
160 #[unsafe(method_family = none)]
161 pub unsafe fn width(&self) -> NSInteger;
162
163 #[unsafe(method(height))]
165 #[unsafe(method_family = none)]
166 pub unsafe fn height(&self) -> NSInteger;
167
168 #[cfg(feature = "objc2-core-foundation")]
169 #[unsafe(method(frame))]
171 #[unsafe(method_family = none)]
172 pub unsafe fn frame(&self) -> CGRect;
173
174 #[unsafe(method(init))]
175 #[unsafe(method_family = init)]
176 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
177
178 #[unsafe(method(new))]
179 #[unsafe(method_family = new)]
180 pub unsafe fn new() -> Retained<Self>;
181 );
182}
183
184extern_class!(
185 #[unsafe(super(NSObject))]
191 #[derive(Debug, PartialEq, Eq, Hash)]
192 pub struct SCShareableContentInfo;
193);
194
195extern_conformance!(
196 unsafe impl NSObjectProtocol for SCShareableContentInfo {}
197);
198
199impl SCShareableContentInfo {
200 extern_methods!(
201 #[unsafe(method(style))]
203 #[unsafe(method_family = none)]
204 pub unsafe fn style(&self) -> SCShareableContentStyle;
205
206 #[unsafe(method(pointPixelScale))]
208 #[unsafe(method_family = none)]
209 pub unsafe fn pointPixelScale(&self) -> c_float;
210
211 #[cfg(feature = "objc2-core-foundation")]
212 #[unsafe(method(contentRect))]
214 #[unsafe(method_family = none)]
215 pub unsafe fn contentRect(&self) -> CGRect;
216 );
217}
218
219impl SCShareableContentInfo {
221 extern_methods!(
222 #[unsafe(method(init))]
223 #[unsafe(method_family = init)]
224 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
225
226 #[unsafe(method(new))]
227 #[unsafe(method_family = new)]
228 pub unsafe fn new() -> Retained<Self>;
229 );
230}
231
232extern_class!(
233 #[unsafe(super(NSObject))]
235 #[derive(Debug, PartialEq, Eq, Hash)]
236 pub struct SCShareableContent;
237);
238
239extern_conformance!(
240 unsafe impl NSObjectProtocol for SCShareableContent {}
241);
242
243impl SCShareableContent {
244 extern_methods!(
245 #[cfg(feature = "block2")]
246 #[unsafe(method(getShareableContentWithCompletionHandler:))]
252 #[unsafe(method_family = none)]
253 pub unsafe fn getShareableContentWithCompletionHandler(
254 completion_handler: &block2::DynBlock<dyn Fn(*mut SCShareableContent, *mut NSError)>,
255 );
256
257 #[cfg(feature = "block2")]
258 #[unsafe(method(getCurrentProcessShareableContentWithCompletionHandler:))]
264 #[unsafe(method_family = none)]
265 pub unsafe fn getCurrentProcessShareableContentWithCompletionHandler(
266 completion_handler: &block2::DynBlock<dyn Fn(*mut SCShareableContent, *mut NSError)>,
267 );
268
269 #[cfg(feature = "block2")]
270 #[unsafe(method(getShareableContentExcludingDesktopWindows:onScreenWindowsOnly:completionHandler:))]
280 #[unsafe(method_family = none)]
281 pub unsafe fn getShareableContentExcludingDesktopWindows_onScreenWindowsOnly_completionHandler(
282 exclude_desktop_windows: bool,
283 on_screen_windows_only: bool,
284 completion_handler: &block2::DynBlock<dyn Fn(*mut SCShareableContent, *mut NSError)>,
285 );
286
287 #[cfg(feature = "block2")]
288 #[unsafe(method(getShareableContentExcludingDesktopWindows:onScreenWindowsOnlyBelowWindow:completionHandler:))]
298 #[unsafe(method_family = none)]
299 pub unsafe fn getShareableContentExcludingDesktopWindows_onScreenWindowsOnlyBelowWindow_completionHandler(
300 exclude_desktop_windows: bool,
301 window: &SCWindow,
302 completion_handler: &block2::DynBlock<dyn Fn(*mut SCShareableContent, *mut NSError)>,
303 );
304
305 #[cfg(feature = "block2")]
306 #[unsafe(method(getShareableContentExcludingDesktopWindows:onScreenWindowsOnlyAboveWindow:completionHandler:))]
316 #[unsafe(method_family = none)]
317 pub unsafe fn getShareableContentExcludingDesktopWindows_onScreenWindowsOnlyAboveWindow_completionHandler(
318 exclude_desktop_windows: bool,
319 window: &SCWindow,
320 completion_handler: &block2::DynBlock<dyn Fn(*mut SCShareableContent, *mut NSError)>,
321 );
322
323 #[cfg(feature = "SCStream")]
324 #[unsafe(method(infoForFilter:))]
330 #[unsafe(method_family = none)]
331 pub unsafe fn infoForFilter(filter: &SCContentFilter) -> Retained<SCShareableContentInfo>;
332
333 #[unsafe(method(windows))]
335 #[unsafe(method_family = none)]
336 pub unsafe fn windows(&self) -> Retained<NSArray<SCWindow>>;
337
338 #[unsafe(method(displays))]
340 #[unsafe(method_family = none)]
341 pub unsafe fn displays(&self) -> Retained<NSArray<SCDisplay>>;
342
343 #[unsafe(method(applications))]
345 #[unsafe(method_family = none)]
346 pub unsafe fn applications(&self) -> Retained<NSArray<SCRunningApplication>>;
347
348 #[unsafe(method(init))]
349 #[unsafe(method_family = init)]
350 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
351
352 #[unsafe(method(new))]
353 #[unsafe(method_family = new)]
354 pub unsafe fn new() -> Retained<Self>;
355 );
356}