use std::path::PathBuf;
use std::sync::mpsc::Receiver;
use crate::animation::WindowAnimator;
use crate::config::history::HistoryStore;
use crate::config::types::FlowConfig;
use crate::ipc::transport::PipeServer;
use crate::registry::WindowRegistry;
use crate::registry::hooks::{HookSignal, HookThreadHandle};
use crate::workspace::{FloatingSpace, Monitor, ScrollingSpace, Workspace};
pub(super) struct LayoutConfig {
pub(super) column_width: u32,
pub(super) min_column_width_px: u32,
pub(super) min_window_height_px: u32,
pub(super) padding: crate::layout::types::Padding,
}
pub struct FlowWM {
pub(super) registry: WindowRegistry,
pub(super) history: HistoryStore,
pub(super) monitors: Vec<Monitor>,
pub(super) active_monitor: usize,
pub(super) animator: WindowAnimator,
pub(super) server: PipeServer,
pub(super) config: FlowConfig,
pub(super) config_dir: PathBuf,
pub(super) hook_receiver: Receiver<crate::registry::HookEvent>,
pub(super) _hook_handle: HookThreadHandle,
pub(super) hook_signal: HookSignal,
pub(super) shutting_down: bool,
pub(super) pending_creations: Vec<(isize, u8)>,
pub(super) float_resume_deadline: Option<std::time::Instant>,
pub(super) last_foreground_sync: std::time::Instant,
}
impl FlowWM {
#[must_use]
#[allow(dead_code)] pub(super) fn active_monitor_index(&self) -> usize {
self.active_monitor
}
#[must_use]
pub(super) fn active_monitor(&self) -> &Monitor {
&self.monitors[self.active_monitor]
}
#[must_use]
pub(super) fn active_monitor_mut(&mut self) -> &mut Monitor {
&mut self.monitors[self.active_monitor]
}
#[must_use]
pub(super) fn active_workspace(&self) -> &Workspace {
self.active_monitor().active_workspace()
}
#[must_use]
pub(super) fn active_workspace_mut(&mut self) -> &mut Workspace {
self.active_monitor_mut().active_workspace_mut()
}
#[must_use]
pub(super) fn active_scrolling(&self) -> &ScrollingSpace {
self.active_monitor().active_scrolling()
}
#[must_use]
pub(super) fn active_scrolling_mut(&mut self) -> &mut ScrollingSpace {
self.active_monitor_mut().active_scrolling_mut()
}
#[must_use]
#[allow(dead_code)] pub(super) fn active_floating(&self) -> &FloatingSpace {
self.active_monitor().active_floating()
}
#[must_use]
#[allow(dead_code)] pub(super) fn active_floating_mut(&mut self) -> &mut FloatingSpace {
self.active_monitor_mut().active_floating_mut()
}
}