Shellminator V3.0.1
Simple Terminal
Loading...
Searching...
No Matches
ShellminatorScreen Class Reference

This is an abstract object for graphics element creation. More...

#include <Shellminator-Screen.hpp>

Inheritance diagram for ShellminatorScreen:
Collaboration diagram for ShellminatorScreen:

Public Member Functions

virtual void draw (bool noClear=false)
 Draw function. More...
 
virtual void init (Shellminator *parent_p, Stream *channel_p)
 Init function. More...
 
virtual void setOrigin (int x, int y)
 Origin of the top left corner. More...
 
virtual void update (int width_p, int height_p)
 Update function. More...
 
virtual void forceRedraw ()
 
int left ()
 Return the coordinate of the left column next to the object. More...
 
int right ()
 Return the coordinate of the right column next to the object. More...
 
int up ()
 Return the coordinate of the upper row next to the object. More...
 
int down ()
 Return the coordinate of the lower row next to the object. More...
 
ShellminatorgetParent ()
 
void attachEndFunction (void(*end_func_p)(Shellminator *))
 
void removeEndFunction ()
 

Public Attributes

int row = 1
 It is used by the grid layout. More...
 
int column = 1
 It is used by the grid layout. More...
 
int columnSpan = 1
 It is used by the grid layout. More...
 
int rowSpan = 1
 It is used by the grid layout. More...
 
ShellminatorScreennextElement = NULL
 It is used by the grid layout. More...
 
void(*)(Shellminator *) getEndFunction ()
 

Protected Attributes

Shellminatorparent = NULL
 Pointer to the caller terminal object. More...
 
Stream * channel = NULL
 
int width = 1
 Actual width of the object. More...
 
int height = 1
 Actual height of the object. More...
 
int originX = 1
 X coordinate of the origin. More...
 
int originY = 1
 Y coordinate of the origin. More...
 
void(* end_func )(Shellminator *) = NULL
 

Detailed Description

This is an abstract object for graphics element creation.

You can inherit from this object to create graphical object for the terminal.

Definition at line 47 of file Shellminator-Screen.hpp.

Member Function Documentation

◆ attachEndFunction()

void ShellminatorScreen::attachEndFunction ( void(*)(Shellminator *)  end_func_p)
inline

Definition at line 135 of file Shellminator-Screen.hpp.

◆ down()

int ShellminatorScreen::down ( )
inline

Return the coordinate of the lower row next to the object.

Definition at line 109 of file Shellminator-Screen.hpp.

◆ draw()

virtual void ShellminatorScreen::draw ( bool  noClear = false)
inlinevirtual

Draw function.

This function is called by the caller terminal if redraw is requested. If you need to draw your screen, the requestRedraw function must be called on the parent terminal object. The reason for this is to save some CPU time and do not waste it to draw something unnecessarily.

Reimplemented in ShellminatorButton, ShellminatorLevelMeter, ShellminatorList, ShellminatorNotification, ShellminatorPlot, ShellminatorProgress, and ShellminatorScreenGrid.

Definition at line 58 of file Shellminator-Screen.hpp.

◆ forceRedraw()

virtual void ShellminatorScreen::forceRedraw ( )
inlinevirtual

◆ getParent()

Shellminator * ShellminatorScreen::getParent ( )
inline

Definition at line 111 of file Shellminator-Screen.hpp.

◆ init()

virtual void ShellminatorScreen::init ( Shellminator parent_p,
Stream *  channel_p 
)
inlinevirtual

Init function.

This function is called by the host terminal, when the plot object gets registered to it. You can put all the initialisation section here.

Parameters
parent_pPointer to the caller terminal object.
channel_pThis is a pointer to a Stream object, which can be used to print the output data.
Note
Please use the channel_p object instead of parent -> channel method. This object can be a regular channel or a buffer accelerated one. The logic behind the buffering and flushing is handled by the caller terminal.

Reimplemented in ShellminatorButton, ShellminatorLevelMeter, ShellminatorListDetailed, ShellminatorList, ShellminatorNotification, ShellminatorPlot, ShellminatorProgress, and ShellminatorScreenGrid.

