use crate::{Direction, LogicalLayout, SplitDirection};
pub trait Layout {
fn split(&mut self, direction: SplitDirection) -> u64;
fn close(&mut self, viewport_id: u64) -> bool;
fn focus(&mut self, viewport_id: u64) -> bool;
fn focus_direction(&mut self, direction: Direction) -> bool;
fn focused_viewport(&self) -> u64;
fn to_logical(&self) -> LogicalLayout;
fn apply_layout(&mut self, layout: &LogicalLayout);
fn window_count(&self) -> usize;
fn is_single(&self) -> bool {
self.window_count() == 1
}
}
#[cfg(test)]
#[path = "layout_tests.rs"]
mod tests;