Replace config transform with ipc

This commit is contained in:
Ivan Molodetskikh
2024-03-27 17:03:17 +04:00
parent cf87a185a9
commit 9927c15f68
4 changed files with 41 additions and 54 deletions
+21
View File
@@ -359,3 +359,24 @@ impl FromStr for LayoutSwitchTarget {
}
}
}
impl FromStr for Transform {
type Err = &'static str;
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(concat!(
r#"invalid transform, can be "90", "180", "270", "#,
r#""flipped", "flipped-90", "flipped-180" or "flipped-270""#
)),
}
}
}