pub(crate) struct CursorManager {
pub mc_x: i32,
pub mc_y: i32,
pub mc_visible: bool,
pub mc_save: [u32; 192],
pub tc_col: usize,
pub tc_row: usize,
pub tc_w: usize,
pub tc_h: usize,
pub tc_visible: bool,
pub tc_color: u32,
pub tc_save: [u32; 1024],
}Expand description
Holds all cursor-related state for the framebuffer terminal.
Mouse cursor – a small arrow sprite that can be saved/restored/drawn. Text cursor – a blinking underline / block that follows the text input position.
Fields§
§mc_x: i32§mc_y: i32§mc_visible: bool§mc_save: [u32; 192]§tc_col: usize§tc_row: usize§tc_w: usize§tc_h: usize§tc_visible: bool§tc_color: u32§tc_save: [u32; 1024]Implementations§
Source§impl CursorManager
impl CursorManager
Sourcepub fn mc_save_hw(&mut self, canvas: &CanvasBuffer)
pub fn mc_save_hw(&mut self, canvas: &CanvasBuffer)
Save the pixels under the mouse cursor into mc_save.
Sourcepub fn mc_draw_hw(&mut self, canvas: &mut CanvasBuffer, fmt: &PixelFormat)
pub fn mc_draw_hw(&mut self, canvas: &mut CanvasBuffer, fmt: &PixelFormat)
Draw the mouse cursor sprite onto the hardware framebuffer.
Sourcepub fn mc_erase_hw(&mut self, canvas: &mut CanvasBuffer)
pub fn mc_erase_hw(&mut self, canvas: &mut CanvasBuffer)
Erase the mouse cursor by restoring the saved pixels.
Sourcepub fn update_mouse_cursor(
&mut self,
x: i32,
y: i32,
canvas: &mut CanvasBuffer,
fmt: &PixelFormat,
) -> bool
pub fn update_mouse_cursor( &mut self, x: i32, y: i32, canvas: &mut CanvasBuffer, fmt: &PixelFormat, ) -> bool
Update mouse cursor position (save old area, redraw at new position).
Sourcepub fn hide_mouse_cursor(&mut self, canvas: &mut CanvasBuffer)
pub fn hide_mouse_cursor(&mut self, canvas: &mut CanvasBuffer)
Hide the mouse cursor.
Sourcepub fn text_cursor_rect(
&self,
col: usize,
row: usize,
glyph_w: usize,
glyph_h: usize,
) -> (usize, usize, usize, usize)
pub fn text_cursor_rect( &self, col: usize, row: usize, glyph_w: usize, glyph_h: usize, ) -> (usize, usize, usize, usize)
Calculate the pixel rectangle for the text cursor at (col, row).
Sourcepub fn text_cursor_save_hw(
&mut self,
col: usize,
row: usize,
glyph_w: usize,
glyph_h: usize,
canvas: &CanvasBuffer,
)
pub fn text_cursor_save_hw( &mut self, col: usize, row: usize, glyph_w: usize, glyph_h: usize, canvas: &CanvasBuffer, )
Save the pixels under the text cursor.
Sourcepub fn text_cursor_draw_hw(
&mut self,
col: usize,
row: usize,
glyph_w: usize,
glyph_h: usize,
color: u32,
canvas: &mut CanvasBuffer,
)
pub fn text_cursor_draw_hw( &mut self, col: usize, row: usize, glyph_w: usize, glyph_h: usize, color: u32, canvas: &mut CanvasBuffer, )
Draw the text cursor (inverted-colour block) on the hardware framebuffer.
Sourcepub fn text_cursor_erase_hw(
&mut self,
col: usize,
row: usize,
glyph_w: usize,
glyph_h: usize,
canvas: &mut CanvasBuffer,
)
pub fn text_cursor_erase_hw( &mut self, col: usize, row: usize, glyph_w: usize, glyph_h: usize, canvas: &mut CanvasBuffer, )
Erase the text cursor by restoring the saved pixels.
Sourcepub fn draw_text_cursor_overlay(
&mut self,
col: usize,
row: usize,
glyph_w: usize,
glyph_h: usize,
color: u32,
canvas: &mut CanvasBuffer,
)
pub fn draw_text_cursor_overlay( &mut self, col: usize, row: usize, glyph_w: usize, glyph_h: usize, color: u32, canvas: &mut CanvasBuffer, )
Draw the text cursor as a solid-colour overlay at the given position.
Sourcepub fn hide_text_cursor(
&mut self,
col: usize,
row: usize,
glyph_w: usize,
glyph_h: usize,
canvas: &mut CanvasBuffer,
)
pub fn hide_text_cursor( &mut self, col: usize, row: usize, glyph_w: usize, glyph_h: usize, canvas: &mut CanvasBuffer, )
Hide the text cursor.
Auto Trait Implementations§
impl Freeze for CursorManager
impl RefUnwindSafe for CursorManager
impl Send for CursorManager
impl Sync for CursorManager
impl Unpin for CursorManager
impl UnsafeUnpin for CursorManager
impl UnwindSafe for CursorManager
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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