SatCat5
satcat5::gui::Display Class Referenceabstract

Detailed Description

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>

Inheritance diagram for satcat5::gui::Display:
[legend]

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
 

Constructor & Destructor Documentation

◆ Display()

satcat5::gui::Display::Display ( u16  h,
u16  w 
)
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.

Member Function Documentation

◆ draw()

virtual bool satcat5::gui::Display::draw ( const satcat5::gui::Cursor cursor,
const satcat5::gui::DrawCmd cmd 
)
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.

◆ scroll()

virtual bool satcat5::gui::Display::scroll ( s16  rows)
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.

Member Data Documentation

◆ m_height

const u16 satcat5::gui::Display::m_height
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.


The documentation for this class was generated from the following file: