terminalgui  0.1.0
Widgets for your terminal, powered by Qt! Create textual GUI (TUI) in your console easily.
Signals | Public Member Functions | Static Public Member Functions | Properties | List of all members
Tg::Terminal Class Reference

Cross-platform representation of terminal window. More...

#include <tgterminal.h>

Inheritance diagram for Tg::Terminal:
Inheritance graph
[legend]
Collaboration diagram for Tg::Terminal:
Collaboration graph
[legend]

Signals

void sizeChanged (const QSize &size) const
 Emitted when terminal window changes size to size.
 

Public Member Functions

 Terminal (QObject *parent=nullptr)
 Constructs a new Terminal object as a child of parent object. More...
 
 ~Terminal ()
 Makes terminal go boom!
 
QSize terminalWindowSize () const
 Reads the underlying terminal window size and returns it.
 
QSize size () const
 Returns current size of the Terminal.
 
void setSize (const QSize &newSize)
 Resizes Terminal instance to newSize. More...
 

Static Public Member Functions

static TerminalglobalTerminal ()
 Returns Singleton Terminal instance. More...
 
static QPoint cursorPosition ()
 Returns current position of keyboard cursor. More...
 
static int keyboardBufferSize ()
 Returns number of characters available in keyboard buffer. More...
 
static int getChar ()
 Retrieves a single character from the keyboard buffer. More...
 

Properties

QSize size
 Size of the terminal window.
 

Detailed Description

Cross-platform representation of terminal window.

Contains some basic APIs used by Widget and its subclasses. This class is internal, there should be no need to use it in user code.

Todo:
Further refactor the API to be more Qt-like. We don't need getChar(), for example, the class could hold keyboard buffer locally and notify Screen when needed via a signal.

Constructor & Destructor Documentation

◆ Terminal()

Tg::Terminal::Terminal ( QObject *  parent = nullptr)

Constructs a new Terminal object as a child of parent object.

Typically it is parented under Screen.

Member Function Documentation

◆ cursorPosition()

QPoint Tg::Terminal::cursorPosition ( )
static

Returns current position of keyboard cursor.

Note
Unused.

◆ getChar()

int Tg::Terminal::getChar ( )
static

Retrieves a single character from the keyboard buffer.

See also
keyboardBufferSize

◆ globalTerminal()

Tg::Terminal * Tg::Terminal::globalTerminal ( )
static

Returns Singleton Terminal instance.

Note
This is a WIP. Terminal will either become a full singleton, or multiple instances will be allowed.

◆ keyboardBufferSize()

int Tg::Terminal::keyboardBufferSize ( )
static

Returns number of characters available in keyboard buffer.

See also
getChar

◆ setSize()

void Tg::Terminal::setSize ( const QSize &  newSize)

Resizes Terminal instance to newSize.

Note
This is not fully implemented or tested.

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