config: move parser option structs into schema crate
This commit is contained in:
parent
b550bb1025
commit
41e7fcc290
6 changed files with 25 additions and 21 deletions
|
|
@ -8,4 +8,7 @@ pub mod animations;
|
||||||
pub mod options;
|
pub mod options;
|
||||||
|
|
||||||
pub use animations::{AnimationCurveConfig, Animations};
|
pub use animations::{AnimationCurveConfig, Animations};
|
||||||
pub use options::{Libei, RepeatRate, SimpleIm, Tearing, UiDrag, Vrr, Xwayland};
|
pub use options::{
|
||||||
|
ColorManagement, Float, FocusHistory, Libei, RepeatRate, SimpleIm, Tearing, UiDrag, Vrr,
|
||||||
|
Xwayland,
|
||||||
|
};
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,22 @@ pub struct UiDrag {
|
||||||
pub threshold: Option<i32>,
|
pub threshold: Option<i32>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug)]
|
||||||
|
pub struct ColorManagement {
|
||||||
|
pub enabled: Option<bool>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
|
pub struct Float {
|
||||||
|
pub show_pin_icon: Option<bool>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
|
pub struct FocusHistory {
|
||||||
|
pub only_visible: Option<bool>,
|
||||||
|
pub same_workspace: Option<bool>,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct RepeatRate {
|
pub struct RepeatRate {
|
||||||
pub rate: i32,
|
pub rate: i32,
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,7 @@ use {
|
||||||
config::{
|
config::{
|
||||||
context::Context,
|
context::Context,
|
||||||
parsers::{
|
parsers::{
|
||||||
color_management::ColorManagement,
|
|
||||||
config::{ConfigParser, ConfigParserError},
|
config::{ConfigParser, ConfigParserError},
|
||||||
float::Float,
|
|
||||||
focus_history::FocusHistory,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
toml::{self},
|
toml::{self},
|
||||||
|
|
@ -48,7 +45,8 @@ use {
|
||||||
};
|
};
|
||||||
|
|
||||||
pub use jay_config_schema::{
|
pub use jay_config_schema::{
|
||||||
AnimationCurveConfig, Animations, Libei, RepeatRate, SimpleIm, Tearing, UiDrag, Vrr, Xwayland,
|
AnimationCurveConfig, Animations, ColorManagement, Float, FocusHistory, Libei, RepeatRate,
|
||||||
|
SimpleIm, Tearing, UiDrag, Vrr, Xwayland,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone)]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
use {
|
use {
|
||||||
crate::{
|
crate::{
|
||||||
config::{
|
config::{
|
||||||
|
ColorManagement,
|
||||||
context::Context,
|
context::Context,
|
||||||
extractor::{Extractor, ExtractorError, bol, opt},
|
extractor::{Extractor, ExtractorError, bol, opt},
|
||||||
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
|
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
|
||||||
|
|
@ -24,11 +25,6 @@ pub enum ColorManagementParserError {
|
||||||
|
|
||||||
pub struct ColorManagementParser<'a>(pub &'a Context<'a>);
|
pub struct ColorManagementParser<'a>(pub &'a Context<'a>);
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
|
||||||
pub struct ColorManagement {
|
|
||||||
pub enabled: Option<bool>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Parser for ColorManagementParser<'_> {
|
impl Parser for ColorManagementParser<'_> {
|
||||||
type Value = ColorManagement;
|
type Value = ColorManagement;
|
||||||
type Error = ColorManagementParserError;
|
type Error = ColorManagementParserError;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
use {
|
use {
|
||||||
crate::{
|
crate::{
|
||||||
config::{
|
config::{
|
||||||
|
Float,
|
||||||
context::Context,
|
context::Context,
|
||||||
extractor::{Extractor, ExtractorError, bol, opt, recover},
|
extractor::{Extractor, ExtractorError, bol, opt, recover},
|
||||||
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
|
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
|
||||||
|
|
@ -24,11 +25,6 @@ pub enum FloatParserError {
|
||||||
|
|
||||||
pub struct FloatParser<'a>(pub &'a Context<'a>);
|
pub struct FloatParser<'a>(pub &'a Context<'a>);
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
|
||||||
pub struct Float {
|
|
||||||
pub show_pin_icon: Option<bool>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Parser for FloatParser<'_> {
|
impl Parser for FloatParser<'_> {
|
||||||
type Value = Float;
|
type Value = Float;
|
||||||
type Error = FloatParserError;
|
type Error = FloatParserError;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
use {
|
use {
|
||||||
crate::{
|
crate::{
|
||||||
config::{
|
config::{
|
||||||
|
FocusHistory,
|
||||||
context::Context,
|
context::Context,
|
||||||
extractor::{Extractor, ExtractorError, bol, opt, recover},
|
extractor::{Extractor, ExtractorError, bol, opt, recover},
|
||||||
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
|
parser::{DataType, ParseResult, Parser, UnexpectedDataType},
|
||||||
|
|
@ -24,12 +25,6 @@ pub enum FocusHistoryParserError {
|
||||||
|
|
||||||
pub struct FocusHistoryParser<'a>(pub &'a Context<'a>);
|
pub struct FocusHistoryParser<'a>(pub &'a Context<'a>);
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
|
||||||
pub struct FocusHistory {
|
|
||||||
pub only_visible: Option<bool>,
|
|
||||||
pub same_workspace: Option<bool>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Parser for FocusHistoryParser<'_> {
|
impl Parser for FocusHistoryParser<'_> {
|
||||||
type Value = FocusHistory;
|
type Value = FocusHistory;
|
||||||
type Error = FocusHistoryParserError;
|
type Error = FocusHistoryParserError;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue