20#ifndef VT102EMULATION_H
21#define VT102EMULATION_H
35constexpr auto MODE_AppScreen = (MODES_SCREEN + 0);
36constexpr auto MODE_AppCuKeys = (MODES_SCREEN + 1);
37constexpr auto MODE_AppKeyPad = (MODES_SCREEN + 2);
38constexpr auto MODE_Mouse1000 = (MODES_SCREEN + 3);
39constexpr auto MODE_Mouse1001 = (MODES_SCREEN + 4);
40constexpr auto MODE_Mouse1002 = (MODES_SCREEN + 5);
41constexpr auto MODE_Mouse1003 = (MODES_SCREEN + 6);
42constexpr auto MODE_Mouse1005 = (MODES_SCREEN + 7);
43constexpr auto MODE_Mouse1006 = (MODES_SCREEN + 8);
44constexpr auto MODE_Mouse1015 = (MODES_SCREEN + 9);
45constexpr auto MODE_Ansi = (MODES_SCREEN + 10);
46constexpr auto MODE_132Columns = (MODES_SCREEN + 11);
47constexpr auto MODE_Allow132Columns = (MODES_SCREEN + 12);
48constexpr auto MODE_BracketedPaste = (MODES_SCREEN + 13);
49constexpr auto MODE_total = (MODES_SCREEN + 14);
85 void reset()
override;
90 void sendString(
const char *,
int length = -1)
override;
91 void sendText(
const QString &text)
override;
92 void sendKeyEvent(
QKeyEvent *,
bool fromPaste)
override;
93 void sendMouseEvent(
int buttons,
int column,
int line,
int eventType)
override;
99 void setMode(
int mode)
override;
100 void resetMode(
int mode)
override;
109 wchar_t applyCharset(
char16_t c);
110 void setCharset(
int n,
int cs);
111 void useCharset(
int n);
112 void setAndUseCharset(
int n,
int cs);
114 void restoreCursor();
115 void resetCharset(
int scrno);
118 void setMargins(
int top,
int bottom);
120 void setDefaultMargins();
123 bool getMode(
int mode);
125 void saveMode(
int mode);
127 void restoreMode(
int mode);
132 void resetTokenizer();
133#define MAX_TOKEN_LENGTH 256
134 void addToCurrentToken(
char16_t cc);
135 char16_t tokenBuffer[MAX_TOKEN_LENGTH];
138 void addDigit(
int dig);
142 void initTokenizer();
150 void reportDecodingError();
152 void processToken(
int code,
char16_t p,
int q);
153 void processWindowAttributeChange();
154 void requestWindowAttribute(
int);
156 void reportTerminalType();
157 void reportSecondaryAttributes();
159 void reportAnswerBack();
160 void reportCursorPosition();
161 void reportTerminalParms(
int p);
164 void scrollLock(
const bool lock);
168 void clearScreenAndSetColumns(
int columnCount);
170 CharCodes _charset[2];
178 memset(&mode,
false, MODE_total *
sizeof(
bool));
181 bool mode[MODE_total];
184 TerminalState _currentModes;
185 TerminalState _savedModes;
193 QTimer *_titleUpdateTimer;
195 bool _reportFocusEvents;
Base class for terminal emulation back-ends.
Provides an xterm compatible terminal emulation based on the DEC VT102 terminal.
void clearEntireScreen() override
Copies the current image into the history and clears the screen.
void reset() override
Resets the state of the terminal.
virtual void focusLost()
The focus lost event can be used by Vim (or other terminal applications) to recognize that the konsol...
void receiveChar(QChar cc) override
Processes an incoming character.
char eraseChar() const override
TODO Document me.
Vt102Emulation()
Constructs a new emulation.
virtual void focusGained()
The focus gained event can be used by Vim (or other terminal applications) to recognize that the kons...
void sendMouseEvent(int buttons, int column, int line, int eventType) override
virtual bool event(QEvent *e)