use super::internal::SCStreamConfiguration;
#[repr(i32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
pub enum SCPresenterOverlayAlertSetting {
#[default]
System = 0,
Never = 1,
Always = 2,
}
impl SCStreamConfiguration {
#[cfg(feature = "macos_14_0")]
pub fn set_ignores_shadows_single_window(&mut self, ignores_shadows: bool) -> &mut Self {
unsafe {
crate::ffi::sc_stream_configuration_set_ignores_shadows_single_window(
self.as_ptr(),
ignores_shadows,
);
}
self
}
#[cfg(feature = "macos_14_0")]
#[must_use]
pub fn with_ignores_shadows_single_window(mut self, ignores_shadows: bool) -> Self {
self.set_ignores_shadows_single_window(ignores_shadows);
self
}
#[cfg(feature = "macos_14_0")]
pub fn ignores_shadows_single_window(&self) -> bool {
unsafe {
crate::ffi::sc_stream_configuration_get_ignores_shadows_single_window(self.as_ptr())
}
}
#[cfg(feature = "macos_13_0")]
pub fn set_should_be_opaque(&mut self, should_be_opaque: bool) -> &mut Self {
unsafe {
crate::ffi::sc_stream_configuration_set_should_be_opaque(
self.as_ptr(),
should_be_opaque,
);
}
self
}
#[cfg(feature = "macos_13_0")]
#[must_use]
pub fn with_should_be_opaque(mut self, should_be_opaque: bool) -> Self {
self.set_should_be_opaque(should_be_opaque);
self
}
#[cfg(feature = "macos_13_0")]
pub fn should_be_opaque(&self) -> bool {
unsafe { crate::ffi::sc_stream_configuration_get_should_be_opaque(self.as_ptr()) }
}
#[cfg(feature = "macos_14_2")]
pub fn set_includes_child_windows(&mut self, includes_child_windows: bool) -> &mut Self {
unsafe {
crate::ffi::sc_stream_configuration_set_includes_child_windows(
self.as_ptr(),
includes_child_windows,
);
}
self
}
#[cfg(feature = "macos_14_2")]
#[must_use]
pub fn with_includes_child_windows(mut self, includes_child_windows: bool) -> Self {
self.set_includes_child_windows(includes_child_windows);
self
}
#[cfg(feature = "macos_14_2")]
pub fn includes_child_windows(&self) -> bool {
unsafe { crate::ffi::sc_stream_configuration_get_includes_child_windows(self.as_ptr()) }
}
#[cfg(feature = "macos_14_2")]
pub fn set_presenter_overlay_privacy_alert_setting(
&mut self,
setting: SCPresenterOverlayAlertSetting,
) -> &mut Self {
unsafe {
crate::ffi::sc_stream_configuration_set_presenter_overlay_privacy_alert_setting(
self.as_ptr(),
setting as i32,
);
}
self
}
#[cfg(feature = "macos_14_2")]
#[must_use]
pub fn with_presenter_overlay_privacy_alert_setting(
mut self,
setting: SCPresenterOverlayAlertSetting,
) -> Self {
self.set_presenter_overlay_privacy_alert_setting(setting);
self
}
#[cfg(feature = "macos_14_2")]
pub fn presenter_overlay_privacy_alert_setting(&self) -> SCPresenterOverlayAlertSetting {
let value = unsafe {
crate::ffi::sc_stream_configuration_get_presenter_overlay_privacy_alert_setting(
self.as_ptr(),
)
};
match value {
1 => SCPresenterOverlayAlertSetting::Never,
2 => SCPresenterOverlayAlertSetting::Always,
_ => SCPresenterOverlayAlertSetting::System,
}
}
#[cfg(feature = "macos_14_0")]
pub fn set_ignores_shadow_display_configuration(&mut self, ignores_shadow: bool) -> &mut Self {
unsafe {
crate::ffi::sc_stream_configuration_set_ignores_shadow_display_configuration(
self.as_ptr(),
ignores_shadow,
);
}
self
}
#[cfg(feature = "macos_14_0")]
#[must_use]
pub fn with_ignores_shadow_display_configuration(mut self, ignores_shadow: bool) -> Self {
self.set_ignores_shadow_display_configuration(ignores_shadow);
self
}
#[cfg(feature = "macos_14_0")]
pub fn ignores_shadow_display_configuration(&self) -> bool {
unsafe {
crate::ffi::sc_stream_configuration_get_ignores_shadow_display_configuration(
self.as_ptr(),
)
}
}
}