23 #ifndef VT102EMULATION_H
24 #define VT102EMULATION_H
27 #include <QtCore/QHash>
36 #define MODE_AppScreen (MODES_SCREEN+0) // Mode #1
37 #define MODE_AppCuKeys (MODES_SCREEN+1) // Application cursor keys (DECCKM)
38 #define MODE_AppKeyPad (MODES_SCREEN+2) //
39 #define MODE_Mouse1000 (MODES_SCREEN+3) // Send mouse X,Y position on press and release
40 #define MODE_Mouse1001 (MODES_SCREEN+4) // Use Hilight mouse tracking
41 #define MODE_Mouse1002 (MODES_SCREEN+5) // Use cell motion mouse tracking
42 #define MODE_Mouse1003 (MODES_SCREEN+6) // Use all motion mouse tracking
43 #define MODE_Mouse1005 (MODES_SCREEN+7) // Xterm-style extended coordinates
44 #define MODE_Mouse1006 (MODES_SCREEN+8) // 2nd Xterm-style extended coordinates
45 #define MODE_Mouse1015 (MODES_SCREEN+9) // Urxvt-style extended coordinates
46 #define MODE_Ansi (MODES_SCREEN+10) // Use US Ascii for character sets G0-G3 (DECANM)
47 #define MODE_132Columns (MODES_SCREEN+11) // 80 <-> 132 column mode switch (DECCOLM)
48 #define MODE_Allow132Columns (MODES_SCREEN+12) // Allow DECCOLM mode
49 #define MODE_total (MODES_SCREEN+13)
91 virtual void sendString(
const char*,
int length = -1);
92 virtual void sendText(
const QString& text);
94 virtual void sendMouseEvent(
int buttons,
int column,
int line,
int eventType);
108 unsigned short applyCharset(
unsigned short c);
109 void setCharset(
int n,
int cs);
110 void useCharset(
int n);
111 void setAndUseCharset(
int n,
int cs);
113 void restoreCursor();
114 void resetCharset(
int scrno);
116 void setMargins(
int top,
int bottom);
118 void setDefaultMargins();
121 bool getMode(
int mode);
123 void saveMode(
int mode);
125 void restoreMode(
int mode);
130 void resetTokenizer();
131 #define MAX_TOKEN_LENGTH 256 // Max length of tokens (e.g. window title)
132 void addToCurrentToken(
int cc);
136 void addDigit(
int dig);
140 void initTokenizer();
147 void reportDecodingError();
149 void processToken(
int code,
int p,
int q);
150 void processWindowAttributeChange();
152 void reportTerminalType();
153 void reportSecondaryAttributes();
155 void reportAnswerBack();
156 void reportCursorPosition();
157 void reportTerminalParms(
int p);
161 void clearScreenAndSetColumns(
int columnCount);
163 CharCodes _charset[2];
170 memset(&mode,
false,
MODE_total *
sizeof(
bool));
176 TerminalState _currentModes;
177 TerminalState _savedModes;
184 QHash<int, QString> _pendingTitleUpdates;
185 QTimer* _titleUpdateTimer;
189 #endif // VT102EMULATION_H
unsigned short vt100_graphics[32]
virtual void reset()
Resets the state of the terminal.
virtual void sendMouseEvent(int buttons, int column, int line, int eventType)
virtual void receiveChar(int cc)
Processes an incoming character.
Vt102Emulation()
Constructs a new emulation.
virtual char eraseChar() const
Returns the special character used for erasing character.
virtual void sendText(const QString &text)
virtual void resetMode(int mode)
virtual void clearEntireScreen()
Copies the current image into the history and clears the screen.
virtual void sendString(const char *, int length=-1)
Base class for terminal emulation back-ends.
Provides an xterm compatible terminal emulation based on the DEC VT102 terminal.
virtual void setMode(int mode)
virtual void sendKeyEvent(QKeyEvent *)