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
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
impl Display
pub fn new( window: Window, gl_context: NotCurrentContext, config: &UiConfig ) -> 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,
scale_factor: f64,
config: &UiConfig,
font: &Font
) -> (f32, f32)
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.
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_active: bool,
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_active: bool, 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.
sourcefn fully_damage(&mut self)
fn fully_damage(&mut self)
Damage the entire window.
fn update_damage<T: EventListener>( &mut self, terminal: &mut MutexGuard<'_, Term<T>>, selection_range: Option<SelectionRange>, search_state: &SearchState )
sourcepub fn draw<T: EventListener>(
&mut self,
terminal: MutexGuard<'_, Term<T>>,
scheduler: &mut Scheduler,
message_buffer: &MessageBuffer,
config: &UiConfig,
search_state: &SearchState
)
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.
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 damage_from_point(&self, point: Point<usize>, len: u32) -> DamageRect
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.
sourcefn damage_highlighted_hints<T: EventListener>(&self, terminal: &mut Term<T>)
fn damage_highlighted_hints<T: EventListener>(&self, terminal: &mut Term<T>)
Damage currently highlighted Display
hints.
sourcefn collect_damage(&self) -> bool
fn collect_damage(&self) -> bool
Returns true
if damage information should be collected, false
otherwise.
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 request_frame(&mut self, scheduler: &mut Scheduler)
fn request_frame(&mut self, scheduler: &mut Scheduler)
Requst a new frame for a window on Wayland.