GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
Vt102Emulation Class Reference

Provides an xterm compatible terminal emulation based on the DEC VT102 terminal. More...

#include "Vt102Emulation.h"

Inheritance diagram for Vt102Emulation:
Collaboration diagram for Vt102Emulation:

Public Slots

void receiveData (const char *buffer, int len)
 Processes an incoming stream of characters. More...
 
virtual void sendKeyEvent (QKeyEvent *)
 
virtual void sendMouseEvent (int buttons, int column, int line, int eventType)
 
virtual void sendString (const char *, int length=-1)
 
virtual void sendText (const QString &text)
 
virtual void setImageSize (int lines, int columns)
 Change the size of the emulation's image. More...
 

Signals

void changeTabTextColorRequest (int color)
 Requests that the color of the text used to represent the tabs associated with this emulation be changed. More...
 
void imageSizeChanged (int lineCount, int columnCount)
 Emitted when the program running in the terminal changes the screen size. More...
 
void lockPtyRequest (bool suspend)
 Requests that sending of input to the emulation from the terminal process be suspended or resumed. More...
 
void outputChanged ()
 Emitted when the contents of the screen image change. More...
 
void profileChangeCommandReceived (const QString &text)
 Emitted when the terminal program requests to change various properties of the terminal display. More...
 
void programBracketedPasteModeChanged (bool bracketedPasteMode)
 
void programUsesMouseChanged (bool usesMouse)
 This is emitted when the program running in the shell indicates whether or not it is interested in mouse events. More...
 
void sendData (const char *data, int len)
 Emitted when a buffer of data is ready to send to the standard input of the terminal. More...
 
void stateSet (int state)
 Emitted when the activity state of the emulation is set. More...
 
void titleChanged (int title, const QString &newTitle)
 Emitted when the program running in the terminal wishes to update the session's title. More...
 
void useUtf8Request (bool)
 Requests that the pty used by the terminal process be set to UTF 8 mode. More...
 

Public Member Functions

 Vt102Emulation ()
 Constructs a new emulation. More...
 
 ~Vt102Emulation ()
 
virtual void clearEntireScreen ()
 Copies the current image into the history and clears the screen. More...
 
void clearHistory ()
 Clears the history scroll. More...
 
const QTextCodec * codec ()
 Returns the codec used to decode incoming characters. More...
 
ScreenWindowcreateWindow ()
 Creates a new window onto the output from this emulation. More...
 
virtual char getErase () const
 TODO Document me. More...
 
const HistoryTypehistory ()
 Returns the history store used by this emulation. More...
 
QSize imageSize ()
 Returns the size of the screen image which the emulation produces. More...
 
QString keyBindings ()
 Returns the name of the emulation's current key bindings. More...
 
int lineCount ()
 Returns the total number of lines, including those stored in the history. More...
 
bool programBracketedPasteMode () const
 
bool programUsesMouse () const
 Returns true if the active terminal program wants mouse input events. More...
 
virtual void reset ()
 Resets the state of the terminal. More...
 
void setCodec (const QTextCodec *)
 Sets the codec used to decode incoming characters. More...
 
void setHistory (const HistoryType &)
 Sets the history store used by this emulation. More...
 
void setKeyBindings (const QString &name)
 Sets the key bindings used to key events ( received through sendKeyEvent() ) into character streams to send to the terminal. More...
 
bool utf8 ()
 Convenience method. More...
 
virtual void writeToStream (TerminalCharacterDecoder *decoder, int startLine, int endLine)
 Copies the output history from startLine to endLine into stream, using decoder to convert the terminal characters into text. More...
 

Protected Types

enum  EmulationCodec { LocaleCodec = 0 , Utf8Codec = 1 }
 

Protected Slots

void bufferedUpdate ()
 Schedules an update of attached views. More...
 

Protected Member Functions

virtual void receiveChar (int cc)
 Processes an incoming character. More...
 
virtual void resetMode (int mode)
 
void setCodec (EmulationCodec codec)
 
virtual void setMode (int mode)
 
void setScreen (int index)
 Sets the active screen. More...
 

Protected Attributes

const QTextCodec * _codec
 
Screen_currentScreen
 
QTextDecoder * _decoder
 
const KeyboardTranslator_keyTranslator
 
Screen_screen [2]
 
QList< ScreenWindow * > _windows
 

Private Slots

