GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Slots | Signals | Public Member Functions | Protected Types | Protected Slots | Protected Member Functions | Protected Attributes | Private Slots | Private Member Functions | Private Attributes | List of all members
Vt102Emulation Class Reference

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

#include "Vt102Emulation.h"

Inheritance diagram for Vt102Emulation:
Inheritance graph
[legend]
Collaboration diagram for Vt102Emulation:
Collaboration graph
[legend]

Public Slots

void receiveData (const char *buffer, int len)
 Processes an incoming stream of characters.
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.

Signals

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

Public Member Functions

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

Protected Types

enum  EmulationCodec { LocaleCodec = 0, Utf8Codec = 1 }

Protected Slots

void bufferedUpdate ()
 Schedules an update of attached views.

Protected Member Functions

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

Protected Attributes

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

Private Slots

void updateTitle ()

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

CharCodes _charset [2]
DECpar _currParm
QHash< int, QString > _pendingTitleUpdates
DECpar _saveParm
QTimer * _titleUpdateTimer
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 76 of file Vt102Emulation.h.

Member Enumeration Documentation

enum Emulation::EmulationCodec
protectedinherited
Enumerator:
LocaleCodec 
Utf8Codec 

Definition at line 406 of file Emulation.h.

Constructor & Destructor Documentation

Vt102Emulation::Vt102Emulation ( )

Constructs a new emulation.

Definition at line 80 of file Vt102Emulation.cpp.

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

Vt102Emulation::~Vt102Emulation ( )

Definition at line 92 of file Vt102Emulation.cpp.

Member Function Documentation

void Vt102Emulation::addArgument ( )
private

Definition at line 218 of file Vt102Emulation.cpp.

References argc, argv, and MAXARGS.

Referenced by receiveChar().

void Vt102Emulation::addDigit ( int  dig)
private

Definition at line 213 of file Vt102Emulation.cpp.

References argc, and argv.

Referenced by receiveChar().

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

Definition at line 1027 of file Vt102Emulation.cpp.

References CHARSET, and vt100_graphics.

Referenced by receiveChar().

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 297 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().

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().

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().

void Emulation::clearHistory ( )
inherited

Clears the history scroll.

Definition at line 134 of file Emulation.cpp.

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

Referenced by TerminalModel::clearHistory().

void Vt102Emulation::clearScreenAndSetColumns ( int  columnCount)
private
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.

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 83 of file Emulation.cpp.

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

Referenced by TerminalModel::addView().

char Vt102Emulation::getErase ( ) const
virtual

TODO Document me.

Reimplemented from Emulation.

Definition at line 1202 of file Vt102Emulation.cpp.

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

Referenced by sendKeyEvent().

bool Vt102Emulation::getMode ( int  mode)
private
const HistoryType & Emulation::history ( )
inherited

Returns the history store used by this emulation.

See setHistory()

Definition at line 145 of file Emulation.cpp.

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

Referenced by TerminalModel::historyType().

QSize Emulation::imageSize ( )
inherited

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

Definition at line 327 of file Emulation.cpp.

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

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

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

Referenced by Emulation::setImageSize().

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().

QString Emulation::keyBindings ( )
inherited

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

See setKeyBindings()

Definition at line 174 of file Emulation.cpp.

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

int Emulation::lineCount ( )
inherited

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

Definition at line 273 of file Emulation.cpp.

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

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.
void Vt102Emulation::onScrollLock ( )
private
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().

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 ...
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 73 of file Emulation.cpp.

References Emulation::_usesMouse.

Referenced by TerminalModel::addView().

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().

void Vt102Emulation::pushToToken ( int  cc)
private

Definition at line 224 of file Vt102Emulation.cpp.

References MAXPBUF, pbuf, and ppos.

Referenced by 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().

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 249 of file Emulation.cpp.

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

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

void Vt102Emulation::reportAnswerBack ( )
private

Definition at line 880 of file Vt102Emulation.cpp.

References ANSWER_BACK, and sendString().

Referenced by tau().

void Vt102Emulation::reportCursorPosition ( )
private

Definition at line 823 of file Vt102Emulation.cpp.

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

Referenced by tau().

void Vt102Emulation::ReportErrorToken ( )
private

Definition at line 1254 of file Vt102Emulation.cpp.

References scan_buffer_report().

Referenced by tau(), and XtermHack().

void Vt102Emulation::reportSecondaryAttributes ( )
private

Definition at line 850 of file Vt102Emulation.cpp.

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

Referenced by tau().

void Vt102Emulation::reportStatus ( )
private

Definition at line 870 of file Vt102Emulation.cpp.

References sendString().

Referenced by tau().

void Vt102Emulation::reportTerminalParms ( int  p)
private

Definition at line 860 of file Vt102Emulation.cpp.

References sendString().

Referenced by tau().

void Vt102Emulation::reportTerminalType ( )
private

Definition at line 837 of file Vt102Emulation.cpp.

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

Referenced by tau().

void Vt102Emulation::reset ( )
virtual
void Vt102Emulation::resetCharset ( int  scrno)
private
void Vt102Emulation::resetMode ( int  mode)
protectedvirtual
void Vt102Emulation::resetModes ( )
private
void Vt102Emulation::resetToken ( )
private

Definition at line 208 of file Vt102Emulation.cpp.

