1
0
Fork 0
forked from wry/wry

config: move output schema into schema crate

This commit is contained in:
kossLAN 2026-05-29 17:04:27 -04:00
parent e94d8fec1f
commit fb65585bfa
No known key found for this signature in database
4 changed files with 140 additions and 93 deletions

View file

@ -6,6 +6,7 @@
pub mod animations;
pub mod options;
pub mod output;
pub mod theme;
pub use animations::{AnimationCurveConfig, Animations};
@ -13,4 +14,7 @@ pub use options::{
ColorManagement, Float, FocusHistory, Libei, RepeatRate, SimpleIm, Tearing, UiDrag, Vrr,
Xwayland,
};
pub use output::{
ConfigConnector, ConfigDrmDevice, ConnectorMatch, DrmDeviceMatch, Mode, Output, OutputMatch,
};
pub use theme::Theme;

View file

@ -0,0 +1,88 @@
use {
crate::{Tearing, Vrr},
jay_config::video::{BlendSpace, ColorSpace, Eotf, Format, GfxApi, Transform},
std::fmt::{Display, Formatter},
};
#[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(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 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>,
}