void bracketedPasteModeChanged (bool bracketedPasteMode)
 
void showBulk ()
 
void updateTitle ()
 
void usesMouseChanged (bool usesMouse)
 

Private Member Functions

void addArgument ()
 
void addDigit (int dig)
 
unsigned short applyCharset (unsigned short c)
 
void clearScreenAndSetColumns (int columnCount)
 
bool getMode (int mode)
 
void initTokenizer ()
 
void onScrollLock ()
 
void pushToToken (int cc)
 
void reportAnswerBack ()
 
void reportCursorPosition ()
 
void ReportErrorToken ()
 
void reportSecondaryAttributes ()
 
void reportStatus ()
 
void reportTerminalParms (int p)
 
void reportTerminalType ()
 
void resetCharset (int scrno)
 
void resetModes ()
 
void resetToken ()
 
void restoreCursor ()
 
void restoreMode (int mode)
 
void saveCursor ()
 
void saveMode (int mode)
 
void scan_buffer_report ()
 
void scrollLock (const bool lock)
 
void setAndUseCharset (int n, int cs)
 
void setCharset (int n, int cs)
 
void setDefaultMargins ()
 
void setMargins (int top, int bottom)
 
void tau (int code, int p, int q)
 
void useCharset (int n)
 
void XtermHack ()
 

Private Attributes

bool _bracketedPasteMode
 
QTimer _bulkTimer1
 
QTimer _bulkTimer2
 
CharCodes _charset [2]
 
DECpar _currParm
 
QHash< int, QString > _pendingTitleUpdates
 
DECpar _saveParm
 
QTimer * _titleUpdateTimer
 
bool _usesMouse
 
int argc
 
int argv [15]
 
int pbuf [80]
 
int ppos
 
int tbl [256]
 

Detailed Description

Provides an xterm compatible terminal emulation based on the DEC VT102 terminal.

A full description of this terminal can be found at http://vt100.net/docs/vt102-ug/

In addition, various additional xterm escape sequences are supported to provide features such as mouse input handling. See http://rtfm.etla.org/xterm/ctlseq.html for a description of xterm's escape sequences.

Definition at line 77 of file Vt102Emulation.h.

Member Enumeration Documentation

◆ EmulationCodec

enum Emulation::EmulationCodec
protectedinherited
Enumerator
LocaleCodec 
Utf8Codec 

Definition at line 410 of file Emulation.h.

Constructor & Destructor Documentation

◆ Vt102Emulation()

Vt102Emulation::Vt102Emulation ( )

Constructs a new emulation.

Definition at line 80 of file Vt102Emulation.cpp.

References _titleUpdateTimer, initTokenizer(), reset(), and updateTitle().

◆ ~Vt102Emulation()

Vt102Emulation::~Vt102Emulation ( )

Definition at line 92 of file Vt102Emulation.cpp.

Member Function Documentation

◆ addArgument()

void Vt102Emulation::addArgument ( )
private

Definition at line 218 of file Vt102Emulation.cpp.

References argc, argv, and MAXARGS.

Referenced by receiveChar().

◆ addDigit()

void Vt102Emulation::addDigit ( int  dig)
private

Definition at line 213 of file Vt102Emulation.cpp.

References argc, and argv.

Referenced by receiveChar().

◆ applyCharset()

unsigned short Vt102Emulation::applyCharset ( unsigned short  c)
private

Definition at line 1042 of file Vt102Emulation.cpp.

References CHARSET, and vt100_graphics.

Referenced by receiveChar().

◆ bracketedPasteModeChanged

void Emulation::bracketedPasteModeChanged ( bool  bracketedPasteMode)
privateslotinherited

Definition at line 91 of file Emulation.cpp.

References Emulation::_bracketedPasteMode.

Referenced by Emulation::Emulation().

◆ bufferedUpdate

void Emulation::bufferedUpdate ( )
protectedslotinherited

Schedules an update of attached views.

Repeated calls to bufferedUpdate() in close succession will result in only a single update, much like the Qt buffered update of widgets.

Definition at line 310 of file Emulation.cpp.

References Emulation::_bulkTimer1, Emulation::_bulkTimer2, BULK_TIMEOUT1, and BULK_TIMEOUT2.

Referenced by clearEntireScreen(), Emulation::createWindow(), Emulation::receiveData(), reset(), and Emulation::setImageSize().

