Trait gabelstaplerwm::wm::layout::Layout
[−]
[src]
pub trait Layout: Debug {
fn arrange(
&self,
num_windows: usize,
screen: &TilingArea
) -> Vec<Option<Geometry>>;
fn right_window(&self, index: usize, max: usize) -> Option<usize>;
fn left_window(&self, index: usize, max: usize) -> Option<usize>;
fn top_window(&self, index: usize, max: usize) -> Option<usize>;
fn bottom_window(&self, index: usize, max: usize) -> Option<usize>;
fn new_window_as_master(&self) -> bool;
fn edit_layout(&mut self, msg: LayoutMessage) -> bool;
fn edit_layout_retry(&mut self, msgs: Vec<LayoutMessage>) -> bool { ... }
}Types that compute geometries for arbitrary amounts of windows.
The only input such objects get are TilingArea and number of windows.
The trait inherits from Debug for purely practical reasons: some types
we want to output (WmCommand in particular) rely on derived Debug
instances and all types implementing Layout implement Debug anyway.
Required Methods
fn arrange(
&self,
num_windows: usize,
screen: &TilingArea
) -> Vec<Option<Geometry>>
&self,
num_windows: usize,
screen: &TilingArea
) -> Vec<Option<Geometry>>
Compute window geometries.
If a None is returned at a particular position, that window is not
to be made visible.
fn right_window(&self, index: usize, max: usize) -> Option<usize>
Get the index of the window to the right of the nth window.
fn left_window(&self, index: usize, max: usize) -> Option<usize>
Get the index of the window to the left of the nth window.
fn top_window(&self, index: usize, max: usize) -> Option<usize>
Get the index of the window to the top of the nth window.
fn bottom_window(&self, index: usize, max: usize) -> Option<usize>
Get the index of the window to the bottom of the nth window.
fn new_window_as_master(&self) -> bool
Decide whether to insert new windows as master.
fn edit_layout(&mut self, msg: LayoutMessage) -> bool
React to a LayoutMessage, returning true on change.
Provided Methods
fn edit_layout_retry(&mut self, msgs: Vec<LayoutMessage>) -> bool
React to the first applicable LayoutMessage.
If any reaction is triggered, return true, else false.