UserInterface

Trait UserInterface 

Source
pub trait UserInterface {
    // Required methods
    fn init(&mut self, tx: Sender<Event>) -> (usize, usize);
    fn shutdown(&mut self);
    fn state_change(&mut self, change: StateChange);
    fn refresh(
        &mut self,
        mode_name: &str,
        layout: &mut Layout,
        n_running: usize,
        pending_keys: &[Input],
        held_click: Option<&Click>,
        mb: Option<MiniBufferState<'_>>,
    );
    fn set_cursor_shape(&mut self, cur_shape: CurShape);
}
Expand description

Something that can be used as a user interface

Required Methods§

Source

fn init(&mut self, tx: Sender<Event>) -> (usize, usize)

Initialise the UI and start processing events.

Called before entering the main editor event loop

Source

fn shutdown(&mut self)

Called when the editor event loop exits cleanly.

Source

fn state_change(&mut self, change: StateChange)

Update internal state based on an Editor state change without rendering.

Source

fn refresh( &mut self, mode_name: &str, layout: &mut Layout, n_running: usize, pending_keys: &[Input], held_click: Option<&Click>, mb: Option<MiniBufferState<'_>>, )

Refresh the ui to display the current editor state.

Source

fn set_cursor_shape(&mut self, cur_shape: CurShape)

Called when the editor mode changes and a new cursor shape is required

Implementors§