Struct App

Source
pub struct App {
Show 20 fields pub win_w: u16, pub win_h: u16, pub panes: Vec<Pane>, pub drag_src: Option<usize>, pub selected: Option<String>, pub windows: Vec<Win>, pub window_mode: bool, pub wdrag: Option<WDrag>, pub sel_win: Option<String>, pub tiles: RefCell<Vec<(String, Rect)>>, pub mpanes: RefCell<Vec<(String, String, Rect)>>, pub pending_kill: Option<(String, bool)>, pub prompt: Option<Prompt>, pub menu: Option<Menu>, pub show_help: bool, pub should_quit: bool, pub cursor: (u16, u16), pub status: String, pub last_canvas: Cell<Rect>, pub last_full: Cell<Rect>,
}

Fields§

§win_w: u16§win_h: u16§panes: Vec<Pane>§drag_src: Option<usize>§selected: Option<String>§windows: Vec<Win>§window_mode: bool§wdrag: Option<WDrag>§sel_win: Option<String>§tiles: RefCell<Vec<(String, Rect)>>§mpanes: RefCell<Vec<(String, String, Rect)>>§pending_kill: Option<(String, bool)>§prompt: Option<Prompt>§menu: Option<Menu>§show_help: bool§should_quit: bool§cursor: (u16, u16)§status: String§last_canvas: Cell<Rect>§last_full: Cell<Rect>

Implementations§

Source§

impl App

Source

pub fn new() -> Result<Self>

Source

pub fn refresh(&mut self) -> Result<()>

Source

pub fn selected_index(&self) -> Option<usize>

Source

fn target(&self) -> Option<String>

Target pane for create/kill: the selected pane, else the active one.

Source

pub fn active_window_id(&self) -> Option<String>

Id of the currently active (focused) window.

Source

pub fn active_window_label(&self) -> Option<String>

index:name of the active window, shown in the top bar.

Source

pub fn split(&mut self, horizontal: bool) -> Result<()>

Source

pub fn new_pane(&mut self, flag: &str, before: bool) -> Result<()>

Create a pane next to the target. flag is “-h”/“-v”; before puts the new pane left/above instead of right/below.

Source

pub fn request_kill(&mut self)

Source

pub fn set_layout(&mut self, name: &str, label: &str) -> Result<()>

Source

pub fn cycle_layout(&mut self) -> Result<()>

Source

pub fn select_window(&mut self, id: &str) -> Result<()>

Source

pub fn swap_windows(&mut self, a: &str, b: &str) -> Result<()>

Source

pub fn move_pane_to_window(&mut self, pane: &str, win: &str) -> Result<()>

Source

pub fn new_window(&mut self) -> Result<()>

Source

pub fn request_kill_window(&mut self, id: String)

Source

pub fn open_rename(&mut self, id: String)

Source

pub fn confirm_rename(&mut self) -> Result<()>

Source

pub fn confirm_kill(&mut self) -> Result<()>

Source

pub fn open_menu(&mut self, name: &str, x: u16, y: u16, target: Option<String>)

Source

pub fn menu_rect(&self, menu: &Menu) -> Rect

Source

pub fn menu_item_at(&self, col: u16, row: u16) -> Option<usize>

Source

pub fn activate_menu(&mut self, idx: usize) -> Result<()>

Source

pub fn quit_button_rect(&self) -> Rect

Source

pub fn mode_button_rect(&self) -> Rect

Source

pub fn help_button_rect(&self) -> Rect

Source

pub fn confirm_rects(&self) -> (Rect, Rect, Rect)

(dialog area, Yes button, No button) for the kill confirmation.

Source

pub fn prompt_rects(&self) -> (Rect, Rect, Rect, Rect)

(dialog area, text field, OK button, Cancel button) for the rename prompt.

Source

pub fn on_mouse(&mut self, m: MouseEvent) -> Result<()>

Source

fn on_mouse_panes(&mut self, m: MouseEvent) -> Result<()>

Source

fn on_mouse_windows(&mut self, m: MouseEvent) -> Result<()>

Source

pub fn set_window_mode(&mut self, on: bool) -> Result<()>

Switch between pane and window mode, seeding the window-mode cursor.

Source

fn win_cols(&self) -> i32

Columns the mission-control grid uses (matches the renderer).

Source

fn focused_window_index(&self) -> i32

Index of the focused window (selected, else active, else first).

Source

pub fn select_dir(&mut self, dir: &str) -> Result<()>

Pane mode: move selection directionally, via tmux’s spatial logic.

Source

pub fn swap_dir(&mut self, dir: &str) -> Result<()>

Pane mode: swap the selected pane with its neighbour in dir.

Source

pub fn win_nav(&mut self, dx: i32, dy: i32) -> Result<()>

Window mode: move the focus across the grid AND switch to that window live, so arrowing around takes you through the session.

Source

pub fn win_swap(&mut self, dx: i32, dy: i32) -> Result<()>

Window mode: reorder — swap the focused window with the grid neighbour.

Source

pub fn pane_key(&mut self, k: KeyEvent) -> Result<()>

Dispatch a key in pane mode (arrows navigate, Shift+arrows move).

Source

fn move_or_select(&mut self, dir: &str, shift: bool) -> Result<()>

Source

pub fn window_key(&mut self, k: KeyEvent) -> Result<()>

Dispatch a key in window mode (arrows navigate, Shift+arrows reorder).

Source§

impl App

Source

pub fn draw(&self, f: &mut Frame<'_>)

Source

fn draw_panes(&self, f: &mut Frame<'_>, canvas: Rect)

Source

fn draw_windows(&self, f: &mut Frame<'_>, canvas: Rect)

Source

fn draw_chrome(&self, f: &mut Frame<'_>, full: Rect)

Source

fn draw_menu(&self, f: &mut Frame<'_>)

Source

fn draw_help(&self, f: &mut Frame<'_>)

Source

fn draw_confirm(&self, f: &mut Frame<'_>)

Source

fn draw_prompt(&self, f: &mut Frame<'_>)

Auto Trait Implementations§

§

impl !Freeze for App

§

impl !RefUnwindSafe for App

§

impl Send for App

§

impl !Sync for App

§

impl Unpin for App

§

impl UnwindSafe for App

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.