Definition at line 70 of file Shellminator-Screen.hpp.

◆ left()

int ShellminatorScreen::left ( )
inline

Return the coordinate of the left column next to the object.

Definition at line 100 of file Shellminator-Screen.hpp.

◆ removeEndFunction()

void ShellminatorScreen::removeEndFunction ( )
inline

Definition at line 136 of file Shellminator-Screen.hpp.

◆ right()

int ShellminatorScreen::right ( )
inline

Return the coordinate of the right column next to the object.

Definition at line 103 of file Shellminator-Screen.hpp.

◆ setOrigin()

virtual void ShellminatorScreen::setOrigin ( int  x,
int  y 
)
inlinevirtual

Origin of the top left corner.

You can specify a custom origin point for the object with this function.

Parameters
xX coordinate of the new origin( starts from 1 ).
yY coordinate of the new origin( starts from 1 ).
Note
The origin of the object is always the top left corner.

Definition at line 78 of file Shellminator-Screen.hpp.

Here is the caller graph for this function:

◆ up()

int ShellminatorScreen::up ( )
inline

Return the coordinate of the upper row next to the object.

Definition at line 106 of file Shellminator-Screen.hpp.

◆ update()

virtual void ShellminatorScreen::update ( int  width_p,
int  height_p 
)
inlinevirtual

Update function.

The update function must be used to process events and not to draw the objects. It is called much frequently than, the draw function. All the event handling should be done in the update function, including key and mouse detection along with various events.

Parameters
width_pThe width of the screen area in characters.
height_pThe height of the screen area in characters.

Reimplemented in ShellminatorButton, ShellminatorLevelMeter, ShellminatorList, ShellminatorNotification, ShellminatorPlot, ShellminatorProgress, and ShellminatorScreenGrid.

Definition at line 94 of file Shellminator-Screen.hpp.

Member Data Documentation

◆ channel

Stream* ShellminatorScreen::channel = NULL
protected

Definition at line 146 of file Shellminator-Screen.hpp.

◆ column

int ShellminatorScreen::column = 1

It is used by the grid layout.

It specifies the column of the widget.

Definition at line 120 of file Shellminator-Screen.hpp.

◆ columnSpan

int ShellminatorScreen::columnSpan = 1

It is used by the grid layout.

It specifies how many columns widget occupies.

Definition at line 124 of file Shellminator-Screen.hpp.

◆ end_func

void(* ShellminatorScreen::end_func) (Shellminator *) = NULL
protected

Definition at line 160 of file Shellminator-Screen.hpp.

◆ getEndFunction

void(*)(Shellminator *) ShellminatorScreen::getEndFunction()
inline

Definition at line 138 of file Shellminator-Screen.hpp.

◆ height

int ShellminatorScreen::height = 1
protected

Actual height of the object.

Definition at line 152 of file Shellminator-Screen.hpp.

◆ nextElement

ShellminatorScreen* ShellminatorScreen::nextElement = NULL

It is used by the grid layout.

The purpose of this is to create a 'chained' list of the used elements in the

Definition at line 133 of file Shellminator-Screen.hpp.

◆ originX

int ShellminatorScreen::originX = 1
protected

X coordinate of the origin.

Definition at line 155 of file Shellminator-Screen.hpp.

◆ originY

int ShellminatorScreen::originY = 1
protected

Y coordinate of the origin.

Definition at line 158 of file Shellminator-Screen.hpp.

◆ parent

Shellminator* ShellminatorScreen::parent = NULL
protected

Pointer to the caller terminal object.

Definition at line 144 of file Shellminator-Screen.hpp.

◆ row

int ShellminatorScreen::row = 1

It is used by the grid layout.

It specifies the row of the widget.

Definition at line 116 of file Shellminator-Screen.hpp.

◆ rowSpan

int ShellminatorScreen::rowSpan = 1

It is used by the grid layout.

It specifies how many rows widget occupies.

Definition at line 128 of file Shellminator-Screen.hpp.

◆ width

int ShellminatorScreen::width = 1
protected

Actual width of the object.

Definition at line 149 of file Shellminator-Screen.hpp.