Struct window_manager::WindowManager
source · pub struct WindowManager {
pub final_fb: Framebuffer<AlphaPixel>,
/* private fields */
}
Expand description
Window manager structure which maintains a list of windows and a mouse.
Fields§
§final_fb: Framebuffer<AlphaPixel>
The final framebuffer which is mapped to the screen (the actual display device).
Implementations§
source§impl WindowManager
impl WindowManager
sourcepub fn set_active(
&mut self,
inner_ref: &Arc<Mutex<WindowInner>>,
refresh: bool
) -> Result<bool, &'static str>
pub fn set_active( &mut self, inner_ref: &Arc<Mutex<WindowInner>>, refresh: bool ) -> Result<bool, &'static str>
Sets one window as active, push last active (if exists) to top of show_list. if refresh
is true
, will then refresh the window’s area.
Returns whether this window is the first active window in the manager.
TODO FIXME: (kevinaboos) remove this dumb notion of “first active”. This is a bad hack.
sourcepub fn delete_window(
&mut self,
inner_ref: &Arc<Mutex<WindowInner>>
) -> Result<(), &'static str>
pub fn delete_window( &mut self, inner_ref: &Arc<Mutex<WindowInner>> ) -> Result<(), &'static str>
delete a window and refresh its region
sourcepub fn refresh_bottom_windows<B: CompositableRegion + Clone>(
&mut self,
bounding_box: impl IntoIterator<Item = B> + Clone,
active: bool
) -> Result<(), &'static str>
pub fn refresh_bottom_windows<B: CompositableRegion + Clone>( &mut self, bounding_box: impl IntoIterator<Item = B> + Clone, active: bool ) -> Result<(), &'static str>
Refresh the region in bounding_box
. Only render the bottom final framebuffer and windows. Ignore the active window if active
is false.
sourcepub fn refresh_top<B: CompositableRegion + Clone>(
&mut self,
bounding_box: impl IntoIterator<Item = B> + Clone
) -> Result<(), &'static str>
pub fn refresh_top<B: CompositableRegion + Clone>( &mut self, bounding_box: impl IntoIterator<Item = B> + Clone ) -> Result<(), &'static str>
Refresh the region of bounding_box
in the top framebuffer
sourcepub fn refresh_windows<B: CompositableRegion + Clone>(
&mut self,
bounding_box: impl IntoIterator<Item = B> + Clone
) -> Result<(), &'static str>
pub fn refresh_windows<B: CompositableRegion + Clone>( &mut self, bounding_box: impl IntoIterator<Item = B> + Clone ) -> Result<(), &'static str>
Refresh the part in bounding_box
of every window. bounding_box
is a region relative to the top-left of the screen. Refresh the whole screen if the bounding box is None.
sourcepub fn refresh_active_window(
&mut self,
bounding_box: Option<Rectangle>
) -> Result<(), &'static str>
pub fn refresh_active_window( &mut self, bounding_box: Option<Rectangle> ) -> Result<(), &'static str>
Refresh the part in bounding_box
of the active window. bounding_box
is a region relative to the top-left of the screen. Refresh the whole screen if the bounding box is None.
sourcepub fn move_active_window(&mut self) -> Result<(), &'static str>
pub fn move_active_window(&mut self) -> Result<(), &'static str>
take active window’s base position and current mouse, move the window with delta
sourcepub fn refresh_mouse(&mut self) -> Result<(), &'static str>
pub fn refresh_mouse(&mut self) -> Result<(), &'static str>
Refresh the mouse display
sourcepub fn move_floating_border(&mut self) -> Result<(), &'static str>
pub fn move_floating_border(&mut self) -> Result<(), &'static str>
Move the floating border when a window is moving.
sourcepub fn is_active(&self, window: &Arc<Mutex<WindowInner>>) -> bool
pub fn is_active(&self, window: &Arc<Mutex<WindowInner>>) -> bool
Returns true if the given window
is the currently active window.
sourcepub fn get_screen_size(&self) -> (usize, usize)
pub fn get_screen_size(&self) -> (usize, usize)
Returns the (width, height)
in pixels of the screen itself (the final framebuffer).