◆ changeTabTextColorRequest

void Emulation::changeTabTextColorRequest ( int  color)
signalinherited

Requests that the color of the text used to represent the tabs associated with this emulation be changed.

This is a Konsole-specific extension from pre-KDE 4 times.

TODO: Document how the parameter works.

Referenced by tau().

◆ clearEntireScreen()

void Vt102Emulation::clearEntireScreen ( )
virtual

Copies the current image into the history and clears the screen.

Implements Emulation.

Definition at line 96 of file Vt102Emulation.cpp.

References Emulation::_currentScreen, Emulation::bufferedUpdate(), and Screen::clearEntireScreen().

Referenced by clearScreenAndSetColumns().

◆ clearHistory()

void Emulation::clearHistory ( )
inherited

Clears the history scroll.

Definition at line 147 of file Emulation.cpp.

References Emulation::_screen, and Screen::setScroll().

Referenced by TerminalModel::clearHistory().

◆ clearScreenAndSetColumns()

void Vt102Emulation::clearScreenAndSetColumns ( int  columnCount)
private

◆ codec()

const QTextCodec* Emulation::codec ( )
inlineinherited

Returns the codec used to decode incoming characters.

See setCodec()

Definition at line 172 of file Emulation.h.

References Emulation::_codec.

Referenced by Emulation::setCodec().

◆ createWindow()

ScreenWindow * Emulation::createWindow ( )
inherited

Creates a new window onto the output from this emulation.

The contents of the window are then rendered by views which are set to use this window using the TerminalDisplay::setScreenWindow() method.

Definition at line 96 of file Emulation.cpp.

References Emulation::_currentScreen, Emulation::_windows, Emulation::bufferedUpdate(), Emulation::outputChanged(), and ScreenWindow::setScreen().

Referenced by TerminalModel::addView().

◆ getErase()

char Vt102Emulation::getErase ( ) const
virtual

TODO Document me.

Reimplemented from Emulation.

Definition at line 1226 of file Vt102Emulation.cpp.

References Emulation::_keyTranslator, KeyboardTranslator::findEntry(), and KeyboardTranslator::Entry::text().

Referenced by sendKeyEvent().

◆ getMode()

bool Vt102Emulation::getMode ( int  mode)
private

◆ history()

const HistoryType & Emulation::history ( )
inherited

Returns the history store used by this emulation.

See setHistory()

Definition at line 158 of file Emulation.cpp.

References Emulation::_screen, and Screen::getScroll().

Referenced by TerminalModel::historyType().

◆ imageSize()

QSize Emulation::imageSize ( )
inherited

Returns the size of the screen image which the emulation produces.

Definition at line 340 of file Emulation.cpp.

References Emulation::_currentScreen, Screen::getColumns(), and Screen::getLines().

◆ imageSizeChanged

void Emulation::imageSizeChanged ( int  lineCount,
int  columnCount 
)
signalinherited

Emitted when the program running in the terminal changes the screen size.

Referenced by Emulation::setImageSize().

◆ initTokenizer()

void Vt102Emulation::initTokenizer ( )
private

Definition at line 240 of file Vt102Emulation.cpp.

References CHR, CPN, CPS, CTL, DIG, GRP, resetToken(), SCS, and tbl.

Referenced by Vt102Emulation().

◆ keyBindings()

QString Emulation::keyBindings ( )
inherited

Returns the name of the emulation's current key bindings.

See setKeyBindings()

Definition at line 187 of file Emulation.cpp.

References Emulation::_keyTranslator, and KeyboardTranslator::name().

Referenced by TerminalModel::keyBindings().

◆ lineCount()

int Emulation::lineCount ( )
inherited

Returns the total number of lines, including those stored in the history.

Definition at line 286 of file Emulation.cpp.

References Emulation::_currentScreen, Screen::getHistLines(), and Screen::getLines().

◆ lockPtyRequest

void Emulation::lockPtyRequest ( bool  suspend)
signalinherited

Requests that sending of input to the emulation from the terminal process be suspended or resumed.

Parameters
suspendIf true, requests that sending of input from the terminal process' stdout be suspended. Otherwise requests that sending of input be resumed.

◆ onScrollLock()

void Vt102Emulation::onScrollLock ( )
private

◆ outputChanged

void Emulation::outputChanged ( )
signalinherited

Emitted when the contents of the screen image change.

