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§
Sourcefn init(&mut self, tx: Sender<Event>) -> (usize, usize)
fn init(&mut self, tx: Sender<Event>) -> (usize, usize)
Initialise the UI and start processing events.
Called before entering the main editor event loop
Sourcefn state_change(&mut self, change: StateChange)
fn state_change(&mut self, change: StateChange)
Update internal state based on an Editor state change without rendering.
Sourcefn refresh(
&mut self,
mode_name: &str,
layout: &mut Layout,
n_running: usize,
pending_keys: &[Input],
held_click: Option<&Click>,
mb: Option<MiniBufferState<'_>>,
)
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.
Sourcefn set_cursor_shape(&mut self, cur_shape: CurShape)
fn set_cursor_shape(&mut self, cur_shape: CurShape)
Called when the editor mode changes and a new cursor shape is required