|
SatCat5
|
Required API for display devices.
The generic Display class sets the API for user-defined objects that executes each DrawCmd, by overriding draw() and scroll(). Boolean methods return true if the command was executed or discarded, or false if the device is busy (i.e., retry later).
Definition at line 105 of file gui_display.h.
#include <gui_display.h>
Public Member Functions | |
| virtual bool | draw (const satcat5::gui::Cursor &cursor, const satcat5::gui::DrawCmd &cmd)=0 |
| Draw pixels to the screen at the designated location. More... | |
| virtual bool | scroll (s16 rows) |
| Optional: Advance the predefined viewport by N pixels. More... | |
| u16 | height () const |
| Total size of the display, in pixels. | |
| u16 | width () const |
| Total size of the display, in pixels. | |
Protected Member Functions | |
| Display (u16 h, u16 w) | |
| Constructor sets the size of this display in pixels. More... | |
Protected Attributes | |
| const u16 | m_height |
| Total size of the display, in pixels. More... | |
| const u16 | m_width |
|
inlineprotected |
Constructor sets the size of this display in pixels.
(Only the child can access the constructor and destructor.)
Definition at line 130 of file gui_display.h.
|
pure virtual |
Draw pixels to the screen at the designated location.
Child class MUST implement this method. Returns false if the command should be repeated.
Implemented in satcat5::gui::FileDisplay, and satcat5::device::spi::Ili9341.
|
inlinevirtual |
Optional: Advance the predefined viewport by N pixels.
Positive values scroll down, wrapping upper rows to the bottom of viewport. Negative values scroll up. Child class MAY implement this method if applicable. Returns false if the command should be repeated.
Reimplemented in satcat5::device::spi::Ili9341.
Definition at line 119 of file gui_display.h.
|
protected |
Total size of the display, in pixels.
The child must set these parameters in the constructor.
Definition at line 135 of file gui_display.h.