#[derive(Debug, Clone)]
pub enum Action {
Quit,
Resize(u16, u16),
FocusNext,
FocusPrevious,
FocusPanel(PanelType),
ToggleFullscreen,
SwitchLayout,
EnterWindowNavMode,
ExitWindowNavMode,
WindowNavMove(WindowDirection),
InsertChar(char),
DeleteChar,
MoveCursor(CursorDirection),
DeleteWord,
DeletePreviousWord,
DeleteToEnd,
DeleteToBeginning,
MoveToBeginning,
MoveToEnd,
SubmitCommand,
SubmitCommandWithText {
command: String,
}, HistoryUp,
HistoryDown,
HistoryPrevious, HistoryNext, EnterCommandMode,
ExitCommandMode, EnterInputMode,
CommandCursorUp,
CommandCursorDown,
CommandCursorLeft,
CommandCursorRight,
CommandHalfPageUp, CommandHalfPageDown,
EnterScriptMode(String),
ExitScriptMode,
SubmitScript,
CancelScript,
InsertNewline,
InsertTab,
AddResponseWithStyle {
content: String,
styled_lines: Option<Vec<ratatui::text::Line<'static>>>,
response_type: ResponseType,
},
AddStyledWelcomeMessage {
styled_lines: Vec<ratatui::text::Line<'static>>,
response_type: ResponseType,
},
CommandCompleted,
CommandFailed(String),
SendRuntimeCommand(RuntimeCommand),
HandleRuntimeStatus(RuntimeStatus),
HandleTraceEvent(ghostscope_protocol::ParsedTraceEvent),
LoadSource {
path: String,
line: Option<usize>,
},
EnterFileSearch,
ExitFileSearch,
EnterTextSearch,
ExitTextSearch,
NavigateSource(SourceNavigation),
SourceSearchInput(char),
SourceSearchBackspace,
SourceSearchConfirm,
SourceFileSearchInput(char),
SourceFileSearchBackspace,
SourceFileSearchConfirm,
SourceNumberInput(char),
SourceGoToLine,
SourceGoToBottom,
SetTraceFromSourceLine,
NavigateEbpf(EbpfNavigation),
SaveEbpfOutput {
filename: Option<String>,
},
SaveCommandSession {
filename: Option<String>,
},
StopSaveOutput, StopSaveSession,
NoOp,
SetSourcePanelVisibility(bool),
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum PanelType {
Source,
EbpfInfo,
InteractiveCommand,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum CursorDirection {
Left,
Right,
Up,
Down,
Home,
End,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum WindowDirection {
Left, Right, Up, Down, }
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum SourceNavigation {
Up,
Down,
Left,
Right,
PageUp,
PageDown,
HalfPageUp, HalfPageDown, WordForward, WordBackward, LineStart, LineEnd, GoToLine(usize),
NextMatch,
PrevMatch,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum EbpfNavigation {
Up,
Down,
PageUp,
PageDown,
GoToLine(usize),
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum ResponseType {
Success,
Error,
Warning,
Info,
Progress,
ScriptDisplay,
}
pub use crate::events::{RuntimeCommand, RuntimeStatus};