diff options
Diffstat (limited to 'niri-config/src/lib.rs')
| -rw-r--r-- | niri-config/src/lib.rs | 51 |
1 files changed, 1 insertions, 50 deletions
diff --git a/niri-config/src/lib.rs b/niri-config/src/lib.rs index 0bf3fe0d..d03de0ff 100644 --- a/niri-config/src/lib.rs +++ b/niri-config/src/lib.rs @@ -10,7 +10,7 @@ use std::time::Duration; use bitflags::bitflags; use knuffel::errors::DecodeError; use miette::{miette, Context, IntoDiagnostic, NarratableReportHandler}; -use niri_ipc::{LayoutSwitchTarget, SizeChange}; +use niri_ipc::{LayoutSwitchTarget, SizeChange, Transform}; use regex::Regex; use smithay::input::keyboard::keysyms::KEY_NoSymbol; use smithay::input::keyboard::xkb::{keysym_from_name, KEYSYM_CASE_INSENSITIVE}; @@ -265,55 +265,6 @@ impl Default for Output { } } -/// Output transform, which goes counter-clockwise. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum Transform { - Normal, - _90, - _180, - _270, - Flipped, - Flipped90, - Flipped180, - Flipped270, -} - -impl FromStr for Transform { - type Err = miette::Error; - - fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { - "normal" => Ok(Self::Normal), - "90" => Ok(Self::_90), - "180" => Ok(Self::_180), - "270" => Ok(Self::_270), - "flipped" => Ok(Self::Flipped), - "flipped-90" => Ok(Self::Flipped90), - "flipped-180" => Ok(Self::Flipped180), - "flipped-270" => Ok(Self::Flipped270), - _ => Err(miette!(concat!( - r#"invalid transform, can be "90", "180", "270", "#, - r#""flipped", "flipped-90", "flipped-180" or "flipped-270""# - ))), - } - } -} - -impl From<Transform> for smithay::utils::Transform { - fn from(value: Transform) -> Self { - match value { - Transform::Normal => Self::Normal, - Transform::_90 => Self::_90, - Transform::_180 => Self::_180, - Transform::_270 => Self::_270, - Transform::Flipped => Self::Flipped, - Transform::Flipped90 => Self::Flipped90, - Transform::Flipped180 => Self::Flipped180, - Transform::Flipped270 => Self::Flipped270, - } - } -} - #[derive(knuffel::Decode, Debug, Clone, Copy, PartialEq, Eq)] pub struct Position { #[knuffel(property)] |