The emulation buffers the updates from successive image changes, and only emits outputChanged() at sensible intervals when there is a lot of terminal activity.

Normally there is no need for objects other than the screen windows created with createWindow() to listen for this signal.

ScreenWindow objects created using createWindow() will emit their own outputChanged() signal in response to this signal.

Referenced by Emulation::createWindow(), and Emulation::showBulk().

◆ profileChangeCommandReceived

void Emulation::profileChangeCommandReceived ( const QString &  text)
signalinherited

Emitted when the terminal program requests to change various properties of the terminal display.

A profile change command occurs when a special escape sequence, followed by a string containing a series of name and value pairs is received. This string can be parsed using a ProfileCommandParser instance.

Parameters
textA string expected to contain a series of key and value pairs in the form: name=value;name2=value2 ...

◆ programBracketedPasteMode()

bool Emulation::programBracketedPasteMode ( ) const
inherited

Definition at line 86 of file Emulation.cpp.

References Emulation::_bracketedPasteMode.

Referenced by TerminalModel::addView().

◆ programBracketedPasteModeChanged

void Emulation::programBracketedPasteModeChanged ( bool  bracketedPasteMode)
signalinherited

◆ programUsesMouse()

bool Emulation::programUsesMouse ( ) const
inherited

Returns true if the active terminal program wants mouse input events.

The programUsesMouseChanged() signal is emitted when this changes.

Definition at line 76 of file Emulation.cpp.

References Emulation::_usesMouse.

Referenced by TerminalModel::addView().

◆ programUsesMouseChanged

void Emulation::programUsesMouseChanged ( bool  usesMouse)
signalinherited

This is emitted when the program running in the shell indicates whether or not it is interested in mouse events.

Parameters
usesMouseThis will be true if the program wants to be informed about mouse events or false otherwise.

Referenced by Emulation::Emulation(), resetMode(), and setMode().

◆ pushToToken()

void Vt102Emulation::pushToToken ( int  cc)
private

Definition at line 224 of file Vt102Emulation.cpp.

References MAXPBUF, pbuf, and ppos.

Referenced by receiveChar().

◆ receiveChar()

void Vt102Emulation::receiveChar ( int  ch)
protectedvirtual

Processes an incoming character.

See receiveData() ch A unicode character code.

Reimplemented from Emulation.

Definition at line 287 of file Vt102Emulation.cpp.

References addArgument(), addDigit(), applyCharset(), argc, argv, ces, CHR, CNTL, COLOR_SPACE_256, COLOR_SPACE_RGB, CPN, CPS, CTL, DIG, eec, ees, egt, epe, epp, eps, ESC, getMode(), GRP, lec, les, lun, MODE_Ansi, pbuf, ppos, pushToToken(), resetToken(), SCS, tau(), TY_CHR, TY_CSI_PE, TY_CSI_PG, TY_CSI_PN, TY_CSI_PR, TY_CSI_PS, TY_CTL, TY_ESC, TY_ESC_CS, TY_ESC_DE, TY_VT52, Xpe, Xte, and XtermHack().

◆ receiveData

void Emulation::receiveData ( const char *  buffer,
int  len 
)
slotinherited

Processes an incoming stream of characters.

receiveData() decodes the incoming character buffer using the current codec(), and then calls receiveChar() for each unicode character in the resulting buffer.

receiveData() also starts a timer which causes the outputChanged() signal to be emitted when it expires. The timer allows multiple updates in quick succession to be buffered into a single outputChanged() signal emission.

Parameters
bufferA string of characters received from the terminal program.
lenThe length of buffer

Definition at line 262 of file Emulation.cpp.

References Emulation::_decoder, Emulation::bufferedUpdate(), octave::jit_convention::length, NOTIFYACTIVITY, Emulation::receiveChar(), and Emulation::stateSet().

Referenced by TerminalModel::onReceiveBlock(), and sendKeyEvent().

◆ reportAnswerBack()

void Vt102Emulation::reportAnswerBack ( )
private

Definition at line 885 of file Vt102Emulation.cpp.

References ANSWER_BACK, and sendString().

Referenced by tau().

◆ reportCursorPosition()

void Vt102Emulation::reportCursorPosition ( )
private

Definition at line 828 of file Vt102Emulation.cpp.

References Emulation::_currentScreen, Screen::getCursorX(), Screen::getCursorY(), and sendString().

