objc2_screen_capture_kit/generated/
SCScreenshotManager.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::*;
10#[cfg(feature = "objc2-core-media")]
11use objc2_core_media::*;
12use objc2_foundation::*;
13#[cfg(feature = "objc2-uniform-type-identifiers")]
14use objc2_uniform_type_identifiers::*;
15
16use crate::*;
17
18#[repr(transparent)]
21#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
22pub struct SCScreenshotDisplayIntent(pub NSInteger);
23impl SCScreenshotDisplayIntent {
24 #[doc(alias = "SCScreenshotDisplayIntentCanonical")]
25 pub const Canonical: Self = Self(0);
26 #[doc(alias = "SCScreenshotDisplayIntentLocal")]
27 pub const Local: Self = Self(1);
28}
29
30unsafe impl Encode for SCScreenshotDisplayIntent {
31 const ENCODING: Encoding = NSInteger::ENCODING;
32}
33
34unsafe impl RefEncode for SCScreenshotDisplayIntent {
35 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
36}
37
38#[repr(transparent)]
41#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
42pub struct SCScreenshotDynamicRange(pub NSInteger);
43impl SCScreenshotDynamicRange {
44 #[doc(alias = "SCScreenshotDynamicRangeSDR")]
45 pub const SDR: Self = Self(0);
46 #[doc(alias = "SCScreenshotDynamicRangeHDR")]
47 pub const HDR: Self = Self(1);
48 #[doc(alias = "SCScreenshotDynamicRangeSDRAndHDR")]
49 pub const SDRAndHDR: Self = Self(2);
50}
51
52unsafe impl Encode for SCScreenshotDynamicRange {
53 const ENCODING: Encoding = NSInteger::ENCODING;
54}
55
56unsafe impl RefEncode for SCScreenshotDynamicRange {
57 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
58}
59
60extern_class!(
61 #[unsafe(super(NSObject))]
63 #[derive(Debug, PartialEq, Eq, Hash)]
64 pub struct SCScreenshotConfiguration;
65);
66
67extern_conformance!(
68 unsafe impl NSObjectProtocol for SCScreenshotConfiguration {}
69);
70
71impl SCScreenshotConfiguration {
72 extern_methods!(
73 #[unsafe(method(width))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn width(&self) -> NSInteger;
77
78 #[unsafe(method(setWidth:))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn setWidth(&self, width: NSInteger);
82
83 #[unsafe(method(height))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn height(&self) -> NSInteger;
87
88 #[unsafe(method(setHeight:))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn setHeight(&self, height: NSInteger);
92
93 #[unsafe(method(showsCursor))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn showsCursor(&self) -> bool;
97
98 #[unsafe(method(setShowsCursor:))]
100 #[unsafe(method_family = none)]
101 pub unsafe fn setShowsCursor(&self, shows_cursor: bool);
102
103 #[cfg(feature = "objc2-core-foundation")]
104 #[unsafe(method(sourceRect))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn sourceRect(&self) -> CGRect;
108
109 #[cfg(feature = "objc2-core-foundation")]
110 #[unsafe(method(setSourceRect:))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn setSourceRect(&self, source_rect: CGRect);
114
115 #[cfg(feature = "objc2-core-foundation")]
116 #[unsafe(method(destinationRect))]
118 #[unsafe(method_family = none)]
119 pub unsafe fn destinationRect(&self) -> CGRect;
120
121 #[cfg(feature = "objc2-core-foundation")]
122 #[unsafe(method(setDestinationRect:))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn setDestinationRect(&self, destination_rect: CGRect);
126
127 #[unsafe(method(ignoreShadows))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn ignoreShadows(&self) -> bool;
131
132 #[unsafe(method(setIgnoreShadows:))]
134 #[unsafe(method_family = none)]
135 pub unsafe fn setIgnoreShadows(&self, ignore_shadows: bool);
136
137 #[unsafe(method(ignoreClipping))]
139 #[unsafe(method_family = none)]
140 pub unsafe fn ignoreClipping(&self) -> bool;
141
142 #[unsafe(method(setIgnoreClipping:))]
144 #[unsafe(method_family = none)]
145 pub unsafe fn setIgnoreClipping(&self, ignore_clipping: bool);
146
147 #[unsafe(method(includeChildWindows))]
149 #[unsafe(method_family = none)]
150 pub unsafe fn includeChildWindows(&self) -> bool;
151
152 #[unsafe(method(setIncludeChildWindows:))]
154 #[unsafe(method_family = none)]
155 pub unsafe fn setIncludeChildWindows(&self, include_child_windows: bool);
156
157 #[unsafe(method(displayIntent))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn displayIntent(&self) -> SCScreenshotDisplayIntent;
161
162 #[unsafe(method(setDisplayIntent:))]
164 #[unsafe(method_family = none)]
165 pub unsafe fn setDisplayIntent(&self, display_intent: SCScreenshotDisplayIntent);
166
167 #[unsafe(method(dynamicRange))]
169 #[unsafe(method_family = none)]
170 pub unsafe fn dynamicRange(&self) -> SCScreenshotDynamicRange;
171
172 #[unsafe(method(setDynamicRange:))]
174 #[unsafe(method_family = none)]
175 pub unsafe fn setDynamicRange(&self, dynamic_range: SCScreenshotDynamicRange);
176
177 #[cfg(feature = "objc2-uniform-type-identifiers")]
178 #[unsafe(method(contentType))]
184 #[unsafe(method_family = none)]
185 pub unsafe fn contentType(&self) -> Retained<UTType>;
186
187 #[cfg(feature = "objc2-uniform-type-identifiers")]
188 #[unsafe(method(setContentType:))]
194 #[unsafe(method_family = none)]
195 pub unsafe fn setContentType(&self, content_type: &UTType);
196
197 #[unsafe(method(fileURL))]
199 #[unsafe(method_family = none)]
200 pub unsafe fn fileURL(&self) -> Option<Retained<NSURL>>;
201
202 #[unsafe(method(setFileURL:))]
204 #[unsafe(method_family = none)]
205 pub unsafe fn setFileURL(&self, file_url: Option<&NSURL>);
206
207 #[cfg(feature = "objc2-uniform-type-identifiers")]
208 #[unsafe(method(supportedContentTypes))]
210 #[unsafe(method_family = none)]
211 pub unsafe fn supportedContentTypes() -> Retained<NSArray<UTType>>;
212 );
213}
214
215impl SCScreenshotConfiguration {
217 extern_methods!(
218 #[unsafe(method(init))]
219 #[unsafe(method_family = init)]
220 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
221
222 #[unsafe(method(new))]
223 #[unsafe(method_family = new)]
224 pub unsafe fn new() -> Retained<Self>;
225 );
226}
227
228extern_class!(
229 #[unsafe(super(NSObject))]
231 #[derive(Debug, PartialEq, Eq, Hash)]
232 pub struct SCScreenshotOutput;
233);
234
235extern_conformance!(
236 unsafe impl NSObjectProtocol for SCScreenshotOutput {}
237);
238
239impl SCScreenshotOutput {
240 extern_methods!(
241 #[cfg(feature = "objc2-core-graphics")]
242 #[unsafe(method(sdrImage))]
244 #[unsafe(method_family = none)]
245 pub unsafe fn sdrImage(&self) -> Option<Retained<CGImage>>;
246
247 #[cfg(feature = "objc2-core-graphics")]
248 #[unsafe(method(setSdrImage:))]
250 #[unsafe(method_family = none)]
251 pub unsafe fn setSdrImage(&self, sdr_image: Option<&CGImage>);
252
253 #[cfg(feature = "objc2-core-graphics")]
254 #[unsafe(method(hdrImage))]
256 #[unsafe(method_family = none)]
257 pub unsafe fn hdrImage(&self) -> Option<Retained<CGImage>>;
258
259 #[cfg(feature = "objc2-core-graphics")]
260 #[unsafe(method(setHdrImage:))]
262 #[unsafe(method_family = none)]
263 pub unsafe fn setHdrImage(&self, hdr_image: Option<&CGImage>);
264
265 #[unsafe(method(fileURL))]
271 #[unsafe(method_family = none)]
272 pub unsafe fn fileURL(&self) -> Option<Retained<NSURL>>;
273
274 #[unsafe(method(setFileURL:))]
280 #[unsafe(method_family = none)]
281 pub unsafe fn setFileURL(&self, file_url: Option<&NSURL>);
282 );
283}
284
285impl SCScreenshotOutput {
287 extern_methods!(
288 #[unsafe(method(init))]
289 #[unsafe(method_family = init)]
290 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
291
292 #[unsafe(method(new))]
293 #[unsafe(method_family = new)]
294 pub unsafe fn new() -> Retained<Self>;
295 );
296}
297
298extern_class!(
299 #[unsafe(super(NSObject))]
301 #[derive(Debug, PartialEq, Eq, Hash)]
302 pub struct SCScreenshotManager;
303);
304
305extern_conformance!(
306 unsafe impl NSObjectProtocol for SCScreenshotManager {}
307);
308
309impl SCScreenshotManager {
310 extern_methods!(
311 #[unsafe(method(init))]
312 #[unsafe(method_family = init)]
313 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
314
315 #[cfg(all(feature = "SCStream", feature = "block2", feature = "objc2-core-media"))]
316 #[unsafe(method(captureSampleBufferWithFilter:configuration:completionHandler:))]
326 #[unsafe(method_family = none)]
327 pub unsafe fn captureSampleBufferWithFilter_configuration_completionHandler(
328 content_filter: &SCContentFilter,
329 config: &SCStreamConfiguration,
330 completion_handler: Option<
331 &block2::DynBlock<dyn Fn(*mut CMSampleBuffer, *mut NSError)>,
332 >,
333 );
334
335 #[cfg(all(
336 feature = "SCStream",
337 feature = "block2",
338 feature = "objc2-core-graphics"
339 ))]
340 #[unsafe(method(captureImageWithFilter:configuration:completionHandler:))]
350 #[unsafe(method_family = none)]
351 pub unsafe fn captureImageWithFilter_configuration_completionHandler(
352 content_filter: &SCContentFilter,
353 config: &SCStreamConfiguration,
354 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut CGImage, *mut NSError)>>,
355 );
356
357 #[cfg(all(
358 feature = "block2",
359 feature = "objc2-core-foundation",
360 feature = "objc2-core-graphics"
361 ))]
362 #[unsafe(method(captureImageInRect:completionHandler:))]
370 #[unsafe(method_family = none)]
371 pub unsafe fn captureImageInRect_completionHandler(
372 rect: CGRect,
373 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut CGImage, *mut NSError)>>,
374 );
375
376 #[cfg(all(feature = "SCStream", feature = "block2"))]
377 #[unsafe(method(captureScreenshotWithFilter:configuration:completionHandler:))]
387 #[unsafe(method_family = none)]
388 pub unsafe fn captureScreenshotWithFilter_configuration_completionHandler(
389 content_filter: &SCContentFilter,
390 config: &SCScreenshotConfiguration,
391 completion_handler: Option<
392 &block2::DynBlock<dyn Fn(*mut SCScreenshotOutput, *mut NSError)>,
393 >,
394 );
395
396 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
397 #[unsafe(method(captureScreenshotWithRect:configuration:completionHandler:))]
407 #[unsafe(method_family = none)]
408 pub unsafe fn captureScreenshotWithRect_configuration_completionHandler(
409 rect: CGRect,
410 config: &SCScreenshotConfiguration,
411 completion_handler: Option<
412 &block2::DynBlock<dyn Fn(*mut SCScreenshotOutput, *mut NSError)>,
413 >,
414 );
415 );
416}
417
418impl SCScreenshotManager {
420 extern_methods!(
421 #[unsafe(method(new))]
422 #[unsafe(method_family = new)]
423 pub unsafe fn new() -> Retained<Self>;
424 );
425}