References argc, argv, and ppos.

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

void Vt102Emulation::restoreCursor ( )
private

Restore the cursor position and the rendition attribute settings.

Definition at line 1097 of file Vt102Emulation.cpp.

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

Referenced by tau().

void Vt102Emulation::restoreMode ( int  mode)
private

Definition at line 1189 of file Vt102Emulation.cpp.

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

Referenced by tau().

void Vt102Emulation::saveCursor ( )
private

Save the cursor position and the rendition attribute settings.

Definition at line 1085 of file Vt102Emulation.cpp.

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

Referenced by tau().

void Vt102Emulation::saveMode ( int  mode)
private

Definition at line 1184 of file Vt102Emulation.cpp.

References _currParm, _saveParm, and DECpar::mode.

Referenced by resetModes(), and tau().

void Vt102Emulation::scan_buffer_report ( )
private

Definition at line 1242 of file Vt102Emulation.cpp.

References hexdump(), pbuf, and ppos.

Referenced by ReportErrorToken().

void Vt102Emulation::scrollLock ( const bool  lock)
private
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 len The length of data in bytes

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

void Vt102Emulation::sendKeyEvent ( QKeyEvent *  event)
virtualslot
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 903 of file Vt102Emulation.cpp.

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

void Vt102Emulation::sendString ( const char s,
int  length = -1 
)
virtualslot
void Vt102Emulation::sendText ( const QString &  text)
virtualslot

Definition at line 923 of file Vt102Emulation.cpp.

References sendKeyEvent().

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

Definition at line 1058 of file Vt102Emulation.cpp.

References CHARSET, and useCharset().

Referenced by tau().

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

Definition at line 1052 of file Vt102Emulation.cpp.

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

Referenced by tau().

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

Sets the codec used to decode incoming characters.

Definition at line 150 of file Emulation.cpp.

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

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

void Emulation::setCodec ( EmulationCodec  codec)
protectedinherited
void Vt102Emulation::setDefaultMargins ( )
private

Definition at line 1071 of file Vt102Emulation.cpp.

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

Referenced by clearScreenAndSetColumns().

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 138 of file Emulation.cpp.

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

Referenced by TerminalModel::setHistoryType().

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

Change the size of the emulation's image.

Definition at line 313 of file Emulation.cpp.

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

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

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 169 of file Emulation.cpp.

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

Referenced by TerminalModel::setKeyBindings().

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

Definition at line 1077 of file Vt102Emulation.cpp.

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

Referenced by tau().

void Vt102Emulation::setMode ( int  mode)
protectedvirtual
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 117 of file Emulation.cpp.

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

Referenced by resetMode(), and setMode().

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().

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_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(), restoreMode(), Screen::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 dcnstr(), dlinsd(), dlinsk(), and receiveChar().

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().

void Vt102Emulation::updateTitle ( )
privateslot

Definition at line 374 of file Vt102Emulation.cpp.

References _pendingTitleUpdates, arg(), and Emulation::titleChanged().

Referenced by Vt102Emulation().

void Vt102Emulation::useCharset ( int  n)
private

Definition at line 1064 of file Vt102Emulation.cpp.

References CHARSET.

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

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().

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().

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 266 of file Emulation.cpp.

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

void Vt102Emulation::XtermHack ( )
private

Definition at line 356 of file Vt102Emulation.cpp.

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

Referenced by receiveChar().

Member Data Documentation

CharCodes Vt102Emulation::_charset[2]
private

Definition at line 172 of file Vt102Emulation.h.

Referenced by resetCharset(), and setCharset().

const QTextCodec* Emulation::_codec
protectedinherited

Definition at line 427 of file Emulation.h.

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

Screen* Emulation::_currentScreen
protectedinherited
DECpar Vt102Emulation::_currParm
private

Definition at line 174 of file Vt102Emulation.h.

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

QTextDecoder* Emulation::_decoder
protectedinherited

Definition at line 428 of file Emulation.h.

Referenced by Emulation::receiveData(), Emulation::setCodec(), and Emulation::~Emulation().

const KeyboardTranslator* Emulation::_keyTranslator
protectedinherited
QHash<int,QString> Vt102Emulation::_pendingTitleUpdates
private

Definition at line 182 of file Vt102Emulation.h.

Referenced by updateTitle(), and XtermHack().

DECpar Vt102Emulation::_saveParm
private

Definition at line 175 of file Vt102Emulation.h.

Referenced by restoreMode(), and saveMode().

Screen* Emulation::_screen[2]
protectedinherited
QTimer* Vt102Emulation::_titleUpdateTimer
private

Definition at line 183 of file Vt102Emulation.h.

Referenced by Vt102Emulation(), and XtermHack().

QList<ScreenWindow*> Emulation::_windows
protectedinherited
int Vt102Emulation::argc
private

Definition at line 148 of file Vt102Emulation.h.

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

int Vt102Emulation::argv[15]
private

Definition at line 147 of file Vt102Emulation.h.

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

int Vt102Emulation::pbuf[80]
private

Definition at line 142 of file Vt102Emulation.h.

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

int Vt102Emulation::ppos
private

Definition at line 143 of file Vt102Emulation.h.

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

int Vt102Emulation::tbl[256]
private

Definition at line 150 of file Vt102Emulation.h.

Referenced by initTokenizer().


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