Referenced by tau().

◆ ReportErrorToken()

void Vt102Emulation::ReportErrorToken ( )
private

Definition at line 1278 of file Vt102Emulation.cpp.

Referenced by tau(), and XtermHack().

◆ reportSecondaryAttributes()

void Vt102Emulation::reportSecondaryAttributes ( )
private

Definition at line 855 of file Vt102Emulation.cpp.

References getMode(), MODE_Ansi, and sendString().

Referenced by tau().

◆ reportStatus()

void Vt102Emulation::reportStatus ( )
private

Definition at line 875 of file Vt102Emulation.cpp.

References sendString().

Referenced by tau().

◆ reportTerminalParms()

void Vt102Emulation::reportTerminalParms ( int  p)
private

Definition at line 865 of file Vt102Emulation.cpp.

References sendString().

Referenced by tau().

◆ reportTerminalType()

void Vt102Emulation::reportTerminalType ( )
private

Definition at line 842 of file Vt102Emulation.cpp.

References getMode(), MODE_Ansi, and sendString().

Referenced by tau().

◆ reset()

void Vt102Emulation::reset ( )
virtual

◆ resetCharset()

void Vt102Emulation::resetCharset ( int  scrno)
private

◆ resetMode()

◆ resetModes()

void Vt102Emulation::resetModes ( )
private

◆ resetToken()

void Vt102Emulation::resetToken ( )
private

Definition at line 208 of file Vt102Emulation.cpp.

References argc, argv, and ppos.

Referenced by initTokenizer(), receiveChar(), and reset().

◆ restoreCursor()

void Vt102Emulation::restoreCursor ( )
private

Restore the cursor position and the rendition attribute settings.

Definition at line 1112 of file Vt102Emulation.cpp.

References Emulation::_currentScreen, CHARSET, and Screen::restoreCursor().

Referenced by tau().

◆ restoreMode()

void Vt102Emulation::restoreMode ( int  mode)
private

Definition at line 1213 of file Vt102Emulation.cpp.

References _saveParm, m, DECpar::mode, resetMode(), and setMode().

Referenced by tau().

◆ saveCursor()

void Vt102Emulation::saveCursor ( )
private

Save the cursor position and the rendition attribute settings.

Definition at line 1100 of file Vt102Emulation.cpp.

References Emulation::_currentScreen, CHARSET, and Screen::saveCursor().

Referenced by tau().

◆ saveMode()

void Vt102Emulation::saveMode ( int  mode)
private

Definition at line 1208 of file Vt102Emulation.cpp.

References _currParm, _saveParm, m, and DECpar::mode.

Referenced by resetModes(), and tau().

◆ scan_buffer_report()

void Vt102Emulation::scan_buffer_report ( )
private

Definition at line 1266 of file Vt102Emulation.cpp.

References hexdump(), pbuf, and ppos.

◆ scrollLock()

void Vt102Emulation::scrollLock ( const bool  lock)
private

◆ sendData

void Emulation::sendData ( const char *  data,
int  len 
)
signalinherited

Emitted when a buffer of data is ready to send to the standard input of the terminal.

Parameters
dataThe buffer of data ready to be sent @paran len The length of data in bytes

Referenced by Emulation::sendKeyEvent(), sendKeyEvent(), and sendString().

◆ sendKeyEvent

◆ sendMouseEvent

void Vt102Emulation::sendMouseEvent ( int  cb,
int  cx,
int  cy,
int  eventType 
)
virtualslot

Mouse clicks are possibly reported to the client application if it has issued interest in them. They are normally consumed by the widget for copy and paste, but may be propagated from the widget when gui->setMouseMarks is set via setMode(MODE_Mouse1000).

‘x’,‘y’ are 1-based. ‘ev’ (event) indicates the button pressed (0-2) or a general mouse release (3).

eventType represents the kind of mouse action that occurred: 0 = Mouse button press or release 1 = Mouse drag

Definition at line 908 of file Vt102Emulation.cpp.

References getMode(), MODE_Mouse1002, MODE_Mouse1003, and sendString().

◆ sendString

void Vt102Emulation::sendString ( const char *  s,
int  length = -1 
)
virtualslot

◆ sendText

void Vt102Emulation::sendText ( const QString &  text)
virtualslot

Definition at line 928 of file Vt102Emulation.cpp.

References sendKeyEvent().

