2023-09-07 13:28:08 -07:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
|
|
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
|
2025-01-31 14:13:33 -08:00
|
|
|
use crate::output::EdidProduct;
|
|
|
|
|
|
2023-12-20 16:52:44 -08:00
|
|
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
2023-09-07 13:28:08 -07:00
|
|
|
pub struct WorkspaceConfig {
|
|
|
|
|
pub workspace_mode: WorkspaceMode,
|
2025-03-24 16:58:32 -07:00
|
|
|
#[serde(default)]
|
2023-09-07 13:28:08 -07:00
|
|
|
pub workspace_layout: WorkspaceLayout,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Default for WorkspaceConfig {
|
|
|
|
|
fn default() -> Self {
|
|
|
|
|
Self {
|
|
|
|
|
workspace_mode: WorkspaceMode::OutputBound,
|
|
|
|
|
workspace_layout: WorkspaceLayout::Vertical,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
|
|
|
|
pub enum WorkspaceMode {
|
|
|
|
|
OutputBound,
|
|
|
|
|
Global,
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-24 16:58:32 -07:00
|
|
|
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)]
|
2023-09-07 13:28:08 -07:00
|
|
|
pub enum WorkspaceLayout {
|
2025-03-24 16:58:32 -07:00
|
|
|
#[default]
|
2023-09-07 13:28:08 -07:00
|
|
|
Vertical,
|
|
|
|
|
Horizontal,
|
|
|
|
|
}
|
2025-01-31 14:13:33 -08:00
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
|
|
|
|
pub struct OutputMatch {
|
|
|
|
|
pub name: String,
|
|
|
|
|
pub edid: Option<EdidProduct>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
|
|
|
|
pub struct PinnedWorkspace {
|
|
|
|
|
pub output: OutputMatch,
|
|
|
|
|
pub tiling_enabled: bool,
|
|
|
|
|
// TODO: name, id
|
|
|
|
|
}
|