screencapturekit/stream/configuration/
advanced.rs1use super::internal::SCStreamConfiguration;
2
3#[repr(i32)]
4#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
5pub enum SCPresenterOverlayAlertSetting {
6 #[default]
7 Never = 0,
8 Once = 1,
9 Always = 2,
10}
11
12impl SCStreamConfiguration {
13 #[cfg(feature = "macos_14_2")]
20 pub fn set_ignore_fraction_of_screen(&mut self, ignore_fraction: f64) {
21 unsafe {
22 crate::ffi::sc_stream_configuration_set_ignore_fraction_of_screen(
23 self.as_ptr(),
24 ignore_fraction,
25 );
26 }
27 }
28
29 #[cfg(feature = "macos_14_2")]
30 pub fn get_ignore_fraction_of_screen(&self) -> f64 {
31 unsafe { crate::ffi::sc_stream_configuration_get_ignore_fraction_of_screen(self.as_ptr()) }
32 }
33
34 #[cfg(feature = "macos_14_2")]
42 pub fn set_ignores_shadows_single_window(&mut self, ignores_shadows: bool) {
43 unsafe {
44 crate::ffi::sc_stream_configuration_set_ignores_shadows_single_window(
45 self.as_ptr(),
46 ignores_shadows,
47 );
48 }
49 }
50
51 #[cfg(feature = "macos_14_2")]
52 pub fn get_ignores_shadows_single_window(&self) -> bool {
53 unsafe {
54 crate::ffi::sc_stream_configuration_get_ignores_shadows_single_window(self.as_ptr())
55 }
56 }
57
58 #[cfg(feature = "macos_13_0")]
66 pub fn set_should_be_opaque(&mut self, should_be_opaque: bool) {
67 unsafe {
68 crate::ffi::sc_stream_configuration_set_should_be_opaque(
69 self.as_ptr(),
70 should_be_opaque,
71 );
72 }
73 }
74
75 #[cfg(feature = "macos_13_0")]
76 pub fn get_should_be_opaque(&self) -> bool {
77 unsafe { crate::ffi::sc_stream_configuration_get_should_be_opaque(self.as_ptr()) }
78 }
79
80 #[cfg(feature = "macos_14_2")]
87 pub fn set_includes_child_windows(&mut self, includes_child_windows: bool) {
88 unsafe {
89 crate::ffi::sc_stream_configuration_set_includes_child_windows(
90 self.as_ptr(),
91 includes_child_windows,
92 );
93 }
94 }
95
96 #[cfg(feature = "macos_14_2")]
97 pub fn get_includes_child_windows(&self) -> bool {
98 unsafe { crate::ffi::sc_stream_configuration_get_includes_child_windows(self.as_ptr()) }
99 }
100
101 #[cfg(feature = "macos_14_2")]
108 pub fn set_presenter_overlay_privacy_alert_setting(
109 self,
110 setting: SCPresenterOverlayAlertSetting,
111 ) {
112 unsafe {
113 crate::ffi::sc_stream_configuration_set_presenter_overlay_privacy_alert_setting(
114 self.as_ptr(),
115 setting as i32,
116 );
117 }
118 }
119
120 #[cfg(feature = "macos_14_2")]
121 pub fn get_presenter_overlay_privacy_alert_setting(&self) -> SCPresenterOverlayAlertSetting {
122 let value = unsafe {
123 crate::ffi::sc_stream_configuration_get_presenter_overlay_privacy_alert_setting(
124 self.as_ptr(),
125 )
126 };
127 match value {
128 0 => SCPresenterOverlayAlertSetting::Never,
129 2 => SCPresenterOverlayAlertSetting::Always,
130 _ => SCPresenterOverlayAlertSetting::Once,
131 }
132 }
133
134 #[cfg(feature = "macos_14_0")]
140 pub fn set_ignore_global_clipboard(&mut self, ignore_global_clipboard: bool) {
141 unsafe {
142 crate::ffi::sc_stream_configuration_set_ignore_global_clipboard(
143 self.as_ptr(),
144 ignore_global_clipboard,
145 );
146 }
147 }
148
149 #[cfg(feature = "macos_14_0")]
150 pub fn get_ignore_global_clipboard(&self) -> bool {
151 unsafe { crate::ffi::sc_stream_configuration_get_ignore_global_clipboard(self.as_ptr()) }
152 }
153
154 #[cfg(feature = "macos_14_0")]
160 pub fn set_ignores_shadow_display_configuration(&mut self, ignores_shadow: bool) {
161 unsafe {
162 crate::ffi::sc_stream_configuration_set_ignores_shadow_display_configuration(
163 self.as_ptr(),
164 ignores_shadow,
165 );
166 }
167 }
168
169 #[cfg(feature = "macos_14_0")]
170 pub fn get_ignores_shadow_display_configuration(&self) -> bool {
171 unsafe {
172 crate::ffi::sc_stream_configuration_get_ignores_shadow_display_configuration(
173 self.as_ptr(),
174 )
175 }
176 }
177}