◆ setAndUseCharset()

void Vt102Emulation::setAndUseCharset ( int  n,
int  cs 
)
private

Definition at line 1073 of file Vt102Emulation.cpp.

References CHARSET, n, and useCharset().

Referenced by tau().

◆ setCharset()

void Vt102Emulation::setCharset ( int  n,
int  cs 
)
private

Definition at line 1067 of file Vt102Emulation.cpp.

References _charset, CharCodes::charset, n, and useCharset().

Referenced by tau().

◆ setCodec() [1/2]

void Emulation::setCodec ( const QTextCodec *  qtc)
inherited

Sets the codec used to decode incoming characters.


Definition at line 163 of file Emulation.cpp.

References Emulation::_codec, Emulation::_decoder, Emulation::useUtf8Request(), and Emulation::utf8().

Referenced by reset(), Emulation::setCodec(), TerminalModel::setCodec(), and tau().

◆ setCodec() [2/2]

void Emulation::setCodec ( EmulationCodec  codec)
protectedinherited

◆ setDefaultMargins()

void Vt102Emulation::setDefaultMargins ( )
private

Definition at line 1086 of file Vt102Emulation.cpp.

References Emulation::_screen, and Screen::setDefaultMargins().

Referenced by clearScreenAndSetColumns().

◆ setHistory()

void Emulation::setHistory ( const HistoryType t)
inherited

Sets the history store used by this emulation.

When new lines are added to the output, older lines at the top of the screen are transferred to a history store.

The number of lines which are kept and the storage location depend on the type of store.

Definition at line 151 of file Emulation.cpp.

References Emulation::_screen, Screen::setScroll(), and Emulation::showBulk().

Referenced by TerminalModel::setHistoryType().

◆ setImageSize

void Emulation::setImageSize ( int  lines,
int  columns 
)
virtualslotinherited

Change the size of the emulation's image.

Definition at line 326 of file Emulation.cpp.

References Emulation::_screen, Emulation::bufferedUpdate(), Emulation::imageSizeChanged(), and Screen::resizeImage().

Referenced by clearScreenAndSetColumns(), tau(), and TerminalModel::updateTerminalSize().

◆ setKeyBindings()

void Emulation::setKeyBindings ( const QString &  name)
inherited

Sets the key bindings used to key events ( received through sendKeyEvent() ) into character streams to send to the terminal.

Definition at line 182 of file Emulation.cpp.

References Emulation::_keyTranslator, KeyboardTranslatorManager::findTranslator(), KeyboardTranslatorManager::instance(), and name.

Referenced by TerminalModel::setKeyBindings().

◆ setMargins()

void Vt102Emulation::setMargins ( int  top,
int  bottom 
)
private

Definition at line 1092 of file Vt102Emulation.cpp.

References Emulation::_screen, and Screen::setMargins().

Referenced by tau().

◆ setMode()

◆ setScreen()

void Emulation::setScreen ( int  n)
protectedinherited

Sets the active screen.

The terminal has two screens, primary and alternate. The primary screen is used by default. When certain interactive programs such as Vim are run, they trigger a switch to the alternate screen.

Parameters
index0 to switch to the primary screen, or 1 to switch to the alternate screen

change between primary and alternate _screen

Definition at line 130 of file Emulation.cpp.

References Emulation::_currentScreen, Emulation::_screen, Emulation::_windows, n, and Screen::setBusySelecting().

Referenced by resetMode(), and setMode().

◆ showBulk

◆ stateSet

void Emulation::stateSet ( int  state)
signalinherited

Emitted when the activity state of the emulation is set.

Parameters
stateThe new activity state, one of NOTIFYNORMAL, NOTIFYACTIVITY or NOTIFYBELL

Referenced by Emulation::receiveChar(), Emulation::receiveData(), Emulation::sendKeyEvent(), and tau().

◆ tau()

void Vt102Emulation::tau ( int  code,
int  p,
int  q 
)
private

Definition at line 403 of file Vt102Emulation.cpp.

