pub struct Window {
cursor: (u8, u8),
hw_cursor: bool,
rect: Rect,
pub style: Attribute,
}
Expand description
The screen represents the cga screen or a part of it.
This class provides an interface to access the screen in text mode (also known as CGA mode), with access directly on the hardware level, i.e. the video memory and the I/O ports of the graphics card.
There can be multiple screes to different areas of the cga. However, only one of them should control the hw_cursor at the same time.
Fields§
§cursor: (u8, u8)
Cursor position
hw_cursor: bool
If the hardware cursor should be used
rect: Rect
Size of the screen
style: Attribute
Style
Implementations§
source§impl Window
impl Window
sourcepub const fn with_hw_cursor(self) -> Self
pub const fn with_hw_cursor(self) -> Self
Configure the window to use the hardware cursor.
sourcepub const fn with_style(self, attr: Attribute) -> Self
pub const fn with_style(self, attr: Attribute) -> Self
Configures the screen to use the given style.
sourcepub fn set_cursor(&mut self, pos: (u8, u8))
pub fn set_cursor(&mut self, pos: (u8, u8))
Move the cursor to pos
sourcepub fn get_cursor(&mut self) -> (u8, u8)
pub fn get_cursor(&mut self) -> (u8, u8)
Returns the cursor position.