A rectangular grid of Pixel.
More...
|
| | Screen (int dimx, int dimy) |
| std::string & | at (int x, int y) |
| | Access a character in a cell at a given position.
|
| const std::string & | at (int x, int y) const |
| | Access a character in a cell at a given position.
|
| Pixel & | PixelAt (int x, int y) |
| | Access a cell (Pixel) at a given position.
|
| const Pixel & | PixelAt (int x, int y) const |
| | Access a cell (Pixel) at a given position.
|
| std::string | ToString () const |
| void | Print () const |
| int | dimx () const |
| int | dimy () const |
| std::string | ResetPosition (bool clear=false) const |
| | Return a string to be printed in order to reset the cursor position to the beginning of the screen.
|
| void | Clear () |
| | Clear all the pixel from the screen.
|
| void | ApplyShader () |
| Cursor | cursor () const |
| void | SetCursor (Cursor cursor) |
| uint8_t | RegisterHyperlink (const std::string &link) |
| const std::string & | Hyperlink (uint8_t id) const |
◆ Screen()
| Screen |
( |
int | dimx, |
|
|
int | dimy ) |
◆ Create() [1/2]
Create a screen with the given dimension.
- Examples
- examples/dom/border.cpp, examples/dom/border_colored.cpp, examples/dom/border_style.cpp, examples/dom/canvas.cpp, examples/dom/color_gallery.cpp, examples/dom/color_info_palette256.cpp, examples/dom/color_truecolor_HSV.cpp, examples/dom/color_truecolor_RGB.cpp, examples/dom/dbox.cpp, examples/dom/graph.cpp, examples/dom/gridbox.cpp, examples/dom/hflow.cpp, examples/dom/html_like.cpp, examples/dom/linear_gradient.cpp, examples/dom/package_manager.cpp, examples/dom/paragraph.cpp, examples/dom/separator.cpp, examples/dom/separator_style.cpp, examples/dom/size.cpp, examples/dom/spinner.cpp, examples/dom/style_blink.cpp, examples/dom/style_bold.cpp, examples/dom/style_color.cpp, examples/dom/style_dim.cpp, examples/dom/style_gallery.cpp, examples/dom/style_hyperlink.cpp, examples/dom/style_inverted.cpp, examples/dom/style_strikethrough.cpp, examples/dom/style_underlined.cpp, examples/dom/style_underlined_double.cpp, examples/dom/table.cpp, examples/dom/vbox_hbox.cpp, and examples/dom/vflow.cpp.
Definition at line 391 of file screen.cpp.
◆ Create() [2/2]
Create a screen with the given dimension along the x-axis and y-axis.
Definition at line 385 of file screen.cpp.
◆ at() [1/2]
| std::string & at |
( |
int | x, |
|
|
int | y ) |
Access a character in a cell at a given position.
- Parameters
-
| x | The cell position along the x-axis. |
| y | The cell position along the y-axis. |
Definition at line 456 of file screen.cpp.
◆ at() [2/2]
| const std::string & at |
( |
int | x, |
|
|
int | y ) const |
Access a character in a cell at a given position.
- Parameters
-
| x | The cell position along the x-axis. |
| y | The cell position along the y-axis. |
Definition at line 463 of file screen.cpp.
◆ PixelAt() [1/2]
| Pixel & PixelAt |
( |
int | x, |
|
|
int | y ) |
Access a cell (Pixel) at a given position.
- Parameters
-
| x | The cell position along the x-axis. |
| y | The cell position along the y-axis. |
Definition at line 470 of file screen.cpp.
◆ PixelAt() [2/2]
| const Pixel & PixelAt |
( |
int | x, |
|
|
int | y ) const |
Access a cell (Pixel) at a given position.
- Parameters
-
| x | The cell position along the x-axis. |
| y | The cell position along the y-axis. |
Definition at line 477 of file screen.cpp.
◆ ToString()
| std::string ToString |
( |
| ) |
const |
Produce a std::string that can be used to print the Screen on the terminal.
- Note
- Don't forget to flush stdout. Alternatively, you can use Screen::Print();
Definition at line 416 of file screen.cpp.
◆ Print()
◆ dimx()
◆ dimy()
◆ ResetPosition()
| std::string ResetPosition |
( |
bool | clear = false | ) |
const |
Return a string to be printed in order to reset the cursor position to the beginning of the screen.
std::string reset_position;
while(true) {
auto document = render();
std::cout << reset_position << screen.ToString() << std::flush;
reset_position = screen.ResetPosition();
using namespace std::chrono_literals;
std::this_thread::sleep_for(0.01s);
}
static Screen Create(Dimensions dimension)
Create a screen with the given dimension.
Dimensions Fit(Element &)
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
- Returns
- The string to print in order to reset the cursor position to the beginning.
Definition at line 500 of file screen.cpp.
◆ Clear()
Clear all the pixel from the screen.
Definition at line 519 of file screen.cpp.
◆ ApplyShader()
◆ cursor()
◆ SetCursor()
| void SetCursor |
( |
Cursor | cursor | ) |
|
|
inline |
◆ RegisterHyperlink()
| uint8_t RegisterHyperlink |
( |
const std::string & | link | ) |
|
◆ Hyperlink()
| const std::string & Hyperlink |
( |
uint8_t | id | ) |
const |
◆ stencil
◆ dimx_
◆ dimy_
◆ pixels_
| std::vector<std::vector<Pixel> > pixels_ |
|
protected |
◆ cursor_
◆ hyperlinks_
| std::vector<std::string> hyperlinks_ = {""} |
|
protected |
The documentation for this class was generated from the following files: