diff options
author | Aram Drevekenin <aram@poor.dev> | 2023-06-15 17:07:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-15 17:07:40 +0200 |
commit | bcbd940bf94cd76751af9b5fad64b716ce2cd3e6 (patch) | |
tree | 3bfed3792edd57f074c4aed9093c90bc6ed215fe /zellij-utils | |
parent | 8d6f20cfd95927b604f9806a2ceb72727901ff1c (diff) |
feat(plugins): plugin pane state events (#2545)
* feat(plugins): report pane state to plugins
* refactor(plugins): rename some stuff
* tests(plugins): adjust for new behavior
* style(fmt): rustfmt
Diffstat (limited to 'zellij-utils')
-rw-r--r-- | zellij-utils/src/data.rs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/zellij-utils/src/data.rs b/zellij-utils/src/data.rs index d470c2489..9a228c72d 100644 --- a/zellij-utils/src/data.rs +++ b/zellij-utils/src/data.rs @@ -2,6 +2,7 @@ use crate::input::actions::Action; use crate::input::config::ConversionError; use clap::ArgEnum; use serde::{Deserialize, Serialize}; +use std::collections::HashMap; use std::fmt; use std::path::PathBuf; use std::str::FromStr; @@ -463,6 +464,7 @@ pub enum Mouse { pub enum Event { ModeUpdate(ModeInfo), TabUpdate(Vec<TabInfo>), + PaneUpdate(PaneManifest), Key(Key), Mouse(Mouse), Timer(f64), @@ -700,6 +702,37 @@ pub struct TabInfo { pub is_swap_layout_dirty: bool, } +#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize)] +pub struct PaneManifest { + pub panes: HashMap<usize, Vec<PaneInfo>>, // usize is the tab position +} + +#[derive(Debug, Default, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)] +pub struct PaneInfo { + pub id: u32, + pub is_plugin: bool, + pub is_focused: bool, + pub is_fullscreen: bool, + pub is_floating: bool, + pub is_suppressed: bool, + pub title: String, + pub exited: bool, + pub exit_status: Option<i32>, + pub is_held: bool, + pub pane_x: usize, + pub pane_content_x: usize, + pub pane_y: usize, + pub pane_content_y: usize, + pub pane_rows: usize, + pub pane_content_rows: usize, + pub pane_columns: usize, + pub pane_content_columns: usize, + pub cursor_coordinates_in_pane: Option<(usize, usize)>, // x, y if cursor is visible + pub terminal_command: Option<String>, + pub plugin_url: Option<String>, + pub is_selectable: bool, +} + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)] pub struct PluginIds { pub plugin_id: u32, |