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

source

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.

source

pub fn delete_window( &mut self, inner_ref: &Arc<Mutex<WindowInner>> ) -> Result<(), &'static str>

delete a window and refresh its region

source

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.

source

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

source

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.

source

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.

source

pub fn move_active_window(&mut self) -> Result<(), &'static str>

take active window’s base position and current mouse, move the window with delta

source

pub fn refresh_mouse(&mut self) -> Result<(), &'static str>

Refresh the mouse display

source

pub fn move_floating_border(&mut self) -> Result<(), &'static str>

Move the floating border when a window is moving.

source

pub fn is_active(&self, window: &Arc<Mutex<WindowInner>>) -> bool

Returns true if the given window is the currently active window.

source

pub fn get_screen_size(&self) -> (usize, usize)

Returns the (width, height) in pixels of the screen itself (the final framebuffer).

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.