Commit 774d43cd authored by Christian Persch's avatar Christian Persch

parser: Add more functions

...and mark them as implemented / unimplemented accordingly.
parent 33e84644
......@@ -64,6 +64,7 @@ libvte_@VTE_API_MAJOR_VERSION@_@VTE_API_MINOR_VERSION@_la_SOURCES = \
parser-charset.hh \
parser-charset-tables.hh \
parser-cmd.hh \
parser-c01.hh \
parser-csi.hh \
parser-dcs.hh \
parser-esc.hh \
......@@ -126,6 +127,7 @@ libvte_@VTE_API_MAJOR_VERSION@_@VTE_API_MINOR_VERSION@_la_CPPFLAGS = \
-DLOCALEDIR='"$(localedir)"' \
-DGLIB_DISABLE_DEPRECATION_WARNINGS \
-DVTE_COMPILATION \
-UPARSER_INCLUDE_NOP \
-I$(builddir)/vte \
-I$(srcdir)/vte \
$(AM_CPPFLAGS)
......@@ -253,6 +255,7 @@ parser_cat_SOURCES = \
parser-charset.hh \
parser-charset-tables.hh \
parser-cmd.hh \
parser-c01.hh \
parser-csi.hh \
parser-dcs.hh \
parser-esc.hh \
......@@ -267,6 +270,7 @@ parser_cat_SOURCES = \
parser_cat_CPPFLAGS = \
-I$(builddir) \
-I$(srcdir) \
-DPARSER_INCLUDE_NOP \
$(AM_CPPFLAGS)
parser_cat_CFLAGS = \
$(GLIB_CFLAGS) \
......@@ -292,6 +296,7 @@ test_parser_SOURCES = \
parser-charset.hh \
parser-charset-tables.hh \
parser-cmd.hh \
parser-c01.hh \
parser-csi.hh \
parser-dcs.hh \
parser-esc.hh \
......@@ -303,6 +308,7 @@ test_parser_SOURCES = \
test_parser_CPPFLAGS = \
-I$(builddir) \
-I$(srcdir) \
-DPARSER_INCLUDE_NOP \
$(AM_CPPFLAGS)
test_parser_CXXFLAGS = \
$(VTE_CFLAGS) \
......
......@@ -15,6 +15,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#if !defined(MODE) || !defined(MODE_FIXED)
#error "Must define MODE and MODE_FIXED before including this file"
#endif
/*
* Modes for SM_ECMA/RM_ECMA.
*
......@@ -23,8 +27,19 @@
* References: ECMA-48 § 7
* WY370
*/
MODE(IRM, 4)
/*
* SRM - local echo send/receive mode
* If set, characters entered by the keyboard are shown on the
* screen as well as being sent to the host; if reset, the
* keyboard input is only sent to the host.
*
* Default: reset
*
* References: ECMA-48 § XXX
* VT525
*/
MODE(SRM, 12)
/* Unsupported */
......@@ -46,20 +61,132 @@ MODE_FIXED(TTM, 16, ALWAYS_RESET)
MODE_FIXED(SATM, 17, ALWAYS_RESET)
MODE_FIXED(TSM, 18, ALWAYS_RESET)
MODE_FIXED(EBM, 19, ALWAYS_RESET) /* ECMA-48 § F.5.1 Removed */
MODE_FIXED(LNM, 20, ALWAYS_RESET) /* ECMA-48 § F.5.2 Removed */
/*
* LNM - line feed/newline mode
* If set, the cursor moves to the first column on LF, FF, VT,
* and a Return key press sends CRLF.
* If reset, the cursor column is unchanged by LF, FF, VT,
* and a Return key press sends CR only.
*
* Default: reset
*
* References: ECMA-48 § F.5.2 Removed!
* VT525
*/
MODE_FIXED(LNM, 20, ALWAYS_RESET)
MODE_FIXED(GRCM, 21, ALWAYS_SET)
MODE_FIXED(ZDM, 22, ALWAYS_RESET) /* ECMA-48 § F.4.2 Deprecated */
#if 0
MODE_FIXED(WYDSCM, 30, ALWAYS_SET)
/*
* WYDSCM - display disable mode
* If set, blanks the screen; if reset, shows the data.
*
* Default: reset
*
* References: WY370
*/
MODE_FIXED(WYDSCM, 30, ALWAYS_RESET)
/*
* WHYSTLINM - status line display mode
*
* Default: reset (set-up)
*
* References: WY370
*/
MODE_FIXED(WYSTLINM, 31, ALWAYS_RESET)
/*
* WYCRTSAVM - screen saver mode
* Like DECCRTSM.
*
* Default: reset (set-up)
*
* References: WY370
*/
MODE_FIXED(WYCRTSAVM, 32, ALWAYS_RESET)
MODE_FIXED(WYSTCURM, 33, ?)
MODE_FIXED(WYULCURM, 34, ?)
/*
* WYSTCURM - steady cursor mode
*
* Default: reset (set-up)
*
* References: WY370
*/
MODE_FIXED(WYSTCURM, 33, ALWAYS_RESET)
/*
* WYULCURM - underline cursor mode
*
* Default: reset (set-up)
*
* References: WY370
*/
MODE_FIXED(WYULCURM, 34, ALWAYS_RESET)
/*
* WYCLRM - width change clear disable mode
* If set, the screen is not cleared when the column mode changes
* by DECCOLM or WY161.
* Note that this does not affect DECSCPP.
* This is the same as DECNCSM mode.
*
* Default: set (set-up)
*
* References: WY370
*/
MODE_FIXED(WYCLRM, 35, ALWAYS_SET)
/*
* WYDELKM - delete key definition
*
* Default: reset (set-up)
*
* References: WY370
*/
MODE_FIXED(WYDELKM, 36, ALWAYS_RESET) /* Same as DECBKM */
MODE_FIXED(WYGATM, 37, ?)
MODE_FIXED(WYTEXM, 38, ?)
/*
* WYGATM - send characters mode
* If set, sends all characters; if reset, only erasable characters.
* Like GATM above.
*
* Default: reset (set-up)
*
* References: WY370
*/
MODE_FIXED(WYGATM, 37, ALWAYS_RESET)
/*
* WYTEXM - send full screen/scrolling region to printer
* Like DECPEX mode.
*
* Default: reset (set-up)
*
* References: WY370
*/
MODE_FIXED(WYTEXM, 38, ALWAYS_RESET)
/*
* WYEXTDM - extra data line
* If set, the last line of the screen is used as data line and not
* a status line; if reset, the last line of the screen is used
* as a status line.
*
* Default: reset
*
* References: WY370
*/
MODE_FIXED(WYEXTDM, 40, ALWAYS_SET)
/*
* WYASCII - WY350 personality mode
* If set, switches to WY350 personality.
*
* Default: reset (set-up)
*
* References: WY370
*/
MODE_FIXED(WYASCII, 42, ALWAYS_SET)
#endif
......@@ -15,6 +15,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#if !defined(MODE) || !defined(MODE_FIXED)
#error "Must define MODE and MODE_FIXED before including this file"
#endif
/*
* Modes for SM_DEC/RM_DEC.
*
......@@ -36,36 +40,83 @@
/*
* DECCKM - cursor keys mode
*
* Controls whether the cursor keys send cursor sequences, or application
* sequences.
*
* Default: reset
*
* References: VT525
*/
MODE(DEC_APPLICATION_CURSOR_KEYS, 1)
/*
* DECCOLM: 132 column mode
*
* Sets page width to 132 (set) or 80 (reset) columns.
*
* Changing this mode resets the top, bottom, left, right margins;
* clears the screen (unless DECNCSM is set); resets DECLRMM; and clears
* the status line if host-writable.
*
* Default: reset
*
* References: VT525
*/
MODE(DEC_132_COLUMN, 3)
/*
* DECSCNM - screen mode
* If set, displays reverse; if reset, normal.
*
* Default: reset
*
* References: VT525
*/
MODE(DEC_REVERSE_IMAGE, 5)
/*
* DECOM - origin mode
* If set, the cursor is restricted to within the page margins.
*
* On terminal reset, DECOM is reset.
*
* Default: reset
*
* References: VT525
*/
MODE(DEC_ORIGIN, 6)
/*
* DECAWM - auto wrap mode
*
* Controls whether text wraps to the next line when the
* cursor reaches the right margin.
*
* Default: reset
*
* References: VT525
*/
MODE(DEC_AUTOWRAP, 7)
/*
* DECTCEM - text cursor enable
* If set, the text cursor is visible; if reset, invisible.
*
* Default: set
*
* References: VT525
*/
MODE(DEC_TEXT_CURSOR, 25)
/*
* DECNKM - numeric/application keypad mode
* Controls whether the numeric keypad sends application (set)
* or keypad (reset) sequences.
*
* Default: reset
*
* References: VT525
*/
MODE(DEC_APPLICATION_KEYPAD, 66)
......@@ -95,53 +146,549 @@ MODE(URXVT_MOUSE_EXT, 1015)
/* DEC */
/*
* DECANM - ansi-mode
* Resetting this puts the terminal into VT52 compatibility mode.
* Control sequences overlap with regular sequences so we have to
* detect them early before dispatching them.
* To return to ECMA-48 mode, use ESC < [1/11 3/12].
*
* Default: set
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECANM, 2, ALWAYS_SET)
/*
* DECSCLM - scrolling mode
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECSCLM, 4, ALWAYS_RESET)
/*
* DECARM - autorepeat mode
* Controls whether keys auytomatically repeat while held pressed
* for more than 0.5s.
* Note that /some/ keys do not repeat regardless of this setting.
*
* Default: set
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECARM, 8, ALWAYS_SET)
MODE_FIXED(DECLTM, 11, ALWAYS_RESET)
MODE_FIXED(DECEKEM, 16, ALWAYS_RESET)
/*
* DECPFF - print FF mode
* Controls whether the terminal terminates a print command by
* sending a FF to the printer.
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECCPFF, 18, ALWAYS_RESET)
/*
* DECPEX - print extent mode
* If set, print page prints only the scrolling region;
* if reset, the complete page.
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECPEX, 19, ALWAYS_RESET)
/*
* DECLRM - RTL mode
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECRLM, 34, ALWAYS_RESET)
/*
* DECHEBM - hebrew/north-american keyboard mapping mode
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECHEBM, 35, ALWAYS_RESET)
/*
* DECHEM - hebrew encoding mode
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECHEM, 36, ALWAYS_RESET)
/*
* DECNRCM - NRCS mode
* Operates in 7-bit (set) or 8-bit (reset) mode.
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECNRCM, 42, ALWAYS_RESET)
MODE_FIXED(DECGEPM, 43, ALWAYS_RESET) /* from VT330 */
/* MODE_FIXED(DECGPCM, 44, ALWAYS_RESET) * from VT330, conflicts with XTERM_MARGIN_BELL */
/* MODE_FIXED(DECGPCS, 45, ALWAYS_RESET) * from VT330, conflicts with XTERM_REVERSE_WRAP */
/* MODE_FIXED(DECGPBM, 46, ALWAYS_RESET) * from VT330, conflicts with XTERM_LOGGING */
/* MODE_FIXED(DECGRPM, 47, ALWAYS_RESET) * from VT330, conflicts with XTERM_ALTBUF */
MODE_FIXED(DEC131TM, 53, ALWAYS_RESET)
/*
* DECNAKB - greek/north-american keyboard mapping mode
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECNAKB, 57, ALWAYS_RESET)
/*
* DECIPEM - enter/return to/from pro-printer emulation mode
* Switches the terminal to (set)/from (reset) the ibm pro
* printer protocol.
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECIPEM, 58, ALWAYS_RESET)
/* MODE_FIXED(DECKKDM, 59, ALWAYS_SET) * Kanji/Katakana Display Mode, from VT382-Kanji */
/*
* DECHCCM - horizontal cursor coupling mode
* Controls what happens when the cursor moves out of the left or
* right margins of the window.
* If set, the window pans to keep the cursor in view; if reset,
* the cursor disappears.
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECHCCM, 60, ALWAYS_RESET)
MODE_FIXED(DECVCCM, 61, ALWAYS_RESET)
MODE_FIXED(DECPCCM, 64, ALWAYS_RESET)
/*
* DECVCCM - vertical cursor coupling mode
* Controls what happens when the cursor moves out of the top or
* bottom of the window, When the height of the window is smaller
* than the page.
* If set, the window pans to keep the cursor in view; if reset,
* the cursor disappears.
*
* Default: set
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECVCCM, 61, ALWAYS_SET)
/*
* DECPCCM - page cursor coupling mode
*
* Default: set
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECPCCM, 64, ALWAYS_SET)
/*
* DECBKM - backarrow key mode
* WYDELKM
*
* If set, the Backspace key works as a backspace key
* sending the BS control; if reset, it works as a Delete
* key sending the DEL control.
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECBKM, 67, ALWAYS_RESET)
/*
* DECKBUM - typewriter/data rpocessing keys mode
*
* If set, the keyboard keys act as data processing keys;
* if reset, as typewriter keys.
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECKBUM, 68, ALWAYS_RESET)
MODE_FIXED(DECVSSM, 69, ALWAYS_RESET) /* aka DECLRMM */
/*
* DECLRMM - vertical split-screen mode
* Controls whether a DECSLRM is executed.
* On set, resets line attributes to single width and single height,
* and while set, the terminal ignores any changes to line attributes.
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECLRMM, 69, ALWAYS_RESET) /* aka DECVSSM */
/*
* DECXRLM - transmit rate limit
* If set, limits the transmit rate; if reset, the rate is
* unlimited.
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECXRLM, 73, ALWAYS_RESET)
/*
* DECSDM - sixel display mode
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
/* MODE_FIXED(DECSDM, 80, ALWAYS_RESET) ! Conflicts with WY161 */
/*
* DECKPM - key position mode
* If set, the keyboard sends extended reports (DECEKBD) that include
* the key position and modifier state; if reset, it sends character codes.
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECKPM, 81, ALWAYS_RESET)
MODE_FIXED(DECTHAISCM, 90, ALWAYS_RESET) /* Thai Space Compensating Mode, from VT382-Thai */
/*
* DECNCSM - no clear screen on DECOLM
* If set, the screen is not cleared when the column mode changes
* by DECCOLM.
* Note that this does not affect DECSCPP.
*
* Default: set
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECNCSM, 95, ALWAYS_RESET)
/*
* DECRLCM - RTL copy mode
* If set, copy/paste from RTL; if reset, from LTR.
* Only enabled when the keyboard language is set to hebrew.
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECRLCM, 96, ALWAYS_RESET)
/*
* DECCRTSM - CRT save mode
* When set, blanks the terminal after the inactivity timeout
* (set with DECCRTST).
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECRCRTSM, 97, ALWAYS_RESET)
/*
* DECARSM - auto resize mode
* Sets whether changing page arrangements automatically
* changes the lines per screen.
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECARSM, 98, ALWAYS_RESET)
/*
* DECMCM - modem control mode
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECMCM, 99, ALWAYS_RESET)
/*
* DECAAM - auto answerback mode
*
* Default: reset
*
* References: VT525
*/
MODE_FIXED(DECAAM, 100, ALWAYS_RESET)
/*
* DECCANSM - conceal answerback message mode
*
* Default: reset
*
* References: VT525
*
* Unimplemented, since we don't support answerback at all.
*/
MODE_FIXED(DECANSM, 101, ALWAYS_RESET)
/*
* DECNULM - null mode
* If set, pass NUL to the printer; if reset, discard NUL.
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECNULM, 102, ALWAYS_RESET)
/*
* DECHDPXM - half-duplex mode
* Whether to use half-duplex (set) or full-duplex (reset) mode.
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECHDPXM, 103, ALWAYS_RESET)
/*
* DECESKM - enable secondary keyboard language mode
* If set, use the secondary keyboard mapping (group 2); if reset,
* use the primary (group 1).
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECESKM, 104, ALWAYS_RESET)
/*
* DECOSCNM - overscan mode
* (monochrome terminal only)
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECOSCNM, 106, ALWAYS_RESET)
/*
* DECNUMLK - num lock mode
*
* Set the num lock state as if by acting the NumLock key.
* Set means NumLock on; reset means off.
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECNUMLK, 108, ALWAYS_RESET)
/*
* DECCAPSLK - caps lock mode
*
* Set the caps lock state as if by acting the CapsLock key.
* Set means CapsLock on; reset means off.
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECCAPSLK, 109, ALWAYS_RESET)
/*
* DECKLHIM - keyboard LED host indicator mode
* If set, the keyboard LEDs show the state from the host
* (see DECLL); if reset, the local state.
*
* Default: reset
*
* References: VT525
*
* Probably not worth implementing.
*/
MODE_FIXED(DECKLHIM, 110, ALWAYS_RESET)
/*
* DECFWM - framed window mode
* If set, session window frames are drawn with frame border and icon.
*
* Default: reset
*
* References: VT525
*
* VTE does not support sessions.
*/
MODE_FIXED(DECFWM, 111, ALWAYS_RESET)
MODE_FIXED(DECRPL, 112, ALWAYS_RESET)
/*
* DECRPL - review previous lines mode
* If set, allows to view the scrollback.