Ui

Struct Ui 

Source
pub struct Ui {
Show 18 fields pub grids: Vec<Grid>, pub draw_order: Vec<DrawItem>, pub float_windows_start: usize, pub cursor: CursorInfo, pub mouse: bool, pub highlights: Vec<Option<Attributes>>, pub highlight_groups: HashMap<String, HlId>, pub did_highlights_change: bool, pub current_mode: u32, pub modes: Vec<ModeInfo>, pub guifont_update: Option<GuiFont>, pub default_colors: DefaultColorsSet, pub messages: Messages, pub cmdline: Cmdline, pub popupmenu: Option<PopupmenuShow>, pub tabline: Option<TablineUpdate>, pub did_flush: bool, pub ignore_next_scroll: bool,
}
Expand description

Manages updates to the UI state from UI events

Fields§

§grids: Vec<Grid>

UI grids, ordered by ID

§draw_order: Vec<DrawItem>

The order in which grids should be drawn, ordered from bottom to top

§float_windows_start: usize

The index into self.draw_order at which floating windows begin

§cursor: CursorInfo

Cursor information

§mouse: bool

Whether the mouse is enabled

§highlights: Vec<Option<Attributes>>

UI highlights, indexed by their ID

§highlight_groups: HashMap<String, HlId>

A lookup from highlight names to highlight IDs

§did_highlights_change: bool

Whether the highlights changed since the last flush

§current_mode: u32

The ID of the current mode

§modes: Vec<ModeInfo>

Information about Vim modes, indexed by ID

§guifont_update: Option<GuiFont>

UI options set by the option_set event

§default_colors: DefaultColorsSet

Default highlight colors

§messages: Messages

Manages ext_hlstate events

§cmdline: Cmdline

Manages ext_cmdline events

§popupmenu: Option<PopupmenuShow>

Manages ext_popupmenu events

§tabline: Option<TablineUpdate>

Manages ext_tabline events

§did_flush: bool

Did we receive a flush event?

§ignore_next_scroll: bool

Implementations§

Source§

impl Ui

Source

pub fn new() -> Self

Source

pub fn grid_index(&self, id: Id) -> Result<usize, usize>

Index of the grid with the given id, or else the index where the grid should be inserted

Source

pub fn grid_mut(&mut self, id: Id) -> Option<&mut Grid>

Grid with the given ID

Source

pub fn grid(&self, id: Id) -> Option<&Grid>

Grid with the given ID

Source

pub fn clear_dirty(&mut self)

Reset dirty flags

Source

pub fn process(&mut self, event: Event)

Update the UI with the given event

Source

pub fn position(&self, grid: Id) -> Option<CellVec<f32>>

Get the position of the grid, accounting for anchor grids and other windowing details

Source

pub fn grid_under_cursor( &self, cursor: PixelVec<u32>, cell_size: Vec2<u32>, ) -> Option<GridUnderCursor>

The grid under the cursor, accounting for anchor grids and other windowing details

Trait Implementations§

Source§

impl Clone for Ui

Source§

fn clone(&self) -> Ui

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for Ui

Source§

fn default() -> Ui

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Ui

§

impl RefUnwindSafe for Ui

§

impl Send for Ui

§

impl Sync for Ui

§

impl Unpin for Ui

§

impl UnwindSafe for Ui

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.