pub struct DeskState { /* private fields */ }Expand description
the windows of an area: kept by the app and passed to desk_begin / desk_next / desk_end /
desk_taskbar. Plain data: save() / load() turn it into a few lines of text (desk 1, then
win KEY X Y W H STATE from the bottom of the z-order to the top – x, y from the area’s
start corner, outer size, all DIP; STATE the DW_* bits – and active KEY; unknown lines
are skipped). The reserved strip is no part of it.
Implementations§
Source§impl DeskState
impl DeskState
Sourcepub fn new() -> DeskState
pub fn new() -> DeskState
no windows: every window goes cascaded to the front in its first frame
Sourcepub fn set_reserve(&mut self, insets: [i32; 4])
pub fn set_reserve(&mut self, insets: [i32; 4])
the strip the area keeps free for a taskbar inside it (DIP: start, top, end, bottom): maximised and snapped windows leave it out, the title bars stay above it; not saved
Sourcepub fn order(&self) -> Vec<u32>
pub fn order(&self) -> Vec<u32>
the windows from the bottom of the z-order to the top (minimised ones too)
Sourcepub fn state(&self, key: u32) -> u32
pub fn state(&self, key: u32) -> u32
DW_* bits of the window (0: a normal window, or an unknown one)
Sourcepub fn rect(&self, key: u32) -> Option<[i32; 4]>
pub fn rect(&self, key: u32) -> Option<[i32; 4]>
the normal place of the window: x, y from the area’s start corner, outer width and height (DIP) – what it comes back to from maximised, snapped or minimised
Sourcepub fn set_rect(&mut self, key: u32, r: [i32; 4])
pub fn set_rect(&mut self, key: u32, r: [i32; 4])
set the normal place of a window (DIP; see rect); a maximised or snapped one shows it once restored
Sourcepub fn activate(&mut self, key: u32)
pub fn activate(&mut self, key: u32)
bring the window to the front and make it active (a minimised one comes back)
Sourcepub fn minimize(&mut self, key: u32)
pub fn minimize(&mut self, key: u32)
minimise the window (it keeps its place in the z-order; the topmost other one becomes active)
Sourcepub fn restore(&mut self, key: u32)
pub fn restore(&mut self, key: u32)
a minimised window comes back (as it was: maximised stays maximised); else a maximised or snapped one goes back to its normal place; it becomes active
Sourcepub fn toggle_max(&mut self, key: u32)
pub fn toggle_max(&mut self, key: u32)
maximise the window, or restore a maximised (or snapped) one
Sourcepub fn snap(&mut self, key: u32, half: u32)
pub fn snap(&mut self, key: u32, half: u32)
snap the window to the start (DW_LEFT) or end (DW_RIGHT) half of the area, 0: back to its normal place