Skip to main content

VgaWriter

Struct VgaWriter 

Source
pub struct VgaWriter { /* private fields */ }

Implementations§

Source§

impl VgaWriter

Source

pub const fn new() -> Self

Creates a new instance.

Source

pub fn set_color(&mut self, fg: Color, bg: Color)

Sets color.

Source

pub fn set_rgb_color(&mut self, fg: RgbColor, bg: RgbColor)

Sets rgb color.

Source

pub fn text_colors(&self) -> (RgbColor, RgbColor)

Performs the text colors operation.

Source

pub fn width(&self) -> usize

Performs the width operation.

Source

pub fn height(&self) -> usize

Performs the height operation.

Source

pub fn cols(&self) -> usize

Performs the cols operation.

Source

pub fn rows(&self) -> usize

Performs the rows operation.

Source

pub fn glyph_size(&self) -> (usize, usize)

Performs the glyph size operation.

Source

pub fn set_cursor_cell(&mut self, col: usize, row: usize)

Sets cursor cell.

Source

pub fn enabled(&self) -> bool

Performs the enabled operation.

Source

pub fn framebuffer_info(&self) -> FramebufferInfo

Performs the framebuffer info operation.

Source

pub fn set_clip_rect(&mut self, x: usize, y: usize, width: usize, height: usize)

Sets clip rect.

Source

pub fn reset_clip_rect(&mut self)

Performs the reset clip rect operation.

Source

pub fn enable_double_buffer(&mut self) -> bool

Enables double buffer.

Source

pub fn disable_double_buffer(&mut self, present: bool)

Disables double buffer.

Source

pub fn present(&mut self)

Performs the present operation.

Source

pub fn update_mouse_cursor(&mut self, x: i32, y: i32)

Updates mouse cursor.

Source

pub fn hide_mouse_cursor(&mut self)

Performs the hide mouse cursor operation.

Source

pub fn pixel_to_sb_pos(&self, px: usize, py: usize) -> Option<(usize, usize)>

Performs the pixel to sb pos operation.

Source

pub fn start_selection(&mut self, px: usize, py: usize)

Starts selection.

Source

pub fn update_selection(&mut self, px: usize, py: usize)

Updates selection.

Source

pub fn end_selection(&mut self)

Performs the end selection operation.

Source

pub fn clear_selection(&mut self)

Performs the clear selection operation.

Source

pub fn clear_with(&mut self, color: RgbColor)

Performs the clear with operation.

Source

pub fn clear(&mut self)

Performs the clear operation.

Source

pub fn draw_pixel(&mut self, x: usize, y: usize, color: RgbColor)

Performs the draw pixel operation.

Source

pub fn draw_pixel_alpha( &mut self, x: usize, y: usize, color: RgbColor, alpha: u8, )

Performs the draw pixel alpha operation.

Source

pub fn draw_line( &mut self, x0: isize, y0: isize, x1: isize, y1: isize, color: RgbColor, )

Performs the draw line operation.

Source

pub fn draw_rect( &mut self, x: usize, y: usize, width: usize, height: usize, color: RgbColor, )

Performs the draw rect operation.

Source

pub fn fill_rect( &mut self, x: usize, y: usize, width: usize, height: usize, color: RgbColor, )

Performs the fill rect operation.

Source

pub fn fill_rect_alpha( &mut self, x: usize, y: usize, width: usize, height: usize, color: RgbColor, alpha: u8, )

Performs the fill rect alpha operation.

Source

pub fn blit_rgb( &mut self, dst_x: usize, dst_y: usize, src_width: usize, src_height: usize, pixels: &[RgbColor], ) -> bool

Performs the blit rgb operation.

Source

pub fn blit_rgb24( &mut self, dst_x: usize, dst_y: usize, src_width: usize, src_height: usize, bytes: &[u8], ) -> bool

Performs the blit rgb24 operation.

Source

pub fn blit_rgba( &mut self, dst_x: usize, dst_y: usize, src_width: usize, src_height: usize, bytes: &[u8], global_alpha: u8, ) -> bool

Performs the blit rgba operation.

Source

pub fn blit_sprite_rgba( &mut self, dst_x: usize, dst_y: usize, sprite: SpriteRgba<'_>, global_alpha: u8, ) -> bool

Performs the blit sprite rgba operation.

Source

pub fn draw_text_at( &mut self, pixel_x: usize, pixel_y: usize, text: &str, fg: RgbColor, bg: RgbColor, )

Performs the draw text at operation.

Source

pub fn measure_text( &self, text: &str, max_width: Option<usize>, wrap: bool, ) -> TextMetrics

Performs the measure text operation.

Source

pub fn draw_text( &mut self, pixel_x: usize, pixel_y: usize, text: &str, opts: TextOptions, ) -> TextMetrics

Performs the draw text operation.

Source

pub fn draw_strata_stack( &mut self, origin_x: usize, origin_y: usize, layer_w: usize, layer_h: usize, )

Performs the draw strata stack operation.

Source

pub fn scroll_view_up(&mut self, lines: usize)

Scroll the view up (backward in history) by lines lines.

Source

pub fn scroll_view_down(&mut self, lines: usize)

Scroll the view down (forward, toward live) by lines lines.

Source

pub fn scroll_to_live(&mut self)

Immediately return to the live (bottom) view.

Source

pub fn scrollbar_click(&mut self, px_x: usize, px_y: usize)

Handle a click at pixel (px_x, px_y) — if it falls in the scrollbar, jump the view to the corresponding scroll position.

Source

pub fn scrollbar_drag_to(&mut self, px_y: usize)

Drag the scrollbar thumb to vertical pixel px_y.

Unlike scrollbar_click, this only depends on Y and is intended for click-and-drag interactions where the pointer may slightly leave the scrollbar strip horizontally.

Source

pub fn scrollbar_hit_test(&self, px_x: usize, px_y: usize) -> bool

Returns true if the pixel coordinates fall within the scrollbar strip.

Trait Implementations§

Source§

impl Write for VgaWriter

Source§

fn write_str(&mut self, s: &str) -> Result

Writes str.

1.1.0 · Source§

fn write_char(&mut self, c: char) -> Result<(), Error>

Writes a char into this writer, returning whether the write succeeded. Read more
1.0.0 · Source§

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Glue for usage of the write! macro with implementors of this trait. Read more
Source§

impl Send for VgaWriter

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.