use igv_core::Region;
#[derive(Debug, Clone, Copy)]
pub enum SnapshotFormat {
Svg,
Png,
}
impl SnapshotFormat {
pub fn from_path(p: &std::path::Path) -> Self {
match p
.extension()
.and_then(|e| e.to_str())
.map(|s| s.to_ascii_lowercase())
{
Some(ref s) if s == "png" => Self::Png,
_ => Self::Svg,
}
}
}
#[derive(Debug, Clone)]
pub enum Action {
SaveSnapshot {
path: Option<std::path::PathBuf>,
format: SnapshotFormat,
},
Move { forward: bool, large: bool },
Zoom { zoom_in: bool },
Goto(Region),
ToggleTheme,
OpenCommand,
CommandSubmit(String),
CommandCancel,
SetBookmark(char),
JumpBookmark(char),
ScrollAlignments(i16),
ResizeAlignments(i16),
ResizeCoverage(i16),
ToggleSignalSharedScale,
ResizeSignal(i16),
ResizeLink(i16),
ToggleHelp,
CloseHelp,
Quit,
OpenBrowser,
None,
}