libobs_wrapper\display\window_manager/
traits.rs

1use crate::utils::ObsError;
2
3pub trait MiscDisplayTrait {
4    fn is_enabled(&self) -> Result<bool, ObsError>;
5
6    fn set_enabled(&self, enabled: bool) -> Result<(), ObsError>;
7
8    fn set_background_color(&self, r: u8, g: u8, b: u8) -> Result<(), ObsError>;
9}
10
11pub trait WindowPositionTrait {
12    /// If create_child is true, sets whether the window is rendered at the bottom of the Z order.
13    ///
14    /// Otherwise, this function has no effect.
15    fn set_render_at_bottom(&self, render_at_bottom: bool) -> Result<(), ObsError>;
16
17    /// Returns true if the window is rendered at the bottom of the Z order.
18    /// If create_child was false during creation, this function always returns false.
19    fn get_render_at_bottom(&self) -> Result<bool, ObsError>;
20    fn set_pos(&self, x: i32, y: i32) -> Result<(), ObsError>;
21    fn set_size(&self, width: u32, height: u32) -> Result<(), ObsError>;
22    fn get_pos(&self) -> Result<(i32, i32), ObsError>;
23
24    fn get_size(&self) -> Result<(u32, u32), ObsError>;
25}
26
27pub trait ShowHideTrait {
28    /// Shows the window.
29    fn show(&mut self) -> Result<(), ObsError>;
30
31    /// Hides the window.
32    fn hide(&mut self) -> Result<(), ObsError>;
33
34    /// Returns true if the window is visible.
35    fn is_visible(&self) -> Result<bool, ObsError>;
36}