References Emulation::_currentScreen, Emulation::_screen, A, Screen::BackSpace(), Screen::backTabulate(), Screen::changeTabStop(), Emulation::changeTabTextColorRequest(), Screen::clearEntireLine(), Screen::clearEntireScreen(), clearScreenAndSetColumns(), Screen::clearTabStops(), Screen::clearToBeginOfLine(), Screen::clearToBeginOfScreen(), Screen::clearToEndOfLine(), Screen::clearToEndOfScreen(), COLOR_SPACE_DEFAULT, COLOR_SPACE_SYSTEM, Screen::cursorDown(), Screen::cursorLeft(), Screen::cursorRight(), Screen::cursorUp(), Screen::deleteChars(), Screen::deleteLines(), Screen::eraseChars(), Screen::helpAlign(), Screen::index(), Screen::insertChars(), Screen::insertLines(), LINE_DOUBLEHEIGHT, LINE_DOUBLEWIDTH, Emulation::LocaleCodec, MODE_Ansi, MODE_AppCuKeys, MODE_AppKeyPad, MODE_AppScreen, MODE_BracketedPaste, MODE_Cursor, MODE_Insert, MODE_Mouse1000, MODE_Mouse1001, MODE_Mouse1002, MODE_Mouse1003, MODE_NewLine, MODE_Origin, MODE_Screen, MODE_Wrap, N, Screen::NewLine(), Screen::NextLine(), NOTIFYBELL, RE_BLINK, RE_BOLD, RE_REVERSE, RE_UNDERLINE, reportAnswerBack(), reportCursorPosition(), ReportErrorToken(), reportSecondaryAttributes(), reportStatus(), reportTerminalParms(), reportTerminalType(), reset(), resetMode(), Screen::resetRendition(), restoreCursor(), Screen::restoreMode(), restoreMode(), Screen::Return(), Screen::reverseIndex(), saveCursor(), saveMode(), Screen::scrollDown(), Screen::scrollUp(), setAndUseCharset(), Screen::setBackColor(), setCharset(), Emulation::setCodec(), Screen::setCursorX(), Screen::setCursorY(), Screen::setCursorYX(), Screen::setDefaultRendition(), Screen::setForeColor(), Emulation::setImageSize(), Screen::setLineProperty(), setMargins(), setMode(), Screen::ShowCharacter(), Emulation::stateSet(), Screen::Tabulate(), TY_CHR, TY_CSI_PE, TY_CSI_PG, TY_CSI_PN, TY_CSI_PR, TY_CSI_PS, TY_CTL, TY_ESC, TY_ESC_CS, TY_ESC_DE, TY_VT52, useCharset(), and Emulation::Utf8Codec.

Referenced by receiveChar().

◆ titleChanged

void Emulation::titleChanged ( int  title,
const QString &  newTitle 
)
signalinherited

Emitted when the program running in the terminal wishes to update the session's title.

This also allows terminal programs to customize other aspects of the terminal emulation display.

This signal is emitted when the escape sequence "\033]ARG;VALUE\007" is received in the input string, where ARG is a number specifying what should change and VALUE is a string specifying the new value.

TODO: The name of this method is not very accurate since this method is used to perform a whole range of tasks besides just setting the user-title of the session.

Parameters
titleSpecifies what to change.
  • 0 - Set window icon text and session title to newTitle
  • 1 - Set window icon text to newTitle
  • 2 - Set session title to newTitle
  • 11 - Set the session's default background color to newTitle, where newTitle can be an HTML-style string (#RRGGBB) or a named color (eg 'red', 'blue'). See http://doc.trolltech.com/4.2/qcolor.html#setNamedColor for more details.
  • 31 - Supposedly treats newTitle as a URL and opens it (NOT IMPLEMENTED)
  • 32 - Sets the icon associated with the session. newTitle is the name of the icon to use, which can be the name of any icon in the current KDE icon theme (eg: 'konsole', 'kate', 'folder_home')
newTitleSpecifies the new title

Referenced by updateTitle().

◆ updateTitle

void Vt102Emulation::updateTitle ( )
privateslot

Definition at line 374 of file Vt102Emulation.cpp.

References _pendingTitleUpdates, and Emulation::titleChanged().

Referenced by Vt102Emulation().

◆ useCharset()

void Vt102Emulation::useCharset ( int  n)
private

Definition at line 1079 of file Vt102Emulation.cpp.

References CHARSET, and n.

Referenced by setAndUseCharset(), setCharset(), and tau().

◆ usesMouseChanged

void Emulation::usesMouseChanged ( bool  usesMouse)
privateslotinherited

Definition at line 81 of file Emulation.cpp.

References Emulation::_usesMouse.

Referenced by Emulation::Emulation().

