adapt config backend options to cli arg names

This commit is contained in:
Ferdinand Schober
2024-11-06 12:12:16 +01:00
parent 71f7e2e5e0
commit cd2cabf25b

View File

@@ -86,15 +86,21 @@ struct CliArgs {
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, ValueEnum)] #[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, ValueEnum)]
pub enum CaptureBackend { pub enum CaptureBackend {
#[cfg(all(unix, feature = "libei", not(target_os = "macos")))] #[cfg(all(unix, feature = "libei", not(target_os = "macos")))]
#[serde(rename = "input-capture-portal")]
InputCapturePortal, InputCapturePortal,
#[cfg(all(unix, feature = "wayland", not(target_os = "macos")))] #[cfg(all(unix, feature = "wayland", not(target_os = "macos")))]
#[serde(rename = "layer-shell")]
LayerShell, LayerShell,
#[cfg(all(unix, feature = "x11", not(target_os = "macos")))] #[cfg(all(unix, feature = "x11", not(target_os = "macos")))]
#[serde(rename = "x11")]
X11, X11,
#[cfg(windows)] #[cfg(windows)]
#[serde(rename = "windows")]
Windows, Windows,
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
#[serde(rename = "macos")]
MacOs, MacOs,
#[serde(rename = "dummy")]
Dummy, Dummy,
} }
@@ -137,17 +143,24 @@ impl From<CaptureBackend> for input_capture::Backend {
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, ValueEnum)] #[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, ValueEnum)]
pub enum EmulationBackend { pub enum EmulationBackend {
#[cfg(all(unix, feature = "wayland", not(target_os = "macos")))] #[cfg(all(unix, feature = "wayland", not(target_os = "macos")))]
#[serde(rename = "wlroots")]
Wlroots, Wlroots,
#[cfg(all(unix, feature = "libei", not(target_os = "macos")))] #[cfg(all(unix, feature = "libei", not(target_os = "macos")))]
#[serde(rename = "libei")]
Libei, Libei,
#[cfg(all(unix, feature = "xdg_desktop_portal", not(target_os = "macos")))] #[cfg(all(unix, feature = "xdg_desktop_portal", not(target_os = "macos")))]
#[serde(rename = "xdp")]
Xdp, Xdp,
#[cfg(all(unix, feature = "x11", not(target_os = "macos")))] #[cfg(all(unix, feature = "x11", not(target_os = "macos")))]
#[serde(rename = "x11")]
X11, X11,
#[cfg(windows)] #[cfg(windows)]
#[serde(rename = "windows")]
Windows, Windows,
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
#[serde(rename = "macos")]
MacOs, MacOs,
#[serde(rename = "dummy")]
Dummy, Dummy,
} }
@@ -193,7 +206,9 @@ impl Display for EmulationBackend {
#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Eq, Serialize, ValueEnum)] #[derive(Clone, Copy, Debug, Deserialize, PartialEq, Eq, Serialize, ValueEnum)]
pub enum Frontend { pub enum Frontend {
#[serde(rename = "gtk")]
Gtk, Gtk,
#[serde(rename = "cli")]
Cli, Cli,
} }