pub struct Display {Show 23 fields
pub window: Window,
pub size_info: SizeInfo,
pub highlighted_hint: Option<HintMatch>,
highlighted_hint_age: usize,
pub vi_highlighted_hint: Option<HintMatch>,
vi_highlighted_hint_age: usize,
pub raw_window_handle: RawWindowHandle,
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,
pub damage_tracker: DamageTracker,
pub font_size: Size,
hint_mouse_point: Option<Point>,
renderer: ManuallyDrop<Renderer>,
surface: ManuallyDrop<Surface<WindowSurface>>,
context: ManuallyDrop<Replaceable<PossiblyCurrentContext>>,
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.
highlighted_hint_age: usize
Frames since hint highlight was created.
vi_highlighted_hint: Option<HintMatch>
Hint highlighted by the vi mode cursor.
vi_highlighted_hint_age: usize
Frames since hint highlight was created.
raw_window_handle: RawWindowHandle
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.
damage_tracker: DamageTracker
Damage tracker for the given display.
font_size: Size
Font size used by the window.
hint_mouse_point: Option<Point>
§renderer: ManuallyDrop<Renderer>
§surface: ManuallyDrop<Surface<WindowSurface>>
§context: ManuallyDrop<Replaceable<PossiblyCurrentContext>>
§glyph_cache: GlyphCache
§meter: Meter
Implementations§
source§impl Display
impl Display
pub fn new( window: Window, gl_context: NotCurrentContext, config: &UiConfig, _tabbed: bool, ) -> Result<Display, Error>
pub fn gl_context(&self) -> &PossiblyCurrentContext
pub fn make_not_current(&mut self)
pub fn make_current(&self)
fn swap_buffers(&self)
sourcefn update_font_size(
glyph_cache: &mut GlyphCache,
config: &UiConfig,
font: &Font,
) -> (f32, f32)
fn update_font_size( glyph_cache: &mut GlyphCache, config: &UiConfig, font: &Font, ) -> (f32, f32)
Update font size and cell dimensions.
This will return a tuple of the cell width and height.
sourcefn reset_glyph_cache(&mut self)
fn reset_glyph_cache(&mut self)
Reset glyph cache.
sourcepub fn handle_update<T>(
&mut self,
terminal: &mut Term<T>,
pty_resize_handle: &mut dyn OnResize,
message_buffer: &MessageBuffer,
search_state: &mut SearchState,
config: &UiConfig,
)where
T: EventListener,
pub fn handle_update<T>(
&mut self,
terminal: &mut Term<T>,
pty_resize_handle: &mut dyn OnResize,
message_buffer: &MessageBuffer,
search_state: &mut SearchState,
config: &UiConfig,
)where
T: EventListener,
Process update events.
sourcepub fn process_renderer_update(&mut self)
pub fn process_renderer_update(&mut self)
Update the state of the renderer.
sourcepub fn draw<T: EventListener>(
&mut self,
terminal: MutexGuard<'_, Term<T>>,
scheduler: &mut Scheduler,
message_buffer: &MessageBuffer,
config: &UiConfig,
search_state: &mut SearchState,
)
pub fn draw<T: EventListener>( &mut self, terminal: MutexGuard<'_, Term<T>>, scheduler: &mut Scheduler, message_buffer: &MessageBuffer, config: &UiConfig, search_state: &mut SearchState, )
Draw the screen.
A reference to Term whose state is being drawn must be provided.
This call may block if vsync is enabled.
sourcepub fn update_config(&mut self, config: &UiConfig)
pub fn update_config(&mut self, config: &UiConfig)
Update to a new configuration.
sourcepub fn update_highlighted_hints<T>(
&mut self,
term: &Term<T>,
config: &UiConfig,
mouse: &Mouse,
modifiers: ModifiersState,
) -> bool
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.
fn draw_ime_preview( &mut self, point: Point<usize>, fg: Rgb, bg: Rgb, rects: &mut Vec<RenderRect>, config: &UiConfig, )
sourcefn format_search(
search_regex: &str,
search_label: &str,
max_width: usize,
) -> String
fn format_search( search_regex: &str, search_label: &str, max_width: usize, ) -> String
Format search regex to account for the cursor and fullwidth characters.
sourcefn draw_hyperlink_preview(
&mut self,
config: &UiConfig,
cursor_point: Option<Point>,
display_offset: usize,
)
fn draw_hyperlink_preview( &mut self, config: &UiConfig, cursor_point: Option<Point>, display_offset: usize, )
Draw preview for the currently highlighted Hyperlink
.
sourcefn draw_search(&mut self, config: &UiConfig, text: &str)
fn draw_search(&mut self, config: &UiConfig, text: &str)
Draw current search regex.
sourcefn draw_render_timer(&mut self, config: &UiConfig)
fn draw_render_timer(&mut self, config: &UiConfig)
Draw render timer.
sourcefn draw_line_indicator(
&mut self,
config: &UiConfig,
total_lines: usize,
obstructed_column: Option<Column>,
line: usize,
)
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.
sourcefn highlight_damage(&self, render_rects: &mut Vec<RenderRect>)
fn highlight_damage(&self, render_rects: &mut Vec<RenderRect>)
Highlight damaged rects.
This function is for debug purposes only.
sourcefn validate_hint_highlights(&mut self, display_offset: usize)
fn validate_hint_highlights(&mut self, display_offset: usize)
Check whether a hint highlight needs to be cleared.
sourcefn request_frame(&mut self, scheduler: &mut Scheduler)
fn request_frame(&mut self, scheduler: &mut Scheduler)
Request a new frame for a window on Wayland.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Display
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.