Struct alacritty::display::Display

source ·
pub struct Display {
Show 22 fields pub window: Window, pub size_info: SizeInfo, pub highlighted_hint: Option<HintMatch>, pub vi_highlighted_hint: Option<HintMatch>, pub is_wayland: bool, pub cursor_hidden: bool, pub visual_bell: VisualBell, pub colors: List, pub hint_state: HintState, pub pending_update: DisplayUpdate, pub pending_renderer_update: Option<RendererUpdate>, pub ime: Ime, pub frame_timer: FrameTimer, hint_mouse_point: Option<Point>, renderer: ManuallyDrop<Renderer>, surface: ManuallyDrop<Surface<WindowSurface>>, context: ManuallyDrop<Replaceable<PossiblyCurrentContext>>, debug_damage: bool, damage_rects: Vec<DamageRect>, next_frame_damage_rects: Vec<DamageRect>, glyph_cache: GlyphCache, meter: Meter,
}
Expand description

The display wraps a window, font rasterizer, and GPU renderer.

Fields§

§window: Window§size_info: SizeInfo§highlighted_hint: Option<HintMatch>

Hint highlighted by the mouse.

§vi_highlighted_hint: Option<HintMatch>

Hint highlighted by the vi mode cursor.

§is_wayland: bool§cursor_hidden: bool

UI cursor visibility for blinking.

§visual_bell: VisualBell§colors: List

Mapped RGB values for each terminal color.

§hint_state: HintState

State of the keyboard hints.

§pending_update: DisplayUpdate

Unprocessed display updates.

§pending_renderer_update: Option<RendererUpdate>

The renderer update that takes place only once before the actual rendering.

§ime: Ime

The ime on the given display.

§frame_timer: FrameTimer

The state of the timer for frame scheduling.

§hint_mouse_point: Option<Point>§renderer: ManuallyDrop<Renderer>§surface: ManuallyDrop<Surface<WindowSurface>>§context: ManuallyDrop<Replaceable<PossiblyCurrentContext>>§debug_damage: bool§damage_rects: Vec<DamageRect>§next_frame_damage_rects: Vec<DamageRect>§glyph_cache: GlyphCache§meter: Meter

Implementations§

source§

impl Display

source

pub fn new( window: Window, gl_context: NotCurrentContext, config: &UiConfig ) -> Result<Display, Error>

source

pub fn gl_context(&self) -> &PossiblyCurrentContext

source

pub fn make_not_current(&mut self)

source

pub fn make_current(&self)

source

fn swap_buffers(&self)

source

fn update_font_size( glyph_cache: &mut GlyphCache, scale_factor: f64, config: &UiConfig, font: &Font ) -> (f32, f32)

Update font size and cell dimensions.

This will return a tuple of the cell width and height.

source

fn reset_glyph_cache(&mut self)

Reset glyph cache.

source

pub fn handle_update<T>( &mut self, terminal: &mut Term<T>, pty_resize_handle: &mut dyn OnResize, message_buffer: &MessageBuffer, search_active: bool, config: &UiConfig )where T: EventListener,

Process update events.

source

pub fn process_renderer_update(&mut self)

Update the state of the renderer.

source

fn fully_damage(&mut self)

Damage the entire window.

source

fn update_damage<T: EventListener>( &mut self, terminal: &mut MutexGuard<'_, Term<T>>, selection_range: Option<SelectionRange>, search_state: &SearchState )

source

pub fn draw<T: EventListener>( &mut self, terminal: MutexGuard<'_, Term<T>>, scheduler: &mut Scheduler, message_buffer: &MessageBuffer, config: &UiConfig, search_state: &SearchState )

Draw the screen.

A reference to Term whose state is being drawn must be provided.

This call may block if vsync is enabled.

source

pub fn update_config(&mut self, config: &UiConfig)

Update to a new configuration.

source

pub fn update_highlighted_hints<T>( &mut self, term: &Term<T>, config: &UiConfig, mouse: &Mouse, modifiers: ModifiersState ) -> bool

Update the mouse/vi mode cursor hint highlighting.

This will return whether the highlighted hints changed.

source

fn draw_ime_preview( &mut self, point: Point<usize>, fg: Rgb, bg: Rgb, rects: &mut Vec<RenderRect>, config: &UiConfig )

Format search regex to account for the cursor and fullwidth characters.

Draw preview for the currently highlighted Hyperlink.

Draw current search regex.

source

fn draw_render_timer(&mut self, config: &UiConfig)

Draw render timer.

source

fn draw_line_indicator( &mut self, config: &UiConfig, total_lines: usize, obstructed_column: Option<Column>, line: usize )

Draw an indicator for the position of a line in history.

source

fn damage_from_point(&self, point: Point<usize>, len: u32) -> DamageRect

Damage len starting from a point.

This method also enqueues damage for the next frame automatically.

source

fn damage_highlighted_hints<T: EventListener>(&self, terminal: &mut Term<T>)

Damage currently highlighted Display hints.

source

fn collect_damage(&self) -> bool

Returns true if damage information should be collected, false otherwise.

source

fn highlight_damage(&self, render_rects: &mut Vec<RenderRect>)

Highlight damaged rects.

This function is for debug purposes only.

source

fn request_frame(&mut self, scheduler: &mut Scheduler)

Requst a new frame for a window on Wayland.

Trait Implementations§

source§

impl Drop for Display

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Display

§

impl !Send for Display

§

impl !Sync for Display

§

impl Unpin for Display

§

impl !UnwindSafe for Display

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.