screencapturekit/stream/configuration/
advanced.rs1use super::internal::SCStreamConfiguration;
2
3#[repr(i32)]
7#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
8pub enum SCPresenterOverlayAlertSetting {
9 #[default]
11 System = 0,
12 Never = 1,
14 Always = 2,
16}
17
18impl SCStreamConfiguration {
19 #[cfg(feature = "macos_14_0")]
27 pub fn set_ignores_shadows_single_window(&mut self, ignores_shadows: bool) -> &mut Self {
28 unsafe {
29 crate::ffi::sc_stream_configuration_set_ignores_shadows_single_window(
30 self.as_ptr(),
31 ignores_shadows,
32 );
33 }
34 self
35 }
36
37 #[cfg(feature = "macos_14_0")]
39 #[must_use]
40 pub fn with_ignores_shadows_single_window(mut self, ignores_shadows: bool) -> Self {
41 self.set_ignores_shadows_single_window(ignores_shadows);
42 self
43 }
44
45 #[cfg(feature = "macos_14_0")]
46 pub fn ignores_shadows_single_window(&self) -> bool {
47 unsafe {
48 crate::ffi::sc_stream_configuration_get_ignores_shadows_single_window(self.as_ptr())
49 }
50 }
51
52 #[cfg(feature = "macos_13_0")]
60 pub fn set_should_be_opaque(&mut self, should_be_opaque: bool) -> &mut Self {
61 unsafe {
62 crate::ffi::sc_stream_configuration_set_should_be_opaque(
63 self.as_ptr(),
64 should_be_opaque,
65 );
66 }
67 self
68 }
69
70 #[cfg(feature = "macos_13_0")]
72 #[must_use]
73 pub fn with_should_be_opaque(mut self, should_be_opaque: bool) -> Self {
74 self.set_should_be_opaque(should_be_opaque);
75 self
76 }
77
78 #[cfg(feature = "macos_13_0")]
79 pub fn should_be_opaque(&self) -> bool {
80 unsafe { crate::ffi::sc_stream_configuration_get_should_be_opaque(self.as_ptr()) }
81 }
82
83 #[cfg(feature = "macos_14_2")]
90 pub fn set_includes_child_windows(&mut self, includes_child_windows: bool) -> &mut Self {
91 unsafe {
92 crate::ffi::sc_stream_configuration_set_includes_child_windows(
93 self.as_ptr(),
94 includes_child_windows,
95 );
96 }
97 self
98 }
99
100 #[cfg(feature = "macos_14_2")]
102 #[must_use]
103 pub fn with_includes_child_windows(mut self, includes_child_windows: bool) -> Self {
104 self.set_includes_child_windows(includes_child_windows);
105 self
106 }
107
108 #[cfg(feature = "macos_14_2")]
109 pub fn includes_child_windows(&self) -> bool {
110 unsafe { crate::ffi::sc_stream_configuration_get_includes_child_windows(self.as_ptr()) }
111 }
112
113 #[cfg(feature = "macos_14_2")]
120 pub fn set_presenter_overlay_privacy_alert_setting(
121 &mut self,
122 setting: SCPresenterOverlayAlertSetting,
123 ) -> &mut Self {
124 unsafe {
125 crate::ffi::sc_stream_configuration_set_presenter_overlay_privacy_alert_setting(
126 self.as_ptr(),
127 setting as i32,
128 );
129 }
130 self
131 }
132
133 #[cfg(feature = "macos_14_2")]
135 #[must_use]
136 pub fn with_presenter_overlay_privacy_alert_setting(
137 mut self,
138 setting: SCPresenterOverlayAlertSetting,
139 ) -> Self {
140 self.set_presenter_overlay_privacy_alert_setting(setting);
141 self
142 }
143
144 #[cfg(feature = "macos_14_2")]
145 pub fn presenter_overlay_privacy_alert_setting(&self) -> SCPresenterOverlayAlertSetting {
146 let value = unsafe {
147 crate::ffi::sc_stream_configuration_get_presenter_overlay_privacy_alert_setting(
148 self.as_ptr(),
149 )
150 };
151 match value {
152 1 => SCPresenterOverlayAlertSetting::Never,
153 2 => SCPresenterOverlayAlertSetting::Always,
154 _ => SCPresenterOverlayAlertSetting::System,
155 }
156 }
157
158 #[cfg(feature = "macos_14_0")]
164 pub fn set_ignores_shadow_display_configuration(&mut self, ignores_shadow: bool) -> &mut Self {
165 unsafe {
166 crate::ffi::sc_stream_configuration_set_ignores_shadow_display_configuration(
167 self.as_ptr(),
168 ignores_shadow,
169 );
170 }
171 self
172 }
173
174 #[cfg(feature = "macos_14_0")]
176 #[must_use]
177 pub fn with_ignores_shadow_display_configuration(mut self, ignores_shadow: bool) -> Self {
178 self.set_ignores_shadow_display_configuration(ignores_shadow);
179 self
180 }
181
182 #[cfg(feature = "macos_14_0")]
183 pub fn ignores_shadow_display_configuration(&self) -> bool {
184 unsafe {
185 crate::ffi::sc_stream_configuration_get_ignores_shadow_display_configuration(
186 self.as_ptr(),
187 )
188 }
189 }
190}