Trait vga::writers::TextWriter[][src]

pub trait TextWriter: Screen {
    fn set_mode(&self);

    fn get_frame_buffer(&self) -> (SpinlockGuard<'_, Vga>, *mut ScreenCharacter) { ... }
fn clear_screen(&self) { ... }
fn fill_screen(&self, character: ScreenCharacter) { ... }
fn disable_cursor(&self) { ... }
fn enable_cursor(&self) { ... }
fn read_character(&self, x: usize, y: usize) -> ScreenCharacter { ... }
fn set_cursor(&self, scan_line_start: u8, scan_line_end: u8) { ... }
fn set_cursor_position(&self, x: usize, y: usize) { ... }
fn write_character(
        &self,
        x: usize,
        y: usize,
        screen_character: ScreenCharacter
    ) { ... } }
Expand description

A helper trait used to interact with various vga text modes.

Required methods

fn set_mode(&self)[src]

Sets the graphics device to a video mode as determined by the TextWriter implementation.

Provided methods

fn get_frame_buffer(&self) -> (SpinlockGuard<'_, Vga>, *mut ScreenCharacter)[src]

Returns the start of the FrameBuffer as *mut ScreenCharacter as well as a lock to the vga driver. This ensures the vga driver stays locked while the frame buffer is in use.

fn clear_screen(&self)[src]

Clears the screen by setting all cells to b' ' with a background color of Color16::Black and a foreground color of Color16::Yellow.

fn fill_screen(&self, character: ScreenCharacter)[src]

Fills the screen by setting all cells to the given screen character.

fn disable_cursor(&self)[src]

Disables the cursor in vga text modes.

fn enable_cursor(&self)[src]

Enables the cursor in vga text modes.

fn read_character(&self, x: usize, y: usize) -> ScreenCharacter[src]

Returns the ScreenCharacter at the given (x, y) position.

fn set_cursor(&self, scan_line_start: u8, scan_line_end: u8)[src]

Sets the size of the cursor, as specified by scan_line_start and scan_line_end.

This field controls the appearance of the text mode cursor by specifying the scan line location within a character cell. The top most scan line is 0, with the bottom determined by CrtcControllerIndex::MaxiumumScanLine (usually 15). If scan_line_start > scan_line_end, the cursor isn’t drawn.

fn set_cursor_position(&self, x: usize, y: usize)[src]

Sets the current text cursor to the position specified by x and y.

fn write_character(&self, x: usize, y: usize, screen_character: ScreenCharacter)[src]

Prints the given character and color at (x, y).

Implementors

impl TextWriter for Text40x25[src]

fn set_mode(&self)[src]

Sets the graphics device to VideoMode::Mode40x25.

impl TextWriter for Text40x50[src]

fn set_mode(&self)[src]

Sets the graphics device to VideoMode::Mode40x50.

impl TextWriter for Text80x25[src]

fn set_mode(&self)[src]