◆ useUtf8Request

void Emulation::useUtf8Request ( bool  )
signalinherited

Requests that the pty used by the terminal process be set to UTF 8 mode.

TODO: More documentation

Referenced by Emulation::setCodec().

◆ utf8()

bool Emulation::utf8 ( )
inlineinherited

Convenience method.

Returns true if the current codec used to decode incoming characters is UTF-8

Definition at line 181 of file Emulation.h.

References Emulation::_codec.

Referenced by Emulation::setCodec().

◆ writeToStream()

void Emulation::writeToStream ( TerminalCharacterDecoder decoder,
int  startLine,
int  endLine 
)
virtualinherited

Copies the output history from startLine to endLine into stream, using decoder to convert the terminal characters into text.

Parameters
decoderA decoder which converts lines of terminal characters with appearance attributes into output text. PlainTextDecoder is the most commonly used decoder.
startLineThe first

Definition at line 279 of file Emulation.cpp.

References Emulation::_currentScreen, Emulation::_decoder, and Screen::writeToStream().

◆ XtermHack()

void Vt102Emulation::XtermHack ( )
private

Definition at line 356 of file Vt102Emulation.cpp.

References _pendingTitleUpdates, _titleUpdateTimer, pbuf, ppos, and ReportErrorToken().

Referenced by receiveChar().

Member Data Documentation

◆ _bracketedPasteMode

bool Emulation::_bracketedPasteMode
privateinherited

◆ _bulkTimer1

QTimer Emulation::_bulkTimer1
privateinherited

◆ _bulkTimer2

QTimer Emulation::_bulkTimer2
privateinherited

◆ _charset

CharCodes Vt102Emulation::_charset[2]
private

Definition at line 173 of file Vt102Emulation.h.

Referenced by resetCharset(), and setCharset().

◆ _codec

const QTextCodec* Emulation::_codec
protectedinherited

Definition at line 431 of file Emulation.h.

Referenced by Emulation::codec(), sendKeyEvent(), Emulation::setCodec(), and Emulation::utf8().

◆ _currentScreen

◆ _currParm

DECpar Vt102Emulation::_currParm
private

Definition at line 175 of file Vt102Emulation.h.

Referenced by getMode(), resetMode(), saveMode(), and setMode().

◆ _decoder

QTextDecoder* Emulation::_decoder
protectedinherited

◆ _keyTranslator

const KeyboardTranslator* Emulation::_keyTranslator
protectedinherited

◆ _pendingTitleUpdates

QHash<int,QString> Vt102Emulation::_pendingTitleUpdates
private

Definition at line 183 of file Vt102Emulation.h.

Referenced by updateTitle(), and XtermHack().

◆ _saveParm

DECpar Vt102Emulation::_saveParm
private

Definition at line 176 of file Vt102Emulation.h.

Referenced by restoreMode(), and saveMode().

◆ _screen

◆ _titleUpdateTimer

QTimer* Vt102Emulation::_titleUpdateTimer
private

Definition at line 184 of file Vt102Emulation.h.

Referenced by Vt102Emulation(), and XtermHack().

◆ _usesMouse

bool Emulation::_usesMouse
privateinherited

Definition at line 456 of file Emulation.h.

Referenced by Emulation::programUsesMouse(), and Emulation::usesMouseChanged().

◆ _windows

QList<ScreenWindow*> Emulation::_windows
protectedinherited

◆ argc

int Vt102Emulation::argc
private

Definition at line 149 of file Vt102Emulation.h.

Referenced by addArgument(), addDigit(), receiveChar(), and resetToken().

◆ argv

int Vt102Emulation::argv[15]
private

Definition at line 148 of file Vt102Emulation.h.

Referenced by addArgument(), addDigit(), receiveChar(), and resetToken().

◆ pbuf

int Vt102Emulation::pbuf[80]
private

Definition at line 143 of file Vt102Emulation.h.

Referenced by pushToToken(), receiveChar(), scan_buffer_report(), and XtermHack().

◆ ppos

int Vt102Emulation::ppos
private

Definition at line 144 of file Vt102Emulation.h.

Referenced by pushToToken(), receiveChar(), resetToken(), scan_buffer_report(), and XtermHack().

◆ tbl

int Vt102Emulation::tbl[256]
private

Definition at line 151 of file Vt102Emulation.h.

Referenced by initTokenizer().


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