config: move output schema into schema crate
This commit is contained in:
parent
e94d8fec1f
commit
fb65585bfa
4 changed files with 140 additions and 93 deletions
|
|
@ -28,14 +28,13 @@ use {
|
|||
keyboard::{Keymap, ModifiedKeySym, mods::Modifiers, syms::KeySym},
|
||||
logging::LogLevel,
|
||||
status::MessageFormat,
|
||||
video::{BlendSpace, ColorSpace, Eotf, Format, GfxApi, Transform},
|
||||
video::GfxApi,
|
||||
window::{ContentType, TileState, WindowType},
|
||||
workspace::WorkspaceDisplayOrder,
|
||||
},
|
||||
std::{
|
||||
cell::RefCell,
|
||||
error::Error,
|
||||
fmt::{Display, Formatter},
|
||||
rc::Rc,
|
||||
time::Duration,
|
||||
},
|
||||
|
|
@ -44,8 +43,9 @@ use {
|
|||
};
|
||||
|
||||
pub use jay_config_schema::{
|
||||
AnimationCurveConfig, Animations, ColorManagement, Float, FocusHistory, Libei, RepeatRate,
|
||||
SimpleIm, Tearing, Theme, UiDrag, Vrr, Xwayland,
|
||||
AnimationCurveConfig, Animations, ColorManagement, ConfigConnector, ConfigDrmDevice,
|
||||
ConnectorMatch, DrmDeviceMatch, Float, FocusHistory, Libei, Mode, Output, OutputMatch,
|
||||
RepeatRate, SimpleIm, Tearing, Theme, UiDrag, Vrr, Xwayland,
|
||||
};
|
||||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
|
|
@ -211,18 +211,6 @@ pub struct Status {
|
|||
pub separator: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum OutputMatch {
|
||||
Any(Vec<OutputMatch>),
|
||||
All {
|
||||
name: Option<String>,
|
||||
connector: Option<String>,
|
||||
serial_number: Option<String>,
|
||||
manufacturer: Option<String>,
|
||||
model: Option<String>,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone)]
|
||||
pub struct GenericMatch<Match> {
|
||||
pub name: Option<String>,
|
||||
|
|
@ -303,62 +291,6 @@ pub struct WindowMatch {
|
|||
pub content_types: Option<ContentType>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum DrmDeviceMatch {
|
||||
Any(Vec<DrmDeviceMatch>),
|
||||
All {
|
||||
name: Option<String>,
|
||||
syspath: Option<String>,
|
||||
vendor: Option<u32>,
|
||||
vendor_name: Option<String>,
|
||||
model: Option<u32>,
|
||||
model_name: Option<String>,
|
||||
devnode: Option<String>,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Mode {
|
||||
pub width: i32,
|
||||
pub height: i32,
|
||||
pub refresh_rate: Option<f64>,
|
||||
}
|
||||
|
||||
impl Display for Mode {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "{} x {}", self.width, self.height)?;
|
||||
if let Some(rr) = self.refresh_rate {
|
||||
write!(f, " @ {rr}")?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Output {
|
||||
pub name: Option<String>,
|
||||
pub match_: OutputMatch,
|
||||
pub x: Option<i32>,
|
||||
pub y: Option<i32>,
|
||||
pub scale: Option<f64>,
|
||||
pub transform: Option<Transform>,
|
||||
pub mode: Option<Mode>,
|
||||
pub vrr: Option<Vrr>,
|
||||
pub tearing: Option<Tearing>,
|
||||
pub format: Option<Format>,
|
||||
pub color_space: Option<ColorSpace>,
|
||||
pub eotf: Option<Eotf>,
|
||||
pub brightness: Option<Option<f64>>,
|
||||
pub blend_space: Option<BlendSpace>,
|
||||
pub use_native_gamut: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum ConnectorMatch {
|
||||
Any(Vec<ConnectorMatch>),
|
||||
All { connector: Option<String> },
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum InputMatch {
|
||||
Any(Vec<InputMatch>),
|
||||
|
|
@ -405,21 +337,6 @@ pub struct Exec {
|
|||
pub envs: Vec<(String, String)>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ConfigConnector {
|
||||
pub match_: ConnectorMatch,
|
||||
pub enabled: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ConfigDrmDevice {
|
||||
pub name: Option<String>,
|
||||
pub match_: DrmDeviceMatch,
|
||||
pub gfx_api: Option<GfxApi>,
|
||||
pub direct_scanout_enabled: Option<bool>,
|
||||
pub flip_margin_ms: Option<f64>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum ConfigKeymap {
|
||||
Named(String),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue