1 pub use base::boolean_t;
4 pub struct ScreenCaptureAccess;
6 impl ScreenCaptureAccess {
7 /// If current app not in list, will open window.
8 /// Return the same result as preflight.
10 pub fn request(&self) -> bool {
11 unsafe { CGRequestScreenCaptureAccess() == 1 }
14 /// Return true if has access
16 pub fn preflight(&self) -> bool {
17 unsafe { CGPreflightScreenCaptureAccess() == 1 }
21 #[link(name = "CoreGraphics", kind = "framework")]
23 // Screen Capture Access
24 fn CGRequestScreenCaptureAccess() -> boolean_t;
25 fn CGPreflightScreenCaptureAccess() -> boolean_t;