![]() |
Max OS 0.3
|
A console that is a subsection of another console, limited by a width and height. More...
#include <console.h>
Public Member Functions | |
| ConsoleArea (Console *console, uint16_t left, uint16_t top, uint16_t width, uint16_t height) | |
| Construct a new Console Area object. | |
| ConsoleArea (Console *console, uint16_t left, uint16_t top, uint16_t width, uint16_t height, common::ConsoleColour foreground, common::ConsoleColour background) | |
| Construct a new Console Area object with specified foreground and background colors. | |
| uint16_t | width () override |
| Return the width of the console area. | |
| uint16_t | height () override |
| Return the height of the console area. | |
| 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. | |
| 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. | |
| void | scroll_up () override |
| Scroll the console area up by 1 line. | |
| void | scroll_up (uint16_t left, uint16_t top, uint16_t width, uint16_t height, common::ConsoleColour foreground=common::ConsoleColour::LightGrey, common::ConsoleColour background=common::ConsoleColour::Black, char fill=' ') override |
| Scroll an area of the console up by 1 line. | |
| 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 the console 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 the console area. | |
Public Member Functions inherited from MaxOS::drivers::console::Console | |
| virtual void | put_character (uint16_t x, uint16_t y, char c, common::ConsoleColour foreground, common::ConsoleColour background) |
| Put a character on the console with a given foreground and background color. | |
| 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 | clear () |
| virtual void | clear (uint16_t left, uint16_t top, uint16_t width, uint16_t height, common::ConsoleColour foreground=common::ConsoleColour::LightGrey, common::ConsoleColour background=common::ConsoleColour::Black, char fill=' ') |
| Clear an area of the console. | |
| virtual void | invert_colors (uint16_t x, uint16_t y) |
| Invert the colors of a character on the console. | |
A console that is a subsection of another console, limited by a width and height.
| ConsoleArea::ConsoleArea | ( | Console * | console, |
| uint16_t | left, | ||
| uint16_t | top, | ||
| uint16_t | width, | ||
| uint16_t | height | ||
| ) |
Construct a new Console Area object.
| console | The console to create the area on |
| left | How far from the left the area starts |
| top | How far from the top the area starts |
| width | The width of the area |
| height | The height of the area |
Definition at line 231 of file console.cpp.
| ConsoleArea::ConsoleArea | ( | Console * | console, |
| uint16_t | left, | ||
| uint16_t | top, | ||
| uint16_t | width, | ||
| uint16_t | height, | ||
| common::ConsoleColour | foreground, | ||
| common::ConsoleColour | background | ||
| ) |
Construct a new Console Area object with specified foreground and background colors.
| console | The console to create the area on |
| left | How far from the left the area starts |
| top | How far from the top the area starts |
| width | The width of the area |
| height | The height of the area |
| foreground | The foreground color of the area |
| background | The background color of the area |
Definition at line 251 of file console.cpp.
References height(), MaxOS::drivers::console::Console::set_background_color(), MaxOS::drivers::console::Console::set_foreground_color(), and width().
|
overridevirtual |
Return the background color of the character at the given coordinates if the coordinates are within the console area.
| x | The x coordinate of the character |
| y | The y coordinate of the character |
Reimplemented from MaxOS::drivers::console::Console.
Definition at line 383 of file console.cpp.
References MaxOS::drivers::console::Console::get_background_color().
Return the character at the given coordinates if the coordinates are within the console area.
| x | The x coordinate of the character |
| y | The y coordinate of the character |
Reimplemented from MaxOS::drivers::console::Console.
Definition at line 348 of file console.cpp.
References MaxOS::drivers::console::Console::get_character().
|
overridevirtual |
Return the foreground color of the character at the given coordinates if the coordinates are within the console area.
| x | The x coordinate of the character |
| y | The y coordinate of the character |
Reimplemented from MaxOS::drivers::console::Console.
Definition at line 365 of file console.cpp.
References MaxOS::drivers::console::Console::get_foreground_color().
|
overridevirtual |
Return the height of the console area.
Reimplemented from MaxOS::drivers::console::Console.
Definition at line 283 of file console.cpp.
Referenced by ConsoleArea(), and scroll_up().
Place a character on the console area if the coordinates are within the area.
| x | The x coordinate of the character |
| y | The y coordinate of the character |
| c | The character to put on the console |
Reimplemented from MaxOS::drivers::console::Console.
Definition at line 294 of file console.cpp.
References MaxOS::drivers::console::Console::put_character().
|
overridevirtual |
Scroll the console area up by 1 line.
Reimplemented from MaxOS::drivers::console::Console.
Definition at line 396 of file console.cpp.
References MaxOS::drivers::console::Console::scroll_up().
|
overridevirtual |
Scroll an area of the console up by 1 line.
| left | The left coordinate of the area to scroll |
| top | The top coordinate of the area to scroll |
| width | The m_width of the area to scroll |
| height | The m_height of the area to scroll |
| foreground | The foreground color of the new line |
| background | The background color of the new line |
| fill | The character to fill the new line with |
Reimplemented from MaxOS::drivers::console::Console.
Definition at line 412 of file console.cpp.
References height(), MaxOS::drivers::console::Console::scroll_up(), and width().
|
overridevirtual |
Change the background color of a character on the console area if the coordinates are within the area.
| x | The x coordinate of the character |
| y | The y coordinate of the character |
| background | The background color of the character |
Reimplemented from MaxOS::drivers::console::Console.
Definition at line 330 of file console.cpp.
References MaxOS::drivers::console::Console::set_background_color().
|
overridevirtual |
Change the foreground color of a character on the console area if the coordinates are within the area.
| x | The x coordinate of the character |
| y | The y coordinate of the character |
| foreground | The foreground color of the character |
Reimplemented from MaxOS::drivers::console::Console.
Definition at line 312 of file console.cpp.
References MaxOS::drivers::console::Console::set_foreground_color().
|
overridevirtual |
Return the width of the console area.
Reimplemented from MaxOS::drivers::console::Console.
Definition at line 274 of file console.cpp.
Referenced by ConsoleArea(), and scroll_up().