pub struct CellRenderer { /* private fields */ }Implementations§
Source§impl CellRenderer
impl CellRenderer
pub fn clear_glyph_cache(&mut self)
Source§impl CellRenderer
impl CellRenderer
pub fn set_background_image( &mut self, path: Option<&str>, mode: BackgroundImageMode, opacity: f32, )
pub fn update_background_image_opacity(&mut self, opacity: f32)
pub fn update_background_image_opacity_only(&mut self, opacity: f32)
Sourcepub fn get_background_as_channel_texture(&self) -> Option<ChannelTexture>
pub fn get_background_as_channel_texture(&self) -> Option<ChannelTexture>
Create a ChannelTexture from the current background image for use in custom shaders.
Returns None if no background image is loaded. The returned ChannelTexture shares the same underlying texture data with the cell renderer’s background image - no copy is made.
Sourcepub fn has_background_image(&self) -> bool
pub fn has_background_image(&self) -> bool
Check if a background image is currently loaded.
Sourcepub fn is_solid_color_background(&self) -> bool
pub fn is_solid_color_background(&self) -> bool
Check if a solid color background is currently set.
Sourcepub fn solid_background_color(&self) -> [f32; 3]
pub fn solid_background_color(&self) -> [f32; 3]
Get the solid background color as normalized RGB values. Returns the color even if not in solid color mode.
Sourcepub fn get_solid_color_as_clear(&self) -> Option<Color>
pub fn get_solid_color_as_clear(&self) -> Option<Color>
Get the solid background color as a wgpu::Color with window_opacity applied. Returns None if not in solid color mode.
Sourcepub fn create_solid_color_texture(&mut self, color: [u8; 3])
pub fn create_solid_color_texture(&mut self, color: [u8; 3])
Create a solid color texture for use as background.
Creates a small (4x4) texture filled with the specified color. Uses Stretch mode for solid colors to fill the entire window. Transparency is controlled by window_opacity, not the texture alpha.
Sourcepub fn get_solid_color_as_channel_texture(
&self,
color: [u8; 3],
) -> ChannelTexture
pub fn get_solid_color_as_channel_texture( &self, color: [u8; 3], ) -> ChannelTexture
Create a ChannelTexture from a solid color for shader iChannel0.
Creates a small texture with the specified color that can be used as a channel texture in custom shaders. The texture is fully opaque; window_opacity controls overall transparency.
Sourcepub fn set_background(
&mut self,
mode: BackgroundMode,
color: [u8; 3],
image_path: Option<&str>,
image_mode: BackgroundImageMode,
image_opacity: f32,
image_enabled: bool,
)
pub fn set_background( &mut self, mode: BackgroundMode, color: [u8; 3], image_path: Option<&str>, image_mode: BackgroundImageMode, image_opacity: f32, image_enabled: bool, )
Set background based on mode (Default, Color, or Image).
This unified method handles all background types and should be used instead of calling individual methods directly.
Source§impl CellRenderer
impl CellRenderer
pub fn render( &mut self, _show_scrollbar: bool, pane_background: Option<&PaneBackground>, ) -> Result<SurfaceTexture>
Sourcepub fn render_to_texture(
&mut self,
target_view: &TextureView,
skip_background_image: bool,
) -> Result<SurfaceTexture>
pub fn render_to_texture( &mut self, target_view: &TextureView, skip_background_image: bool, ) -> Result<SurfaceTexture>
Render terminal content to an intermediate texture for shader processing.
§Arguments
target_view- The texture view to render toskip_background_image- If true, skip rendering the background image. Use this when a custom shader will handle the background image via iChannel0 instead.
Note: Solid color backgrounds are NOT rendered here. For cursor shaders, the solid color is passed to the shader’s render function as the clear color instead.
Sourcepub fn render_background_only(
&self,
target_view: &TextureView,
clear_first: bool,
) -> Result<bool>
pub fn render_background_only( &self, target_view: &TextureView, clear_first: bool, ) -> Result<bool>
Render only the background (image or solid color) to a view.
This is useful for split pane rendering where the background should be rendered once full-screen before rendering each pane’s cells on top.
§Arguments
target_view- The texture view to render toclear_first- If true, clear the surface before rendering
§Returns
true if a background image was rendered, false if only clear color was used
Sourcepub fn render_to_view(&self, target_view: &TextureView) -> Result<()>
pub fn render_to_view(&self, target_view: &TextureView) -> Result<()>
Render terminal content to a view for screenshots. This renders without requiring the surface texture.
pub fn render_overlays( &mut self, surface_texture: &SurfaceTexture, show_scrollbar: bool, ) -> Result<()>
Sourcepub fn render_pane_to_view(
&mut self,
surface_view: &TextureView,
viewport: &PaneViewport,
cells: &[Cell],
cols: usize,
rows: usize,
cursor_pos: Option<(usize, usize)>,
cursor_opacity: f32,
show_scrollbar: bool,
clear_first: bool,
skip_background_image: bool,
separator_marks: &[SeparatorMark],
pane_background: Option<&PaneBackground>,
) -> Result<()>
pub fn render_pane_to_view( &mut self, surface_view: &TextureView, viewport: &PaneViewport, cells: &[Cell], cols: usize, rows: usize, cursor_pos: Option<(usize, usize)>, cursor_opacity: f32, show_scrollbar: bool, clear_first: bool, skip_background_image: bool, separator_marks: &[SeparatorMark], pane_background: Option<&PaneBackground>, ) -> Result<()>
Render a single pane’s content within a viewport to an existing surface texture
This method renders cells to a specific region of the render target, using a GPU scissor rect to clip to the pane bounds.
§Arguments
surface_view- The texture view to render toviewport- The pane’s viewport (position, size, focus state, opacity)cells- The cells to render (should match viewport grid size)cols- Number of columns in the cell gridrows- Number of rows in the cell gridcursor_pos- Cursor position (col, row) within this pane, or None if no cursorcursor_opacity- Cursor opacity (0.0 = hidden, 1.0 = fully visible)show_scrollbar- Whether to render the scrollbar for this paneclear_first- If true, clears the viewport region before renderingskip_background_image- If true, skip rendering the background image. Use this when the background image has already been rendered full-screen (for split panes).
Source§impl CellRenderer
impl CellRenderer
pub async fn new( window: Arc<Window>, font_family: Option<&str>, font_family_bold: Option<&str>, font_family_italic: Option<&str>, font_family_bold_italic: Option<&str>, font_ranges: &[FontRange], font_size: f32, cols: usize, rows: usize, window_padding: f32, line_spacing: f32, char_spacing: f32, scrollbar_position: &str, scrollbar_width: f32, scrollbar_thumb_color: [f32; 4], scrollbar_track_color: [f32; 4], enable_text_shaping: bool, enable_ligatures: bool, enable_kerning: bool, font_antialias: bool, font_hinting: bool, font_thin_strokes: ThinStrokesMode, minimum_contrast: f32, vsync_mode: VsyncMode, power_preference: PowerPreference, window_opacity: f32, background_color: [u8; 3], background_image_path: Option<&str>, background_image_mode: BackgroundImageMode, background_image_opacity: f32, ) -> Result<Self>
pub fn device(&self) -> &Device
pub fn queue(&self) -> &Queue
pub fn surface_format(&self) -> TextureFormat
pub fn cell_width(&self) -> f32
pub fn cell_height(&self) -> f32
pub fn window_padding(&self) -> f32
pub fn content_offset_y(&self) -> f32
Sourcepub fn set_content_offset_y(&mut self, offset: f32) -> Option<(usize, usize)>
pub fn set_content_offset_y(&mut self, offset: f32) -> Option<(usize, usize)>
Set the vertical content offset (e.g., tab bar height at top). Returns Some((cols, rows)) if grid size changed, None otherwise.
pub fn content_offset_x(&self) -> f32
Sourcepub fn set_content_offset_x(&mut self, offset: f32) -> Option<(usize, usize)>
pub fn set_content_offset_x(&mut self, offset: f32) -> Option<(usize, usize)>
Set the horizontal content offset (e.g., tab bar on left). Returns Some((cols, rows)) if grid size changed, None otherwise.
pub fn content_inset_bottom(&self) -> f32
Sourcepub fn set_content_inset_bottom(&mut self, inset: f32) -> Option<(usize, usize)>
pub fn set_content_inset_bottom(&mut self, inset: f32) -> Option<(usize, usize)>
Set the bottom content inset (e.g., tab bar at bottom). Returns Some((cols, rows)) if grid size changed, None otherwise.
pub fn content_inset_right(&self) -> f32
Sourcepub fn set_content_inset_right(&mut self, inset: f32) -> Option<(usize, usize)>
pub fn set_content_inset_right(&mut self, inset: f32) -> Option<(usize, usize)>
Set the right content inset (e.g., AI Inspector panel). Returns Some((cols, rows)) if grid size changed, None otherwise.
pub fn grid_size(&self) -> (usize, usize)
pub fn keep_text_opaque(&self) -> bool
pub fn resize(&mut self, width: u32, height: u32) -> (usize, usize)
Sourcepub fn update_cells(&mut self, new_cells: &[Cell]) -> bool
pub fn update_cells(&mut self, new_cells: &[Cell]) -> bool
Update cells. Returns true if any row actually changed.
Sourcepub fn clear_all_cells(&mut self)
pub fn clear_all_cells(&mut self)
Clear all cells and mark all rows as dirty.
Sourcepub fn update_cursor(
&mut self,
pos: (usize, usize),
opacity: f32,
style: CursorStyle,
) -> bool
pub fn update_cursor( &mut self, pos: (usize, usize), opacity: f32, style: CursorStyle, ) -> bool
Update cursor position, opacity and style. Returns true if anything changed.
pub fn clear_cursor(&mut self) -> bool
Sourcepub fn update_cursor_color(&mut self, color: [u8; 3])
pub fn update_cursor_color(&mut self, color: [u8; 3])
Update cursor color
Sourcepub fn update_cursor_text_color(&mut self, color: Option<[u8; 3]>)
pub fn update_cursor_text_color(&mut self, color: Option<[u8; 3]>)
Update cursor text color (color of text under block cursor)
Set whether cursor should be hidden when cursor shader is active.
Returns true if the value changed.
Sourcepub fn set_focused(&mut self, focused: bool) -> bool
pub fn set_focused(&mut self, focused: bool) -> bool
Set window focus state (affects unfocused cursor rendering).
Returns true if the value changed.
Sourcepub fn update_cursor_guide(&mut self, enabled: bool, color: [u8; 4])
pub fn update_cursor_guide(&mut self, enabled: bool, color: [u8; 4])
Update cursor guide settings
Sourcepub fn update_cursor_shadow(
&mut self,
enabled: bool,
color: [u8; 4],
offset: [f32; 2],
blur: f32,
)
pub fn update_cursor_shadow( &mut self, enabled: bool, color: [u8; 4], offset: [f32; 2], blur: f32, )
Update cursor shadow settings
Sourcepub fn update_cursor_boost(&mut self, intensity: f32, color: [u8; 3])
pub fn update_cursor_boost(&mut self, intensity: f32, color: [u8; 3])
Update cursor boost settings
Sourcepub fn update_unfocused_cursor_style(&mut self, style: UnfocusedCursorStyle)
pub fn update_unfocused_cursor_style(&mut self, style: UnfocusedCursorStyle)
Update unfocused cursor style
pub fn update_scrollbar( &mut self, scroll_offset: usize, visible_lines: usize, total_lines: usize, marks: &[ScrollbackMark], )
Sourcepub fn update_scrollbar_for_pane(
&mut self,
scroll_offset: usize,
visible_lines: usize,
total_lines: usize,
marks: &[ScrollbackMark],
viewport: &PaneViewport,
)
pub fn update_scrollbar_for_pane( &mut self, scroll_offset: usize, visible_lines: usize, total_lines: usize, marks: &[ScrollbackMark], viewport: &PaneViewport, )
Update scrollbar state constrained to a specific pane’s bounds.
Converts the pane viewport (pixel bounds) into the inset parameters
that Scrollbar::update expects, so the track and thumb are confined
to the pane instead of spanning the full window.
pub fn set_visual_bell_intensity(&mut self, intensity: f32)
pub fn update_opacity(&mut self, opacity: f32)
Sourcepub fn set_transparency_affects_only_default_background(&mut self, value: bool)
pub fn set_transparency_affects_only_default_background(&mut self, value: bool)
Set whether transparency affects only default background cells. When true, non-default (colored) backgrounds remain opaque for readability.
Sourcepub fn set_keep_text_opaque(&mut self, value: bool)
pub fn set_keep_text_opaque(&mut self, value: bool)
Set whether text should always be rendered at full opacity. When true, text remains opaque regardless of window transparency settings.
pub fn set_link_underline_style(&mut self, style: LinkUnderlineStyle)
Sourcepub fn update_command_separator(
&mut self,
enabled: bool,
thickness: f32,
opacity: f32,
exit_color: bool,
color: [u8; 3],
)
pub fn update_command_separator( &mut self, enabled: bool, thickness: f32, opacity: f32, exit_color: bool, color: [u8; 3], )
Update command separator settings from config
Sourcepub fn set_separator_marks(&mut self, marks: Vec<SeparatorMark>) -> bool
pub fn set_separator_marks(&mut self, marks: Vec<SeparatorMark>) -> bool
Set the visible separator marks for the current frame.
Returns true if the marks changed.
Sourcepub fn set_gutter_indicators(&mut self, indicators: Vec<(usize, [f32; 4])>)
pub fn set_gutter_indicators(&mut self, indicators: Vec<(usize, [f32; 4])>)
Set the gutter indicator data for the current frame.
Each entry is (screen_row, [r, g, b, a]) for the gutter background.
Sourcepub fn update_scale_factor(&mut self, scale_factor: f64)
pub fn update_scale_factor(&mut self, scale_factor: f64)
Update scale factor and recalculate all font metrics and cell dimensions. This is called when the window is dragged between displays with different DPIs.
pub fn update_window_padding(&mut self, padding: f32) -> Option<(usize, usize)>
pub fn update_scrollbar_appearance( &mut self, width: f32, thumb_color: [f32; 4], track_color: [f32; 4], )
pub fn update_scrollbar_position(&mut self, position: &str)
pub fn scrollbar_contains_point(&self, x: f32, y: f32) -> bool
pub fn scrollbar_thumb_bounds(&self) -> Option<(f32, f32)>
pub fn scrollbar_track_contains_x(&self, x: f32) -> bool
pub fn scrollbar_mouse_y_to_scroll_offset(&self, mouse_y: f32) -> Option<usize>
Sourcepub fn scrollbar_mark_at_position(
&self,
mouse_x: f32,
mouse_y: f32,
tolerance: f32,
) -> Option<&ScrollbackMark>
pub fn scrollbar_mark_at_position( &self, mouse_x: f32, mouse_y: f32, tolerance: f32, ) -> Option<&ScrollbackMark>
Find a scrollbar mark at the given mouse position for tooltip display.
Returns the mark if mouse is within tolerance pixels of a mark.
pub fn reconfigure_surface(&mut self)
Sourcepub fn update_font_antialias(&mut self, enabled: bool) -> bool
pub fn update_font_antialias(&mut self, enabled: bool) -> bool
Update font anti-aliasing setting Returns true if the setting changed (requiring glyph cache clear)
Sourcepub fn update_font_hinting(&mut self, enabled: bool) -> bool
pub fn update_font_hinting(&mut self, enabled: bool) -> bool
Update font hinting setting Returns true if the setting changed (requiring glyph cache clear)
Sourcepub fn update_font_thin_strokes(&mut self, mode: ThinStrokesMode) -> bool
pub fn update_font_thin_strokes(&mut self, mode: ThinStrokesMode) -> bool
Update thin strokes mode Returns true if the setting changed (requiring glyph cache clear)
Sourcepub fn update_minimum_contrast(&mut self, ratio: f32) -> bool
pub fn update_minimum_contrast(&mut self, ratio: f32) -> bool
Update minimum contrast ratio Returns true if the setting changed (requiring redraw)
Sourcepub fn supported_present_modes(&self) -> &[PresentMode]
pub fn supported_present_modes(&self) -> &[PresentMode]
Get the list of supported present modes for this surface
Sourcepub fn is_vsync_mode_supported(&self, mode: VsyncMode) -> bool
pub fn is_vsync_mode_supported(&self, mode: VsyncMode) -> bool
Check if a vsync mode is supported
Sourcepub fn update_vsync_mode(&mut self, mode: VsyncMode) -> (VsyncMode, bool)
pub fn update_vsync_mode(&mut self, mode: VsyncMode) -> (VsyncMode, bool)
Update the vsync mode. Returns the actual mode applied (may differ if requested mode unsupported). Also returns whether the mode was changed.
Sourcepub fn current_vsync_mode(&self) -> VsyncMode
pub fn current_vsync_mode(&self) -> VsyncMode
Get the current vsync mode
pub fn update_graphics( &mut self, _graphics: &[TerminalGraphic], _scroll_offset: usize, _scrollback_len: usize, _visible_lines: usize, ) -> Result<()>
Auto Trait Implementations§
impl !Freeze for CellRenderer
impl !RefUnwindSafe for CellRenderer
impl Send for CellRenderer
impl Sync for CellRenderer
impl Unpin for CellRenderer
impl UnsafeUnpin for CellRenderer
impl !UnwindSafe for CellRenderer
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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more