[−][src]Trait vga::writers::TextWriter
A helper trait used to interact with various vga text modes.
Required methods
fn set_mode(&self)
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)
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)
Clears the screen by setting all cells to b' '
with
a background color of Color16::Black
and a foreground
color of Color16::Yellow
.
fn disable_cursor(&self)
Disables the cursor in vga text modes.
fn enable_cursor(&self)
Enables the cursor in vga text modes.
fn read_character(&self, x: usize, y: usize) -> ScreenCharacter
Returns the ScreenCharacter
at the given (x, y)
position.
fn set_cursor(&self, scan_line_start: u8, scan_line_end: u8)
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)
Sets the current text cursor to the position specified by
x
and y
.
fn write_character(&self, x: usize, y: usize, screen_character: ScreenCharacter)
Prints the given character
and color
at (x, y)
.