Control Surface master
MIDI Control Surface library for Arduino
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
DisplayElement Class Referenceabstract

#include <Display/DisplayElement.hpp>

Detailed Description

An interface for elements that draw to a display.

Definition at line 11 of file DisplayElement.hpp.

+ Inheritance diagram for DisplayElement:
+ Collaboration diagram for DisplayElement:

Enabling and disabling display elements

void enable ()
 Enable this display element: insert it into the linked list of instances, so it gets drawn to the display. More...
 
void disable ()
 Disable this display element: remove it from the linked list of instances, so it no longer gets drawn to the display. More...
 
bool isEnabled () const
 Check if this display element is enabled. More...
 
static void enable (DisplayElement *element)
 Enable this display element: insert it into the linked list of instances, so it gets drawn to the display. More...
 
static void enable (DisplayElement &element)
 Enable this display element: insert it into the linked list of instances, so it gets drawn to the display. More...
 
template<class U , size_t N>
static void enable (U(&array)[N])
 Enable this display element: insert it into the linked list of instances, so it gets drawn to the display. More...
 
static void disable (DisplayElement *element)
 Disable this display element: remove it from the linked list of instances, so it no longer gets drawn to the display. More...
 
static void disable (DisplayElement &element)
 Disable this display element: remove it from the linked list of instances, so it no longer gets drawn to the display. More...
 
template<class U , size_t N>
static void disable (U(&array)[N])
 Disable this display element: remove it from the linked list of instances, so it no longer gets drawn to the display. More...
 

Public Member Functions

virtual ~DisplayElement ()
 
virtual void draw ()=0
 Draw this DisplayElement to the display buffer. More...
 
virtual bool getDirty () const =0
 Check if this DisplayElement has to be re-drawn. More...
 
DisplayInterfacegetDisplay ()
 Get a reference to the display that this element draws to. More...
 
const DisplayInterfacegetDisplay () const
 Get a const reference to the display that this element draws to. More...
 

Static Public Member Functions

static DoublyLinkedList< DisplayElement > & getAll ()
 Get the list of all DisplayElement instances. More...
 

Protected Member Functions

 DisplayElement (DisplayInterface &display)
 Create a new DisplayElement. More...
 

Protected Attributes

DisplayInterfacedisplay
 
DisplayElementnext
 
DisplayElementprevious
 

Static Protected Attributes

static DoublyLinkedList< DisplayElementelements
 

Constructor & Destructor Documentation

◆ DisplayElement()

DisplayElement ( DisplayInterface display)
inlineprotected

Create a new DisplayElement.

Parameters
displayThe display that this display element draws to.

Definition at line 17 of file DisplayElement.hpp.

◆ ~DisplayElement()

virtual ~DisplayElement ( )
inlinevirtual

Definition at line 86 of file DisplayElement.hpp.

Member Function Documentation

◆ enable() [1/4]

void enable ( )
inlineprotected

Enable this display element: insert it into the linked list of instances, so it gets drawn to the display.

Definition at line 33 of file DisplayElement.hpp.

◆ disable() [1/4]

void disable ( )
inlineprotected

Disable this display element: remove it from the linked list of instances, so it no longer gets drawn to the display.

Definition at line 43 of file DisplayElement.hpp.

◆ isEnabled()

bool isEnabled ( ) const
inlineprotected

Check if this display element is enabled.

Note
Assumes that the element is not added to a different linked list by the user.

Definition at line 57 of file DisplayElement.hpp.

◆ enable() [2/4]

static void enable ( DisplayElement element)
inlinestaticprotected

Enable this display element: insert it into the linked list of instances, so it gets drawn to the display.

Definition at line 62 of file DisplayElement.hpp.

◆ enable() [3/4]

static void enable ( DisplayElement element)
inlinestaticprotected

Enable this display element: insert it into the linked list of instances, so it gets drawn to the display.

Definition at line 64 of file DisplayElement.hpp.

◆ enable() [4/4]

static void enable ( U(&)  array[N])
inlinestaticprotected

Enable this display element: insert it into the linked list of instances, so it gets drawn to the display.

Definition at line 67 of file DisplayElement.hpp.

◆ disable() [2/4]

static void disable ( DisplayElement element)
inlinestaticprotected

Disable this display element: remove it from the linked list of instances, so it no longer gets drawn to the display.

Definition at line 73 of file DisplayElement.hpp.

◆ disable() [3/4]

static void disable ( DisplayElement element)
inlinestaticprotected

Disable this display element: remove it from the linked list of instances, so it no longer gets drawn to the display.

Definition at line 75 of file DisplayElement.hpp.

◆ disable() [4/4]

static void disable ( U(&)  array[N])
inlinestaticprotected

Disable this display element: remove it from the linked list of instances, so it no longer gets drawn to the display.

Definition at line 78 of file DisplayElement.hpp.

◆ draw()

virtual void draw ( )
pure virtual

◆ getDirty()

virtual bool getDirty ( ) const
pure virtual

◆ getDisplay() [1/2]

DisplayInterface & getDisplay ( )
inline

Get a reference to the display that this element draws to.

Definition at line 95 of file DisplayElement.hpp.

◆ getDisplay() [2/2]

const DisplayInterface & getDisplay ( ) const
inline

Get a const reference to the display that this element draws to.

Definition at line 97 of file DisplayElement.hpp.

◆ getAll()

static DoublyLinkedList< DisplayElement > & getAll ( )
inlinestatic

Get the list of all DisplayElement instances.

Definition at line 100 of file DisplayElement.hpp.

Member Data Documentation

◆ display

DisplayInterface& display
protected

Definition at line 103 of file DisplayElement.hpp.

◆ elements

DoublyLinkedList< DisplayElement > elements
staticprotected

Definition at line 105 of file DisplayElement.hpp.

◆ next

DisplayElement * next
protectedinherited

Definition at line 324 of file LinkedList.hpp.

◆ previous

DisplayElement * previous
protectedinherited

Definition at line 325 of file LinkedList.hpp.


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