pinnacle/src/layout.rs

29 lines
643 B
Rust
Raw Normal View History

use std::{error::Error, fmt::Display};
2023-05-29 19:45:04 +02:00
use smithay::desktop::Window;
use crate::State;
pub mod automatic;
pub mod manual;
pub trait Layout {
fn layout_windows(&self, state: &mut State, windows: Vec<Window>);
fn add_window(&mut self, state: &mut State, window: Window);
fn remove_window(&mut self, state: &mut State, window: Window)
-> Result<(), RemoveWindowError>;
}
#[derive(Debug)]
pub enum RemoveWindowError {
NotFound,
2023-05-29 19:45:04 +02:00
}
impl Display for RemoveWindowError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self)
}
}
impl Error for RemoveWindowError {}