The Pedigree Project
0.1
|
#include <Terminal.h>
Public Member Functions | |
Terminal (char *pName, size_t nWidth, size_t nHeight, size_t offsetLeft, size_t offsetTop, rgb_t *pBackground, cairo_t *pCairo, class Widget *pWidget, class Tui *pTui, class Font *pNormalFont, class Font *pBoldFont) | |
bool | initialise () |
bool | isAlive () |
void | renewBuffer (size_t nWidth, size_t nHeight) |
void | processKey (uint64_t key) |
void | clearQueue () |
char | getFromQueue () |
size_t | queueLength () |
int | getSelectFd () const |
void | write (const char *pStr, DirtyRectangle &rect) |
void | setHasPendingRequest (bool b, size_t sz) |
bool | hasPendingRequest () |
size_t | getPendingRequestSz () |
void | setActive (bool b, DirtyRectangle &rect) |
size_t | getRows () |
size_t | getCols () |
void | redrawAll (DirtyRectangle &rect) |
void | refresh () |
rgb_t * | getBuffer () |
int | getPid () |
void | showCursor (DirtyRectangle &rect) |
void | hideCursor (DirtyRectangle &rect) |
void | setCursorStyle (bool bFilled=true) |
void | cancel () |
void | setCairo (cairo_t *pCairo, cairo_surface_t *pSurface) |
void | setFonts (Font *pNormalFont, Font *pBoldFont) |
Private Member Functions | |
Terminal (const Terminal &) | |
Terminal & | operator= (const Terminal &) |
void | addToQueue (char c, bool bFlush=false) |
Private Attributes | |
rgb_t * | m_pBuffer |
PedigreeGraphics::Framebuffer * | m_pFramebuffer |
Xterm * | m_pXterm |
char | m_pName [256] |
char | m_pQueue [256] |
size_t | m_Len |
char | m_pWriteBuffer [4] |
size_t | m_WriteBufferLen |
bool | m_bHasPendingRequest |
size_t | m_PendingRequestSz |
int | m_Pid |
int | m_MasterPty |
size_t | m_OffsetLeft |
size_t | m_OffsetTop |
volatile char | m_Cancel |
volatile bool | m_WriteInProgress |
Friends | |
class | Xterm |
A Terminal is a wrapper around an Xterm class - it provides UTF-8 <-> UTF-32 conversion and input queueing.
Definition at line 38 of file Terminal.h.
|
inline |
Cancels the current write operation (used by SIGINT handling)
Definition at line 148 of file Terminal.h.
void Terminal::clearQueue | ( | ) |
Wipes out the queue for this terminal.
Definition at line 270 of file Terminal.cc.
char Terminal::getFromQueue | ( | ) |
Grabs 1 byte of the utf-8 encoded queue.
Definition at line 256 of file Terminal.cc.
|
inline |
Gets descriptor to select() on for readability to see if we have pending output.
Definition at line 74 of file Terminal.h.
References PedigreeGraphics::Framebuffer::getHeight(), PedigreeGraphics::Framebuffer::getWidth(), PedigreeGraphics::Framebuffer::redraw(), Xterm::renderAll(), and write().
Referenced by Tui::run().
bool Terminal::initialise | ( | ) |
Definition at line 85 of file Terminal.cc.
Referenced by Tui::initialise(), and TextIO::writeStr().
bool Terminal::isAlive | ( | ) |
Verifies whether the terminal and its child are alive.
Definition at line 225 of file Terminal.cc.
Referenced by Tui::run().
void Terminal::processKey | ( | uint64_t | key | ) |
Adds a 64-bit keycode from the Keyboard class.
Definition at line 251 of file Terminal.cc.
Referenced by Tui::keyInput().
|
inline |
Returns the queue length.
Definition at line 67 of file Terminal.h.
void Terminal::renewBuffer | ( | size_t | nWidth, |
size_t | nHeight | ||
) |
Kills and recreates the terminal's buffer, with a change in size.
Definition at line 240 of file Terminal.cc.
Referenced by Tui::resize().
void Terminal::write | ( | const char * | pStr, |
DirtyRectangle & | rect | ||
) |
Writes the given UTF-8 sequence to the Xterm.
Definition at line 275 of file Terminal.cc.
Referenced by getSelectFd(), and Tui::run().