9#ifndef MAXOS_DRIVERS_CONSOLE_H
10#define MAXOS_DRIVERS_CONSOLE_H
17namespace MaxOS::drivers::console {
29 virtual uint16_t
width();
72 uint16_t
width()
override;
73 uint16_t
height()
override;
99 uint16_t m_cursor_x { 0 };
100 uint16_t m_cursor_y { 0 };
A stream that strings can be written to.
A console that is a subsection of another console, limited by a width and height.
char get_character(uint16_t x, uint16_t y) override
Return the character at the given coordinates if the coordinates are within the console area.
common::ConsoleColour get_foreground_color(uint16_t x, uint16_t y) override
Return the foreground color of the character at the given coordinates if the coordinates are within t...
void set_background_color(uint16_t x, uint16_t y, common::ConsoleColour background) override
Change the background color of a character on the console area if the coordinates are within the area...
uint16_t height() override
Return the height of the console area.
void scroll_up() override
Scroll the console area up by 1 line.
void put_character(uint16_t x, uint16_t y, char c) override
Place a character on the console area if the coordinates are within the area.
void set_foreground_color(uint16_t x, uint16_t y, common::ConsoleColour foreground) override
Change the foreground color of a character on the console area if the coordinates are within the area...
common::ConsoleColour get_background_color(uint16_t x, uint16_t y) override
Return the background color of the character at the given coordinates if the coordinates are within t...
uint16_t width() override
Return the width of the console area.
A stream that can be used to write to a console.
void write_char(char c) override
write a character to the console stream
void set_cursor(uint16_t x, uint16_t y)
Set the m_position of the cursor.
Abstract class for a console, allows for the printing of characters and strings with colours.
virtual void set_foreground_color(uint16_t x, uint16_t y, common::ConsoleColour foreground)
Set the foreground color of a character on the console.
virtual common::ConsoleColour get_background_color(uint16_t x, uint16_t y)
Get the background color of a character on the console.
virtual void scroll_up()
Scroll the entire console up by 1 line.
virtual char get_character(uint16_t x, uint16_t y)
Get the character at a given coordinate on the console.
virtual uint16_t height()
Get the height of the console in characters.
virtual void put_string(uint16_t x, uint16_t y, string s, common::ConsoleColour foreground=common::ConsoleColour::LightGrey, common::ConsoleColour background=common::ConsoleColour::Black)
Put a string on the console.
virtual void put_character(uint16_t x, uint16_t y, char c)
Put a character on the console.
virtual void invert_colors(uint16_t x, uint16_t y)
Invert the colors of a character on the console.
virtual uint16_t width()
Get the width of the console in characters.
virtual common::ConsoleColour get_foreground_color(uint16_t x, uint16_t y)
Get the background color of a character on the console.
virtual void set_background_color(uint16_t x, uint16_t y, common::ConsoleColour background)
Set the background color of a character on the console.
Defines a Colour class for representing colours in RGBA format, along with ANSI and console colour en...
ConsoleColour
Enumeration of console colour codes.
Defines OutputStream and GenericOutputStream classes for writing data to streams.