#include </home/clem/local/src/opie/noncore/apps/opie-console/emulation_layer.h>
Collaboration diagram for EmulationLayer:

Public Slots | |
| virtual void | onImageSizeChange (int lines, int columns) |
| virtual void | onHistoryCursorChange (int cursor) |
| virtual void | onKeyPress (QKeyEvent *) |
| virtual void | clearSelection () |
| virtual void | onSelectionBegin (const int x, const int y) |
| virtual void | onSelectionExtend (const int x, const int y) |
| virtual void | setSelection (const bool preserve_line_breaks) |
| void | onRcvBlock (const QByteArray &) |
Signals | |
| void | sndBlock (const QByteArray &) |
| void | ImageSizeChanged (int lines, int columns) |
| void | changeColumns (int columns) |
| void | changeTitle (int arg, const char *str) |
Public Member Functions | |
| EmulationLayer (WidgetLayer *gui) | |
| ~EmulationLayer () | |
| virtual void | setHistory (bool on) |
| virtual bool | history () |
| virtual void | onRcvChar (int) |
| virtual void | setMode (int)=0 |
| virtual void | resetMode (int)=0 |
| virtual void | sendString (const char *)=0 |
| virtual void | sendString (const QByteArray &)=0 |
| virtual void | setConnect (bool r) |
| void | setColumns (int columns) |
| void | setKeytrans (int no) |
| void | setKeytrans (const char *no) |
Protected Member Functions | |
| void | setScreen (int n) |
| void | setCodec (int c) |
Protected Attributes | |
| WidgetLayer * | gui |
| Screen * | scr |
| Screen * | screen [2] |
| bool | connected |
| QTextCodec * | codec |
| QTextCodec * | localeCodec |
| QTextDecoder * | decoder |
| KeyTrans * | keytrans |
Private Slots | |
| void | showBulk () |
Private Member Functions | |
| void | bulkNewline () |
| void | bulkStart () |
| void | bulkEnd () |
Private Attributes | |
| QTimer | bulk_timer |
| int | bulk_nlcnt |
| char * | SelectedText |
| int | bulk_incnt |
This class is responsible to scan the escapes sequences of the terminal emulation and to map it to their corresponding semantic complements. Thus this module knows mainly about decoding escapes sequences and is a stateless device w.r.t. the semantics.
It is also responsible to refresh the Widget by certain rules.
The reason for doing so is twofold.
First, experiments show that directly displaying the operation results in slowing down the overall performance of emulations. Displaying individual characters using X11 creates a lot of overhead.
Second, by using the following refreshing method, the screen operations can be completely separated from the displaying. This greatly simplifies the programmer's task of coding and maintaining the screen operations, since one need not worry about differential modifications on the display affecting the operation of concern.
We use a refreshing algorithm here that has been adoped from rxvt/kvt.
By this, refreshing is driven by a timer, which is (re)started whenever a new bunch of data to be interpreted by the emulation arives at `onRcvBlock'. As soon as no more data arrive for `BULK_TIMEOUT' milliseconds, we trigger refresh. This rule suits both bulk display operation as done by curses as well as individual characters typed. (BULK_TIMEOUT < 1000 / max characters received from keyboard per second).
Additionally, we trigger refreshing by newlines comming in to make visual snapshots of lists as produced by `cat', `ls' and likely programs, thereby producing the illusion of a permanent and immediate display operation.
As a sort of catch-all needed for cases where none of the above conditions catch, the screen refresh is also triggered by a count of incoming bulks (`bulk_incnt').
Definition at line 36 of file emulation_layer.h.
|
|
Definition at line 95 of file emulation_layer.cpp. References bulk_incnt, bulk_nlcnt, bulk_timer, clearSelection(), connected, FALSE, onImageSizeChange(), onKeyPress(), onSelectionBegin(), onSelectionExtend(), scr, screen, setSelection(), and showBulk(). |
|
|
Definition at line 128 of file emulation_layer.cpp. References bulk_timer, and screen. |
|
|
Definition at line 319 of file emulation_layer.cpp. References bulk_incnt, bulk_nlcnt, BULK_TIMEOUT, bulk_timer, gui, showBulk(), and TRUE. Referenced by onRcvBlock(). |
|
|
called when Definition at line 289 of file emulation_layer.cpp. References bulk_incnt, and bulk_nlcnt. Referenced by onRcvBlock(). |
|
|
Definition at line 314 of file emulation_layer.cpp. References bulk_timer. Referenced by onRcvBlock(). |
|
|
Referenced by setColumns(). |
|
||||||||||||
|
|
|
|
Definition at line 275 of file emulation_layer.cpp. References Screen::clearSelection(), connected, scr, and showBulk(). Referenced by EmulationLayer(). |
|
|
Definition at line 150 of file emulation_layer.cpp. References Screen::hasScroll(), and screen. |
|
||||||||||||
|
Referenced by onImageSizeChange(). |
|
|
Definition at line 358 of file emulation_layer.cpp. References connected, scr, Screen::setHistCursor(), and showBulk(). |
|
||||||||||||
|
triggered by image size change of the Widget `gui'. This event is simply propagated to the attached screens and to the related serial line. Definition at line 349 of file emulation_layer.cpp. References connected, ImageSizeChanged(), Screen::resizeImage(), screen, and showBulk(). Referenced by EmulationLayer(), and setConnect(). |
|
|
Definition at line 211 of file emulation_layer.cpp. References connected, Screen::getHistCursor(), Screen::getHistLines(), scr, sendString(), Screen::setHistCursor(), and sndBlock(). Referenced by EmulationLayer(). |
|
|
to be called, when new data arrives Definition at line 239 of file emulation_layer.cpp. References bulk_incnt, bulkEnd(), bulkNewline(), bulkStart(), decoder, i, QString::length(), onRcvChar(), and QTextDecoder::toUnicode(). |
|
|
process single char (decode) Definition at line 186 of file emulation_layer.cpp. References Screen::BackSpace(), gui, Screen::NewLine(), Screen::Return(), scr, Screen::ShowCharacter(), and Screen::Tabulate(). Referenced by onRcvBlock(). |
|
||||||||||||
|
Definition at line 257 of file emulation_layer.cpp. References connected, scr, Screen::setSelBeginXY(), and showBulk(). Referenced by EmulationLayer(). |
|
||||||||||||
|
Definition at line 263 of file emulation_layer.cpp. References connected, scr, Screen::setSelExtentXY(), and showBulk(). Referenced by EmulationLayer(). |
|
|
|
|
|
sends a string to IOLayer encodes to suit emulation before |
|
|
Referenced by onKeyPress(). |
|
|
Definition at line 155 of file emulation_layer.cpp. References codec, QTextCodec::codecForLocale(), QTextCodec::codecForName(), decoder, and QTextCodec::makeDecoder(). |
|
|
Definition at line 365 of file emulation_layer.cpp. References changeColumns(). |
|
|
Definition at line 327 of file emulation_layer.cpp. References Screen::clearSelection(), connected, gui, onImageSizeChange(), scr, and showBulk(). |
|
|
Definition at line 143 of file emulation_layer.cpp. References connected, screen, Screen::setScroll(), and showBulk(). |
|
|
Definition at line 169 of file emulation_layer.cpp. References KeyTrans::find(), and keytrans. |
|
|
Definition at line 164 of file emulation_layer.cpp. References KeyTrans::find(), and keytrans. |
|
|
|
|
|
change between primary and alternate screen Definition at line 138 of file emulation_layer.cpp. |
|
|
Referenced by EmulationLayer(). |
|
|
Definition at line 298 of file emulation_layer.cpp. References bulk_incnt, bulk_nlcnt, connected, Screen::getColumns(), Screen::getCookedImage(), Screen::getHistCursor(), Screen::getHistLines(), Screen::getLines(), gui, image, and scr. Referenced by bulkEnd(), clearSelection(), EmulationLayer(), onHistoryCursorChange(), onImageSizeChange(), onSelectionBegin(), onSelectionExtend(), setConnect(), and setHistory(). |
|
|
will send data, encoded to suit emulation Referenced by onKeyPress(). |
|
|
Definition at line 141 of file emulation_layer.h. Referenced by bulkEnd(), bulkNewline(), EmulationLayer(), onRcvBlock(), and showBulk(). |
|
|
Definition at line 139 of file emulation_layer.h. Referenced by bulkEnd(), bulkNewline(), EmulationLayer(), and showBulk(). |
|
|
Definition at line 138 of file emulation_layer.h. Referenced by bulkEnd(), bulkStart(), EmulationLayer(), and ~EmulationLayer(). |
|
|
Definition at line 118 of file emulation_layer.h. Referenced by setCodec(). |
|
|
Definition at line 114 of file emulation_layer.h. Referenced by clearSelection(), EmulationLayer(), onHistoryCursorChange(), onImageSizeChange(), onKeyPress(), onSelectionBegin(), onSelectionExtend(), setConnect(), setHistory(), and showBulk(). |
|
|
Definition at line 120 of file emulation_layer.h. Referenced by onRcvBlock(), and setCodec(). |
|
|
Definition at line 109 of file emulation_layer.h. Referenced by bulkEnd(), onRcvChar(), setConnect(), and showBulk(). |
|
|
Definition at line 122 of file emulation_layer.h. Referenced by setKeytrans(). |
|
|
Definition at line 119 of file emulation_layer.h. |
|
|
Definition at line 110 of file emulation_layer.h. Referenced by clearSelection(), EmulationLayer(), onHistoryCursorChange(), onKeyPress(), onRcvChar(), onSelectionBegin(), onSelectionExtend(), setConnect(), setScreen(), and showBulk(). |
|
|
Definition at line 111 of file emulation_layer.h. Referenced by EmulationLayer(), history(), onImageSizeChange(), setHistory(), setScreen(), and ~EmulationLayer(). |
|
|
Definition at line 140 of file emulation_layer.h. |
1.4.2