diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2024-07-25 19:22:56 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2024-07-25 19:22:56 +0000 |
commit | fb2954048725f4531377ccf5d49a5461cbe1f7e9 (patch) | |
tree | 4fb4641083ed4d5fd72d0c33c6ae697357389633 | |
parent | 4c008a26e440b17c2164acffd17b1150dfb9ba1b (diff) |
Update to xterm 393. tested by op@ and naddy@
71 files changed, 12077 insertions, 4529 deletions
diff --git a/app/xterm/COPYING b/app/xterm/COPYING index 1c1a4a169..0894da4e8 100644 --- a/app/xterm/COPYING +++ b/app/xterm/COPYING @@ -1,7 +1,7 @@ ---- $XTermId: COPYING,v 1.6 2023/01/02 15:46:55 tom Exp $ +--- $XTermId: COPYING,v 1.7 2024/01/01 20:00:01 tom Exp $ ------------------------------------------------------------------------------- -Copyright 1996-2022,2023 by Thomas E. Dickey +Copyright 1996-2023,2024 by Thomas E. Dickey All Rights Reserved diff --git a/app/xterm/MANIFEST b/app/xterm/MANIFEST index 27806e9e6..59f555025 100644 --- a/app/xterm/MANIFEST +++ b/app/xterm/MANIFEST @@ -1,4 +1,4 @@ -MANIFEST for xterm, version xterm-378 +MANIFEST for xterm, version xterm-393 -------------------------------------------------------------------------------- MANIFEST this file 256colres.h resource-definitions for 256-color mode @@ -33,6 +33,8 @@ charclass.c compact character-class module charclass.h interface of charclass.c charproc.c VT100 parser functions charsets.c module to translate character-sets +charsets.dat raw data to transform into charsets.h +charsets.h charset definitions for xterm config.guess configure script: guess the system type config.sub configure script: validate system type configure generated @@ -148,6 +150,8 @@ icons/xterm.xpms collection of icons icons/xterm_16x16.xpm normal icon 16x16 pixmap icons/xterm_32x32.xpm 32x32 monochrome icon icons/xterm_48x48.xpm 48x48 monochrome icon +package subdirectory +package/xterm.spec build-script package/debian subdirectory package/debian/changelog build-script package/debian/color.sed build-script @@ -157,14 +161,13 @@ package/debian/copyright build-script package/debian/postinst post-install script for update-alternatives package/debian/prerm pre-remove script for update-alternatives package/debian/rules build-script -package/debian/source subdirectory -package/debian/source/format build-script -package/debian subdirectory package/debian/watch build-script package/debian/xterm-dev.docs build-script package/debian/xterm-dev.lintian-overrides ignore useless warnings from lintian package/debian/xterm-dev.menu Debian menu-file for xterm-dev package. package/debian/xterm-xres.sed build-script +package/debian/source subdirectory +package/debian/source/format build-script package/freebsd subdirectory package/freebsd/Makefile build-script package/freebsd/distinfo generated sums @@ -178,8 +181,6 @@ package/pkgsrc/Makefile build-script package/pkgsrc/PLIST build-script package/pkgsrc/distinfo build-script package/pkgsrc/options.mk build-script -package subdirectory -package/xterm.spec build-script tektests subdirectory tektests/aitest.tek tek4014 demo: draw a globe tektests/dmerc.tek tek4014 demo: draws a Mercator projection with orbit diff --git a/app/xterm/NEWS b/app/xterm/NEWS index 007c56fcb..d0a7a2732 100644 --- a/app/xterm/NEWS +++ b/app/xterm/NEWS @@ -1,22 +1,31 @@ The NEWS file was generated from xterm.log.html, which serves as the changelog for xterm. -------------------------------------------------------------------------------- - Patch #378 - 2023/01/09 + Patch #393 - 2024/07/11 - * improve descriptions of XTQMODKEYS and XTQALLOWED features in - ctlseqs.ms (reports by Bram Moolenaar, Thomas Wolff). - * add bracketed+paste and report+version building blocks to terminfo, - from ncurses 6.4 - * improve check for unsupported formatting characters, e.g., - zero-width space, to properly ignore them (report by Thomas Wolff). - * improve/document error-checking for some of the controls which - return responses: DECRQSS, XTGETXRES, XTSETTCAP, XTGETTCAP - (prompted by discussion with David Leadbeater). - * improve limit-checks for fallback font cache (report by Dimitrije - Erdeljan). - * improve check for too-wide glyph in fallback font by allowing xterm - to continue searching for a suitable font rather than just failing - on the first. Also add limitFontWidth to allow changing the amount - by which a glyph must extend outside the font's bounding box to - disallow it. + * add a check for ANSI SC/RC, to ignore CSI parameters. + * improve check for missing characters for bitmap-fonts by using the + normal font for reference in the case where the current font, e.g., + the wide-font was derived from the normal font and lacks + per-character metrics (report by Rajeev V. Pillai). + * fix regression in error-recovery for SGR parameters from patch #357 + (report by James Holderness). + * remove some duplicates in xtermcfg.h (report by Matthew Green). + * change default for --enable-imake configure option. + * fixes for wcwidth: + + return 0 for format effectors, like a zero-width printing + character rather than -1 like a control character (report by + Rajeev V. Pillai). + + correct doublewidth to account for reserved codepoints which + are listed in the EastAsianWidth file. + + add a special case for surrogate pairs, which might be checked + in testing the wcwidth function. + * amend sixel bounds-check added in patch #371 to not wrap + out-of-bounds data. + * eliminate maxStringParse limit for SIXEL. + * improve logic which ignores APC, PM and SOS controls to also not + accumulate their data temporarily in a buffer. + * exclude TERM_INGRESS from cleanup of environment variables (patch + by Iain Riley). + * fix some documentation typos (report by Thomas Wolff). diff --git a/app/xterm/THANKS b/app/xterm/THANKS index 39e4d047d..1964ab437 100644 --- a/app/xterm/THANKS +++ b/app/xterm/THANKS @@ -1,4 +1,4 @@ --- $XTermId: THANKS,v 1.36 2022/11/17 00:49:53 tom Exp $ +-- $XTermId: THANKS,v 1.39 2024/02/10 01:24:54 tom Exp $ -- vile:txtmode fk=utf-8 There's no AUTHORS file in this distribution; it would be redundant since I (Thomas E. Dickey) have done more than 80% of the work on xterm since 1996. @@ -13,6 +13,7 @@ Here is a list from xterm.log.html of people who have contributed changes, or whose suggested change could be adapted: Adam M Costello +Adam Saponara Adam Sulmicki Ailin Nemui Al Poole @@ -81,6 +82,7 @@ Dennis Schneider Dimitrios Christidis Ed Schouten Eddy De Greef +Edward Rosten Edward S Arthur Egbert Eich Egmont Koblinger @@ -124,6 +126,7 @@ Joe Allen Joe Peterson Johnny Billquist Jonathan Irwin +Jonny Langley Julien Cristau Juliusz Chroboczek Jungshik Shin @@ -154,6 +157,7 @@ Martin Hostettler Martin Pirker Martin Tournoij Matthew Green +Matthew Martin Matthias Baake Matthias Scheler Matthieu Herrb @@ -193,6 +197,7 @@ Pavel Roskin Peder Stray Per Hedeland Peter Berg Larsen +Petri Kaukasoina Phil Sidler Philipp Klaus Krause Pierre Lombard @@ -252,6 +257,7 @@ Victor Stinner Victor Vaile Vincent Lefèvre Vladimir A Pavlov +Waldemar Brodkorb Walter Harms Werner Fink Werner Lemberg diff --git a/app/xterm/VTPrsTbl.c b/app/xterm/VTPrsTbl.c index 07c904fc6..d5952eef9 100644 --- a/app/xterm/VTPrsTbl.c +++ b/app/xterm/VTPrsTbl.c @@ -1,7 +1,7 @@ -/* $XTermId: VTPrsTbl.c,v 1.106 2022/11/25 01:19:18 tom Exp $ */ +/* $XTermId: VTPrsTbl.c,v 1.117 2023/12/27 22:46:08 tom Exp $ */ /* - * Copyright 1999-2021,2022 by Thomas E. Dickey + * Copyright 1999-2022,2023 by Thomas E. Dickey * * All Rights Reserved * @@ -467,13 +467,13 @@ CASE_CSI_HASH_STATE, /* $ % & ' */ CASE_CSI_DOLLAR_STATE, CASE_CSI_IGNORE, -CASE_CSI_IGNORE, +CASE_CSI_AMP_STATE, CASE_CSI_TICK_STATE, /* ( ) * + */ CASE_CSI_IGNORE, +CASE_CSI_IGNORE, /* vt525 */ CASE_CSI_IGNORE, -CASE_CSI_IGNORE, -CASE_CSI_IGNORE, +CASE_CSI_IGNORE, /* vt420 and vt520 */ /* , - . / */ CASE_CSI_IGNORE, CASE_CSI_IGNORE, @@ -526,8 +526,8 @@ CASE_GROUND_STATE, CASE_SU, /* T U V W */ CASE_TRACK_MOUSE, -CASE_GROUND_STATE, -CASE_GROUND_STATE, +CASE_GROUND_STATE, /* vt420:NP */ +CASE_GROUND_STATE, /* vt420:PP */ CASE_GROUND_STATE, /* X Y Z [ */ CASE_ECH, @@ -627,7 +627,7 @@ CASE_CSI_HASH_STATE, /* currency yen brokenbar section */ CASE_CSI_DOLLAR_STATE, CASE_CSI_IGNORE, -CASE_CSI_IGNORE, +CASE_CSI_AMP_STATE, CASE_CSI_TICK_STATE, /* diaeresis copyright ordfeminine guillemotleft */ CASE_CSI_IGNORE, @@ -791,15 +791,15 @@ CASE_CSI_HASH_STATE, /* $ % & ' */ CASE_CSI_DOLLAR_STATE, CASE_CSI_IGNORE, -CASE_CSI_IGNORE, +CASE_CSI_AMP_STATE, CASE_CSI_TICK_STATE, /* ( ) * + */ CASE_CSI_IGNORE, CASE_CSI_IGNORE, CASE_CSI_STAR_STATE, -CASE_CSI_IGNORE, +CASE_CSI_IGNORE, /* vt420 and vt520 */ /* , - . / */ -CASE_CSI_IGNORE, +CASE_CSI_COMMA_STATE, CASE_CSI_IGNORE, CASE_CSI_IGNORE, CASE_CSI_IGNORE, @@ -850,8 +850,8 @@ CASE_GROUND_STATE, CASE_SU, /* T U V W */ CASE_TRACK_MOUSE, -CASE_GROUND_STATE, -CASE_GROUND_STATE, +CASE_GROUND_STATE, /* vt420:NP */ +CASE_GROUND_STATE, /* vt420:PP */ CASE_GROUND_STATE, /* X Y Z [ */ CASE_ECH, @@ -901,7 +901,7 @@ CASE_GROUND_STATE, /* | } ~ DEL */ CASE_GROUND_STATE, CASE_GROUND_STATE, -CASE_GROUND_STATE, +CASE_GROUND_STATE, /* vt510:DECFNK */ CASE_IGNORE, /* 0x80 0x81 0x82 0x83 */ CASE_GROUND_STATE, @@ -951,7 +951,7 @@ CASE_CSI_HASH_STATE, /* currency yen brokenbar section */ CASE_CSI_DOLLAR_STATE, CASE_CSI_IGNORE, -CASE_CSI_IGNORE, +CASE_CSI_AMP_STATE, CASE_CSI_TICK_STATE, /* diaeresis copyright ordfeminine guillemotleft */ CASE_CSI_IGNORE, @@ -959,7 +959,7 @@ CASE_CSI_IGNORE, CASE_CSI_STAR_STATE, CASE_CSI_IGNORE, /* notsign hyphen registered macron */ -CASE_CSI_IGNORE, +CASE_CSI_COMMA_STATE, CASE_CSI_IGNORE, CASE_CSI_IGNORE, CASE_CSI_IGNORE, @@ -1537,10 +1537,10 @@ CASE_DECSCA, CASE_GROUND_STATE, CASE_GROUND_STATE, /* t u v w */ -CASE_GROUND_STATE, -CASE_GROUND_STATE, -CASE_GROUND_STATE, -CASE_GROUND_STATE, +CASE_GROUND_STATE, /* vt510:DECSRFR */ +CASE_GROUND_STATE, /* vt510:DECSTRL */ +CASE_DECRQDE, +CASE_GROUND_STATE, /* vt420:DECRPDE */ /* x y z { */ CASE_GROUND_STATE, CASE_GROUND_STATE, @@ -1699,7 +1699,7 @@ CASE_GROUND_STATE, /* ocircumflex otilde odiaeresis division */ CASE_GROUND_STATE, CASE_GROUND_STATE, -CASE_GROUND_STATE, +CASE_DECRQDE, CASE_GROUND_STATE, /* oslash ugrave uacute ucircumflex */ CASE_GROUND_STATE, @@ -1817,9 +1817,9 @@ CASE_GROUND_STATE, CASE_GROUND_STATE, CASE_GROUND_STATE, /* P Q R S */ -CASE_GROUND_STATE, -CASE_GROUND_STATE, -CASE_GROUND_STATE, +CASE_GROUND_STATE, /* vt510:PPA */ +CASE_GROUND_STATE, /* vt420:PPR */ +CASE_GROUND_STATE, /* vt510:PPB */ CASE_GROUND_STATE, /* T U V W */ CASE_GROUND_STATE, @@ -1857,14 +1857,14 @@ CASE_GROUND_STATE, CASE_GROUND_STATE, CASE_GROUND_STATE, /* p q r s */ -CASE_GROUND_STATE, +CASE_GROUND_STATE, /* vt510:DECSSCLS */ CASE_DECSCUSR, -CASE_GROUND_STATE, +CASE_GROUND_STATE, /* vt510:DECSKCV */ CASE_GROUND_STATE, /* t u v w */ CASE_DECSWBV, CASE_DECSMBV, -CASE_GROUND_STATE, +CASE_GROUND_STATE, /* vt510:DECSLCK */ CASE_GROUND_STATE, /* x y z { */ CASE_GROUND_STATE, @@ -1873,8 +1873,8 @@ CASE_GROUND_STATE, CASE_GROUND_STATE, /* | } ~ DEL */ CASE_GROUND_STATE, -CASE_GROUND_STATE, -CASE_GROUND_STATE, +CASE_GROUND_STATE, /* vt510:DECKBD */ +CASE_GROUND_STATE, /* vt510:DECTME */ CASE_IGNORE, /* 0x80 0x81 0x82 0x83 */ CASE_GROUND_STATE, @@ -2689,6 +2689,330 @@ CASE_GROUND_STATE, }; #endif +Const PARSE_T csi_amp_table[] = /* CSI ... & */ +{ +/* NUL SOH STX ETX */ +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +/* EOT ENQ ACK BEL */ +CASE_IGNORE, +CASE_ENQ, +CASE_IGNORE, +CASE_BELL, +/* BS HT NL VT */ +CASE_BS, +CASE_TAB, +CASE_VMOT, +CASE_VMOT, +/* FF CR SO SI */ +CASE_VMOT, +CASE_CR, +CASE_SO, +CASE_SI, +/* DLE DC1 DC2 DC3 */ +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +/* DC4 NAK SYN ETB */ +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +/* CAN EM SUB ESC */ +CASE_GROUND_STATE, +CASE_IGNORE, +CASE_GROUND_STATE, +CASE_ESC, +/* FS GS RS US */ +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +/* SP ! " # */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* $ % & ' */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* ( ) * + */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* , - . / */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* 0 1 2 3 */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* 4 5 6 7 */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* 8 9 : ; */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* < = > ? */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* @ A B C */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* D E F G */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* H I J K */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* L M N O */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* P Q R S */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* T U V W */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* X Y Z [ */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* \ ] ^ _ */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* ` a b c */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* d e f g */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* h i j k */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* l m n o */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* p q r s */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* t u v w */ +CASE_GROUND_STATE, +CASE_DECRQUPSS, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* x y z { */ +CASE_GROUND_STATE, /* vt420:Enable Session */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* | } ~ DEL */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_IGNORE, +/* 0x80 0x81 0x82 0x83 */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* 0x84 0x85 0x86 0x87 */ +CASE_IND, +CASE_NEL, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* 0x88 0x89 0x8a 0x8b */ +CASE_HTS, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* 0x8c 0x8d 0x8e 0x8f */ +CASE_GROUND_STATE, +CASE_RI, +CASE_SS2, +CASE_SS3, +/* 0x90 0x91 0x92 0x93 */ +CASE_DCS, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* 0x94 0x95 0x96 0x97 */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_SPA, +CASE_EPA, +/* 0x98 0x99 0x9a 0x9b */ +CASE_SOS, +CASE_GROUND_STATE, +CASE_DECID, +CASE_CSI_STATE, +/* 0x9c 0x9d 0x9e 0x9f */ +CASE_ST, +CASE_OSC, +CASE_PM, +CASE_APC, +/* nobreakspace exclamdown cent sterling */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* currency yen brokenbar section */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* diaeresis copyright ordfeminine guillemotleft */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* notsign hyphen registered macron */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* degree plusminus twosuperior threesuperior */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* acute mu paragraph periodcentered */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* cedilla onesuperior masculine guillemotright */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* onequarter onehalf threequarters questiondown */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* Agrave Aacute Acircumflex Atilde */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Adiaeresis Aring AE Ccedilla */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Egrave Eacute Ecircumflex Ediaeresis */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Igrave Iacute Icircumflex Idiaeresis */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Eth Ntilde Ograve Oacute */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Ocircumflex Otilde Odiaeresis multiply */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Ooblique Ugrave Uacute Ucircumflex */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Udiaeresis Yacute Thorn ssharp */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* agrave aacute acircumflex atilde */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* adiaeresis aring ae ccedilla */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* egrave eacute ecircumflex ediaeresis */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* igrave iacute icircumflex idiaeresis */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* eth ntilde ograve oacute */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* ocircumflex otilde odiaeresis division */ +CASE_GROUND_STATE, +CASE_DECRQUPSS, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* oslash ugrave uacute ucircumflex */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* udiaeresis yacute thorn ydiaeresis */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +}; + #if OPT_DEC_RECTOPS Const PARSE_T csi_dollar_table[] = /* CSI ... $ */ { @@ -2839,12 +3163,12 @@ CASE_DECCARA, CASE_GROUND_STATE, /* t u v w */ CASE_DECRARA, -CASE_GROUND_STATE, +CASE_GROUND_STATE, /* vt420:DECRQTSR */ CASE_DECCRA, CASE_DECRQPSR, /* x y z { */ CASE_DECFRA, -CASE_GROUND_STATE, +CASE_GROUND_STATE, /* vt420:DECRPM */ CASE_DECERA, CASE_DECSERA, /* | } ~ DEL */ @@ -3157,23 +3481,23 @@ CASE_GROUND_STATE, CASE_GROUND_STATE, CASE_GROUND_STATE, /* p q r s */ -CASE_GROUND_STATE, -CASE_GROUND_STATE, -CASE_GROUND_STATE, -CASE_GROUND_STATE, +CASE_GROUND_STATE, /* vt510:DECSPPCS */ +CASE_GROUND_STATE, /* vt420:DECSRC */ +CASE_GROUND_STATE, /* vt510:DECSCS */ +CASE_GROUND_STATE, /* vt510:DECSFC */ /* t u v w */ CASE_GROUND_STATE, -CASE_GROUND_STATE, +CASE_GROUND_STATE, /* vt510:DECSCP */ CASE_GROUND_STATE, CASE_GROUND_STATE, /* x y z { */ CASE_DECSACE, CASE_DECRQCRA, -CASE_GROUND_STATE, +CASE_GROUND_STATE, /* vt420:DECINVM */ CASE_GROUND_STATE, /* | } ~ DEL */ CASE_DECSNLS, -CASE_GROUND_STATE, +CASE_GROUND_STATE, /* vt420:DECLFKC */ CASE_GROUND_STATE, CASE_IGNORE, /* 0x80 0x81 0x82 0x83 */ @@ -3339,6 +3663,332 @@ CASE_GROUND_STATE, }; #endif /* OPT_DEC_RECTOPS */ +#if OPT_VT525_COLORS +Const PARSE_T csi_comma_table[] = /* CSI ... , */ +{ +/* NUL SOH STX ETX */ +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +/* EOT ENQ ACK BEL */ +CASE_IGNORE, +CASE_ENQ, +CASE_IGNORE, +CASE_BELL, +/* BS HT NL VT */ +CASE_BS, +CASE_TAB, +CASE_VMOT, +CASE_VMOT, +/* FF CR SO SI */ +CASE_VMOT, +CASE_CR, +CASE_SO, +CASE_SI, +/* DLE DC1 DC2 DC3 */ +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +/* DC4 NAK SYN ETB */ +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +/* CAN EM SUB ESC */ +CASE_GROUND_STATE, +CASE_IGNORE, +CASE_GROUND_STATE, +CASE_ESC, +/* FS GS RS US */ +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +/* SP ! " # */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* $ % & ' */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* ( ) * + */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* , - . / */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* 0 1 2 3 */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* 4 5 6 7 */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* 8 9 : ; */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* < = > ? */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* @ A B C */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* D E F G */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* H I J K */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* L M N O */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* P Q R S */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* T U V W */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* X Y Z [ */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* \ ] ^ _ */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* ` a b c */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* d e f g */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* h i j k */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* l m n o */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* p q r s */ +CASE_GROUND_STATE, /* vt520:DECLTOD */ +CASE_DECTID, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* t u v w */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, /* vt520:DECRQKT */ +CASE_GROUND_STATE, /* vt520:DECRPKT */ +CASE_GROUND_STATE, /* vt520:DECRQKD */ +/* x y z { */ +CASE_GROUND_STATE, /* vt520:DECSPMA */ +CASE_GROUND_STATE, /* vt520:DECUS */ +CASE_GROUND_STATE, /* vt520:DECDLDA */ +CASE_GROUND_STATE, /* vt520:DECSZS */ +/* | } ~ DEL */ +CASE_DECAC, +CASE_DECATC, +CASE_GROUND_STATE, /* vt520:DECPS */ +CASE_GROUND_STATE, +/* 0x80 0x81 0x82 0x83 */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* 0x84 0x85 0x86 0x87 */ +CASE_IND, +CASE_NEL, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* 0x88 0x89 0x8a 0x8b */ +CASE_HTS, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* 0x8c 0x8d 0x8e 0x8f */ +CASE_GROUND_STATE, +CASE_RI, +CASE_SS2, +CASE_SS3, +/* 0x90 0x91 0x92 0x93 */ +CASE_DCS, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* 0x94 0x95 0x96 0x97 */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_SPA, +CASE_EPA, +/* 0x98 0x99 0x9a 0x9b */ +CASE_SOS, +CASE_GROUND_STATE, +CASE_DECID, +CASE_CSI_STATE, +/* 0x9c 0x9d 0x9e 0x9f */ +CASE_ST, +CASE_OSC, +CASE_PM, +CASE_APC, +/* nobreakspace exclamdown cent sterling */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* currency yen brokenbar section */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* diaeresis copyright ordfeminine guillemotleft */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* notsign hyphen registered macron */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* degree plusminus twosuperior threesuperior */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* acute mu paragraph periodcentered */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* cedilla onesuperior masculine guillemotright */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* onequarter onehalf threequarters questiondown */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* Agrave Aacute Acircumflex Atilde */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Adiaeresis Aring AE Ccedilla */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Egrave Eacute Ecircumflex Ediaeresis */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Igrave Iacute Icircumflex Idiaeresis */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Eth Ntilde Ograve Oacute */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Ocircumflex Otilde Odiaeresis multiply */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Ooblique Ugrave Uacute Ucircumflex */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Udiaeresis Yacute Thorn ssharp */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* agrave aacute acircumflex atilde */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* adiaeresis aring ae ccedilla */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* egrave eacute ecircumflex ediaeresis */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* igrave iacute icircumflex idiaeresis */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* eth ntilde ograve oacute */ +CASE_GROUND_STATE, +CASE_DECTID, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* ocircumflex otilde odiaeresis division */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* oslash ugrave uacute ucircumflex */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* udiaeresis yacute thorn ydiaeresis */ +CASE_DECAC, +CASE_DECATC, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +}; +#endif /* OPT_VT525_COLORS */ + Const PARSE_T dec_table[] = /* CSI ? */ { /* NUL SOH STX ETX */ @@ -3450,7 +4100,7 @@ CASE_GRAPHICS_ATTRIBUTES, CASE_GROUND_STATE, CASE_GROUND_STATE, CASE_GROUND_STATE, -CASE_GROUND_STATE, +CASE_DECST8C, /* X Y Z [ */ CASE_GROUND_STATE, CASE_GROUND_STATE, @@ -3610,7 +4260,7 @@ CASE_GRAPHICS_ATTRIBUTES, CASE_GROUND_STATE, CASE_GROUND_STATE, CASE_GROUND_STATE, -CASE_GROUND_STATE, +CASE_DECST8C, /* Ooblique Ugrave Uacute Ucircumflex */ CASE_GROUND_STATE, CASE_GROUND_STATE, diff --git a/app/xterm/VTparse.def b/app/xterm/VTparse.def index 60cac529f..9761b2987 100644 --- a/app/xterm/VTparse.def +++ b/app/xterm/VTparse.def @@ -1,10 +1,10 @@ -# $XTermId: VTparse.def,v 1.66 2022/11/24 13:58:46 tom Exp $ +# $XTermId: VTparse.def,v 1.72 2023/12/27 22:45:19 tom Exp $ # # vile:confmode rs=lf # ----------------------------------------------------------------------------- # this file is part of xterm # -# Copyright 1996-2021,2022 by Thomas E. Dickey +# Copyright 1996-2022,2023 by Thomas E. Dickey # # All Rights Reserved # @@ -221,3 +221,11 @@ CASE_XTERM_SHIFT_ESCAPE # XTSHIFTESCAPE CASE_DECSSDT CASE_DECSASD CASE_XTERM_REPORT_MOD_FKEYS # XTQMODKEYS +CASE_DECRQDE +CASE_DECRQUPSS +CASE_CSI_AMP_STATE +CASE_CSI_COMMA_STATE +CASE_DECAC +CASE_DECATC +CASE_DECTID +CASE_DECST8C diff --git a/app/xterm/VTparse.h b/app/xterm/VTparse.h index 4670bfde4..940ab225c 100644 --- a/app/xterm/VTparse.h +++ b/app/xterm/VTparse.h @@ -1,7 +1,7 @@ -/* $XTermId: VTparse.h,v 1.69 2019/02/10 23:34:21 tom Exp $ */ +/* $XTermId: VTparse.h,v 1.72 2023/11/24 13:18:38 tom Exp $ */ /* - * Copyright 1996-2018,2019 by Thomas E. Dickey + * Copyright 1996-2019,2023 by Thomas E. Dickey * * All Rights Reserved * @@ -51,10 +51,13 @@ typedef unsigned char PARSE_T; extern Const PARSE_T ansi_table[]; extern Const PARSE_T cigtable[]; extern Const PARSE_T csi2_table[]; +extern Const PARSE_T csi_amp_table[]; +extern Const PARSE_T csi_dec_dollar_table[]; extern Const PARSE_T csi_ex_table[]; extern Const PARSE_T csi_quo_table[]; extern Const PARSE_T csi_sp_table[]; extern Const PARSE_T csi_table[]; +extern Const PARSE_T csi_tick_table[]; extern Const PARSE_T dec2_table[]; extern Const PARSE_T dec3_table[]; extern Const PARSE_T dec_table[]; @@ -65,8 +68,6 @@ extern Const PARSE_T scrtable[]; extern Const PARSE_T scs96table[]; extern Const PARSE_T scstable[]; extern Const PARSE_T sos_table[]; -extern Const PARSE_T csi_dec_dollar_table[]; -extern Const PARSE_T csi_tick_table[]; #if OPT_DEC_RECTOPS extern Const PARSE_T csi_dollar_table[]; @@ -79,6 +80,10 @@ extern Const PARSE_T vt52_esc_table[]; extern Const PARSE_T vt52_ignore_table[]; #endif +#if OPT_VT525_COLORS +extern Const PARSE_T csi_comma_table[]; +#endif + #if OPT_WIDE_CHARS extern Const PARSE_T esc_pct_table[]; extern Const PARSE_T scs_amp_table[]; diff --git a/app/xterm/button.c b/app/xterm/button.c index 6f238fab2..ae1ae43f5 100644 --- a/app/xterm/button.c +++ b/app/xterm/button.c @@ -1,7 +1,7 @@ -/* $XTermId: button.c,v 1.646 2022/11/25 00:26:32 tom Exp $ */ +/* $XTermId: button.c,v 1.663 2024/04/19 07:42:00 tom Exp $ */ /* - * Copyright 1999-2021,2022 by Thomas E. Dickey + * Copyright 1999-2023,2024 by Thomas E. Dickey * * All Rights Reserved * @@ -77,6 +77,7 @@ button.c Handles button events in the terminal emulator. #include <menu.h> #include <charclass.h> #include <xstrings.h> +#include <xterm_io.h> #if OPT_SELECT_REGEX #if defined(HAVE_PCRE2POSIX_H) @@ -1302,8 +1303,9 @@ eventColBetween(TScreen *screen, XEvent *event) /* must be XButtonEvent */ } static int -ReadLineMovePoint(TScreen *screen, int col, int ldelta) +ReadLineMovePoint(XtermWidget xw, int col, int ldelta) { + TScreen *screen = TScreenOf(xw); Char line[6]; unsigned count = 0; @@ -1314,13 +1316,13 @@ ReadLineMovePoint(TScreen *screen, int col, int ldelta) line[count++] = ANSI_CSI; } else { line[count++] = ANSI_ESC; - line[count++] = '['; /* XXX maybe sometimes O is better? */ + line[count++] = (xw->keyboard.flags & MODE_DECCKM) ? 'O' : '['; } line[count] = CharOf(col > 0 ? 'C' : 'D'); if (col < 0) col = -col; while (col--) - v_write(screen->respond, line, 3); + v_write(screen->respond, line, (size_t) 3); return 1; } @@ -1328,12 +1330,16 @@ static int ReadLineDelete(TScreen *screen, CELL *cell1, CELL *cell2) { int del; + Char erases[2]; + + erases[0] = (Char) get_tty_erase(screen->respond, XTERM_ERASE, "pty"); + erases[1] = 0; del = (cell2->col - cell1->col) + ((cell2->row - cell1->row) * MaxCols(screen)); if (del <= 0) /* Just in case... */ return 0; while (del--) - v_write(screen->respond, (const Char *) "\177", 1); + v_write(screen->respond, erases, (size_t) 1); return 1; } @@ -1348,13 +1354,13 @@ readlineExtend(XtermWidget xw, XEvent *event) if (isClick1_clean(xw, my_event) && SCREEN_FLAG(screen, click1_moves) && rowOnCurrentLine(screen, eventRow(screen, event), &ldelta1)) { - ReadLineMovePoint(screen, eventColBetween(screen, event), ldelta1); + ReadLineMovePoint(xw, eventColBetween(screen, event), ldelta1); } if (isDoubleClick3(xw, screen, my_event) && SCREEN_FLAG(screen, dclick3_deletes) && rowOnCurrentLine(screen, screen->startSel.row, &ldelta1) && rowOnCurrentLine(screen, screen->endSel.row, &ldelta2)) { - ReadLineMovePoint(screen, screen->endSel.col, ldelta2); + ReadLineMovePoint(xw, screen->endSel.col, ldelta2); ReadLineDelete(screen, &screen->startSel, &(screen->endSel)); } } @@ -1388,7 +1394,7 @@ DiredButton(Widget w, Line[2] = 'G'; Line[3] = CharOf(' ' + col); Line[4] = CharOf(' ' + line); - v_write(screen->respond, Line, 5); + v_write(screen->respond, Line, (size_t) 5); } } } @@ -1436,13 +1442,12 @@ ReadLineButton(Widget w, if (col == 0) goto finish; Line[0] = ANSI_ESC; - /* XXX: sometimes it is better to send '['? */ - Line[1] = 'O'; + Line[1] = (xw->keyboard.flags & MODE_DECCKM) ? 'O' : '['; Line[2] = CharOf(col > 0 ? 'C' : 'D'); if (col < 0) col = -col; while (col--) - v_write(screen->respond, Line, 3); + v_write(screen->respond, Line, (size_t) 3); finish: if (event->type == ButtonRelease) do_select_end(xw, event, params, num_params, False); @@ -1473,7 +1478,7 @@ ViButton(Widget w, Char Line[6]; Line[0] = ANSI_ESC; /* force an exit from insert-mode */ - v_write(pty, Line, 1); + v_write(pty, Line, (size_t) 1); if (line < 0) { line = -line; @@ -1482,7 +1487,7 @@ ViButton(Widget w, Line[0] = CONTROL('p'); } while (--line >= 0) - v_write(pty, Line, 1); + v_write(pty, Line, (size_t) 1); } } } @@ -1665,6 +1670,8 @@ DECtoASCII(unsigned ch) if (xtermIsDecGraphic(ch)) { ch = CharOf("###########+++++##-##++++|######"[ch]); /* 01234567890123456789012345678901 */ + } else { + ch = '?'; /* DEC Technical has no mapping */ } return ch; } @@ -1697,20 +1704,22 @@ UTF8toLatin1(TScreen *screen, Char *s, unsigned long len, unsigned long *result) if (len != 0) { PtyData data; + Boolean save_vt100 = screen->vt100_graphics; fakePtyData(&data, s, s + len); + screen->vt100_graphics = False; /* temporary override */ while (decodeUtf8(screen, &data)) { Bool fails = False; Bool extra = False; IChar value; skipPtyData(&data, value); - if (value == UCS_REPL) { + if (is_UCS_SPECIAL(value)) { fails = True; } else if (value < 256) { AddChar(&buffer, &used, offset, CharOf(value)); } else { unsigned eqv = ucs2dec(screen, value); - if (xtermIsDecGraphic(eqv)) { + if (xtermIsInternalCs(eqv)) { AddChar(&buffer, &used, offset, DECtoASCII(eqv)); } else { eqv = AsciiEquivs(value); @@ -1740,6 +1749,7 @@ UTF8toLatin1(TScreen *screen, Char *s, unsigned long len, unsigned long *result) AddChar(&buffer, &used, offset, ' '); } AddChar(&buffer, &used, offset, '\0'); + screen->vt100_graphics = save_vt100; *result = (unsigned long) (offset - 1); } else { *result = 0; @@ -2278,7 +2288,7 @@ GettingSelection(Display *dpy, Atom type, Char *line, unsigned long len) #ifdef VMS # define tty_vwrite(pty,lag,l) tt_write(lag,l) #else /* !( VMS ) */ -# define tty_vwrite(pty,lag,l) v_write(pty,lag,l) +# define tty_vwrite(pty,lag,l) v_write(pty,lag,(size_t) l) #endif /* defined VMS */ #if OPT_PASTE64 @@ -2454,14 +2464,18 @@ _qWriteSelectionData(XtermWidget xw, Char *lag, size_t length) #endif /* OPT_PASTE64 */ #if OPT_READLINE if (SCREEN_FLAG(screen, paste_quotes)) { + Char quote[2]; + quote[0] = (Char) get_tty_lnext(screen->respond, XTERM_LNEXT, "pty"); + quote[1] = 0; + TRACE(("writing quoted selection data %s\n", visibleChars(lag, length))); while (length--) { - tty_vwrite(screen->respond, (const Char *) "\026", 1); /* Control-V */ + tty_vwrite(screen->respond, quote, 1); tty_vwrite(screen->respond, lag++, 1); } } else #endif { - TRACE(("writing base64 padding %s\n", visibleChars(lag, length))); + TRACE(("writing selection data %s\n", visibleChars(lag, length))); tty_vwrite(screen->respond, lag, length); } } @@ -2469,14 +2483,9 @@ _qWriteSelectionData(XtermWidget xw, Char *lag, size_t length) static void _WriteSelectionData(XtermWidget xw, Char *line, size_t length) { - /* Write data to pty a line at a time. */ - /* Doing this one line at a time may no longer be necessary - because v_write has been re-written. */ - -#if OPT_PASTE64 +#if OPT_PASTE64 || OPT_READLINE TScreen *screen = TScreenOf(xw); #endif - Char *lag, *end; /* in the VMS version, if tt_pasting isn't set to True then qio reads aren't blocked and an infinite loop is entered, where the @@ -2486,30 +2495,23 @@ _WriteSelectionData(XtermWidget xw, Char *line, size_t length) tt_pasting = True; #endif - end = &line[length]; - lag = line; - #if OPT_PASTE64 if (screen->base64_paste) { - _qWriteSelectionData(xw, lag, (size_t) (end - lag)); + _qWriteSelectionData(xw, line, length); base64_flush(screen); } else #endif { if (!SCREEN_FLAG(screen, paste_literal_nl)) { - Char *cp; - for (cp = line; cp != end; cp++) { - if (*cp == '\n') { - *cp = '\r'; - _qWriteSelectionData(xw, lag, (size_t) (cp - lag + 1)); - lag = cp + 1; + size_t n; + for (n = 0; n < length; ++n) { + if (line[n] == '\n') { + line[n] = '\r'; } } } - if (lag != end) { - _qWriteSelectionData(xw, lag, (size_t) (end - lag)); - } + _qWriteSelectionData(xw, line, length); } #ifdef VMS tt_pasting = False; @@ -2551,11 +2553,82 @@ removeControls(XtermWidget xw, char *value) dst = strlen(value); } else { size_t src = 0; + Boolean *disallowed = screen->disallow_paste_ops; + TERMIO_STRUCT data; + char current_chars[epLAST]; + + if (disallowed[epSTTY] && ttyGetAttr(screen->respond, &data) == 0) { + int n; + int disabled = xtermDisabledChar(); + + TRACE(("disallow(STTY):")); + memcpy(current_chars, disallowed, sizeof(current_chars)); + + for (n = 0; n < NCCS; ++n) { + PasteControls nc = (data.c_cc[n] < 32 + ? data.c_cc[n] + : (data.c_cc[n] == 127 + ? epDEL + : epLAST)); + if (nc == epNUL || nc == epLAST) + continue; + if (CharOf(data.c_cc[n]) == CharOf(disabled)) + continue; + if ((n == VMIN || n == VTIME) && !(data.c_lflag & ICANON)) + continue; + switch (n) { + /* POSIX */ + case VEOF: + case VEOL: + case VERASE: + case VINTR: + case VKILL: + case VQUIT: + case VSTART: + case VSTOP: + case VSUSP: + /* system-dependent */ +#ifdef VDISCARD + case VDISCARD: +#endif +#ifdef VDSUSP + case VDSUSP: +#endif +#ifdef VEOL2 + case VEOL2: +#endif +#ifdef VLNEXT + case VLNEXT: +#endif +#ifdef VREPRINT + case VREPRINT: +#endif +#ifdef VSTATUS + case VSTATUS: +#endif +#ifdef VSWTC + case VSWTC: /* System V SWTCH */ +#endif +#ifdef VWERASE + case VWERASE: +#endif + break; + default: + continue; + } + if (nc != epLAST) { + TRACE((" \\%03o", data.c_cc[n])); + current_chars[nc] = 1; + } + } + TRACE(("\n")); + disallowed = current_chars; + } while ((value[dst] = value[src]) != '\0') { int ch = CharOf(value[src++]); #define ReplacePaste(n) \ - if (screen->disallow_paste_ops[n]) \ + if (disallowed[n]) \ value[dst] = ' ' if (ch < 32) { @@ -2826,7 +2899,7 @@ HandleInsertSelection(Widget w, && (okSendMousePos(xw) == MOUSE_OFF) && SCREEN_FLAG(screen, paste_moves) && rowOnCurrentLine(screen, eventRow(screen, event), &ldelta)) - ReadLineMovePoint(screen, eventColBetween(screen, event), ldelta); + ReadLineMovePoint(xw, eventColBetween(screen, event), ldelta); #endif /* OPT_READLINE */ xtermGetSelection(w, event->xbutton.time, params, *num_params, NULL); @@ -3101,7 +3174,7 @@ EndExtend(XtermWidget xw, break; } } - v_write(screen->respond, line, count); + v_write(screen->respond, line, (size_t) count); UnHiliteText(xw); } } @@ -3932,6 +4005,7 @@ do_select_regex(TScreen *screen, CELL *startc, CELL *endc) indexed)) != 0) { int len = (int) strlen(search); int col; + int offset; int best_col = -1; int best_len = -1; @@ -3940,12 +4014,13 @@ do_select_regex(TScreen *screen, CELL *startc, CELL *endc) endc->row = 0; endc->col = 0; - for (col = 0; indexed[col] < len; ++col) { + for (col = 0; (offset = indexed[col]) < len; ++col) { if (regexec(&preg, - search + indexed[col], - (size_t) 1, &match, 0) == 0) { - int start_inx = (int) (match.rm_so + indexed[col]); - int finis_inx = (int) (match.rm_eo + indexed[col]); + search + offset, + (size_t) 1, &match, + col ? REG_NOTBOL : 0) == 0) { + int start_inx = (int) (match.rm_so + offset); + int finis_inx = (int) (match.rm_eo + offset); int start_col = indexToCol(indexed, len, start_inx); int finis_col = indexToCol(indexed, len, finis_inx); @@ -3972,11 +4047,10 @@ do_select_regex(TScreen *screen, CELL *startc, CELL *endc) indexed[best_col], indexed[best_nxt])); TRACE(("matched:%d:%s\n", - indexed[best_nxt] + 1 - + indexed[best_nxt] - indexed[best_col], visibleChars((Char *) (search + indexed[best_col]), - (unsigned) (indexed[best_nxt] + - 1 - + (unsigned) (indexed[best_nxt] - indexed[best_col])))); } free(search); @@ -4947,14 +5021,15 @@ _OwnSelection(XtermWidget xw, SelectedCells *tcp = &(screen->clipboard_data); TRACE(("saving selection to clipboard buffer\n")); scp = &(screen->selected_cells[CLIPBOARD_CODE]); - if ((buf = (Char *) malloc((size_t) scp->data_length)) == 0) + if ((buf = (Char *) malloc((size_t) scp->data_length)) == 0) { SysError(ERROR_BMALLOC2); - - free(tcp->data_buffer); - memcpy(buf, scp->data_buffer, scp->data_length); - tcp->data_buffer = buf; - tcp->data_limit = scp->data_length; - tcp->data_length = scp->data_length; + } else { + free(tcp->data_buffer); + memcpy(buf, scp->data_buffer, scp->data_length); + tcp->data_buffer = buf; + tcp->data_limit = scp->data_length; + tcp->data_length = scp->data_length; + } } scp = &(screen->selected_cells[which]); if (scp->data_length == 0) { @@ -5094,6 +5169,8 @@ SaveText(TScreen *screen, unsigned c; assert(i < (int) ld->lineSize); c = E2A(ld->charData[i]); + if (ld->attribs[i] & INVISIBLE) + continue; #if OPT_WIDE_CHARS /* We want to strip out every occurrence of HIDDEN_CHAR AFTER a * wide character. @@ -5432,7 +5509,7 @@ EditorButton(XtermWidget xw, XButtonEvent *event) /* Transmit key sequence to process running under xterm */ TRACE(("EditorButton -> %s\n", visibleChars(line, count))); - v_write(pty, line, count); + v_write(pty, line, (size_t) count); } return; } diff --git a/app/xterm/cachedGCs.c b/app/xterm/cachedGCs.c index 896487d08..cbba73173 100644 --- a/app/xterm/cachedGCs.c +++ b/app/xterm/cachedGCs.c @@ -1,7 +1,7 @@ -/* $XTermId: cachedGCs.c,v 1.81 2021/09/16 19:48:02 tom Exp $ */ +/* $XTermId: cachedGCs.c,v 1.82 2024/05/17 20:59:36 tom Exp $ */ /* - * Copyright 2007-2019,2021 by Thomas E. Dickey + * Copyright 2007-2021,2024 by Thomas E. Dickey * * All Rights Reserved * @@ -92,7 +92,7 @@ traceCgsEnum(CgsEnum value) CASE(BoldReverse); CASE(Border); CASE(Filler); -#if OPT_BOX_CHARS +#if OPT_BOX_CHARS || OPT_WIDE_CHARS CASE(Line); CASE(Dots); #endif @@ -343,7 +343,7 @@ newCache(XtermWidget xw, VTwin *cgsWin, CgsEnum cgsId, CgsCache * me) xgcv.graphics_exposures = True; /* default */ xgcv.function = GXcopy; break; -#if OPT_BOX_CHARS +#if OPT_BOX_CHARS || OPT_WIDE_CHARS case gcLine: mask |= (GCGraphicsExposures | GCFunction); xgcv.graphics_exposures = True; /* default */ diff --git a/app/xterm/charclass.c b/app/xterm/charclass.c index 66c959c83..caaf2b399 100644 --- a/app/xterm/charclass.c +++ b/app/xterm/charclass.c @@ -1,4 +1,4 @@ -/* $XTermId: charclass.c,v 1.46 2023/01/04 09:26:46 tom Exp $ */ +/* $XTermId: charclass.c,v 1.50 2023/04/01 00:11:47 tom Exp $ */ /* * Copyright 2002-2022,2023 by Thomas E. Dickey @@ -262,8 +262,8 @@ report_wide_char_class(void) printf("from these overlapping intervals of character codes:\n"); for (i = classtab[0].first; i <= classtab[0].last; i++) { printf("\tU+%04X .. U+%04X %s\n", - classtab[i].first, - classtab[i].last, + (unsigned) classtab[i].first, + (unsigned) classtab[i].last, class_name((Classes) classtab[i].cclass)); } printf("\n"); @@ -311,7 +311,7 @@ expected_class(int wch) { int result = wch; wint_t ch = (wint_t) wch; - if (ch == '\0' || ch == '\t') { + if (wch < 0 || ch == '\0' || ch == '\t') { result = BLANK; } else if (iswcntrl(ch)) { result = CNTRL; diff --git a/app/xterm/charproc.c b/app/xterm/charproc.c index 69fee861e..c49284ba7 100644 --- a/app/xterm/charproc.c +++ b/app/xterm/charproc.c @@ -1,7 +1,7 @@ -/* $XTermId: charproc.c,v 1.1924 2023/01/09 00:26:45 tom Exp $ */ +/* $XTermId: charproc.c,v 1.2032 2024/07/10 21:09:42 tom Exp $ */ /* - * Copyright 1999-2022,2023 by Thomas E. Dickey + * Copyright 1999-2023,2024 by Thomas E. Dickey * * All Rights Reserved * @@ -133,6 +133,7 @@ #include <charclass.h> #include <xstrings.h> #include <graphics.h> +#include <graphics_sixel.h> #ifdef NO_LEAKS #include <xtermcap.h> @@ -143,7 +144,8 @@ typedef int (*BitFunc) (unsigned * /* p */ , static IChar doinput(XtermWidget /* xw */ ); static int set_character_class(char * /*s */ ); -static void FromAlternate(XtermWidget /* xw */ ); +static void FromAlternate(XtermWidget /* xw */ , + Bool /* clearFirst */ ); static void ReallyReset(XtermWidget /* xw */ , Bool /* full */ , Bool /* saved */ ); @@ -467,7 +469,7 @@ static XtResource xterm_resources[] = Bres(XtNshowWrapMarks, XtCShowWrapMarks, screen.show_wrap_marks, False), Bres(XtNhpLowerleftBugCompat, XtCHpLowerleftBugCompat, screen.hp_ll_bc, False), Bres(XtNi18nSelections, XtCI18nSelections, screen.i18nSelections, True), - Bres(XtNfastScroll, XtCFastScroll, screen.fastscroll, False), + Bres(XtNfastScroll, XtCFastScroll, screen.fastscroll, True), Bres(XtNjumpScroll, XtCJumpScroll, screen.jumpscroll, True), Bres(XtNkeepClipboard, XtCKeepClipboard, screen.keepClipboard, False), Bres(XtNkeepSelection, XtCKeepSelection, screen.keepSelection, True), @@ -477,6 +479,7 @@ static XtResource xterm_resources[] = Bres(XtNmultiScroll, XtCMultiScroll, screen.multiscroll, False), Bres(XtNoldXtermFKeys, XtCOldXtermFKeys, screen.old_fkeys, False), Bres(XtNpopOnBell, XtCPopOnBell, screen.poponbell, False), + Bres(XtNpreferLatin1, XtCPreferLatin1, screen.prefer_latin1, True), Bres(XtNprinterAutoClose, XtCPrinterAutoClose, SPS.printer_autoclose, False), Bres(XtNprinterExtent, XtCPrinterExtent, SPS.printer_extent, False), Bres(XtNprinterFormFeed, XtCPrinterFormFeed, SPS.printer_formfeed, False), @@ -505,6 +508,7 @@ static XtResource xterm_resources[] = Ires(XtNinternalBorder, XtCBorderWidth, screen.border, DEFBORDER), Ires(XtNlimitResize, XtCLimitResize, misc.limit_resize, 1), Ires(XtNlimitResponse, XtCLimitResponse, screen.unparse_max, DEF_LIMIT_RESPONSE), + Ires(XtNmaxStringParse, XtCMaxStringParse, screen.strings_max, DEF_STRINGS_MAX), Ires(XtNmultiClickTime, XtCMultiClickTime, screen.multiClickTime, MULTICLICKTIME), Ires(XtNnMarginBell, XtCColumn, screen.nmarginbell, N_MARGINBELL), Ires(XtNpointerMode, XtCPointerMode, screen.pointer_mode, DEF_POINTER_MODE), @@ -572,10 +576,10 @@ static XtResource xterm_resources[] = #endif #ifndef NO_ACTIVE_ICON - Sres("activeIcon", "ActiveIcon", misc.active_icon_s, "default"), - Ires("iconBorderWidth", XtCBorderWidth, misc.icon_border_width, 2), - Sres("iconFont", "IconFont", screen.icon_fontname, "nil2"), - Cres("iconBorderColor", XtCBorderColor, misc.icon_border_pixel, XtDefaultBackground), + Sres(XtNactiveIcon, XtCActiveIcon, misc.active_icon_s, "default"), + Ires(XtNiconBorderWidth, XtCBorderWidth, misc.icon_border_width, 2), + Sres(XtNiconFont, XtCIconFont, screen.icon_fontname, "nil2"), + Cres(XtNiconBorderColor, XtCBorderColor, misc.icon_border_pixel, XtDefaultBackground), #endif /* NO_ACTIVE_ICON */ #if OPT_BLINK_CURS @@ -583,6 +587,7 @@ static XtResource xterm_resources[] = Sres(XtNcursorBlink, XtCCursorBlink, screen.cursor_blink_s, "never"), #endif Bres(XtNcursorUnderLine, XtCCursorUnderLine, screen.cursor_underline, False), + Bres(XtNcursorBar, XtCCursorBar, screen.cursor_bar, False), #if OPT_BLINK_TEXT Bres(XtNshowBlinkAsBold, XtCCursorBlink, screen.blink_as_bold, DEFBLINKASBOLD), @@ -596,9 +601,11 @@ static XtResource xterm_resources[] = #if OPT_BOX_CHARS Bres(XtNforceBoxChars, XtCForceBoxChars, screen.force_box_chars, False), Bres(XtNforcePackedFont, XtCForcePackedFont, screen.force_packed, True), - Bres(XtNshowMissingGlyphs, XtCShowMissingGlyphs, screen.force_all_chars, False), Bres(XtNassumeAllChars, XtCAssumeAllChars, screen.assume_all_chars, True), #endif +#if OPT_BOX_CHARS || OPT_WIDE_CHARS + Bres(XtNshowMissingGlyphs, XtCShowMissingGlyphs, screen.force_all_chars, True), +#endif #if OPT_BROKEN_OSC Bres(XtNbrokenLinuxOSC, XtCBrokenLinuxOSC, screen.brokenLinuxOSC, True), @@ -752,6 +759,8 @@ static XtResource xterm_resources[] = screen.numcolorregisters, 0), Bres(XtNprivateColorRegisters, XtCPrivateColorRegisters, screen.privatecolorregisters, True), + Bres(XtNincrementalGraphics, XtCIncrementalGraphics, + screen.incremental_graphics, False), #endif #if OPT_STATUS_LINE @@ -838,6 +847,7 @@ static XtResource xterm_resources[] = Sres(XtNfaceName, XtCFaceName, misc.default_xft.f_n, DEFFACENAME), Sres(XtNrenderFont, XtCRenderFont, misc.render_font_s, "default"), Ires(XtNlimitFontsets, XtCLimitFontsets, misc.limit_fontsets, DEF_XFT_CACHE), + Ires(XtNlimitFontHeight, XtCLimitFontHeight, misc.limit_fontheight, 10), Ires(XtNlimitFontWidth, XtCLimitFontWidth, misc.limit_fontwidth, 10), #if OPT_RENDERWIDE Sres(XtNfaceNameDoublesize, XtCFaceNameDoublesize, misc.default_xft.f_w, DEFFACENAME), @@ -1215,7 +1225,7 @@ void saveCharsets(TScreen *screen, DECNRCM_codes * target) { int g; - for (g = 0; g < NUM_GSETS; ++g) { + for (g = 0; g < NUM_GSETS2; ++g) { target[g] = screen->gsets[g]; } } @@ -1224,7 +1234,7 @@ void restoreCharsets(TScreen *screen, DECNRCM_codes * source) { int g; - for (g = 0; g < NUM_GSETS; ++g) { + for (g = 0; g < NUM_GSETS2; ++g) { screen->gsets[g] = source[g]; } } @@ -1232,12 +1242,39 @@ restoreCharsets(TScreen *screen, DECNRCM_codes * source) void resetCharsets(TScreen *screen) { - TRACE(("resetCharsets\n")); + int dft_upss = ((screen->ansi_level >= 2) + ? PreferredUPSS(screen) + : nrc_ASCII); + +#if OPT_WIDE_CHARS + /* + * User-preferred selection set makes a choice between ISO-8859-1 and + * a precursor to it. Those are both single-byte encodings. Because the + * multibyte UTF-8 equates to ISO-8859-1, the default (DEC Supplemental) + * cannot be used as a default in UTF-8 mode. But we cannot use ISO-8859-1 + * either, because that would break the special case in decodeUtf8() that + * checks if NRCS is being used, passing 8-bit characters as is. + * + * In short, UPSS is not available with UTF-8, but DECRQUPSS will say that + * ISO-Latin1 is selected. + */ + if (screen->wide_chars && (screen->utf8_mode || screen->utf8_nrc_mode)) { + dft_upss = nrc_ASCII; + } +#endif + TRACE(("resetCharsets: UPSS=%s\n", visibleScsCode(dft_upss))); + + /* + * The assignments for G2/G3 to ASCII differ from the documented DEC + * terminal, because xterm also checks GR to decide whether or not to + * handle non-Unicode character sets, e.g., NRCS. + */ initCharset(screen, 0, nrc_ASCII); initCharset(screen, 1, nrc_ASCII); - initCharset(screen, 2, nrc_ASCII); - initCharset(screen, 3, nrc_ASCII); + initCharset(screen, 2, dft_upss); + initCharset(screen, 3, dft_upss); + initCharset(screen, 4, dft_upss); /* gsets_upss */ screen->curgl = 0; /* G0 => GL. */ screen->curgr = 2; /* G2 => GR. */ @@ -1268,8 +1305,9 @@ modified_DECNRCM(XtermWidget xw) /* * VT300 and up support three ANSI conformance levels, defined according to - * the dpANSI X3.134.1 standard. DEC's manuals equate levels 1 and 2, and - * are unclear. This code is written based on the manuals. + * ECMA-43 (originally dpANSI X3.134.1). + * + * VSRM - Documented Exceptions EL-00070-D */ static void set_ansi_conformance(TScreen *screen, int level) @@ -1280,23 +1318,17 @@ set_ansi_conformance(TScreen *screen, int level) screen->terminal_id, screen->ansi_level)); if (screen->vtXX_level >= 3) { - switch (screen->ansi_level = level) { - case 1: - /* FALLTHRU */ - case 2: - initCharset(screen, 0, nrc_ASCII); /* G0 is ASCII */ - initCharset(screen, 1, nrc_ASCII); /* G1 is ISO Latin-1 */ - screen->curgl = 0; - screen->curgr = 1; - break; - case 3: - initCharset(screen, 0, nrc_ASCII); /* G0 is ASCII */ - screen->curgl = 0; - break; - } + screen->ansi_level = level; } } +static void +set_vtXX_level(TScreen *screen, int level) +{ + screen->vtXX_level = level; + screen->ansi_level = (level > 1) ? 3 : 1; +} + /* * Set scrolling margins. VTxxx terminals require that the top/bottom are * different, so we have at least two lines in the scrolling region. @@ -1393,6 +1425,7 @@ static const struct { ,DATA(cigtable) ,DATA(csi2_table) ,DATA(csi_ex_table) + ,DATA(csi_amp_table) ,DATA(csi_quo_table) ,DATA(csi_table) ,DATA(dec2_table) @@ -1416,17 +1449,20 @@ static const struct { ,DATA(csi_star_table) ,DATA(csi_dec_dollar_table) #endif +#if OPT_VT52_MODE + ,DATA(vt52_table) + ,DATA(vt52_esc_table) + ,DATA(vt52_ignore_table) +#endif +#if OPT_VT525_COLORS + ,DATA(csi_comma_table) +#endif #if OPT_WIDE_CHARS ,DATA(esc_pct_table) ,DATA(scs_amp_table) ,DATA(scs_pct_table) ,DATA(scs_2qt_table) #endif -#if OPT_VT52_MODE - ,DATA(vt52_table) - ,DATA(vt52_esc_table) - ,DATA(vt52_ignore_table) -#endif #if OPT_XTERM_SGR ,DATA(csi_hash_table) #endif @@ -1483,6 +1519,10 @@ check_tables(void) } /* * All of the tables should have their GL/GR parts encoded the same. + * + * Originally reported by Paul Williams (patch #171), this is a + * standard feature of DEC's terminals, documented in DEC 070 section + * 3.5.4.5 "GR Graphic Characters Within Control Strings". */ for (ch = 32; ch < 127; ++ch) { PARSE_T st_l = table[ch]; @@ -1542,6 +1582,7 @@ check_bitmasks(void) DATA(DGRP(2), FG_COLOR), DATA(DGRP(2), PROTECTED), DATA(DGRP(4), CHARDRAWN), + DATA(DGRP(2), INVISIBLE), #if OPT_WIDE_ATTRS DATA(DGRP(2), ATR_FAINT), DATA(DGRP(2), ATR_ITALIC), @@ -1551,16 +1592,16 @@ check_bitmasks(void) DATA(DGRP(2), ATR_DIRECT_BG), #endif DATA(DMSK(DGRP(2)), SGR_MASK2), + DATA(DMSK(DGRP(3)), ATTRIBUTES), + DATA(DGRP(3), REVERSE_VIDEO), DATA(DGRP(3), WRAPAROUND), DATA(DGRP(3), REVERSEWRAP), - DATA(DGRP(3), REVERSE_VIDEO), + DATA(DGRP(3), REVERSEWRAP2), DATA(DGRP(3), LINEFEED), DATA(DGRP(3), ORIGIN), DATA(DGRP(3), INSERT), DATA(DGRP(3), SMOOTHSCROLL), DATA(DGRP(3), IN132COLUMNS), - DATA(DGRP(3), INVISIBLE), - DATA(DMSK(DGRP(3)), ATTRIBUTES), DATA(DGRP(5), NATIONAL), DATA(DGRP(5), LEFT_RIGHT), DATA(DGRP(5), NOCLEAR_COLM), @@ -1659,27 +1700,36 @@ dump_params(void) } \ size = new_length -#define WriteNow() { \ - unsigned single = 0; \ - \ - if (screen->curss) { \ - dotext(xw, \ - screen->gsets[(int) (screen->curss)], \ - sp->print_area, \ - (Cardinal) 1); \ - screen->curss = 0; \ - single++; \ - } \ - if (sp->print_used > single) { \ - dotext(xw, \ - screen->gsets[(int) (screen->curgl)], \ - sp->print_area + single, \ - (Cardinal) (sp->print_used - single)); \ - } \ - sp->print_used = 0; \ - } \ - -#define PARSE_SRM 1 +#define WriteNow() { \ + unsigned single = 0; \ + \ + if (screen->curss) { \ + if (sp->print_area != NULL) { \ + dotext(xw, \ + screen->gsets[(int) (screen->curss)], \ + sp->print_area, \ + (Cardinal) 1); \ + single++; \ + } \ + screen->curss = 0; \ + } \ + if (sp->print_used > single) { \ + if (sp->print_area != NULL) { \ + dotext(xw, \ + screen->gsets[(int) (screen->curgl)], \ + sp->print_area + single, \ + (Cardinal) (sp->print_used - single)); \ + } \ + } \ + sp->print_used = 0; \ + } \ + +typedef enum { + sa_INIT + ,sa_LAST + ,sa_REGIS + ,sa_SIXEL +} StringArgs; struct ParseState { unsigned check_recur; @@ -1692,6 +1742,8 @@ struct ParseState { int scssize; Bool private_function; /* distinguish private-mode from standard */ int string_mode; /* nonzero iff we're processing a string */ + StringArgs string_args; /* parse-state within string processing */ + Bool string_skip; /* true if we will ignore the string */ int lastchar; /* positive iff we had a graphic character */ int nextstate; #if OPT_WIDE_CHARS @@ -1751,76 +1803,95 @@ static const struct { int min_level; int max_level; int need_nrc; + int sized_96; } scs_table[] = { - { nrc_ASCII, 0, 'B', 1, 9, 0 }, - { nrc_British, 0, 'A', 1, 9, 0 }, - { nrc_DEC_Spec_Graphic, 0, '0', 1, 9, 0 }, - { nrc_DEC_Alt_Chars, 0, '1', 1, 1, 0 }, - { nrc_DEC_Alt_Graphics, 0, '2', 1, 1, 0 }, + { nrc_ASCII, 0, 'B', 1, 9, 0, 0 }, + { nrc_British, 0, 'A', 1, 9, 0, 0 }, + { nrc_DEC_Spec_Graphic, 0, '0', 1, 9, 0, 0 }, + { nrc_DEC_Alt_Chars, 0, '1', 1, 1, 0, 0 }, + { nrc_DEC_Alt_Graphics, 0, '2', 1, 1, 0, 0 }, /* VT2xx */ - { nrc_DEC_Supp, 0, '<', 2, 9, 0 }, - { nrc_Dutch, 0, '4', 2, 9, 1 }, - { nrc_Finnish, 0, '5', 2, 9, 1 }, - { nrc_Finnish2, 0, 'C', 2, 9, 1 }, - { nrc_French, 0, 'R', 2, 9, 1 }, - { nrc_French2, 0, 'f', 2, 9, 1 }, - { nrc_French_Canadian, 0, 'Q', 2, 9, 1 }, - { nrc_German, 0, 'K', 2, 9, 1 }, - { nrc_Italian, 0, 'Y', 2, 9, 1 }, - { nrc_Norwegian_Danish2, 0, 'E', 2, 9, 1 }, - { nrc_Norwegian_Danish3, 0, '6', 2, 9, 1 }, - { nrc_Spanish, 0, 'Z', 2, 9, 1 }, - { nrc_Swedish, 0, '7', 2, 9, 1 }, - { nrc_Swedish2, 0, 'H', 2, 9, 1 }, - { nrc_Swiss, 0, '=', 2, 9, 1 }, + { nrc_DEC_Supp, 0, '<', 2, 2, 0, 0 }, + { nrc_Dutch, 0, '4', 2, 9, 1, 0 }, + { nrc_Finnish, 0, '5', 2, 9, 1, 0 }, + { nrc_Finnish2, 0, 'C', 2, 9, 1, 0 }, + { nrc_French, 0, 'R', 2, 9, 1, 0 }, + { nrc_French2, 0, 'f', 2, 9, 1, 0 }, + { nrc_French_Canadian, 0, 'Q', 2, 9, 1, 0 }, + { nrc_German, 0, 'K', 2, 9, 1, 0 }, + { nrc_Italian, 0, 'Y', 2, 9, 1, 0 }, + { nrc_Norwegian_Danish2, 0, 'E', 2, 9, 1, 0 }, + { nrc_Norwegian_Danish3, 0, '6', 2, 9, 1, 0 }, + { nrc_Spanish, 0, 'Z', 2, 9, 1, 0 }, + { nrc_Swedish, 0, '7', 2, 9, 1, 0 }, + { nrc_Swedish2, 0, 'H', 2, 9, 1, 0 }, + { nrc_Swiss, 0, '=', 2, 9, 1, 0 }, /* VT3xx */ - { nrc_British_Latin_1, 0, 'A', 3, 9, 1 }, - { nrc_DEC_Supp_Graphic, '%', '5', 3, 9, 0 }, - { nrc_DEC_Technical, 0, '>', 3, 9, 0 }, - { nrc_French_Canadian2, 0, '9', 3, 9, 1 }, - { nrc_Norwegian_Danish, 0, '`', 3, 9, 1 }, - { nrc_Portugese, '%', '6', 3, 9, 1 }, - { nrc_ISO_Latin_1_Supp, 0, 'A', 3, 9, 0 }, + { nrc_DEC_UPSS, 0, '<', 3, 9, 0, 1 }, + { nrc_British_Latin_1, 0, 'A', 3, 9, 1, 0 }, + { nrc_DEC_Supp_Graphic, '%', '5', 3, 9, 0, 0 }, + { nrc_DEC_Technical, 0, '>', 3, 9, 0, 0 }, + { nrc_French_Canadian2, 0, '9', 3, 9, 1, 0 }, + { nrc_Norwegian_Danish, 0, '`', 3, 9, 1, 0 }, + { nrc_Portugese, '%', '6', 3, 9, 1, 0 }, + { nrc_ISO_Latin_1_Supp, 0, 'A', 3, 9, 0, 1 }, /* VT5xx */ - { nrc_Greek, '"', '>', 5, 9, 1 }, - { nrc_Hebrew, '%', '=', 5, 9, 1 }, - { nrc_Turkish, '%', '2', 5, 9, 1 }, - { nrc_DEC_Cyrillic, '&', '4', 5, 9, 0 }, - { nrc_DEC_Greek_Supp, '"', '?', 5, 9, 0 }, - { nrc_DEC_Hebrew_Supp, '"', '4', 5, 9, 0 }, - { nrc_DEC_Turkish_Supp, '%', '0', 5, 9, 0 }, - { nrc_ISO_Greek_Supp, 0, 'F', 5, 9, 0 }, - { nrc_ISO_Hebrew_Supp, 0, 'H', 5, 9, 0 }, - { nrc_ISO_Latin_2_Supp, 0, 'B', 5, 9, 0 }, - { nrc_ISO_Latin_5_Supp, 0, 'M', 5, 9, 0 }, - { nrc_ISO_Latin_Cyrillic,0, 'L', 5, 9, 0 }, + { nrc_Greek, '"', '>', 5, 9, 1, 0 }, + { nrc_Hebrew, '%', '=', 5, 9, 1, 0 }, + { nrc_Turkish, '%', '2', 5, 9, 1, 0 }, + { nrc_DEC_Cyrillic, '&', '4', 5, 9, 0, 0 }, + { nrc_DEC_Greek_Supp, '"', '?', 5, 9, 0, 0 }, + { nrc_DEC_Hebrew_Supp, '"', '4', 5, 9, 0, 0 }, + { nrc_DEC_Turkish_Supp, '%', '0', 5, 9, 0, 0 }, + { nrc_ISO_Greek_Supp, 0, 'F', 5, 9, 0, 1 }, + { nrc_ISO_Hebrew_Supp, 0, 'H', 5, 9, 0, 1 }, + { nrc_ISO_Latin_2_Supp, 0, 'B', 5, 9, 0, 1 }, + { nrc_ISO_Latin_5_Supp, 0, 'M', 5, 9, 0, 1 }, + { nrc_ISO_Latin_Cyrillic,0, 'L', 5, 9, 0, 1 }, /* VT5xx (not implemented) */ #if 0 - { nrc_Russian, '&', '5', 5, 9, 1 }, - { nrc_SCS_NRCS, '%', '3', 5, 9, 0 }, + { nrc_Russian, '&', '5', 5, 9, 1, 0 }, + { nrc_SCS_NRCS, '%', '3', 5, 9, 0, 0 }, #endif }; /* *INDENT-ON* */ #if OPT_DEC_RECTOPS static char * -encode_scs(DECNRCM_codes value) +encode_scs(DECNRCM_codes value, int *psize) { static char buffer[3]; Cardinal n; char *result = buffer; + for (n = 0; n < XtNumber(scs_table); ++n) { if (scs_table[n].result == value) { if (scs_table[n].prefix) *result++ = (char) scs_table[n].prefix; if (scs_table[n].suffix) *result++ = (char) scs_table[n].suffix; + *psize = scs_table[n].sized_96; break; } } *result = '\0'; return buffer; } + +static int +is_96charset(DECNRCM_codes value) +{ + Cardinal n; + int result = 0; + + for (n = 0; n < XtNumber(scs_table); ++n) { + if (scs_table[n].result == value) { + result = scs_table[n].sized_96 ? 1 : 0; + break; + } + } + return result; +} #endif void @@ -1834,7 +1905,7 @@ xtermDecodeSCS(XtermWidget xw, int which, int sgroup, int prefix, int suffix) for (n = 0; n < XtNumber(scs_table); ++n) { if (prefix == scs_table[n].prefix && suffix == scs_table[n].suffix - && sgroup == scs_table[n].min_level + && sgroup <= scs_table[n].min_level && screen->vtXX_level >= scs_table[n].min_level && screen->vtXX_level <= scs_table[n].max_level && (scs_table[n].need_nrc == 0 || (xw->flags & NATIONAL) != 0)) { @@ -1898,27 +1969,6 @@ subparam_index(int p, int s) } /* - * Check if the given item in the parameter array has subparameters. - * If so, return the number of subparameters to use as a loop limit, etc. - */ -static int -param_has_subparams(int item) -{ - int result = 0; - if (parms.has_subparams) { - int n = subparam_index(item, 0); - if (n >= 0 && parms.is_sub[n]) { - while (++n < nparam && parms.is_sub[n - 1] < parms.is_sub[n]) { - result++; - } - } - } - TRACE(("...param_has_subparams(%d) ->%d\n", item, result)); - return result; -} - -#if OPT_DIRECT_COLOR || OPT_256_COLORS || OPT_88_COLORS || OPT_ISO_COLORS -/* * Given an index into the parameter array, return the corresponding parameter * number (starting from zero). */ @@ -1929,8 +1979,8 @@ param_number(int item) int j, p; for (j = p = 0; j < nparam; ++j, ++p) { - if (p >= item) { - result = j; + if (j >= item) { + result = p; break; } if (parms.is_sub[j]) { @@ -1945,6 +1995,29 @@ param_number(int item) return result; } +/* + * Check if the given index in the parameter array has subparameters. + * If so, return the number of subparameters to use as a loop limit, etc. + */ +static int +param_has_subparams(int item) +{ + int result = 0; + if (parms.has_subparams) { + int p = param_number(item); + int n = subparam_index(p, 0); + if (n >= 0 && parms.is_sub[n]) { + while (++n < nparam && parms.is_sub[n - 1] < parms.is_sub[n]) { + result++; + } + } + } + TRACE(("...param_has_subparams(%d) ->%d\n", item, result)); + return result; +} + +#if OPT_DIRECT_COLOR || OPT_256_COLORS || OPT_88_COLORS || OPT_ISO_COLORS + static int get_subparam(int p, int s) { @@ -2126,6 +2199,12 @@ optional_param(int which) } static int +only_default(void) +{ + return (nparam <= 1) && (GetParam(0) == DEFAULT); +} + +static int zero_if_default(int which) { int result = (nparam > which) ? GetParam(which) : 0; @@ -2143,6 +2222,44 @@ one_if_default(int which) return result; } +#define BeginString(mode) \ + do { \ + sp->string_mode = mode; \ + sp->string_args = sa_LAST; \ + sp->parsestate = sos_table; \ + } while (0) + +#define BeginString2(mode) \ + do { \ + sp->string_mode = mode; \ + sp->string_args = sa_INIT; \ + sp->parsestate = sos_table; \ + } while (0) + +static void +begin_sixel(XtermWidget xw, struct ParseState *sp) +{ + TScreen *screen = TScreenOf(xw); + + sp->string_args = sa_LAST; + if (optSixelGraphics(screen)) { +#if OPT_SIXEL_GRAPHICS + ANSI params; + const char *cp; + + cp = (const char *) sp->string_area; + sp->string_area[sp->string_used] = '\0'; + parse_ansi_params(¶ms, &cp); + parse_sixel_init(xw, ¶ms); + sp->string_args = sa_SIXEL; + sp->string_used = 0; +#else + (void) screen; + TRACE(("ignoring sixel graphic (compilation flag not enabled)\n")); +#endif + } +} + /* * Color palette changes using the OSC controls require a repaint of the * screen - but not immediately. Do the repaint as soon as we detect a @@ -2416,10 +2533,10 @@ find_SL_Timeout(XtermWidget xw) case SLwritten: break; case SLclock: - result = 1000; + result = DEF_SL_CLOCK; break; case SLcoords: - result = 80; + result = DEF_SL_COORDS; break; } return result; @@ -2433,38 +2550,37 @@ StatusInit(SavedCursor * data) data->sgr_background = -1; } -/* save the status-line position, restore main display */ -static void -StatusSave(XtermWidget xw) -{ - TScreen *screen = TScreenOf(xw); - - CursorSave2(xw, &screen->status_data[1]); - CursorRestore2(xw, &screen->status_data[0]); +#define SL_SAVE(n) \ + do { \ + TRACE(("@%d saving %s to %d,%d\n", __LINE__, \ + (n) ? "status" : "main", \ + screen->cur_row, \ + screen->cur_col)); \ + CursorSave2(xw, &screen->status_data[n]); \ + } while (0) +#define SL_RESTORE(n) \ + do { \ + CursorRestore2(xw, &screen->status_data[n]); \ + TRACE(("@%d restored %s to %d,%d\n", __LINE__, \ + (n) ? "status" : "main", \ + screen->status_data[n].row, \ + screen->status_data[n].col)); \ + } while (0) - TRACE(("...StatusSave %d,%d -> %d,%d (main)\n", - screen->status_data[1].row, - screen->status_data[1].col, - screen->cur_row, - screen->cur_col)); -} +/* save the status-line position, restore main display */ +#define SL_SAVE2() \ + do { \ + SL_SAVE(1); \ + SL_RESTORE(0); \ + } while (0) /* save the main-display position, restore status-line */ -static void -StatusRestore(XtermWidget xw) -{ - TScreen *screen = TScreenOf(xw); - - CursorSave2(xw, &screen->status_data[0]); - CursorRestore2(xw, &screen->status_data[1]); - screen->cur_row = FirstRowNumber(screen); - - TRACE(("...StatusRestore %d,%d -> %d,%d (status)\n", - screen->status_data[0].row, - screen->status_data[0].col, - screen->cur_row, - screen->cur_col)); -} +#define SL_RESTORE2() \ + do { \ + SL_SAVE(0); \ + SL_RESTORE(1); \ + screen->cur_row = FirstRowNumber(screen); \ + } while (0) static void StatusPutChars(XtermWidget xw, const char *value, int length) @@ -2479,6 +2595,8 @@ StatusPutChars(XtermWidget xw, const char *value, int length) Cardinal n; for (n = 0; n < SL_BUFSIZ && length > 0 && *value != '\0'; ++n) { buffer[n] = CharOf(*value++); + if (buffer[n] < 32 || buffer[n] > 126) + buffer[n] = ' '; /* FIXME - provide for UTF-8 */ --length; } buffer[n] = 0; @@ -2493,6 +2611,7 @@ show_indicator_status(XtPointer closure, XtIntervalId * id GCC_UNUSED) { XtermWidget xw = (XtermWidget) closure; TScreen *screen = TScreenOf(xw); + int right_margin; time_t now; const char *parse; @@ -2503,13 +2622,15 @@ show_indicator_status(XtPointer closure, XtIntervalId * id GCC_UNUSED) screen->status_timeout = False; return; } - if (screen->status_active) { + if (screen->status_active && (screen->status_type == screen->status_shown)) { return; } screen->status_active = True; - CursorSave2(xw, &screen->status_data[0]); + if (screen->status_shown <= 1) { + SL_SAVE(0); + } screen->cur_row = FirstRowNumber(screen); screen->cur_col = 0; @@ -2569,13 +2690,17 @@ show_indicator_status(XtPointer closure, XtIntervalId * id GCC_UNUSED) StatusPutChars(xw, parse, 1); } } - while (screen->cur_col < screen->max_col) - StatusPutChars(xw, " ", 1); + right_margin = ScrnRightMargin(xw); + memset(buffer, ' ', (size_t) SL_BUFSIZ); + while (screen->cur_col < right_margin) { + int chunk = Min(SL_BUFSIZ, (right_margin - screen->cur_col)); + StatusPutChars(xw, buffer, chunk); + } - ScrnRefresh(xw, FirstRowNumber(screen), 0, 1, screen->max_col, True); + ScrnRefresh(xw, FirstRowNumber(screen), 0, 1, right_margin, True); screen->status_active = False; - CursorRestore2(xw, &screen->status_data[0]); + SL_RESTORE(0); /* if we processed a position or date/time, repeat */ interval = find_SL_Timeout(xw); @@ -2609,6 +2734,7 @@ clear_status_line(XtermWidget xw) int n; char buffer[SL_BUFSIZ + 1]; CLineData *ld = getLineData(screen, screen->cur_row); + int right_margin = ScrnRightMargin(xw); TRACE(("...text[%d:%d]:%s\n", screen->cur_row, @@ -2617,7 +2743,7 @@ clear_status_line(XtermWidget xw) memset(buffer, '#', SL_BUFSIZ); for (n = 0; n < screen->max_col; n += SL_BUFSIZ) { - StatusPutChars(xw, buffer, screen->max_col - n); + StatusPutChars(xw, buffer, right_margin - n); } } #endif @@ -2664,37 +2790,64 @@ resize_status_line(XtermWidget xw) * DEC STD 070, chapter 14 "VSRM - Status Display Extension" */ static void -update_status_line(XtermWidget xw) +update_status_line(XtermWidget xw, int new_active, int new_type) { + /* *INDENT-EQLS* */ TScreen *screen = TScreenOf(xw); + int old_active = screen->status_active; + int old_type = screen->status_type; + int old_shown = screen->status_shown; TRACE_SL("update_status_line"); + if (new_active >= 0 && new_active <= 1) { + screen->status_active = new_active; + if (old_active == new_active) { + goto finish; + } + if (old_type < 2) { + goto finish; + } + if (new_active && !old_active) { + SL_SAVE(0); + } + } else if (new_type >= 0 && new_type <= 2) { + screen->status_type = new_type; + } else { + goto finish; + } + if (screen->status_type == 1) { + int next_shown = screen->status_type; if (screen->status_type != screen->status_shown) { if (screen->status_shown == 0) { resize_status_line(xw); } else { clear_status_line(xw); } - screen->status_shown = screen->status_type; - TRACE_SL("...updating shown"); } show_indicator_status(xw, NULL); + if (screen->status_shown != next_shown) { + screen->status_shown = next_shown; + TRACE_SL("...updating shown"); + } + if (old_shown == 2) { + SL_RESTORE(0); + } } else if (screen->status_active) { if (screen->status_type != screen->status_shown) { Boolean do_resize = False; if (screen->status_type == 0) { if (screen->status_shown >= 2) { - StatusSave(xw); + SL_SAVE2(); } do_resize = True; /* shrink... */ clear_status_line(xw); StatusInit(&screen->status_data[1]); } else if (screen->status_shown == 0) { if (screen->status_type >= 2) { - StatusRestore(xw); + SL_RESTORE2(); } do_resize = True; /* grow... */ } else { @@ -2714,7 +2867,7 @@ update_status_line(XtermWidget xw) clear_status_line(xw); } if (screen->status_shown >= 2) { - StatusSave(xw); + SL_SAVE2(); } if (screen->status_type == 0) { screen->status_timeout = False; @@ -2726,7 +2879,9 @@ update_status_line(XtermWidget xw) TRACE_SL("...updating shown"); } } + finish: TRACE_SL("update_status_line (done)"); + return; } /* @@ -2734,29 +2889,17 @@ update_status_line(XtermWidget xw) * forth between the main-display and the status-line without clearing the * status-line (unless the status-line was not shown before). * - * This has no effect if the status-line displays an indicator (type==1). + * This has no effect if the status-line displays an indicator (type==1), + * or if no status-line type was selected (type==0). */ static void handle_DECSASD(XtermWidget xw, int value) { - TScreen *screen = TScreenOf(xw); - Boolean updates = value ? True : False; - TRACE(("CASE_DECSASD - select active status display: %s (currently %s)\n", BtoS(value), - BtoS(screen->status_active))); + BtoS(TScreenOf(xw)->status_active))); - if (screen->status_active != updates) { - screen->status_active = updates; - if (screen->status_type != 1) { - if (updates) { - TRACE(("...@%d, saving main position %d,%d\n", - __LINE__, screen->cur_row, screen->cur_col)); - CursorSave2(xw, &screen->status_data[0]); - } - update_status_line(xw); - } - } + update_status_line(xw, value, -1); } /* @@ -2772,22 +2915,16 @@ handle_DECSASD(XtermWidget xw, int value) static void handle_DECSSDT(XtermWidget xw, int value) { - TScreen *screen = TScreenOf(xw); - TRACE(("CASE_DECSSDT - select type of status display: %d (currently %d)\n", value, - screen->status_type)); - if (value <= 2) { - screen->status_type = value; - if (!screen->status_active) { - TRACE(("...@%d, saving main position %d,%d\n", - __LINE__, screen->cur_row, screen->cur_col)); - CursorSave2(xw, &screen->status_data[0]); - } - update_status_line(xw); - } + TScreenOf(xw)->status_type)); + + update_status_line(xw, -1, value); } -#endif + +#else +#define clear_status_line(xw) /* nothing */ +#endif /* OPT_STATUS_LINE */ #if OPT_VT52_MODE static void @@ -2946,8 +3083,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) if (sp->parsestate == sp->groundtable) { sp->nextstate = is_formatter ? CASE_IGNORE : CASE_PRINT; } else if (sp->parsestate == sos_table) { - c &= WIDEST_ICHAR; - if (c > 255) { + if ((c & WIDEST_ICHAR) > 255) { TRACE(("Found code > 255 while in SOS state: %04X\n", c)); c = BAD_ASCII; } @@ -2968,7 +3104,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) */ if (screen->brokenLinuxOSC && sp->parsestate == sos_table) { - if (sp->string_used) { + if (sp->string_used && sp->string_area) { switch (sp->string_area[0]) { case 'P': if (sp->string_used <= 7) @@ -3018,32 +3154,33 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) * with values in the C1 range to use them as printable characters, * provided that they are not intermixed with an escape sequence. */ - if (screen->c1_printable - && (c >= 128 && c < 256)) { - sp->nextstate = (sp->parsestate == esc_table - ? CASE_ESC_IGNORE - : sp->parsestate[E2A(160)]); - TRACE(("allowC1Printable %04X %s ->%s\n", - c, which_table(sp->parsestate), - visibleVTparse(sp->nextstate))); - } +#if OPT_WIDE_CHARS + if (!screen->wide_chars) +#endif + if (screen->c1_printable + && (c >= 128 && c < 256)) { + sp->nextstate = (sp->parsestate == esc_table + ? CASE_ESC_IGNORE + : sp->parsestate[E2A(160)]); + TRACE(("allowC1Printable %04X %s ->%s\n", + c, which_table(sp->parsestate), + visibleVTparse(sp->nextstate))); + } #endif #if OPT_WIDE_CHARS /* * If we have a C1 code and the c1_printable flag is not set, simply - * ignore it when it was translated from UTF-8. That is because the - * value could not have been present as-is in the UTF-8. - * - * To see that CASE_IGNORE is a consistent value, note that it is - * always used for NUL and other uninteresting C0 controls. + * ignore it when it was translated from UTF-8, unless the parse-state + * tells us that a C1 would be legal. */ #if OPT_C1_PRINT if (!screen->c1_printable) #endif if (screen->wide_chars && (c >= 128 && c < 160)) { - sp->nextstate = CASE_IGNORE; + if (sp->parsestate != ansi_table) + sp->nextstate = CASE_IGNORE; } /* @@ -3093,17 +3230,12 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) } /* - * Accumulate string for APC, DCS, PM, OSC, SOS controls - * This should always be 8-bit characters. + * Accumulate string for DCS, OSC controls + * The string content should always be 8-bit characters. + * + * APC, PM and SOS are ignored; xterm currently does not use those. */ if (sp->parsestate == sos_table) { - SafeAlloc(Char, sp->string_area, sp->string_used, sp->string_size); - if (new_string == 0) { - xtermWarning("Cannot allocate %lu bytes for string mode %d\n", - (unsigned long) new_length, sp->string_mode); - continue; - } - SafeFree(sp->string_area, sp->string_size); #if OPT_WIDE_CHARS /* * We cannot display codes above 255, but let's try to @@ -3115,7 +3247,66 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) c = BAD_ASCII; } #endif - sp->string_area[(sp->string_used)++] = CharOf(c); + if (sp->string_mode == ANSI_APC || + sp->string_mode == ANSI_PM || + sp->string_mode == ANSI_SOS) { + /* EMPTY */ + } +#if OPT_SIXEL_GRAPHICS + else if (sp->string_args == sa_SIXEL) { + /* avoid adding the string-terminator */ + if (sos_table[CharOf(c)] == CASE_IGNORE) + parse_sixel_char((char) c); + } +#endif + else if (sp->string_skip) { + sp->string_used++; + } else if (sp->string_used > screen->strings_max) { + sp->string_skip = True; + sp->string_used++; + FreeAndNull(sp->string_area); + sp->string_size = 0; + } else { + SafeAlloc(Char, sp->string_area, sp->string_used, sp->string_size); + if (new_string == 0) { + xtermWarning("Cannot allocate %lu bytes for string mode %#02x\n", + (unsigned long) new_length, sp->string_mode); + continue; + } + SafeFree(sp->string_area, sp->string_size); + /* + * ReGIS and SIXEL data can be detected by skipping over (only) + * parameters to the first non-parameter character and + * inspecting it. Since both are DCS, we can also ignore OSC. + */ + sp->string_area[(sp->string_used)++] = CharOf(c); + if (sp->string_args < sa_LAST) { + switch (c) { + case ':': + case ';': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + break; + case 'p': + sp->string_args = sa_REGIS; + break; + case 'q': + begin_sixel(xw, sp); + break; + default: + sp->string_args = sa_LAST; + break; + } + } + } } else if (sp->parsestate != esc_table) { /* if we were accumulating, we're not any more */ sp->string_mode = 0; @@ -3178,6 +3369,56 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) if (xw->work.palette_changed) { repaintWhenPaletteChanged(xw, sp); } +#if OPT_STATUS_LINE + /* + * If we are currently writing to the status-line, ignore controls that + * apply only to the full screen, or which use features which we will + * not support in the status-line. + */ + if (IsStatusShown(screen) && (screen)->status_active) { + switch (sp->nextstate) { + case CASE_DECDHL: + case CASE_DECSWL: + case CASE_DECDWL: + case CASE_CUU: + case CASE_CUD: + case CASE_VPA: + case CASE_VPR: + case CASE_ED: + case CASE_TRACK_MOUSE: + case CASE_DECSTBM: + case CASE_DECALN: + case CASE_GRAPHICS_ATTRIBUTES: + case CASE_SPA: + case CASE_EPA: + case CASE_SU: + case CASE_IND: + case CASE_CPL: + case CASE_CNL: + case CASE_NEL: + case CASE_RI: +#if OPT_DEC_LOCATOR + case CASE_DECEFR: + case CASE_DECELR: + case CASE_DECSLE: + case CASE_DECRQLP: +#endif +#if OPT_DEC_RECTOPS + case CASE_DECRQCRA: + case CASE_DECCRA: + case CASE_DECERA: + case CASE_DECFRA: + case CASE_DECSERA: + case CASE_DECSACE: + case CASE_DECCARA: + case CASE_DECRARA: +#endif + ResetState(sp); + sp->nextstate = -1; /* not a legal state */ + break; + } + } +#endif switch (sp->nextstate) { case CASE_PRINT: @@ -3207,10 +3448,12 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) case CASE_BELL: TRACE(("CASE_BELL - bell\n")); if (sp->string_mode == ANSI_OSC) { - if (sp->string_used) - sp->string_area[--(sp->string_used)] = '\0'; - if (sp->check_recur <= 1) - do_osc(xw, sp->string_area, sp->string_used, (int) c); + if (sp->string_area) { + if (sp->string_used) + sp->string_area[--(sp->string_used)] = '\0'; + if (sp->check_recur <= 1) + do_osc(xw, sp->string_area, sp->string_used, (int) c); + } ResetState(sp); } else { /* bell */ @@ -3258,7 +3501,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) xtermIndex(xw, 1); if (xw->flags & LINEFEED) CarriageReturn(xw); - else + else if (screen->jumpscroll && !screen->fastscroll) do_xevents(xw); break; @@ -3601,8 +3844,8 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) * response, but there's no control sequence that modifies * this. We set it via a resource. */ - if (screen->terminal_id < 200) { - switch (screen->terminal_id) { + if (screen->display_da1 < 200) { + switch (screen->display_da1) { case 132: reply.a_param[count++] = 4; /* VT132 */ #if OPT_REGIS_GRAPHICS @@ -3638,7 +3881,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) } } else { reply.a_param[count++] = (ParmType) (60 - + screen->terminal_id + + screen->display_da1 / 100); reply.a_param[count++] = 1; /* 132-columns */ reply.a_param[count++] = 2; /* printer */ @@ -3660,7 +3903,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) reply.a_param[count++] = 9; /* national replacement charsets */ reply.a_param[count++] = 15; /* technical characters */ reply.a_param[count++] = 16; /* locator port */ - if (screen->terminal_id >= 400) { + if (screen->display_da1 >= 400) { reply.a_param[count++] = 17; /* terminal state interrogation */ reply.a_param[count++] = 18; /* windowing extension */ reply.a_param[count++] = 21; /* horizontal scrolling */ @@ -3804,7 +4047,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) default: TRACE(("...unexpected subparameter in SGR\n")); item += skip; /* ignore this */ - op = NPARAM; /* will never use this, anyway */ + op = 9999; /* will never use this, anyway */ break; } } @@ -4132,8 +4375,6 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) } } break; - case 53: /* according to existing xterm handling */ - /* FALLTHRU */ case 55: /* according to the VT330/VT340 Text Programming Manual */ TRACE(("...request locator status\n")); if (sp->private_function @@ -4359,7 +4600,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) set_lr_margins(screen, left - 1, right - 1); CursorSet(screen, 0, 0, xw->flags); } - } else { + } else if (only_default()) { TRACE(("CASE_ANSI_SC - save cursor\n")); CursorSave(xw); } @@ -4373,6 +4614,8 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) break; case CASE_ANSI_RC: + if (!only_default()) + break; /* FALLTHRU */ case CASE_DECRC: TRACE(("CASE_%sRC - restore cursor\n", @@ -4410,8 +4653,9 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) case CASE_DECSCUSR: TRACE(("CASE_DECSCUSR\n")); { - Boolean change = True; + Boolean change; int blinks = screen->cursor_blink_esc; + XtCursorShape shapes = screen->cursor_shape; HideCursor(xw); @@ -4444,12 +4688,12 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) blinks = False; screen->cursor_shape = CURSOR_BAR; break; - default: - change = False; - break; } - TRACE(("cursor_shape:%d blinks:%s\n", - screen->cursor_shape, BtoS(blinks))); + change = (blinks != screen->cursor_blink_esc || + shapes != screen->cursor_shape); + TRACE(("cursor_shape:%d blinks:%d%s\n", + screen->cursor_shape, blinks, + change ? " (changed)" : "")); if (change) { xtermSetCursorBox(screen); if (SettableCursorBlink(screen)) { @@ -4513,7 +4757,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) * On restore, the terminal does not recognize DECRQSS for * DECSCL (per vttest). */ - screen->vtXX_level = 1; + set_vtXX_level(screen, 1); xw->flags = screen->vt52_save_flags; screen->curgl = screen->vt52_save_curgl; screen->curgr = screen->vt52_save_curgr; @@ -4572,7 +4816,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) */ ReallyReset(xw, False, False); init_parser(xw, sp); - screen->vtXX_level = new_vtXX_level; + set_vtXX_level(screen, new_vtXX_level); if (new_vtXX_level > 1) { switch (case_value) { case 1: @@ -4747,37 +4991,52 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) (unsigned long) sp->string_used, sp->string_mode)); ResetState(sp); - if (!sp->string_used) + if (!sp->string_used && !sp->string_args) break; - sp->string_area[--(sp->string_used)] = '\0'; - if (sp->check_recur <= 1) - switch (sp->string_mode) { - case ANSI_APC: - /* ignored */ - break; - case ANSI_DCS: - do_dcs(xw, sp->string_area, sp->string_used); - break; - case ANSI_OSC: - do_osc(xw, sp->string_area, sp->string_used, ANSI_ST); - break; - case ANSI_PM: - /* ignored */ - break; - case ANSI_SOS: - /* ignored */ - break; - default: - TRACE(("unknown mode\n")); - break; + if (sp->string_skip) { + xtermWarning("Ignoring too-long string (%lu) for mode %#02x\n", + (unsigned long) sp->string_used, + sp->string_mode); + sp->string_skip = False; + sp->string_used = 0; + } else { + if (sp->string_used) + sp->string_area[--(sp->string_used)] = '\0'; + if (sp->check_recur <= 1) { + switch (sp->string_mode) { + case ANSI_APC: + /* ignored */ + break; + case ANSI_DCS: +#if OPT_SIXEL_GRAPHICS + if (sp->string_args == sa_SIXEL) { + parse_sixel_finished(); + TRACE(("DONE parsed sixel data\n")); + } else +#endif + do_dcs(xw, sp->string_area, sp->string_used); + break; + case ANSI_OSC: + do_osc(xw, sp->string_area, sp->string_used, ANSI_ST); + break; + case ANSI_PM: + /* ignored */ + break; + case ANSI_SOS: + /* ignored */ + break; + default: + TRACE(("unknown mode\n")); + break; + } } + } break; case CASE_SOS: TRACE(("CASE_SOS: Start of String\n")); if (ParseSOS(screen)) { - sp->string_mode = ANSI_SOS; - sp->parsestate = sos_table; + BeginString(ANSI_SOS); } else { illegal_parse(xw, c, sp); } @@ -4786,8 +5045,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) case CASE_PM: TRACE(("CASE_PM: Privacy Message\n")); if (ParseSOS(screen)) { - sp->string_mode = ANSI_PM; - sp->parsestate = sos_table; + BeginString(ANSI_PM); } else { illegal_parse(xw, c, sp); } @@ -4795,15 +5053,13 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) case CASE_DCS: TRACE(("CASE_DCS: Device Control String\n")); - sp->string_mode = ANSI_DCS; - sp->parsestate = sos_table; + BeginString2(ANSI_DCS); break; case CASE_APC: TRACE(("CASE_APC: Application Program Command\n")); if (ParseSOS(screen)) { - sp->string_mode = ANSI_APC; - sp->parsestate = sos_table; + BeginString(ANSI_APC); } else { illegal_parse(xw, c, sp); } @@ -4925,13 +5181,15 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) case CASE_SS2: TRACE(("CASE_SS2\n")); - screen->curss = 2; + if (screen->vtXX_level > 1) + screen->curss = 2; ResetState(sp); break; case CASE_SS3: TRACE(("CASE_SS3\n")); - screen->curss = 3; + if (screen->vtXX_level > 1) + screen->curss = 3; ResetState(sp); break; @@ -5038,6 +5296,15 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) break; #endif /* OPT_DEC_LOCATOR */ + case CASE_CSI_AMP_STATE: + TRACE(("CASE_CSI_AMP_STATE\n")); + /* csi ampersand (&) */ + if (screen->vtXX_level >= 3) + sp->parsestate = csi_amp_table; + else + sp->parsestate = eigtable; + break; + #if OPT_DEC_RECTOPS case CASE_CSI_DOLLAR_STATE: TRACE(("CASE_CSI_DOLLAR_STATE\n")); @@ -5182,6 +5449,23 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) ResetState(sp); break; + case CASE_DECRQDE: + if (screen->vtXX_level >= 3) { + init_reply(ANSI_CSI); + count = 0; + reply.a_param[count++] = (ParmType) MaxRows(screen); /* number of lines */ + reply.a_param[count++] = (ParmType) MaxCols(screen); /* number of columns */ + reply.a_param[count++] = 1; /* current page column */ + reply.a_param[count++] = 1; /* current page line */ + reply.a_param[count++] = 1; /* current page */ + reply.a_inters = '"'; + reply.a_final = 'w'; + reply.a_nparam = (ParmType) count; + unparseseq(xw, &reply); + } + ResetState(sp); + break; + case CASE_DECRQPSR: #define reply_char(n,c) do { reply.a_radix[(n)] = 1; reply.a_param[(n)++] = (ParmType)(c); } while (0) #define reply_bit(n,c) ((n) ? (c) : 0) @@ -5221,10 +5505,15 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) reply.a_param[count++] = screen->curgl; reply.a_param[count++] = screen->curgr; reply_char(count, ';'); - reply_char(count, 0x4f); /* assert all 96's */ + value = 0x40; + for (item = 0; item < NUM_GSETS; ++item) { + value |= (is_96charset(screen->gsets[item]) << item); + } + reply_char(count, value); /* encoded charset sizes */ reply_char(count, ';'); for (item = 0; item < NUM_GSETS; ++item) { - char *temp = encode_scs(screen->gsets[item]); + int ps; + char *temp = encode_scs(screen->gsets[item], &ps); while (*temp != '\0') { reply_char(count, *temp++); } @@ -5243,11 +5532,10 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) for (item = 0; item < MAX_TABS; ++item) { if (count + 1 >= NPARAM) break; - if (TabIsSet(xw->tabs, item)) { - reply.a_param[count++] = (ParmType) (item + 1); - } if (item > screen->max_col) break; + if (TabIsSet(xw->tabs, item)) + reply.a_param[count++] = (ParmType) (item + 1); } reply.a_nparam = (ParmType) count; unparseseq(xw, &reply); @@ -5257,6 +5545,24 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) ResetState(sp); break; + case CASE_DECRQUPSS: + TRACE(("CASE_DECRQUPSS\n")); + if (screen->vtXX_level >= 3) { + int psize = 0; + char *encoded = encode_scs(screen->gsets_upss, &psize); + init_reply(ANSI_DCS); + count = 0; + reply_char(count, psize ? '1' : '0'); + reply_char(count, '!'); + reply_char(count, 'u'); + reply_char(count, *encoded++); + if (*encoded) + reply_char(count, *encoded); + reply.a_nparam = (ParmType) count; + unparseseq(xw, &reply); + } + break; + case CASE_RQM: TRACE(("CASE_RQM\n")); do_ansi_rqm(xw, ParamPair(0)); @@ -5274,6 +5580,21 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) /* csi ? dollar ($) */ sp->parsestate = csi_dec_dollar_table; break; + + case CASE_DECST8C: + TRACE(("CASE_DECST8C\n")); + if (screen->vtXX_level >= 5 + && (GetParam(0) == 5 || GetParam(0) <= 0)) { + TabZonk(xw->tabs); + for (count = 0; count < MAX_TABS; ++count) { + item = (count + 1) * 8; + if (item > screen->max_col) + break; + TabSet(xw->tabs, item); + } + } + ResetState(sp); + break; #else case CASE_CSI_DOLLAR_STATE: /* csi dollar ($) */ @@ -5289,8 +5610,108 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) /* csi ? dollar ($) */ sp->parsestate = eigtable; break; + + case CASE_DECST8C: + /* csi ? 5 W */ + ResetState(sp); + break; #endif /* OPT_DEC_RECTOPS */ +#if OPT_VT525_COLORS + case CASE_CSI_COMMA_STATE: + TRACE(("CASE_CSI_COMMA_STATE\n")); + /* csi comma (,) */ + if (screen->vtXX_level >= 5) + sp->parsestate = csi_comma_table; + else + sp->parsestate = eigtable; + break; + + case CASE_DECAC: + TRACE(("CASE_DECAC\n")); +#if OPT_ISO_COLORS + if (screen->terminal_id >= 525) { + int fg, bg; + + switch (GetParam(0)) { + case 1: + fg = GetParam(1); + bg = GetParam(2); + if (fg >= 0 && fg < 16 && bg >= 0 && bg < 16) { + Boolean repaint = False; + + if (AssignFgColor(xw, + GET_COLOR_RES(xw, screen->Acolors[fg]))) + repaint = True; + if (AssignBgColor(xw, + GET_COLOR_RES(xw, screen->Acolors[bg]))) + repaint = True; + if (repaint) + xtermRepaint(xw); + screen->assigned_fg = fg; + screen->assigned_bg = bg; + } + break; + case 2: + /* window frames: not implemented */ + break; + } + } +#endif + ResetState(sp); + break; + + case CASE_DECATC: +#if OPT_ISO_COLORS + TRACE(("CASE_DECATC\n")); + if (screen->terminal_id >= 525) { + int ps = GetParam(0); + int fg = GetParam(1); + int bg = GetParam(2); + if (ps >= 0 && ps < 16 + && fg >= 0 && fg < 16 + && bg >= 0 && bg < 16) { + screen->alt_colors[ps].fg = fg; + screen->alt_colors[ps].bg = bg; + } + } +#endif + ResetState(sp); + break; + + case CASE_DECTID: + TRACE(("CASE_DECTID\n")); + switch (GetParam(0)) { + case 0: + screen->display_da1 = 100; + break; + case 1: + screen->display_da1 = 101; + break; + case 2: + screen->display_da1 = 102; + break; + case 5: + screen->display_da1 = 220; + break; + case 7: + screen->display_da1 = 320; + break; + case 9: + screen->display_da1 = 420; + break; + case 10: + screen->display_da1 = 520; + break; + } + ResetState(sp); + break; +#else + case CASE_CSI_COMMA_STATE: + sp->parsestate = eigtable; + break; +#endif + case CASE_DECSASD: #if OPT_STATUS_LINE if (screen->vtXX_level >= 2) { @@ -5413,8 +5834,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) case CASE_OSC: TRACE(("CASE_OSC: Operating System Command\n")); - sp->parsestate = sos_table; - sp->string_mode = ANSI_OSC; + BeginString(ANSI_OSC); break; case CASE_RIS: @@ -5444,31 +5864,36 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) case CASE_LS2: TRACE(("CASE_LS2\n")); - screen->curgl = 2; + if (screen->ansi_level > 2) + screen->curgl = 2; ResetState(sp); break; case CASE_LS3: TRACE(("CASE_LS3\n")); - screen->curgl = 3; + if (screen->ansi_level > 2) + screen->curgl = 3; ResetState(sp); break; case CASE_LS3R: TRACE(("CASE_LS3R\n")); - screen->curgr = 3; + if (screen->ansi_level > 2) + screen->curgr = 3; ResetState(sp); break; case CASE_LS2R: TRACE(("CASE_LS2R\n")); - screen->curgr = 2; + if (screen->ansi_level > 2) + screen->curgr = 2; ResetState(sp); break; case CASE_LS1R: TRACE(("CASE_LS1R\n")); - screen->curgr = 1; + if (screen->ansi_level > 2) + screen->curgr = 1; ResetState(sp); break; @@ -6154,7 +6579,7 @@ in_put(XtermWidget xw) * of output. */ if (size == FRG_SIZE) { - init_timeval(&my_timeout, 0); + init_timeval(&my_timeout, 0L); i = Select(max_plus1, &select_mask, &write_mask, 0, &my_timeout); if (i > 0 && FD_ISSET(screen->respond, &select_mask)) { sched_yield(); @@ -6183,7 +6608,7 @@ in_put(XtermWidget xw) XFD_COPYSET(&pty_mask, &write_mask); } else FD_ZERO(&write_mask); - init_timeval(&my_timeout, 0); + init_timeval(&my_timeout, 0L); time_select = 0; /* @@ -6205,12 +6630,12 @@ in_put(XtermWidget xw) } #if OPT_STATUS_LINE if ((screen->status_type == 1) && screen->status_timeout) { - ImproveTimeout(find_SL_Timeout(xw) * 1000); + ImproveTimeout(find_SL_Timeout(xw) * 1000L); time_select = 1; } #endif if (screen->awaitInput) { - ImproveTimeout(50000); + ImproveTimeout(50000L); time_select = 1; } #if OPT_BLINK_CURS @@ -6221,9 +6646,9 @@ in_put(XtermWidget xw) * Compute the timeout for the blinking cursor to be much * smaller than the "on" or "off" interval. */ - long tick = smaller_timeout((screen->blink_on < screen->blink_off) - ? screen->blink_on - : screen->blink_off); + long tick = smaller_timeout((long) ((screen->blink_on < screen->blink_off) + ? screen->blink_on + : screen->blink_off)); ImproveTimeout(tick); time_select = 1; } @@ -6247,7 +6672,7 @@ in_put(XtermWidget xw) /* if there is room to write more data to the pty, go write more */ if (FD_ISSET(screen->respond, &write_mask)) { - v_write(screen->respond, (Char *) 0, 0); /* flush buffer */ + v_write(screen->respond, (Char *) 0, (size_t) 0); /* flush buffer */ } /* if there are X events already in our queue, it @@ -6341,11 +6766,21 @@ dotext(XtermWidget xw, Cardinal offset; int rmargin = ScrnRightMargin(xw); + xw->work.write_text = buf; +#if OPT_DEC_RECTOPS + xw->work.write_sums = NULL; +#endif #if OPT_WIDE_CHARS if (screen->vt100_graphics) #endif - if (!(len = (Cardinal) xtermCharSetOut(xw, buf, buf + len, charset))) - return; + { + DECNRCM_codes rightset = screen->gsets[(int) (screen->curgr)]; + if (charset != nrc_ASCII || rightset != nrc_ASCII) { + len = xtermCharSetOut(xw, len, charset); + if (len == 0) + return; + } + } if_OPT_XMC_GLITCH(screen, { Cardinal n; @@ -6484,7 +6919,7 @@ dotext(XtermWidget xw, } if (chars_chomped != 0 && next_col <= last_col) { - WriteText(xw, buf + offset, chars_chomped); + WriteText(xw, offset, chars_chomped); } else if (!did_wrap && len > 0 && (xw->flags & WRAPAROUND) @@ -6530,7 +6965,7 @@ dotext(XtermWidget xw, } next_col = screen->cur_col + this_col; - WriteText(xw, buf + offset, (unsigned) this_col); + WriteText(xw, offset, (unsigned) this_col); /* * The call to WriteText updates screen->cur_col. @@ -6834,6 +7269,12 @@ dpmodes(XtermWidget xw, BitFunc func) update_appcursor(); break; case srm_DECANM: /* ANSI/VT52 mode */ +#if OPT_STATUS_LINE + if (screen->status_type == 2 && screen->status_active) { + /* DEC 070, section 14.2.3 item 4 */ + /* EMPTY */ ; + } else +#endif if (IsSM()) { /* ANSI (VT100) */ /* * Setting DECANM should have no effect, since this function @@ -6857,7 +7298,7 @@ dpmodes(XtermWidget xw, BitFunc func) * (e.g., a VT420) does not alter those tab settings when * switching modes. */ - screen->vtXX_level = 0; + set_vtXX_level(screen, 0); screen->vt52_save_flags = xw->flags; xw->flags = 0; screen->vt52_save_curgl = screen->curgl; @@ -6880,8 +7321,13 @@ dpmodes(XtermWidget xw, BitFunc func) ? 132 : 80) || j != MaxCols(screen)); - if (!(xw->flags & NOCLEAR_COLM)) + if (!(xw->flags & NOCLEAR_COLM)) { +#if OPT_STATUS_LINE + if (IsStatusShown(screen)) + clear_status_line(xw); +#endif ClearScreen(xw); + } if (willResize) RequestResize(xw, -1, j, True); (*func) (&xw->flags, IN132COLUMNS); @@ -7006,6 +7452,9 @@ dpmodes(XtermWidget xw, BitFunc func) update_reversewrap(); } break; + case srm_REVERSEWRAP2: /* extended reverse wraparound (xterm) */ + (*func) (&xw->flags, REVERSEWRAP2); + break; #ifdef ALLOWLOGGING case srm_ALLOWLOGGING: /* logging (xterm) also DECGPBM (Graphics Print Background Mode) */ if_PRINT_GRAPHICS2(set_bool_mode(screen->graphics_print_background_mode)) { @@ -7036,7 +7485,7 @@ dpmodes(XtermWidget xw, BitFunc func) ToAlternate(xw, True); ClearScreen(xw); } else { - FromAlternate(xw); + FromAlternate(xw, False); CursorRestore(xw); } } else if (IsSM()) { @@ -7050,7 +7499,7 @@ dpmodes(XtermWidget xw, BitFunc func) } else { if (screen->whichBuf) ClearScreen(xw); - FromAlternate(xw); + FromAlternate(xw, False); } } else if (IsSM()) { do_ti_xtra_scroll(xw); @@ -7062,7 +7511,7 @@ dpmodes(XtermWidget xw, BitFunc func) if (IsSM()) { ToAlternate(xw, False); } else { - FromAlternate(xw); + FromAlternate(xw, False); } } else if (IsSM()) { do_ti_xtra_scroll(xw); @@ -7092,7 +7541,7 @@ dpmodes(XtermWidget xw, BitFunc func) (*func) (&xw->keyboard.flags, MODE_DECSDM); TRACE(("DECSET/DECRST DECSDM %s (resource default is %s)\n", BtoS(xw->keyboard.flags & MODE_DECSDM), - BtoS(!TScreenOf(xw)->sixel_scrolling))); + BtoS(!screen->sixel_scrolling))); update_decsdm(); } break; @@ -7206,7 +7655,7 @@ dpmodes(XtermWidget xw, BitFunc func) xw->misc.titeInhibit = False; } else if (!xw->misc.titeInhibit) { xw->misc.titeInhibit = True; - FromAlternate(xw); + FromAlternate(xw, False); } update_titeInhibit(); break; @@ -7218,6 +7667,9 @@ dpmodes(XtermWidget xw, BitFunc func) CursorRestore(xw); } break; + case srm_FAST_SCROLL: + set_bool_mode(screen->fastscroll); + break; #if OPT_TCAP_FKEYS case srm_TCAP_FKEYS: set_keyboard_type(xw, keyboardIsTermcap, IsSM()); @@ -7272,7 +7724,7 @@ dpmodes(XtermWidget xw, BitFunc func) case srm_PRIVATE_COLOR_REGISTERS: /* private color registers for each graphic */ TRACE(("DECSET/DECRST PRIVATE_COLOR_REGISTERS to %s (resource default is %s)\n", BtoS(screen->privatecolorregisters), - BtoS(TScreenOf(xw)->privatecolorregisters))); + BtoS(screen->privatecolorregisters0))); set_bool_mode(screen->privatecolorregisters); update_privatecolorregisters(); break; @@ -7287,6 +7739,35 @@ dpmodes(XtermWidget xw, BitFunc func) } break; #endif + case srm_DECARSM: /* ignore */ + case srm_DECATCBM: /* ignore */ + case srm_DECATCUM: /* ignore */ + case srm_DECBBSM: /* ignore */ + case srm_DECCAAM: /* ignore */ + case srm_DECCANSM: /* ignore */ + case srm_DECCAPSLK: /* ignore */ + case srm_DECCRTSM: /* ignore */ + case srm_DECECM: /* ignore */ + case srm_DECFWM: /* ignore */ + case srm_DECHDPXM: /* ignore */ + case srm_DECHEM: /* ignore */ + case srm_DECHCCM: /* ignore */ + case srm_DECHWUM: /* ignore */ + case srm_DECIPEM: /* ignore */ + case srm_DECKBUM: /* ignore */ + case srm_DECKLHIM: /* ignore */ + case srm_DECKPM: /* ignore */ + case srm_DECRLM: /* ignore */ + case srm_DECMCM: /* ignore */ + case srm_DECNAKB: /* ignore */ + case srm_DECNULM: /* ignore */ + case srm_DECNUMLK: /* ignore */ + case srm_DECOSCNM: /* ignore */ + case srm_DECPCCM: /* ignore */ + case srm_DECRLCM: /* ignore */ + case srm_DECRPL: /* ignore */ + case srm_DECVCCM: /* ignore */ + case srm_DECXRLM: /* ignore */ default: TRACE(("DATA_ERROR: unknown private code %d\n", code)); break; @@ -7405,6 +7886,9 @@ savemodes(XtermWidget xw) DoSM(DP_X_REVWRAP, xw->flags & REVERSEWRAP); } break; + case srm_REVERSEWRAP2: /* extended reverse wraparound (xterm) */ + DoSM(DP_X_REVWRAP2, xw->flags & REVERSEWRAP2); + break; #ifdef ALLOWLOGGING case srm_ALLOWLOGGING: /* logging (xterm) also DECGPBM (Graphics Print Background Mode) */ if_PRINT_GRAPHICS2(DoSM(DP_DECGPBM, screen->graphics_print_background_mode)) { @@ -7543,6 +8027,9 @@ savemodes(XtermWidget xw) CursorSave(xw); } break; + case srm_FAST_SCROLL: + DoSM(DP_FAST_SCROLL, screen->fastscroll); + break; #if OPT_PASTE64 || OPT_READLINE case srm_PASTE_IN_BRACKET: SCREEN_FLAG_save(screen, paste_brackets); @@ -7580,6 +8067,37 @@ savemodes(XtermWidget xw) DoSM(DP_SIXEL_SCROLLS_RIGHT, screen->sixel_scrolls_right); break; #endif + case srm_DECARSM: /* ignore */ + case srm_DECATCBM: /* ignore */ + case srm_DECATCUM: /* ignore */ + case srm_DECBBSM: /* ignore */ + case srm_DECCAAM: /* ignore */ + case srm_DECCANSM: /* ignore */ + case srm_DECCAPSLK: /* ignore */ + case srm_DECCRTSM: /* ignore */ + case srm_DECECM: /* ignore */ + case srm_DECFWM: /* ignore */ + case srm_DECHCCM: /* ignore */ + case srm_DECHDPXM: /* ignore */ + case srm_DECHEM: /* ignore */ + case srm_DECHWUM: /* ignore */ + case srm_DECIPEM: /* ignore */ + case srm_DECKBUM: /* ignore */ + case srm_DECKLHIM: /* ignore */ + case srm_DECKPM: /* ignore */ + case srm_DECRLM: /* ignore */ + case srm_DECMCM: /* ignore */ + case srm_DECNAKB: /* ignore */ + case srm_DECNULM: /* ignore */ + case srm_DECNUMLK: /* ignore */ + case srm_DECOSCNM: /* ignore */ + case srm_DECPCCM: /* ignore */ + case srm_DECRLCM: /* ignore */ + case srm_DECRPL: /* ignore */ + case srm_DECVCCM: /* ignore */ + case srm_DECXRLM: /* ignore */ + default: + break; } } } @@ -7741,6 +8259,9 @@ restoremodes(XtermWidget xw) update_reversewrap(); } break; + case srm_REVERSEWRAP2: /* extended reverse wraparound (xterm) */ + bitcpy(&xw->flags, screen->save_modes[DP_X_REVWRAP2], REVERSEWRAP2); + break; #ifdef ALLOWLOGGING case srm_ALLOWLOGGING: /* logging (xterm) also DECGPBM (Graphics Print Background Mode) */ if_PRINT_GRAPHICS2(DoRM(DP_DECGPBM, screen->graphics_print_background_mode)) { @@ -7765,7 +8286,7 @@ restoremodes(XtermWidget xw) if (screen->save_modes[DP_X_ALTBUF]) ToAlternate(xw, False); else - FromAlternate(xw); + FromAlternate(xw, False); /* update_altscreen done by ToAlt and FromAlt */ } else if (screen->save_modes[DP_X_ALTBUF]) { do_ti_xtra_scroll(xw); @@ -7777,7 +8298,7 @@ restoremodes(XtermWidget xw) if (screen->save_modes[DP_X_ALTBUF]) ToAlternate(xw, False); else - FromAlternate(xw); + FromAlternate(xw, False); /* update_altscreen done by ToAlt and FromAlt */ } else if (screen->save_modes[DP_X_ALTBUF]) { do_ti_xtra_scroll(xw); @@ -7838,7 +8359,7 @@ restoremodes(XtermWidget xw) case srm_ALLOW_ALTBUF: DoRM(DP_ALLOW_ALTBUF, xw->misc.titeInhibit); if (xw->misc.titeInhibit) - FromAlternate(xw); + FromAlternate(xw, False); update_titeInhibit(); break; case srm_SAVE_CURSOR: @@ -7846,6 +8367,9 @@ restoremodes(XtermWidget xw) CursorRestore(xw); } break; + case srm_FAST_SCROLL: + DoRM(DP_FAST_SCROLL, screen->fastscroll); + break; case srm_ALTERNATE_SCROLL: DoRM(DP_ALTERNATE_SCROLL, screen->alternateScroll); break; @@ -7964,6 +8488,37 @@ restoremodes(XtermWidget xw) BtoS(screen->sixel_scrolls_right))); break; #endif + case srm_DECARSM: /* ignore */ + case srm_DECATCBM: /* ignore */ + case srm_DECATCUM: /* ignore */ + case srm_DECBBSM: /* ignore */ + case srm_DECCAAM: /* ignore */ + case srm_DECCANSM: /* ignore */ + case srm_DECCAPSLK: /* ignore */ + case srm_DECCRTSM: /* ignore */ + case srm_DECECM: /* ignore */ + case srm_DECFWM: /* ignore */ + case srm_DECHCCM: /* ignore */ + case srm_DECHDPXM: /* ignore */ + case srm_DECHEM: /* ignore */ + case srm_DECHWUM: /* ignore */ + case srm_DECIPEM: /* ignore */ + case srm_DECKBUM: /* ignore */ + case srm_DECKLHIM: /* ignore */ + case srm_DECKPM: /* ignore */ + case srm_DECRLM: /* ignore */ + case srm_DECMCM: /* ignore */ + case srm_DECNAKB: /* ignore */ + case srm_DECNULM: /* ignore */ + case srm_DECNUMLK: /* ignore */ + case srm_DECOSCNM: /* ignore */ + case srm_DECPCCM: /* ignore */ + case srm_DECRLCM: /* ignore */ + case srm_DECRPL: /* ignore */ + case srm_DECVCCM: /* ignore */ + case srm_DECXRLM: /* ignore */ + default: + break; } } } @@ -8364,63 +8919,62 @@ window_ops(XtermWidget xw) } break; +#define WhichTitle(n) \ + ((n) == 0 \ + ? "window/icon titles" \ + : ((n) == 1 \ + ? "icon title" \ + : ((n) == 2 \ + ? "window title" \ + : "no titles"))) + case ewPushTitle: /* save the window's title(s) on stack */ if (AllowWindowOps(xw, ewPushTitle)) { - SaveTitle *last = screen->save_title; - SaveTitle *item = TypeCalloc(SaveTitle); + SaveTitle item; - TRACE(("...push title onto stack\n")); - if (item != 0) { - switch (zero_if_default(1)) { - case 0: - item->iconName = get_icon_label(xw); - item->windowName = get_window_label(xw); - break; - case 1: - item->iconName = get_icon_label(xw); - break; - case 2: - item->windowName = get_window_label(xw); - break; - } - item->next = last; - if (item->iconName == 0) { - item->iconName = ((last == 0) - ? get_icon_label(xw) - : x_strdup(last->iconName)); - } - if (item->windowName == 0) { - item->windowName = ((last == 0) - ? get_window_label(xw) - : x_strdup(last->windowName)); - } - screen->save_title = item; + TRACE(("...push %s onto stack\n", WhichTitle(zero_if_default(1)))); + memset(&item, 0, sizeof(item)); + switch (zero_if_default(1)) { + case 0: + item.iconName = get_icon_label(xw); + item.windowName = get_window_label(xw); + break; + case 1: + item.iconName = get_icon_label(xw); + break; + case 2: + item.windowName = get_window_label(xw); + break; } + xtermPushTitle(screen, zero_if_default(2), &item); } break; case ewPopTitle: /* restore the window's title(s) from stack */ if (AllowWindowOps(xw, ewPopTitle)) { - SaveTitle *item = screen->save_title; + SaveTitle item; - TRACE(("...pop title off stack\n")); - if (item != 0) { + TRACE(("...%s %s off stack\n", + (zero_if_default(2) + ? "get" + : "pop"), + WhichTitle(zero_if_default(1)))); + + if (xtermPopTitle(screen, zero_if_default(2), &item)) { switch (zero_if_default(1)) { case 0: - ChangeIconName(xw, item->iconName); - ChangeTitle(xw, item->windowName); + ChangeIconName(xw, item.iconName); + ChangeTitle(xw, item.windowName); break; case 1: - ChangeIconName(xw, item->iconName); + ChangeIconName(xw, item.iconName); break; case 2: - ChangeTitle(xw, item->windowName); + ChangeTitle(xw, item.windowName); break; } - screen->save_title = item->next; - free(item->iconName); - free(item->windowName); - free(item); + if (!zero_if_default(2)) + xtermFreeTitle(&item); } } break; @@ -8512,14 +9066,14 @@ unparseseq(XtermWidget xw, ANSI *ap) } switch (ap->a_radix[i]) { case 16: - sprintf(temp, "%04X", ap->a_param[i] & 0xffff); + sprintf(temp, "%04X", UParmOf(ap->a_param[i])); unparseputs(xw, temp); break; case 1: unparseputc(xw, ap->a_param[i]); break; default: - unparseputn(xw, (unsigned) (UParm) ap->a_param[i]); + unparseputn(xw, UParmOf(ap->a_param[i])); break; } } @@ -8589,7 +9143,7 @@ unparseputc(XtermWidget xw, int c) */ if (screen->tc_query_code >= 0) { char tmp[3]; - sprintf(tmp, "%02X", c & 0xFF); + sprintf(tmp, "%02X", (unsigned) (c & 0xFF)); buf[len++] = CharOf(tmp[0]); buf[len++] = CharOf(tmp[1]); } else @@ -8626,11 +9180,11 @@ unparse_end(XtermWidget xw) if (screen->unparse_len) { TRACE(("unparse_end %u:%s\n", screen->unparse_len, - visibleIChars(screen->unparse_bfr, screen->unparse_len))); + visibleIChars(screen->unparse_bfr, (size_t) screen->unparse_len))); #ifdef VMS tt_write(screen->unparse_bfr, screen->unparse_len); #else /* VMS */ - writePtyData(screen->respond, screen->unparse_bfr, screen->unparse_len); + writePtyData(screen->respond, screen->unparse_bfr, (size_t) screen->unparse_len); #endif /* VMS */ screen->unparse_len = 0; } @@ -8640,7 +9194,7 @@ void ToggleAlternate(XtermWidget xw) { if (TScreenOf(xw)->whichBuf) - FromAlternate(xw); + FromAlternate(xw, False); else ToAlternate(xw, False); } @@ -8665,7 +9219,7 @@ ToAlternate(XtermWidget xw, Bool clearFirst) } static void -FromAlternate(XtermWidget xw) +FromAlternate(XtermWidget xw, Bool clearFirst) { TScreen *screen = TScreenOf(xw); @@ -8674,6 +9228,8 @@ FromAlternate(XtermWidget xw) if (screen->scroll_amt) { FlushScroll(xw); } + if (clearFirst) + ClearScreen(xw); SwitchBufs(xw, 0, False); screen->visbuf = screen->editBuf_index[screen->whichBuf]; update_altscreen(); @@ -8874,9 +9430,15 @@ RequestResize(XtermWidget xw, int rows, int cols, Bool text) TRACE(("RequestResize(rows=%d, cols=%d, text=%d)\n", rows, cols, text)); #if OPT_STATUS_LINE - if (IsStatusShown(screen) && (rows > 0)) { - TRACE(("...reserve a row for status-line\n")); - ++rows; + if (IsStatusShown(screen)) { + if (rows == -1) { + /* prevent shrinking on DECCOLM, XTRESTORE, DECSCPP, DECANM */ + rows = MaxRows(screen); + } + if (rows > 0) { + TRACE(("...reserve a row for status-line\n")); + ++rows; + } } #endif @@ -9134,7 +9696,7 @@ repairColors(XtermWidget target) screen->Tcolors[TEXT_BG].resource = x_strdup(XtDefaultBackground); if (screen->Tcolors[TEXT_FG].resource == 0 || screen->Tcolors[TEXT_BG].resource == 0) { - Exit(1); + Exit(ERROR_MISC); } screen->Tcolors[TEXT_FG].value = target->dft_foreground; screen->Tcolors[TEXT_BG].value = target->dft_background; @@ -9424,9 +9986,8 @@ set_flags_from_list(char *target, } #define InitCursorShape(target, source) \ - target->cursor_shape = source->cursor_underline \ - ? CURSOR_UNDERLINE \ - : CURSOR_BLOCK + target->cursor_shape = source->cursor_underline ? CURSOR_UNDERLINE : \ + source->cursor_bar ? CURSOR_BAR : CURSOR_BLOCK #if OPT_XRES_QUERY static XtResource * @@ -9659,6 +10220,7 @@ static const FlagList tblPasteOps[] = ,DATA2(NL, LF) ,DATA(C0) ,DATA(DEL) + ,DATA(STTY) ,DATA_END }; #undef DATA @@ -9956,9 +10518,11 @@ VTInitialize(Widget wrequest, #if OPT_BOX_CHARS init_Bres(screen.force_box_chars); init_Bres(screen.force_packed); - init_Bres(screen.force_all_chars); init_Bres(screen.assume_all_chars); #endif +#if OPT_BOX_CHARS || OPT_WIDE_CHARS + init_Bres(screen.force_all_chars); +#endif init_Bres(screen.free_bold_box); init_Bres(screen.allowBoldFonts); @@ -9981,6 +10545,7 @@ VTInitialize(Widget wrequest, screen->cursor_blink_i = screen->cursor_blink; #endif init_Bres(screen.cursor_underline); + init_Bres(screen.cursor_bar); /* resources allow for underline or block, not (yet) bar */ InitCursorShape(screen, TScreenOf(request)); #if OPT_BLINK_CURS @@ -10034,6 +10599,7 @@ VTInitialize(Widget wrequest, init_Sres(screen.term_id); screen->terminal_id = decodeTerminalID(TScreenOf(request)->term_id); + screen->display_da1 = screen->terminal_id; /* * (1) If a known terminal model, and not a graphical terminal, preserve * the terminal id. @@ -10066,13 +10632,14 @@ VTInitialize(Widget wrequest, break; #endif screen->terminal_id = limitedTerminalID(screen->terminal_id); + screen->display_da1 = screen->terminal_id; break; } TRACE(("term_id '%s' -> terminal_id %d\n", screen->term_id, screen->terminal_id)); - screen->vtXX_level = (screen->terminal_id / 100); + set_vtXX_level(screen, (screen->terminal_id / 100)); init_Ires(screen.title_modes); screen->title_modes0 = screen->title_modes; @@ -10142,6 +10709,7 @@ VTInitialize(Widget wrequest, wnew->screen.pointer_mode0 = wnew->screen.pointer_mode; init_Sres(screen.answer_back); + init_Bres(screen.prefer_latin1); wnew->SPS.printer_checked = False; init_Sres(SPS.printer_command); @@ -10416,6 +10984,21 @@ VTInitialize(Widget wrequest, init_Bres(screen.faint_relative); #endif +#if OPT_VT525_COLORS + screen->assigned_fg = 7; + screen->assigned_bg = 0; +#if MIN_ANSI_COLORS >= 16 + /* + * VT520-RM does not define the initial palette, but this is preferable + * to black-on-black. + */ + for (i = 0; i < 16; i++) { + screen->alt_colors[i].fg = screen->assigned_fg; + screen->alt_colors[i].bg = screen->assigned_bg; + } +#endif +#endif + TRACE(("...will fake resources for color%d to color%d\n", MIN_ANSI_COLORS, NUM_ANSI_COLORS - 1)); @@ -10556,9 +11139,15 @@ VTInitialize(Widget wrequest, #if OPT_RENDERFONT init_Ires(misc.limit_fontsets); + init_Ires(misc.limit_fontheight); + if (wnew->misc.limit_fontheight > 50) { + xtermWarning("limiting extra fontheight percent to 50 (was %d)\n", + wnew->misc.limit_fontheight); + wnew->misc.limit_fontheight = 50; + } init_Ires(misc.limit_fontwidth); if (wnew->misc.limit_fontwidth > 50) { - xtermWarning("limiting extra fontwidth percent to 50 (was %u)\n", + xtermWarning("limiting extra fontwidth percent to 50 (was %d)\n", wnew->misc.limit_fontwidth); wnew->misc.limit_fontwidth = 50; } @@ -10753,6 +11342,11 @@ VTInitialize(Widget wrequest, init_Bres(screen.privatecolorregisters); /* FIXME: should this be off unconditionally here? */ TRACE(("initialized PRIVATE_COLOR_REGISTERS to resource default: %s\n", BtoS(screen->privatecolorregisters))); + screen->privatecolorregisters0 = screen->privatecolorregisters; + + init_Bres(screen.incremental_graphics); + TRACE(("initialized INCREMENTAL_GRAPHICS to resource default: %s\n", + BtoS(screen->incremental_graphics))); #endif #if OPT_GRAPHICS @@ -10782,7 +11376,7 @@ VTInitialize(Widget wrequest, break; case 382: native_w = 960; - native_h = 750; + native_h = 720; break; } @@ -10879,6 +11473,7 @@ VTInitialize(Widget wrequest, #if OPT_SIXEL_GRAPHICS init_Bres(screen.sixel_scrolls_right); + screen->sixel_scrolls_right0 = screen->sixel_scrolls_right; #endif #if OPT_PRINT_GRAPHICS init_Bres(screen.graphics_print_to_host); @@ -10953,6 +11548,8 @@ VTInitialize(Widget wrequest, screen->unparse_bfr = (IChar *) (void *) XtCalloc(screen->unparse_max, (Cardinal) sizeof(IChar)); + init_Ires(screen.strings_max); + if (screen->savelines < 0) screen->savelines = 0; @@ -11099,13 +11696,12 @@ VTDestroy(Widget w GCC_UNUSED) deleteScrollback(screen); } - while (screen->save_title != 0) { - SaveTitle *last = screen->save_title; - screen->save_title = last->next; - free(last->iconName); - free(last->windowName); - free(last); - } + for (n = 0; n < MAX_SAVED_TITLES; ++n) + xtermFreeTitle(&screen->saved_titles.data[n]); + +#if OPT_STATUS_LINE + free(screen->status_fmt); +#endif #ifndef NO_ACTIVE_ICON TRACE_FREE_LEAK(xw->misc.active_icon_s); #endif @@ -11344,8 +11940,9 @@ VTDestroy(Widget w GCC_UNUSED) XtFree((void *) (xw->visInfo)); #if OPT_WIDE_CHARS + FreeTypedBuffer(IChar); FreeTypedBuffer(XChar2b); - FreeTypedBuffer(char); + FreeTypedBuffer(Char); #endif #if OPT_RENDERFONT #if OPT_RENDERWIDE @@ -11381,7 +11978,7 @@ getProperty(Display *dpy, TRACE(("getProperty %s(%s)\n", prop_name, req_type ? TraceAtomName(dpy, req_type) : "?")); - property = XInternAtom(dpy, prop_name, False); + property = CachedInternAtom(dpy, prop_name); if (!xtermGetWinProp(dpy, w, @@ -11484,7 +12081,7 @@ discount_frame_extents(XtermWidget xw, int *high, int *wide) TScreen *screen = TScreenOf(xw); Display *dpy = screen->display; - Atom atom_supported = XInternAtom(dpy, "_NET_FRAME_EXTENTS", False); + Atom atom_supported = CachedInternAtom(dpy, "_NET_FRAME_EXTENTS"); Atom actual_type; int actual_format; long long_offset = 0; @@ -11681,7 +12278,7 @@ VTRealize(Widget w, /* really screwed if we couldn't open default font */ if (!GetNormalFont(screen, fNorm)->fs) { xtermWarning("unable to locate a suitable font\n"); - Exit(1); + Exit(ERROR_MISC); } #if OPT_WIDE_CHARS if (screen->utf8_mode) { @@ -11803,7 +12400,7 @@ VTRealize(Widget w, TRACE(("%s@%d -- ", __FILE__, __LINE__)); TRACE_WM_HINTS(xw); - if ((pid_atom = XInternAtom(XtDisplay(xw), "_NET_WM_PID", False)) != None) { + if ((pid_atom = CachedInternAtom(XtDisplay(xw), "_NET_WM_PID")) != None) { /* XChangeProperty format 32 really is "long" */ unsigned long pid_l = (unsigned long) getpid(); TRACE(("Setting _NET_WM_PID property to %lu\n", pid_l)); @@ -11937,19 +12534,13 @@ VTRealize(Widget w, copyCgs(xw, win, gcBoldReverse, gcNormReverse); initBorderGC(xw, win); - -#if OPT_TOOLBAR - /* - * Toolbar is initialized before we get here. Enable the menu item - * and set it properly. - */ - SetItemSensitivity(vtMenuEntries[vtMenu_activeicon].widget, True); - update_activeicon(); -#endif } else { ReportIcons(("disabled active-icon\n")); xw->work.active_icon = eiFalse; } +#if OPT_TOOLBAR + update_activeicon(); +#endif #endif /* NO_ACTIVE_ICON */ #if OPT_INPUT_METHOD @@ -12824,9 +13415,14 @@ ShowCursor(XtermWidget xw) * Finally, draw the underline. */ screen->box->x = (short) x; - screen->box->y = (short) (y + FontHeight(screen) - 2); - XDrawLines(screen->display, VDrawable(screen), outlineGC, - screen->box, NBOX, CoordModePrevious); + screen->box->y = (short) (y + + FontHeight(screen) + - screen->box[2].y); + XFillRectangle(screen->display, VDrawable(screen), outlineGC, + screen->box->x, + screen->box->y, + (unsigned) screen->box[1].x, + (unsigned) screen->box[2].y); } else if (isCursorBar(screen)) { /* @@ -12834,8 +13430,11 @@ ShowCursor(XtermWidget xw) */ screen->box->x = (short) x; screen->box->y = (short) y; - XDrawLines(screen->display, VDrawable(screen), outlineGC, - screen->box, NBOX, CoordModePrevious); + XFillRectangle(screen->display, VDrawable(screen), outlineGC, + screen->box->x, + screen->box->y, + (unsigned) screen->box[1].x, + (unsigned) screen->box[2].y); } else { #if OPT_WIDE_ATTRS int italics_on = ((ld->attribs[cursor_col] & ATR_ITALIC) != 0); @@ -13295,12 +13894,20 @@ ReallyReset(XtermWidget xw, Bool full, Bool saved) InitCursorShape(screen, screen); xtermSetCursorBox(screen); #if OPT_BLINK_CURS - SetCursorBlink(xw, screen->cursor_blink_i); screen->cursor_blink_esc = 0; + SetCursorBlink(xw, screen->cursor_blink_i); TRACE(("cursor_shape:%d blinks:%d\n", screen->cursor_shape, screen->cursor_blink)); #endif +#if OPT_STATUS_LINE + if (screen->vtXX_level >= 2) { + if (full) + handle_DECSSDT(xw, 0); /* DEC STD 070, page 14-10, RIS */ + else + handle_DECSASD(xw, 0); /* DEC STD 070, page 14-9, DECSTR */ + } +#endif /* reset scrolling region */ resetMarginMode(xw); @@ -13317,6 +13924,12 @@ ReallyReset(XtermWidget xw, Bool full, Bool saved) /* Reset character-sets to initial state */ resetCharsets(screen); + UIntClr(xw->keyboard.flags, (MODE_DECCKM | MODE_KAM | MODE_DECKPAM)); + if (xw->misc.appcursorDefault) + xw->keyboard.flags |= MODE_DECCKM; + if (xw->misc.appkeypadDefault) + xw->keyboard.flags |= MODE_DECKPAM; + #if OPT_MOD_FKEYS /* Reset modifier-resources to initial state */ xw->keyboard.modify_now = xw->keyboard.modify_1st; @@ -13345,19 +13958,20 @@ ReallyReset(XtermWidget xw, Bool full, Bool saved) xtermShowPointer(xw, True); TabReset(xw->tabs); - xw->keyboard.flags = MODE_SRM; + xw->keyboard.flags |= MODE_SRM; guard_keyboard_type = False; screen->old_fkeys = screen->old_fkeys0; decode_keyboard_type(xw, &resource); update_keyboard_type(); + UIntClr(xw->keyboard.flags, MODE_DECBKM); #if OPT_INITIAL_ERASE if (xw->keyboard.reset_DECBKM == 1) xw->keyboard.flags |= MODE_DECBKM; else if (xw->keyboard.reset_DECBKM == 2) #endif - if (TScreenOf(xw)->backarrow_key) + if (screen->backarrow_key) xw->keyboard.flags |= MODE_DECBKM; TRACE(("full reset DECBKM %s\n", BtoS(xw->keyboard.flags & MODE_DECBKM))); @@ -13368,27 +13982,26 @@ ReallyReset(XtermWidget xw, Bool full, Bool saved) screen->title_modes = screen->title_modes0; screen->pointer_mode = screen->pointer_mode0; #if OPT_SIXEL_GRAPHICS - if (TScreenOf(xw)->sixel_scrolling) + if (screen->sixel_scrolling) UIntClr(xw->keyboard.flags, MODE_DECSDM); else UIntSet(xw->keyboard.flags, MODE_DECSDM); TRACE(("full reset DECSDM to %s (resource default is %s)\n", BtoS(xw->keyboard.flags & MODE_DECSDM), - BtoS(!TScreenOf(xw)->sixel_scrolling))); + BtoS(!screen->sixel_scrolling))); #endif #if OPT_GRAPHICS - screen->privatecolorregisters = TScreenOf(xw)->privatecolorregisters; - TRACE(("full reset PRIVATE_COLOR_REGISTERS to %s (resource default is %s)\n", - BtoS(screen->privatecolorregisters), - BtoS(TScreenOf(xw)->privatecolorregisters))); + screen->privatecolorregisters = screen->privatecolorregisters0; + TRACE(("full reset PRIVATE_COLOR_REGISTERS to %s\n", + BtoS(screen->privatecolorregisters))); + update_privatecolorregisters(); #endif #if OPT_SIXEL_GRAPHICS - screen->sixel_scrolls_right = TScreenOf(xw)->sixel_scrolls_right; - TRACE(("full reset SIXEL_SCROLLS_RIGHT to %s (resource default is %s)\n", - BtoS(screen->sixel_scrolls_right), - BtoS(TScreenOf(xw)->sixel_scrolls_right))); + screen->sixel_scrolls_right = screen->sixel_scrolls_right0; + TRACE(("full reset SIXEL_SCROLLS_RIGHT to %s\n", + BtoS(screen->sixel_scrolls_right))); #endif update_appcursor(); @@ -13398,7 +14011,7 @@ ReallyReset(XtermWidget xw, Bool full, Bool saved) show_8bit_control(False); reset_decudk(xw); - FromAlternate(xw); + FromAlternate(xw, True); ClearScreen(xw); screen->cursor_state = OFF; @@ -13442,13 +14055,7 @@ ReallyReset(XtermWidget xw, Bool full, Bool saved) CursorSet(screen, 0, 0, xw->flags); CursorSave(xw); } else { /* DECSTR */ - /* - * There's a tiny difference, to accommodate usage of xterm. - * We reset autowrap to the resource values rather than turning - * it off. - */ - UIntClr(xw->keyboard.flags, (MODE_DECCKM | MODE_KAM | MODE_DECKPAM)); - bitcpy(&xw->flags, xw->initflags, WRAPAROUND | REVERSEWRAP); + bitcpy(&xw->flags, xw->initflags, WRAPAROUND | REVERSEWRAP | REVERSEWRAP2); bitclr(&xw->flags, INSERT | INVERSE | BOLD | BLINK | UNDERLINE | INVISIBLE); ResetItalics(xw); if_OPT_ISO_COLORS(screen, { diff --git a/app/xterm/charsets.c b/app/xterm/charsets.c index 134330280..0ee4ef82e 100644 --- a/app/xterm/charsets.c +++ b/app/xterm/charsets.c @@ -1,7 +1,7 @@ -/* $XTermId: charsets.c,v 1.113 2020/12/25 15:15:37 tom Exp $ */ +/* $XTermId: charsets.c,v 1.126 2024/05/22 00:27:53 tom Exp $ */ /* - * Copyright 1998-2019,2020 by Thomas E. Dickey + * Copyright 1998-2023,2024 by Thomas E. Dickey * * All Rights Reserved * @@ -31,15 +31,14 @@ * */ +#include <assert.h> +#include <X11/keysym.h> + #include <xterm.h> #include <data.h> +#include <charsets.h> #include <fontutils.h> -#include <X11/keysym.h> - -#define BLANK ' ' -#define UNDEF 0x2e2e /* rendered as a backwards "?" (alt: 0x2426) */ - /* * This module performs translation as needed to support the DEC VT220 national * replacement character sets as well as supplementary character sets (aka @@ -58,1341 +57,82 @@ * character set to the national character set. * * The latter reference, though easier to read, has a few errors and omissions. - * - * According to - * Digital ANSI-Compliant Printing Protocol - * Level 2 Programming Reference Manual - * EK–PPLV2–PM. B01 - * - * the supplementary character sets Greek, Hebrew, Latin-5 and Latin/Cyrillic - * are standardized by ISO: - * ISO Greek is 8859-7 - * ISO Hebrew is 8859-8 - * ISO Latin-5 is 8859-9 - * ISO Latin/Cyrillic is 8859-5 - * - * These are derived from the data at - * ftp://www.unicode.org/Public/MAPPINGS/ISO8859/ - * - * Note: the "figure A-xx" comments refer to EK–PPLV2–PM. - */ - -/* - * A "codepage" is treated different from the NRC mode: it is always enabled. - * Reuse the UNI() macros by temporarily setting its state. - */ -#if OPT_WIDE_CHARS -#define begin_CODEPAGE() \ - if (!(xw->flags & NATIONAL)) { \ - screen->utf8_nrc_mode++; \ - } -#define end_CODEPAGE() \ - if (!(xw->flags & NATIONAL)) { \ - screen->utf8_nrc_mode--; \ - } -#else -#define begin_CODEPAGE() /* nothing */ -#define end_CODEPAGE() /* nothing */ -#endif - -/* - * xterm's original implementation of NRCS in 1998 was before Unicode became - * prevalent. Most of the necessary mappings could be done using definitions - * from X11/keysymdef.h */ -#define map_NRCS_Dutch(code) \ - switch (code) { \ - MAP(0x23, XK_sterling); \ - MAP(0x40, XK_threequarters); \ - UNI(0x5b, 0x0133); /* ij ligature */ \ - MAP(0x5c, XK_onehalf); \ - MAP(0x5d, XK_bar); \ - MAP(0x7b, XK_diaeresis); \ - UNI(0x7c, 0x0192); /* florin */ \ - MAP(0x7d, XK_onequarter); \ - MAP(0x7e, XK_acute); \ - } - -#define map_NRCS_Finnish(code) \ - switch (code) { \ - MAP(0x5b, XK_Adiaeresis); \ - MAP(0x5c, XK_Odiaeresis); \ - MAP(0x5d, XK_Aring); \ - MAP(0x5e, XK_Udiaeresis); \ - MAP(0x60, XK_eacute); \ - MAP(0x7b, XK_adiaeresis); \ - MAP(0x7c, XK_odiaeresis); \ - MAP(0x7d, XK_aring); \ - MAP(0x7e, XK_udiaeresis); \ - } - -#define map_NRCS_French(code) \ - switch (code) { \ - MAP(0x23, XK_sterling); \ - MAP(0x40, XK_agrave); \ - MAP(0x5b, XK_degree); \ - MAP(0x5c, XK_ccedilla); \ - MAP(0x5d, XK_section); \ - MAP(0x7b, XK_eacute); \ - MAP(0x7c, XK_ugrave); \ - MAP(0x7d, XK_egrave); \ - MAP(0x7e, XK_diaeresis); \ - } - -#define map_NRCS_French_Canadian(code) \ - switch (code) { \ - MAP(0x40, XK_agrave); \ - MAP(0x5b, XK_acircumflex); \ - MAP(0x5c, XK_ccedilla); \ - MAP(0x5d, XK_ecircumflex); \ - MAP(0x5e, XK_icircumflex); \ - MAP(0x60, XK_ocircumflex); \ - MAP(0x7b, XK_eacute); \ - MAP(0x7c, XK_ugrave); \ - MAP(0x7d, XK_egrave); \ - MAP(0x7e, XK_ucircumflex); \ - } - -#define map_NRCS_German(code) \ - switch (code) { \ - MAP(0x40, XK_section); \ - MAP(0x5b, XK_Adiaeresis); \ - MAP(0x5c, XK_Odiaeresis); \ - MAP(0x5d, XK_Udiaeresis); \ - MAP(0x7b, XK_adiaeresis); \ - MAP(0x7c, XK_odiaeresis); \ - MAP(0x7d, XK_udiaeresis); \ - MAP(0x7e, XK_ssharp); \ - } - -#define map_NRCS_Italian(code) \ - switch (code) { \ - MAP(0x23, XK_sterling); \ - MAP(0x40, XK_section); \ - MAP(0x5b, XK_degree); \ - MAP(0x5c, XK_ccedilla); \ - MAP(0x5d, XK_eacute); \ - MAP(0x60, XK_ugrave); \ - MAP(0x7b, XK_agrave); \ - MAP(0x7c, XK_ograve); \ - MAP(0x7d, XK_egrave); \ - MAP(0x7e, XK_igrave); \ - } - -#define map_NRCS_Norwegian_Danish(code) \ - switch (code) { \ - MAP(0x40, XK_Adiaeresis); \ - MAP(0x5b, XK_AE); \ - MAP(0x5c, XK_Ooblique); \ - MAP(0x5d, XK_Aring); \ - MAP(0x5e, XK_Udiaeresis); \ - MAP(0x60, XK_adiaeresis); \ - MAP(0x7b, XK_ae); \ - MAP(0x7c, XK_oslash); \ - MAP(0x7d, XK_aring); \ - MAP(0x7e, XK_udiaeresis); \ - } - -#define map_NRCS_Portuguese(code) \ - switch (code) { \ - MAP(0x5b, XK_Atilde); \ - MAP(0x5c, XK_Ccedilla); \ - MAP(0x5d, XK_Otilde); \ - MAP(0x7b, XK_atilde); \ - MAP(0x7c, XK_ccedilla); \ - MAP(0x7d, XK_otilde); \ - } - -#define map_NRCS_Spanish(code) \ - switch (code) { \ - MAP(0x23, XK_sterling); \ - MAP(0x40, XK_section); \ - MAP(0x5b, XK_exclamdown); \ - MAP(0x5c, XK_Ntilde); \ - MAP(0x5d, XK_questiondown); \ - MAP(0x7b, XK_degree); \ - MAP(0x7c, XK_ntilde); \ - MAP(0x7d, XK_ccedilla); \ - } - -#define map_NRCS_Swedish(code) \ - switch (code) { \ - MAP(0x40, XK_Eacute); \ - MAP(0x5b, XK_Adiaeresis); \ - MAP(0x5c, XK_Odiaeresis); \ - MAP(0x5d, XK_Aring); \ - MAP(0x5e, XK_Udiaeresis); \ - MAP(0x60, XK_eacute); \ - MAP(0x7b, XK_adiaeresis); \ - MAP(0x7c, XK_odiaeresis); \ - MAP(0x7d, XK_aring); \ - MAP(0x7e, XK_udiaeresis); \ - } - -#define map_NRCS_Swiss(code) \ - switch (code) { \ - MAP(0x23, XK_ugrave); \ - MAP(0x40, XK_agrave); \ - MAP(0x5b, XK_eacute); \ - MAP(0x5c, XK_ccedilla); \ - MAP(0x5d, XK_ecircumflex); \ - MAP(0x5e, XK_icircumflex); \ - MAP(0x5f, XK_egrave); \ - MAP(0x60, XK_ocircumflex); \ - MAP(0x7b, XK_adiaeresis); \ - MAP(0x7c, XK_odiaeresis); \ - MAP(0x7d, XK_udiaeresis); \ - MAP(0x7e, XK_ucircumflex); \ - } -/* - * Unlike NRCS, which splices a few characters onto ASCII, the supplementary - * character sets are complete, normally mapped to GR. Most of these mappings - * rely upon glyphs not found in ISO-8859-1. We can display most of those - * using Unicode, thereby supporting specialized applications that use SCS - * with luit, subject to the limitation that select/paste will give meaningless - * results in terms of the application which uses these mappings. - * - * Since the codepages introduced with VT320, etc, use 8-bit encodings, there - * is no plausible argument to be made that these mappings "use" UTF-8, even - * though there is a hidden step in the terminal emulator which relies upon - * UTF-8. - */ -#define map_DEC_Supp_Graphic(code,dft) \ - begin_CODEPAGE(); \ - switch (code) { \ - XXX(0x24, UNDEF); \ - XXX(0x26, UNDEF); \ - MAP(0x28, 0xa4); \ - XXX(0x2c, UNDEF); \ - XXX(0x2d, UNDEF); \ - XXX(0x2e, UNDEF); \ - XXX(0x2f, UNDEF); \ - XXX(0x34, UNDEF); \ - XXX(0x38, UNDEF); \ - XXX(0x3e, UNDEF); \ - XXX(0x50, UNDEF); \ - UNI(0x57, 0x0152); \ - MAP(0x5d, 0x0178); \ - XXX(0x5e, UNDEF); \ - XXX(0x70, UNDEF); \ - UNI(0x77, 0x0153); \ - MAP(0x7d, 0xff); \ - XXX(0x7e, UNDEF); \ - XXX(0x7f, UNDEF); \ - default: dft; break; \ +#define HandleUPSS(charset) \ + if (charset == nrc_DEC_UPSS) { \ + charset = screen->gsets_upss; \ + if (screen->vtXX_level >= 5) { \ + /* EMPTY */ ; \ + } else if (screen->vtXX_level >= 3) { \ + if (charset != nrc_DEC_Supp) \ + charset = nrc_ISO_Latin_1_Supp; \ + } else if (screen->vtXX_level < 2) { \ + charset = nrc_ASCII; \ } \ - end_CODEPAGE() + } -#if OPT_WIDE_CHARS - /* derived from http://www.vt100.net/charsets/technical.html */ -#define map_DEC_Technical(code) \ - begin_CODEPAGE(); \ - switch (code) { \ - UNI(0x21, 0x23b7); /* RADICAL SYMBOL BOTTOM Centred left to right, so that it joins up with 02/02 */ \ - UNI(0x22, 0x250c); /* BOX DRAWINGS LIGHT DOWN AND RIGHT */ \ - UNI(0x23, 0x2500); /* BOX DRAWINGS LIGHT HORIZONTAL */ \ - UNI(0x24, 0x2320); /* TOP HALF INTEGRAL with the proviso that the stem is vertical, to join with 02/06 */ \ - UNI(0x25, 0x2321); /* BOTTOM HALF INTEGRAL with the proviso above. */ \ - UNI(0x26, 0x2502); /* BOX DRAWINGS LIGHT VERTICAL */ \ - UNI(0x27, 0x23a1); /* LEFT SQUARE BRACKET UPPER CORNER Joins vertically to 02/06, 02/08. Doesn't join to its right. */ \ - UNI(0x28, 0x23a3); /* LEFT SQUARE BRACKET LOWER CORNER Joins vertically to 02/06, 02/07. Doesn't join to its right. */ \ - UNI(0x29, 0x23a4); /* RIGHT SQUARE BRACKET UPPER CORNER Joins vertically to 026, 02a. Doesn't join to its left. */ \ - UNI(0x2a, 0x23a6); /* RIGHT SQUARE BRACKET LOWER CORNER Joins vertically to 026, 029. Doesn't join to its left. */ \ - UNI(0x2b, 0x23a7); /* LEFT CURLY BRACKET UPPER HOOK Joins vertically to 026, 02c, 02/15. Doesn't join to its right. */ \ - UNI(0x2c, 0x23a9); /* LEFT CURLY BRACKET LOWER HOOK Joins vertically to 026, 02b, 02/15. Doesn't join to its right. */ \ - UNI(0x2d, 0x23ab); /* RIGHT CURLY BRACKET UPPER HOOK Joins vertically to 026, 02e, 03/00. Doesn't join to its left. */ \ - UNI(0x2e, 0x23ad); /* RIGHT CURLY BRACKET LOWER HOOK Joins vertically to 026, 02d, 03/00. Doesn't join to its left. */ \ - UNI(0x2f, 0x23a8); /* LEFT CURLY BRACKET MIDDLE PIECE Joins vertically to 026, 02b, 02c. */ \ - UNI(0x30, 0x23ac); /* RIGHT CURLY BRACKET MIDDLE PIECE Joins vertically to 02/06, 02d, 02e. */ \ - XXX(0x31, UNDEF); /* Top Left Sigma. Joins to right with 02/03, 03/05. Joins diagonally below right with 03/03, 03/07. */ \ - XXX(0x32, UNDEF); /* Bottom Left Sigma. Joins to right with 02/03, 03/06. Joins diagonally above right with 03/04, 03/07. */ \ - XXX(0x33, UNDEF); /* Top Diagonal Sigma. Line for joining 03/01 to 03/04 or 03/07. */ \ - XXX(0x34, UNDEF); /* Bottom Diagonal Sigma. Line for joining 03/02 to 03/03 or 03/07. */ \ - XXX(0x35, UNDEF); /* Top Right Sigma. Joins to left with 02/03, 03/01. */ \ - XXX(0x36, UNDEF); /* Bottom Right Sigma. Joins to left with 02/03, 03/02. */ \ - XXX(0x37, UNDEF); /* Middle Sigma. Joins diagonally with 03/01, 03/02, 03/03, 03/04. */ \ - XXX(0x38, UNDEF); /* undefined */ \ - XXX(0x39, UNDEF); /* undefined */ \ - XXX(0x3a, UNDEF); /* undefined */ \ - XXX(0x3b, UNDEF); /* undefined */ \ - UNI(0x3c, 0x2264); /* LESS-THAN OR EQUAL TO */ \ - UNI(0x3d, 0x2260); /* NOT EQUAL TO */ \ - UNI(0x3e, 0x2265); /* GREATER-THAN OR EQUAL TO */ \ - UNI(0x3f, 0x222B); /* INTEGRAL */ \ - UNI(0x40, 0x2234); /* THEREFORE */ \ - UNI(0x41, 0x221d); /* PROPORTIONAL TO */ \ - UNI(0x42, 0x221e); /* INFINITY */ \ - UNI(0x43, 0x00f7); /* DIVISION SIGN */ \ - UNI(0x44, 0x0394); /* GREEK CAPITAL DELTA */ \ - UNI(0x45, 0x2207); /* NABLA */ \ - UNI(0x46, 0x03a6); /* GREEK CAPITAL LETTER PHI */ \ - UNI(0x47, 0x0393); /* GREEK CAPITAL LETTER GAMMA */ \ - UNI(0x48, 0x223c); /* TILDE OPERATOR */ \ - UNI(0x49, 0x2243); /* ASYMPTOTICALLY EQUAL TO */ \ - UNI(0x4a, 0x0398); /* GREEK CAPITAL LETTER THETA */ \ - UNI(0x4b, 0x00d7); /* MULTIPLICATION SIGN */ \ - UNI(0x4c, 0x039b); /* GREEK CAPITAL LETTER LAMDA */ \ - UNI(0x4d, 0x21d4); /* LEFT RIGHT DOUBLE ARROW */ \ - UNI(0x4e, 0x21d2); /* RIGHTWARDS DOUBLE ARROW */ \ - UNI(0x4f, 0x2261); /* IDENTICAL TO */ \ - UNI(0x50, 0x03a0); /* GREEK CAPITAL LETTER PI */ \ - UNI(0x51, 0x03a8); /* GREEK CAPITAL LETTER PSI */ \ - UNI(0x52, UNDEF); /* undefined */ \ - UNI(0x53, 0x03a3); /* GREEK CAPITAL LETTER SIGMA */ \ - XXX(0x54, UNDEF); /* undefined */ \ - XXX(0x55, UNDEF); /* undefined */ \ - UNI(0x56, 0x221a); /* SQUARE ROOT */ \ - UNI(0x57, 0x03a9); /* GREEK CAPITAL LETTER OMEGA */ \ - UNI(0x58, 0x039e); /* GREEK CAPITAL LETTER XI */ \ - UNI(0x59, 0x03a5); /* GREEK CAPITAL LETTER UPSILON */ \ - UNI(0x5a, 0x2282); /* SUBSET OF */ \ - UNI(0x5b, 0x2283); /* SUPERSET OF */ \ - UNI(0x5c, 0x2229); /* INTERSECTION */ \ - UNI(0x5d, 0x222a); /* UNION */ \ - UNI(0x5e, 0x2227); /* LOGICAL AND */ \ - UNI(0x5f, 0x2228); /* LOGICAL OR */ \ - UNI(0x60, 0x00ac); /* NOT SIGN */ \ - UNI(0x61, 0x03b1); /* GREEK SMALL LETTER ALPHA */ \ - UNI(0x62, 0x03b2); /* GREEK SMALL LETTER BETA */ \ - UNI(0x63, 0x03c7); /* GREEK SMALL LETTER CHI */ \ - UNI(0x64, 0x03b4); /* GREEK SMALL LETTER DELTA */ \ - UNI(0x65, 0x03b5); /* GREEK SMALL LETTER EPSILON */ \ - UNI(0x66, 0x03c6); /* GREEK SMALL LETTER PHI */ \ - UNI(0x67, 0x03b3); /* GREEK SMALL LETTER GAMMA */ \ - UNI(0x68, 0x03b7); /* GREEK SMALL LETTER ETA */ \ - UNI(0x69, 0x03b9); /* GREEK SMALL LETTER IOTA */ \ - UNI(0x6a, 0x03b8); /* GREEK SMALL LETTER THETA */ \ - UNI(0x6b, 0x03ba); /* GREEK SMALL LETTER KAPPA */ \ - UNI(0x6c, 0x03bb); /* GREEK SMALL LETTER LAMDA */ \ - XXX(0x6d, UNDEF); /* undefined */ \ - UNI(0x6e, 0x03bd); /* GREEK SMALL LETTER NU */ \ - UNI(0x6f, 0x2202); /* PARTIAL DIFFERENTIAL */ \ - UNI(0x70, 0x03c0); /* GREEK SMALL LETTER PI */ \ - UNI(0x71, 0x03c8); /* GREEK SMALL LETTER PSI */ \ - UNI(0x72, 0x03c1); /* GREEK SMALL LETTER RHO */ \ - UNI(0x73, 0x03c3); /* GREEK SMALL LETTER SIGMA */ \ - UNI(0x74, 0x03c4); /* GREEK SMALL LETTER TAU */ \ - XXX(0x75, UNDEF); /* undefined */ \ - UNI(0x76, 0x0192); /* LATIN SMALL LETTER F WITH HOOK Probably chosen for its meaning of "function" */ \ - UNI(0x77, 0x03c9); /* GREEK SMALL LETTER OMEGA */ \ - UNI(0x78, 0x03bE); /* GREEK SMALL LETTER XI */ \ - UNI(0x79, 0x03c5); /* GREEK SMALL LETTER UPSILON */ \ - UNI(0x7a, 0x03b6); /* GREEK SMALL LETTER ZETA */ \ - UNI(0x7b, 0x2190); /* LEFTWARDS ARROW */ \ - UNI(0x7c, 0x2191); /* UPWARDS ARROW */ \ - UNI(0x7d, 0x2192); /* RIGHTWARDS ARROW */ \ - UNI(0x7e, 0x2193); /* DOWNWARDS ARROW */ \ - } \ - end_CODEPAGE() - /* ISO Latin/Cyrillic is 8859-5 */ -#define map_ISO_Latin_Cyrillic(code) \ - begin_CODEPAGE(); \ - switch (code) { \ - UNI(0x20, 0x00a0); /* NO-BREAK SPACE */ \ - UNI(0x21, 0x0401); /* CYRILLIC CAPITAL LETTER IO */ \ - UNI(0x22, 0x0402); /* CYRILLIC CAPITAL LETTER DJE */ \ - UNI(0x23, 0x0403); /* CYRILLIC CAPITAL LETTER GJE */ \ - UNI(0x24, 0x0404); /* CYRILLIC CAPITAL LETTER UKRAINIAN IE */ \ - UNI(0x25, 0x0405); /* CYRILLIC CAPITAL LETTER DZE */ \ - UNI(0x26, 0x0406); /* CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I */ \ - UNI(0x27, 0x0407); /* CYRILLIC CAPITAL LETTER YI */ \ - UNI(0x28, 0x0408); /* CYRILLIC CAPITAL LETTER JE */ \ - UNI(0x29, 0x0409); /* CYRILLIC CAPITAL LETTER LJE */ \ - UNI(0x2a, 0x040a); /* CYRILLIC CAPITAL LETTER NJE */ \ - UNI(0x2b, 0x040b); /* CYRILLIC CAPITAL LETTER TSHE */ \ - UNI(0x2c, 0x040c); /* CYRILLIC CAPITAL LETTER KJE */ \ - UNI(0x2d, 0x00ad); /* SOFT HYPHEN */ \ - UNI(0x2e, 0x040e); /* CYRILLIC CAPITAL LETTER SHORT U */ \ - UNI(0x2f, 0x040f); /* CYRILLIC CAPITAL LETTER DZHE */ \ - UNI(0x30, 0x0410); /* CYRILLIC CAPITAL LETTER A */ \ - UNI(0x31, 0x0411); /* CYRILLIC CAPITAL LETTER BE */ \ - UNI(0x32, 0x0412); /* CYRILLIC CAPITAL LETTER VE */ \ - UNI(0x33, 0x0413); /* CYRILLIC CAPITAL LETTER GHE */ \ - UNI(0x34, 0x0414); /* CYRILLIC CAPITAL LETTER DE */ \ - UNI(0x35, 0x0415); /* CYRILLIC CAPITAL LETTER IE */ \ - UNI(0x36, 0x0416); /* CYRILLIC CAPITAL LETTER ZHE */ \ - UNI(0x37, 0x0417); /* CYRILLIC CAPITAL LETTER ZE */ \ - UNI(0x38, 0x0418); /* CYRILLIC CAPITAL LETTER I */ \ - UNI(0x39, 0x0419); /* CYRILLIC CAPITAL LETTER SHORT I */ \ - UNI(0x3a, 0x041a); /* CYRILLIC CAPITAL LETTER KA */ \ - UNI(0x3b, 0x041b); /* CYRILLIC CAPITAL LETTER EL */ \ - UNI(0x3c, 0x041c); /* CYRILLIC CAPITAL LETTER EM */ \ - UNI(0x3d, 0x041d); /* CYRILLIC CAPITAL LETTER EN */ \ - UNI(0x3e, 0x041e); /* CYRILLIC CAPITAL LETTER O */ \ - UNI(0x3f, 0x041f); /* CYRILLIC CAPITAL LETTER PE */ \ - UNI(0x40, 0x0420); /* CYRILLIC CAPITAL LETTER ER */ \ - UNI(0x41, 0x0421); /* CYRILLIC CAPITAL LETTER ES */ \ - UNI(0x42, 0x0422); /* CYRILLIC CAPITAL LETTER TE */ \ - UNI(0x43, 0x0423); /* CYRILLIC CAPITAL LETTER U */ \ - UNI(0x44, 0x0424); /* CYRILLIC CAPITAL LETTER EF */ \ - UNI(0x45, 0x0425); /* CYRILLIC CAPITAL LETTER HA */ \ - UNI(0x46, 0x0426); /* CYRILLIC CAPITAL LETTER TSE */ \ - UNI(0x47, 0x0427); /* CYRILLIC CAPITAL LETTER CHE */ \ - UNI(0x48, 0x0428); /* CYRILLIC CAPITAL LETTER SHA */ \ - UNI(0x49, 0x0429); /* CYRILLIC CAPITAL LETTER SHCHA */ \ - UNI(0x4a, 0x042a); /* CYRILLIC CAPITAL LETTER HARD SIGN */ \ - UNI(0x4b, 0x042b); /* CYRILLIC CAPITAL LETTER YERU */ \ - UNI(0x4c, 0x042c); /* CYRILLIC CAPITAL LETTER SOFT SIGN */ \ - UNI(0x4d, 0x042d); /* CYRILLIC CAPITAL LETTER E */ \ - UNI(0x4e, 0x042e); /* CYRILLIC CAPITAL LETTER YU */ \ - UNI(0x4f, 0x042f); /* CYRILLIC CAPITAL LETTER YA */ \ - UNI(0x50, 0x0430); /* CYRILLIC SMALL LETTER A */ \ - UNI(0x51, 0x0431); /* CYRILLIC SMALL LETTER BE */ \ - UNI(0x52, 0x0432); /* CYRILLIC SMALL LETTER VE */ \ - UNI(0x53, 0x0433); /* CYRILLIC SMALL LETTER GHE */ \ - UNI(0x54, 0x0434); /* CYRILLIC SMALL LETTER DE */ \ - UNI(0x55, 0x0435); /* CYRILLIC SMALL LETTER IE */ \ - UNI(0x56, 0x0436); /* CYRILLIC SMALL LETTER ZHE */ \ - UNI(0x57, 0x0437); /* CYRILLIC SMALL LETTER ZE */ \ - UNI(0x58, 0x0438); /* CYRILLIC SMALL LETTER I */ \ - UNI(0x59, 0x0439); /* CYRILLIC SMALL LETTER SHORT I */ \ - UNI(0x5a, 0x043a); /* CYRILLIC SMALL LETTER KA */ \ - UNI(0x5b, 0x043b); /* CYRILLIC SMALL LETTER EL */ \ - UNI(0x5c, 0x043c); /* CYRILLIC SMALL LETTER EM */ \ - UNI(0x5d, 0x043d); /* CYRILLIC SMALL LETTER EN */ \ - UNI(0x5e, 0x043e); /* CYRILLIC SMALL LETTER O */ \ - UNI(0x5f, 0x043f); /* CYRILLIC SMALL LETTER PE */ \ - UNI(0x60, 0x0440); /* CYRILLIC SMALL LETTER ER */ \ - UNI(0x61, 0x0441); /* CYRILLIC SMALL LETTER ES */ \ - UNI(0x62, 0x0442); /* CYRILLIC SMALL LETTER TE */ \ - UNI(0x63, 0x0443); /* CYRILLIC SMALL LETTER U */ \ - UNI(0x64, 0x0444); /* CYRILLIC SMALL LETTER EF */ \ - UNI(0x65, 0x0445); /* CYRILLIC SMALL LETTER HA */ \ - UNI(0x66, 0x0446); /* CYRILLIC SMALL LETTER TSE */ \ - UNI(0x67, 0x0447); /* CYRILLIC SMALL LETTER CHE */ \ - UNI(0x68, 0x0448); /* CYRILLIC SMALL LETTER SHA */ \ - UNI(0x69, 0x0449); /* CYRILLIC SMALL LETTER SHCHA */ \ - UNI(0x6a, 0x044a); /* CYRILLIC SMALL LETTER HARD SIGN */ \ - UNI(0x6b, 0x044b); /* CYRILLIC SMALL LETTER YERU */ \ - UNI(0x6c, 0x044c); /* CYRILLIC SMALL LETTER SOFT SIGN */ \ - UNI(0x6d, 0x044d); /* CYRILLIC SMALL LETTER E */ \ - UNI(0x6e, 0x044e); /* CYRILLIC SMALL LETTER YU */ \ - UNI(0x6f, 0x044f); /* CYRILLIC SMALL LETTER YA */ \ - UNI(0x70, 0x2116); /* NUMERO SIGN */ \ - UNI(0x71, 0x0451); /* CYRILLIC SMALL LETTER IO */ \ - UNI(0x72, 0x0452); /* CYRILLIC SMALL LETTER DJE */ \ - UNI(0x73, 0x0453); /* CYRILLIC SMALL LETTER GJE */ \ - UNI(0x74, 0x0454); /* CYRILLIC SMALL LETTER UKRAINIAN IE */ \ - UNI(0x75, 0x0455); /* CYRILLIC SMALL LETTER DZE */ \ - UNI(0x76, 0x0456); /* CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I */ \ - UNI(0x77, 0x0457); /* CYRILLIC SMALL LETTER YI */ \ - UNI(0x78, 0x0458); /* CYRILLIC SMALL LETTER JE */ \ - UNI(0x79, 0x0459); /* CYRILLIC SMALL LETTER LJE */ \ - UNI(0x7a, 0x045a); /* CYRILLIC SMALL LETTER NJE */ \ - UNI(0x7b, 0x045b); /* CYRILLIC SMALL LETTER TSHE */ \ - UNI(0x7c, 0x045c); /* CYRILLIC SMALL LETTER KJE */ \ - UNI(0x7d, 0x00a7); /* SECTION SIGN */ \ - UNI(0x7e, 0x045e); /* CYRILLIC SMALL LETTER SHORT U */ \ - UNI(0x7f, 0x045f); /* CYRILLIC SMALL LETTER DZHE */ \ - } \ - end_CODEPAGE() - /* ISO Greek is 8859-7 */ -#define map_ISO_Greek_Supp(code) \ - begin_CODEPAGE(); \ - switch (code) { \ - UNI(0x20, 0x00a0); /* NO-BREAK SPACE */ \ - UNI(0x21, 0x2018); /* LEFT SINGLE QUOTATION MARK */ \ - UNI(0x22, 0x2019); /* RIGHT SINGLE QUOTATION MARK */ \ - UNI(0x23, 0x00a3); /* POUND SIGN */ \ - UNI(0x24, 0x20ac); /* EURO SIGN */ \ - UNI(0x25, 0x20af); /* DRACHMA SIGN */ \ - UNI(0x26, 0x00a6); /* BROKEN BAR */ \ - UNI(0x27, 0x00a7); /* SECTION SIGN */ \ - UNI(0x28, 0x00a8); /* DIAERESIS */ \ - UNI(0x29, 0x00a9); /* COPYRIGHT SIGN */ \ - UNI(0x2a, 0x037a); /* GREEK YPOGEGRAMMENI */ \ - UNI(0x2b, 0x00ab); /* LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ - UNI(0x2c, 0x00ac); /* NOT SIGN */ \ - UNI(0x2d, 0x00ad); /* SOFT HYPHEN */ \ - XXX(0x2e, UNDEF); /* undefined */ \ - UNI(0x2f, 0x2015); /* HORIZONTAL BAR */ \ - UNI(0x30, 0x00b0); /* DEGREE SIGN */ \ - UNI(0x31, 0x00b1); /* PLUS-MINUS SIGN */ \ - UNI(0x32, 0x00b2); /* SUPERSCRIPT TWO */ \ - UNI(0x33, 0x00b3); /* SUPERSCRIPT THREE */ \ - UNI(0x34, 0x0384); /* GREEK TONOS */ \ - UNI(0x35, 0x0385); /* GREEK DIALYTIKA TONOS */ \ - UNI(0x36, 0x0386); /* GREEK CAPITAL LETTER ALPHA WITH TONOS */ \ - UNI(0x37, 0x00b7); /* MIDDLE DOT */ \ - UNI(0x38, 0x0388); /* GREEK CAPITAL LETTER EPSILON WITH TONOS */ \ - UNI(0x39, 0x0389); /* GREEK CAPITAL LETTER ETA WITH TONOS */ \ - UNI(0x3a, 0x038a); /* GREEK CAPITAL LETTER IOTA WITH TONOS */ \ - UNI(0x3b, 0x00bb); /* RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ - UNI(0x3c, 0x038c); /* GREEK CAPITAL LETTER OMICRON WITH TONOS */ \ - UNI(0x3d, 0x00bd); /* VULGAR FRACTION ONE HALF */ \ - UNI(0x3e, 0x038e); /* GREEK CAPITAL LETTER UPSILON WITH TONOS */ \ - UNI(0x3f, 0x038f); /* GREEK CAPITAL LETTER OMEGA WITH TONOS */ \ - UNI(0x40, 0x0390); /* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS */ \ - UNI(0x41, 0x0391); /* GREEK CAPITAL LETTER ALPHA */ \ - UNI(0x42, 0x0392); /* GREEK CAPITAL LETTER BETA */ \ - UNI(0x43, 0x0393); /* GREEK CAPITAL LETTER GAMMA */ \ - UNI(0x44, 0x0394); /* GREEK CAPITAL LETTER DELTA */ \ - UNI(0x45, 0x0395); /* GREEK CAPITAL LETTER EPSILON */ \ - UNI(0x46, 0x0396); /* GREEK CAPITAL LETTER ZETA */ \ - UNI(0x47, 0x0397); /* GREEK CAPITAL LETTER ETA */ \ - UNI(0x48, 0x0398); /* GREEK CAPITAL LETTER THETA */ \ - UNI(0x49, 0x0399); /* GREEK CAPITAL LETTER IOTA */ \ - UNI(0x4a, 0x039a); /* GREEK CAPITAL LETTER KAPPA */ \ - UNI(0x4b, 0x039b); /* GREEK CAPITAL LETTER LAMDA */ \ - UNI(0x4c, 0x039c); /* GREEK CAPITAL LETTER MU */ \ - UNI(0x4d, 0x039d); /* GREEK CAPITAL LETTER NU */ \ - UNI(0x4e, 0x039e); /* GREEK CAPITAL LETTER XI */ \ - UNI(0x4f, 0x039f); /* GREEK CAPITAL LETTER OMICRON */ \ - UNI(0x50, 0x03a0); /* GREEK CAPITAL LETTER PI */ \ - UNI(0x51, 0x03a1); /* GREEK CAPITAL LETTER RHO */ \ - XXX(0x52, UNDEF); /* undefined */ \ - UNI(0x53, 0x03a3); /* GREEK CAPITAL LETTER SIGMA */ \ - UNI(0x54, 0x03a4); /* GREEK CAPITAL LETTER TAU */ \ - UNI(0x55, 0x03a5); /* GREEK CAPITAL LETTER UPSILON */ \ - UNI(0x56, 0x03a6); /* GREEK CAPITAL LETTER PHI */ \ - UNI(0x57, 0x03a7); /* GREEK CAPITAL LETTER CHI */ \ - UNI(0x58, 0x03a8); /* GREEK CAPITAL LETTER PSI */ \ - UNI(0x59, 0x03a9); /* GREEK CAPITAL LETTER OMEGA */ \ - UNI(0x5a, 0x03aa); /* GREEK CAPITAL LETTER IOTA WITH DIALYTIKA */ \ - UNI(0x5b, 0x03ab); /* GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA */ \ - UNI(0x5c, 0x03ac); /* GREEK SMALL LETTER ALPHA WITH TONOS */ \ - UNI(0x5d, 0x03ad); /* GREEK SMALL LETTER EPSILON WITH TONOS */ \ - UNI(0x5e, 0x03ae); /* GREEK SMALL LETTER ETA WITH TONOS */ \ - UNI(0x5f, 0x03af); /* GREEK SMALL LETTER IOTA WITH TONOS */ \ - UNI(0x60, 0x03b0); /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS */ \ - UNI(0x61, 0x03b1); /* GREEK SMALL LETTER ALPHA */ \ - UNI(0x62, 0x03b2); /* GREEK SMALL LETTER BETA */ \ - UNI(0x63, 0x03b3); /* GREEK SMALL LETTER GAMMA */ \ - UNI(0x64, 0x03b4); /* GREEK SMALL LETTER DELTA */ \ - UNI(0x65, 0x03b5); /* GREEK SMALL LETTER EPSILON */ \ - UNI(0x66, 0x03b6); /* GREEK SMALL LETTER ZETA */ \ - UNI(0x67, 0x03b7); /* GREEK SMALL LETTER ETA */ \ - UNI(0x68, 0x03b8); /* GREEK SMALL LETTER THETA */ \ - UNI(0x69, 0x03b9); /* GREEK SMALL LETTER IOTA */ \ - UNI(0x6a, 0x03ba); /* GREEK SMALL LETTER KAPPA */ \ - UNI(0x6b, 0x03bb); /* GREEK SMALL LETTER LAMDA */ \ - UNI(0x6c, 0x03bc); /* GREEK SMALL LETTER MU */ \ - UNI(0x6d, 0x03bd); /* GREEK SMALL LETTER NU */ \ - UNI(0x6e, 0x03be); /* GREEK SMALL LETTER XI */ \ - UNI(0x6f, 0x03bf); /* GREEK SMALL LETTER OMICRON */ \ - UNI(0x70, 0x03c0); /* GREEK SMALL LETTER PI */ \ - UNI(0x71, 0x03c1); /* GREEK SMALL LETTER RHO */ \ - UNI(0x72, 0x03c2); /* GREEK SMALL LETTER FINAL SIGMA */ \ - UNI(0x73, 0x03c3); /* GREEK SMALL LETTER SIGMA */ \ - UNI(0x74, 0x03c4); /* GREEK SMALL LETTER TAU */ \ - UNI(0x75, 0x03c5); /* GREEK SMALL LETTER UPSILON */ \ - UNI(0x76, 0x03c6); /* GREEK SMALL LETTER PHI */ \ - UNI(0x77, 0x03c7); /* GREEK SMALL LETTER CHI */ \ - UNI(0x78, 0x03c8); /* GREEK SMALL LETTER PSI */ \ - UNI(0x79, 0x03c9); /* GREEK SMALL LETTER OMEGA */ \ - UNI(0x7a, 0x03ca); /* GREEK SMALL LETTER IOTA WITH DIALYTIKA */ \ - UNI(0x7b, 0x03cb); /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA */ \ - UNI(0x7c, 0x03cc); /* GREEK SMALL LETTER OMICRON WITH TONOS */ \ - UNI(0x7d, 0x03cd); /* GREEK SMALL LETTER UPSILON WITH TONOS */ \ - UNI(0x7e, 0x03ce); /* GREEK SMALL LETTER OMEGA WITH TONOS */ \ - } \ - end_CODEPAGE() - /* figure A-23 "ISO Latin-Hebrew Supplemental Character Set" */ -#define map_ISO_Hebrew(code) \ - begin_CODEPAGE(); \ - switch (code) { \ - UNI(0x20, 0x00a0); /* NO-BREAK SPACE */ \ - XXX(0x21, UNDEF); /* undefined */ \ - UNI(0x22, 0x00a2); /* CENT SIGN */ \ - UNI(0x23, 0x00a3); /* POUND SIGN */ \ - UNI(0x24, 0x00a4); /* CURRENCY SIGN */ \ - UNI(0x25, 0x00a5); /* YEN SIGN */ \ - UNI(0x26, 0x00a6); /* BROKEN BAR */ \ - UNI(0x27, 0x00a7); /* SECTION SIGN */ \ - UNI(0x28, 0x00a8); /* DIAERESIS */ \ - UNI(0x29, 0x00a9); /* COPYRIGHT SIGN */ \ - UNI(0x2a, 0x00d7); /* MULTIPLICATION SIGN */ \ - UNI(0x2b, 0x00ab); /* LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ - UNI(0x2c, 0x00ac); /* NOT SIGN */ \ - UNI(0x2d, 0x00ad); /* SOFT HYPHEN */ \ - UNI(0x2e, 0x00ae); /* REGISTERED SIGN */ \ - UNI(0x2f, 0x00af); /* MACRON */ \ - UNI(0x30, 0x00b0); /* DEGREE SIGN */ \ - UNI(0x31, 0x00b1); /* PLUS-MINUS SIGN */ \ - UNI(0x32, 0x00b2); /* SUPERSCRIPT TWO */ \ - UNI(0x33, 0x00b3); /* SUPERSCRIPT THREE */ \ - UNI(0x34, 0x00b4); /* ACUTE ACCENT */ \ - UNI(0x35, 0x00b5); /* MICRO SIGN */ \ - UNI(0x36, 0x00b6); /* PILCROW SIGN */ \ - UNI(0x37, 0x00b7); /* MIDDLE DOT */ \ - UNI(0x38, 0x00b8); /* CEDILLA */ \ - UNI(0x39, 0x00b9); /* SUPERSCRIPT ONE */ \ - UNI(0x3a, 0x00f7); /* DIVISION SIGN */ \ - UNI(0x3b, 0x00bb); /* RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ - UNI(0x3c, 0x00bc); /* VULGAR FRACTION ONE QUARTER */ \ - UNI(0x3d, 0x00bd); /* VULGAR FRACTION ONE HALF */ \ - UNI(0x3e, 0x00be); /* VULGAR FRACTION THREE QUARTERS */ \ - XXX(0x3f, UNDEF); /* undefined */ \ - XXX(0x40, UNDEF); /* undefined */ \ - XXX(0x41, UNDEF); /* undefined */ \ - XXX(0x42, UNDEF); /* undefined */ \ - XXX(0x43, UNDEF); /* undefined */ \ - XXX(0x44, UNDEF); /* undefined */ \ - XXX(0x45, UNDEF); /* undefined */ \ - XXX(0x46, UNDEF); /* undefined */ \ - XXX(0x47, UNDEF); /* undefined */ \ - XXX(0x48, UNDEF); /* undefined */ \ - XXX(0x49, UNDEF); /* undefined */ \ - XXX(0x4a, UNDEF); /* undefined */ \ - XXX(0x4b, UNDEF); /* undefined */ \ - XXX(0x4c, UNDEF); /* undefined */ \ - XXX(0x4d, UNDEF); /* undefined */ \ - XXX(0x4e, UNDEF); /* undefined */ \ - XXX(0x4f, UNDEF); /* undefined */ \ - XXX(0x50, UNDEF); /* undefined */ \ - XXX(0x51, UNDEF); /* undefined */ \ - XXX(0x52, UNDEF); /* undefined */ \ - XXX(0x53, UNDEF); /* undefined */ \ - XXX(0x54, UNDEF); /* undefined */ \ - XXX(0x55, UNDEF); /* undefined */ \ - XXX(0x56, UNDEF); /* undefined */ \ - XXX(0x57, UNDEF); /* undefined */ \ - XXX(0x58, UNDEF); /* undefined */ \ - XXX(0x59, UNDEF); /* undefined */ \ - XXX(0x5a, UNDEF); /* undefined */ \ - XXX(0x5b, UNDEF); /* undefined */ \ - XXX(0x5c, UNDEF); /* undefined */ \ - XXX(0x5d, UNDEF); /* undefined */ \ - XXX(0x5e, UNDEF); /* undefined */ \ - UNI(0x5f, 0x2017); /* DOUBLE LOW LINE */ \ - UNI(0x60, 0x05d0); /* HEBREW LETTER ALEF */ \ - UNI(0x61, 0x05d1); /* HEBREW LETTER BET */ \ - UNI(0x62, 0x05d2); /* HEBREW LETTER GIMEL */ \ - UNI(0x63, 0x05d3); /* HEBREW LETTER DALET */ \ - UNI(0x64, 0x05d4); /* HEBREW LETTER HE */ \ - UNI(0x65, 0x05d5); /* HEBREW LETTER VAV */ \ - UNI(0x66, 0x05d6); /* HEBREW LETTER ZAYIN */ \ - UNI(0x67, 0x05d7); /* HEBREW LETTER HET */ \ - UNI(0x68, 0x05d8); /* HEBREW LETTER TET */ \ - UNI(0x69, 0x05d9); /* HEBREW LETTER YOD */ \ - UNI(0x6a, 0x05da); /* HEBREW LETTER FINAL KAF */ \ - UNI(0x6b, 0x05db); /* HEBREW LETTER KAF */ \ - UNI(0x6c, 0x05dc); /* HEBREW LETTER LAMED */ \ - UNI(0x6d, 0x05dd); /* HEBREW LETTER FINAL MEM */ \ - UNI(0x6e, 0x05de); /* HEBREW LETTER MEM */ \ - UNI(0x6f, 0x05df); /* HEBREW LETTER FINAL NUN */ \ - UNI(0x70, 0x05e0); /* HEBREW LETTER NUN */ \ - UNI(0x71, 0x05e1); /* HEBREW LETTER SAMEKH */ \ - UNI(0x72, 0x05e2); /* HEBREW LETTER AYIN */ \ - UNI(0x73, 0x05e3); /* HEBREW LETTER FINAL PE */ \ - UNI(0x74, 0x05e4); /* HEBREW LETTER PE */ \ - UNI(0x75, 0x05e5); /* HEBREW LETTER FINAL TSADI */ \ - UNI(0x76, 0x05e6); /* HEBREW LETTER TSADI */ \ - UNI(0x77, 0x05e7); /* HEBREW LETTER QOF */ \ - UNI(0x78, 0x05e8); /* HEBREW LETTER RESH */ \ - UNI(0x79, 0x05e9); /* HEBREW LETTER SHIN */ \ - UNI(0x7a, 0x05ea); /* HEBREW LETTER TAV */ \ - XXX(0x7b, UNDEF); /* undefined */ \ - XXX(0x7c, UNDEF); /* undefined */ \ - UNI(0x7d, 0x200e); /* LEFT-TO-RIGHT MARK */ \ - UNI(0x7e, 0x200f); /* RIGHT-TO-LEFT MARK */ \ - } \ - end_CODEPAGE() - /* ISO Latin-2 is 8859-2 */ -#define map_ISO_Latin_2(code) \ - begin_CODEPAGE(); \ - switch (code) { \ - UNI(0x20, 0x00a0); /* NO-BREAK SPACE */ \ - UNI(0x21, 0x0104); /* LATIN CAPITAL LETTER A WITH OGONEK */ \ - UNI(0x22, 0x02d8); /* BREVE */ \ - UNI(0x23, 0x0141); /* LATIN CAPITAL LETTER L WITH STROKE */ \ - UNI(0x24, 0x00a4); /* CURRENCY SIGN */ \ - UNI(0x25, 0x013d); /* LATIN CAPITAL LETTER L WITH CARON */ \ - UNI(0x26, 0x015a); /* LATIN CAPITAL LETTER S WITH ACUTE */ \ - UNI(0x27, 0x00a7); /* SECTION SIGN */ \ - UNI(0x28, 0x00a8); /* DIAERESIS */ \ - UNI(0x29, 0x0160); /* LATIN CAPITAL LETTER S WITH CARON */ \ - UNI(0x2a, 0x015e); /* LATIN CAPITAL LETTER S WITH CEDILLA */ \ - UNI(0x2b, 0x0164); /* LATIN CAPITAL LETTER T WITH CARON */ \ - UNI(0x2c, 0x0179); /* LATIN CAPITAL LETTER Z WITH ACUTE */ \ - UNI(0x2d, 0x00ad); /* SOFT HYPHEN */ \ - UNI(0x2e, 0x017d); /* LATIN CAPITAL LETTER Z WITH CARON */ \ - UNI(0x2f, 0x017b); /* LATIN CAPITAL LETTER Z WITH DOT ABOVE */ \ - UNI(0x30, 0x00b0); /* DEGREE SIGN */ \ - UNI(0x31, 0x0105); /* LATIN SMALL LETTER A WITH OGONEK */ \ - UNI(0x32, 0x02db); /* OGONEK */ \ - UNI(0x33, 0x0142); /* LATIN SMALL LETTER L WITH STROKE */ \ - UNI(0x34, 0x00b4); /* ACUTE ACCENT */ \ - UNI(0x35, 0x013e); /* LATIN SMALL LETTER L WITH CARON */ \ - UNI(0x36, 0x015b); /* LATIN SMALL LETTER S WITH ACUTE */ \ - UNI(0x37, 0x02c7); /* CARON */ \ - UNI(0x38, 0x00b8); /* CEDILLA */ \ - UNI(0x39, 0x0161); /* LATIN SMALL LETTER S WITH CARON */ \ - UNI(0x3a, 0x015f); /* LATIN SMALL LETTER S WITH CEDILLA */ \ - UNI(0x3b, 0x0165); /* LATIN SMALL LETTER T WITH CARON */ \ - UNI(0x3c, 0x017a); /* LATIN SMALL LETTER Z WITH ACUTE */ \ - UNI(0x3d, 0x02dd); /* DOUBLE ACUTE ACCENT */ \ - UNI(0x3e, 0x017e); /* LATIN SMALL LETTER Z WITH CARON */ \ - UNI(0x3f, 0x017c); /* LATIN SMALL LETTER Z WITH DOT ABOVE */ \ - UNI(0x40, 0x0154); /* LATIN CAPITAL LETTER R WITH ACUTE */ \ - UNI(0x41, 0x00c1); /* LATIN CAPITAL LETTER A WITH ACUTE */ \ - UNI(0x42, 0x00c2); /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX */ \ - UNI(0x43, 0x0102); /* LATIN CAPITAL LETTER A WITH BREVE */ \ - UNI(0x44, 0x00c4); /* LATIN CAPITAL LETTER A WITH DIAERESIS */ \ - UNI(0x45, 0x0139); /* LATIN CAPITAL LETTER L WITH ACUTE */ \ - UNI(0x46, 0x0106); /* LATIN CAPITAL LETTER C WITH ACUTE */ \ - UNI(0x47, 0x00c7); /* LATIN CAPITAL LETTER C WITH CEDILLA */ \ - UNI(0x48, 0x010c); /* LATIN CAPITAL LETTER C WITH CARON */ \ - UNI(0x49, 0x00c9); /* LATIN CAPITAL LETTER E WITH ACUTE */ \ - UNI(0x4a, 0x0118); /* LATIN CAPITAL LETTER E WITH OGONEK */ \ - UNI(0x4b, 0x00cb); /* LATIN CAPITAL LETTER E WITH DIAERESIS */ \ - UNI(0x4c, 0x011a); /* LATIN CAPITAL LETTER E WITH CARON */ \ - UNI(0x4d, 0x00cd); /* LATIN CAPITAL LETTER I WITH ACUTE */ \ - UNI(0x4e, 0x00ce); /* LATIN CAPITAL LETTER I WITH CIRCUMFLEX */ \ - UNI(0x4f, 0x010e); /* LATIN CAPITAL LETTER D WITH CARON */ \ - UNI(0x50, 0x0110); /* LATIN CAPITAL LETTER D WITH STROKE */ \ - UNI(0x51, 0x0143); /* LATIN CAPITAL LETTER N WITH ACUTE */ \ - UNI(0x52, 0x0147); /* LATIN CAPITAL LETTER N WITH CARON */ \ - UNI(0x53, 0x00d3); /* LATIN CAPITAL LETTER O WITH ACUTE */ \ - UNI(0x54, 0x00d4); /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX */ \ - UNI(0x55, 0x0150); /* LATIN CAPITAL LETTER O WITH DOUBLE ACUTE */ \ - UNI(0x56, 0x00d6); /* LATIN CAPITAL LETTER O WITH DIAERESIS */ \ - UNI(0x57, 0x00d7); /* MULTIPLICATION SIGN */ \ - UNI(0x58, 0x0158); /* LATIN CAPITAL LETTER R WITH CARON */ \ - UNI(0x59, 0x016e); /* LATIN CAPITAL LETTER U WITH RING ABOVE */ \ - UNI(0x5a, 0x00da); /* LATIN CAPITAL LETTER U WITH ACUTE */ \ - UNI(0x5b, 0x0170); /* LATIN CAPITAL LETTER U WITH DOUBLE ACUTE */ \ - UNI(0x5c, 0x00dc); /* LATIN CAPITAL LETTER U WITH DIAERESIS */ \ - UNI(0x5d, 0x00dd); /* LATIN CAPITAL LETTER Y WITH ACUTE */ \ - UNI(0x5e, 0x0162); /* LATIN CAPITAL LETTER T WITH CEDILLA */ \ - UNI(0x5f, 0x00df); /* LATIN SMALL LETTER SHARP S */ \ - UNI(0x60, 0x0155); /* LATIN SMALL LETTER R WITH ACUTE */ \ - UNI(0x61, 0x00e1); /* LATIN SMALL LETTER A WITH ACUTE */ \ - UNI(0x62, 0x00e2); /* LATIN SMALL LETTER A WITH CIRCUMFLEX */ \ - UNI(0x63, 0x0103); /* LATIN SMALL LETTER A WITH BREVE */ \ - UNI(0x64, 0x00e4); /* LATIN SMALL LETTER A WITH DIAERESIS */ \ - UNI(0x65, 0x013a); /* LATIN SMALL LETTER L WITH ACUTE */ \ - UNI(0x66, 0x0107); /* LATIN SMALL LETTER C WITH ACUTE */ \ - UNI(0x67, 0x00e7); /* LATIN SMALL LETTER C WITH CEDILLA */ \ - UNI(0x68, 0x010d); /* LATIN SMALL LETTER C WITH CARON */ \ - UNI(0x69, 0x00e9); /* LATIN SMALL LETTER E WITH ACUTE */ \ - UNI(0x6a, 0x0119); /* LATIN SMALL LETTER E WITH OGONEK */ \ - UNI(0x6b, 0x00eb); /* LATIN SMALL LETTER E WITH DIAERESIS */ \ - UNI(0x6c, 0x011b); /* LATIN SMALL LETTER E WITH CARON */ \ - UNI(0x6d, 0x00ed); /* LATIN SMALL LETTER I WITH ACUTE */ \ - UNI(0x6e, 0x00ee); /* LATIN SMALL LETTER I WITH CIRCUMFLEX */ \ - UNI(0x6f, 0x010f); /* LATIN SMALL LETTER D WITH CARON */ \ - UNI(0x70, 0x0111); /* LATIN SMALL LETTER D WITH STROKE */ \ - UNI(0x71, 0x0144); /* LATIN SMALL LETTER N WITH ACUTE */ \ - UNI(0x72, 0x0148); /* LATIN SMALL LETTER N WITH CARON */ \ - UNI(0x73, 0x00f3); /* LATIN SMALL LETTER O WITH ACUTE */ \ - UNI(0x74, 0x00f4); /* LATIN SMALL LETTER O WITH CIRCUMFLEX */ \ - UNI(0x75, 0x0151); /* LATIN SMALL LETTER O WITH DOUBLE ACUTE */ \ - UNI(0x76, 0x00f6); /* LATIN SMALL LETTER O WITH DIAERESIS */ \ - UNI(0x77, 0x00f7); /* DIVISION SIGN */ \ - UNI(0x78, 0x0159); /* LATIN SMALL LETTER R WITH CARON */ \ - UNI(0x79, 0x016f); /* LATIN SMALL LETTER U WITH RING ABOVE */ \ - UNI(0x7a, 0x00fa); /* LATIN SMALL LETTER U WITH ACUTE */ \ - UNI(0x7b, 0x0171); /* LATIN SMALL LETTER U WITH DOUBLE ACUTE */ \ - UNI(0x7c, 0x00fc); /* LATIN SMALL LETTER U WITH DIAERESIS */ \ - UNI(0x7d, 0x00fd); /* LATIN SMALL LETTER Y WITH ACUTE */ \ - UNI(0x7e, 0x0163); /* LATIN SMALL LETTER T WITH CEDILLA */ \ - UNI(0x7f, 0x02d9); /* DOT ABOVE */ \ - } \ - end_CODEPAGE() - /* ISO Latin-5 is 8859-9 */ -#define map_ISO_Latin_5(code) \ - begin_CODEPAGE(); \ - switch (code) { \ - UNI(0x20, 0x00a0); /* NO-BREAK SPACE */ \ - UNI(0x21, 0x00a1); /* INVERTED EXCLAMATION MARK */ \ - UNI(0x22, 0x00a2); /* CENT SIGN */ \ - UNI(0x23, 0x00a3); /* POUND SIGN */ \ - UNI(0x24, 0x00a4); /* CURRENCY SIGN */ \ - UNI(0x25, 0x00a5); /* YEN SIGN */ \ - UNI(0x26, 0x00a6); /* BROKEN BAR */ \ - UNI(0x27, 0x00a7); /* SECTION SIGN */ \ - UNI(0x28, 0x00a8); /* DIAERESIS */ \ - UNI(0x29, 0x00a9); /* COPYRIGHT SIGN */ \ - UNI(0x2a, 0x00aa); /* FEMININE ORDINAL INDICATOR */ \ - UNI(0x2b, 0x00ab); /* LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ - UNI(0x2c, 0x00ac); /* NOT SIGN */ \ - UNI(0x2d, 0x00ad); /* SOFT HYPHEN */ \ - UNI(0x2e, 0x00ae); /* REGISTERED SIGN */ \ - UNI(0x2f, 0x00af); /* MACRON */ \ - UNI(0x30, 0x00b0); /* DEGREE SIGN */ \ - UNI(0x31, 0x00b1); /* PLUS-MINUS SIGN */ \ - UNI(0x32, 0x00b2); /* SUPERSCRIPT TWO */ \ - UNI(0x33, 0x00b3); /* SUPERSCRIPT THREE */ \ - UNI(0x34, 0x00b4); /* ACUTE ACCENT */ \ - UNI(0x35, 0x00b5); /* MICRO SIGN */ \ - UNI(0x36, 0x00b6); /* PILCROW SIGN */ \ - UNI(0x37, 0x00b7); /* MIDDLE DOT */ \ - UNI(0x38, 0x00b8); /* CEDILLA */ \ - UNI(0x39, 0x00b9); /* SUPERSCRIPT ONE */ \ - UNI(0x3a, 0x00ba); /* MASCULINE ORDINAL INDICATOR */ \ - UNI(0x3b, 0x00bb); /* RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ - UNI(0x3c, 0x00bc); /* VULGAR FRACTION ONE QUARTER */ \ - UNI(0x3d, 0x00bd); /* VULGAR FRACTION ONE HALF */ \ - UNI(0x3e, 0x00be); /* VULGAR FRACTION THREE QUARTERS */ \ - UNI(0x3f, 0x00bf); /* INVERTED QUESTION MARK */ \ - UNI(0x40, 0x00c0); /* LATIN CAPITAL LETTER A WITH GRAVE */ \ - UNI(0x41, 0x00c1); /* LATIN CAPITAL LETTER A WITH ACUTE */ \ - UNI(0x42, 0x00c2); /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX */ \ - UNI(0x43, 0x00c3); /* LATIN CAPITAL LETTER A WITH TILDE */ \ - UNI(0x44, 0x00c4); /* LATIN CAPITAL LETTER A WITH DIAERESIS */ \ - UNI(0x45, 0x00c5); /* LATIN CAPITAL LETTER A WITH RING ABOVE */ \ - UNI(0x46, 0x00c6); /* LATIN CAPITAL LETTER AE */ \ - UNI(0x47, 0x00c7); /* LATIN CAPITAL LETTER C WITH CEDILLA */ \ - UNI(0x48, 0x00c8); /* LATIN CAPITAL LETTER E WITH GRAVE */ \ - UNI(0x49, 0x00c9); /* LATIN CAPITAL LETTER E WITH ACUTE */ \ - UNI(0x4a, 0x00ca); /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX */ \ - UNI(0x4b, 0x00cb); /* LATIN CAPITAL LETTER E WITH DIAERESIS */ \ - UNI(0x4c, 0x00cc); /* LATIN CAPITAL LETTER I WITH GRAVE */ \ - UNI(0x4d, 0x00cd); /* LATIN CAPITAL LETTER I WITH ACUTE */ \ - UNI(0x4e, 0x00ce); /* LATIN CAPITAL LETTER I WITH CIRCUMFLEX */ \ - UNI(0x4f, 0x00cf); /* LATIN CAPITAL LETTER I WITH DIAERESIS */ \ - UNI(0x50, 0x011e); /* LATIN CAPITAL LETTER G WITH BREVE */ \ - UNI(0x51, 0x00d1); /* LATIN CAPITAL LETTER N WITH TILDE */ \ - UNI(0x52, 0x00d2); /* LATIN CAPITAL LETTER O WITH GRAVE */ \ - UNI(0x53, 0x00d3); /* LATIN CAPITAL LETTER O WITH ACUTE */ \ - UNI(0x54, 0x00d4); /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX */ \ - UNI(0x55, 0x00d5); /* LATIN CAPITAL LETTER O WITH TILDE */ \ - UNI(0x56, 0x00d6); /* LATIN CAPITAL LETTER O WITH DIAERESIS */ \ - UNI(0x57, 0x00d7); /* MULTIPLICATION SIGN */ \ - UNI(0x58, 0x00d8); /* LATIN CAPITAL LETTER O WITH STROKE */ \ - UNI(0x59, 0x00d9); /* LATIN CAPITAL LETTER U WITH GRAVE */ \ - UNI(0x5a, 0x00da); /* LATIN CAPITAL LETTER U WITH ACUTE */ \ - UNI(0x5b, 0x00db); /* LATIN CAPITAL LETTER U WITH CIRCUMFLEX */ \ - UNI(0x5c, 0x00dc); /* LATIN CAPITAL LETTER U WITH DIAERESIS */ \ - UNI(0x5d, 0x0130); /* LATIN CAPITAL LETTER I WITH DOT ABOVE */ \ - UNI(0x5e, 0x015e); /* LATIN CAPITAL LETTER S WITH CEDILLA */ \ - UNI(0x5f, 0x00df); /* LATIN SMALL LETTER SHARP S */ \ - UNI(0x60, 0x00e0); /* LATIN SMALL LETTER A WITH GRAVE */ \ - UNI(0x61, 0x00e1); /* LATIN SMALL LETTER A WITH ACUTE */ \ - UNI(0x62, 0x00e2); /* LATIN SMALL LETTER A WITH CIRCUMFLEX */ \ - UNI(0x63, 0x00e3); /* LATIN SMALL LETTER A WITH TILDE */ \ - UNI(0x64, 0x00e4); /* LATIN SMALL LETTER A WITH DIAERESIS */ \ - UNI(0x65, 0x00e5); /* LATIN SMALL LETTER A WITH RING ABOVE */ \ - UNI(0x66, 0x00e6); /* LATIN SMALL LETTER AE */ \ - UNI(0x67, 0x00e7); /* LATIN SMALL LETTER C WITH CEDILLA */ \ - UNI(0x68, 0x00e8); /* LATIN SMALL LETTER E WITH GRAVE */ \ - UNI(0x69, 0x00e9); /* LATIN SMALL LETTER E WITH ACUTE */ \ - UNI(0x6a, 0x00ea); /* LATIN SMALL LETTER E WITH CIRCUMFLEX */ \ - UNI(0x6b, 0x00eb); /* LATIN SMALL LETTER E WITH DIAERESIS */ \ - UNI(0x6c, 0x00ec); /* LATIN SMALL LETTER I WITH GRAVE */ \ - UNI(0x6d, 0x00ed); /* LATIN SMALL LETTER I WITH ACUTE */ \ - UNI(0x6e, 0x00ee); /* LATIN SMALL LETTER I WITH CIRCUMFLEX */ \ - UNI(0x6f, 0x00ef); /* LATIN SMALL LETTER I WITH DIAERESIS */ \ - UNI(0x70, 0x011f); /* LATIN SMALL LETTER G WITH BREVE */ \ - UNI(0x71, 0x00f1); /* LATIN SMALL LETTER N WITH TILDE */ \ - UNI(0x72, 0x00f2); /* LATIN SMALL LETTER O WITH GRAVE */ \ - UNI(0x73, 0x00f3); /* LATIN SMALL LETTER O WITH ACUTE */ \ - UNI(0x74, 0x00f4); /* LATIN SMALL LETTER O WITH CIRCUMFLEX */ \ - UNI(0x75, 0x00f5); /* LATIN SMALL LETTER O WITH TILDE */ \ - UNI(0x76, 0x00f6); /* LATIN SMALL LETTER O WITH DIAERESIS */ \ - UNI(0x77, 0x00f7); /* DIVISION SIGN */ \ - UNI(0x78, 0x00f8); /* LATIN SMALL LETTER O WITH STROKE */ \ - UNI(0x79, 0x00f9); /* LATIN SMALL LETTER U WITH GRAVE */ \ - UNI(0x7a, 0x00fa); /* LATIN SMALL LETTER U WITH ACUTE */ \ - UNI(0x7b, 0x00fb); /* LATIN SMALL LETTER U WITH CIRCUMFLEX */ \ - UNI(0x7c, 0x00fc); /* LATIN SMALL LETTER U WITH DIAERESIS */ \ - UNI(0x7d, 0x0131); /* LATIN SMALL LETTER DOTLESS I */ \ - UNI(0x7e, 0x015f); /* LATIN SMALL LETTER S WITH CEDILLA */ \ - UNI(0x7f, 0x00ff); /* LATIN SMALL LETTER Y WITH DIAERESIS */ \ - } \ - end_CODEPAGE() - /* DEC Cyrillic from screenshot */ -#define map_DEC_Cyrillic(code) \ - begin_CODEPAGE(); \ - switch (code) { \ - UNI(0x20, 0x00a0); /* NO-BREAK SPACE */ \ - XXX(0x21, UNDEF); /* undefined */ \ - XXX(0x22, UNDEF); /* undefined */ \ - XXX(0x23, UNDEF); /* undefined */ \ - XXX(0x24, UNDEF); /* undefined */ \ - XXX(0x25, UNDEF); /* undefined */ \ - XXX(0x26, UNDEF); /* undefined */ \ - XXX(0x27, UNDEF); /* undefined */ \ - XXX(0x28, UNDEF); /* undefined */ \ - XXX(0x29, UNDEF); /* undefined */ \ - XXX(0x2a, UNDEF); /* undefined */ \ - XXX(0x2b, UNDEF); /* undefined */ \ - XXX(0x2c, UNDEF); /* undefined */ \ - XXX(0x2d, UNDEF); /* undefined */ \ - XXX(0x2e, UNDEF); /* undefined */ \ - XXX(0x2f, UNDEF); /* undefined */ \ - XXX(0x30, UNDEF); /* undefined */ \ - XXX(0x31, UNDEF); /* undefined */ \ - XXX(0x32, UNDEF); /* undefined */ \ - XXX(0x33, UNDEF); /* undefined */ \ - XXX(0x34, UNDEF); /* undefined */ \ - XXX(0x35, UNDEF); /* undefined */ \ - XXX(0x36, UNDEF); /* undefined */ \ - XXX(0x37, UNDEF); /* undefined */ \ - XXX(0x38, UNDEF); /* undefined */ \ - XXX(0x39, UNDEF); /* undefined */ \ - XXX(0x3a, UNDEF); /* undefined */ \ - XXX(0x3b, UNDEF); /* undefined */ \ - XXX(0x3c, UNDEF); /* undefined */ \ - XXX(0x3d, UNDEF); /* undefined */ \ - XXX(0x3e, UNDEF); /* undefined */ \ - XXX(0x3f, UNDEF); /* undefined */ \ - \ - UNI(0x40, 0x044e); /* CYRILLIC SMALL LETTER YU */ \ - UNI(0x41, 0x0430); /* CYRILLIC SMALL LETTER A */ \ - UNI(0x42, 0x0431); /* CYRILLIC SMALL LETTER BE */ \ - UNI(0x43, 0x0446); /* CYRILLIC SMALL LETTER TSE */ \ - UNI(0x44, 0x0434); /* CYRILLIC SMALL LETTER DE */ \ - UNI(0x45, 0x0435); /* CYRILLIC SMALL LETTER IE */ \ - UNI(0x46, 0x0444); /* CYRILLIC SMALL LETTER EF */ \ - UNI(0x47, 0x0433); /* CYRILLIC SMALL LETTER GHE */ \ - UNI(0x48, 0x0445); /* CYRILLIC SMALL LETTER HA */ \ - UNI(0x49, 0x0438); /* CYRILLIC SMALL LETTER I */ \ - UNI(0x4a, 0x0439); /* CYRILLIC SMALL LETTER SHORT I */ \ - UNI(0x4b, 0x043a); /* CYRILLIC SMALL LETTER KA */ \ - UNI(0x4c, 0x043b); /* CYRILLIC SMALL LETTER EL */ \ - UNI(0x4d, 0x043c); /* CYRILLIC SMALL LETTER EM */ \ - UNI(0x4e, 0x043d); /* CYRILLIC SMALL LETTER EN */ \ - UNI(0x4f, 0x043e); /* CYRILLIC SMALL LETTER O */ \ - UNI(0x50, 0x043f); /* CYRILLIC SMALL LETTER PE */ \ - UNI(0x51, 0x044f); /* CYRILLIC SMALL LETTER YA */ \ - UNI(0x52, 0x0440); /* CYRILLIC SMALL LETTER ER */ \ - UNI(0x53, 0x0441); /* CYRILLIC SMALL LETTER ES */ \ - UNI(0x54, 0x0442); /* CYRILLIC SMALL LETTER TE */ \ - UNI(0x55, 0x0443); /* CYRILLIC SMALL LETTER U */ \ - UNI(0x56, 0x0436); /* CYRILLIC SMALL LETTER ZHE */ \ - UNI(0x57, 0x0432); /* CYRILLIC SMALL LETTER VE */ \ - UNI(0x58, 0x044c); /* CYRILLIC SMALL LETTER SOFT SIGN */ \ - UNI(0x59, 0x044b); /* CYRILLIC SMALL LETTER YERU */ \ - UNI(0x5a, 0x0437); /* CYRILLIC SMALL LETTER ZE */ \ - UNI(0x5b, 0x0448); /* CYRILLIC SMALL LETTER SHA */ \ - UNI(0x5c, 0x044d); /* CYRILLIC SMALL LETTER E */ \ - UNI(0x5d, 0x0449); /* CYRILLIC SMALL LETTER SHCHA */ \ - UNI(0x5e, 0x0447); /* CYRILLIC SMALL LETTER CHE */ \ - UNI(0x5f, 0x044a); /* CYRILLIC SMALL LETTER HARD SIGN */ \ - \ - UNI(0x60, 0x042e); /* CYRILLIC CAPITAL LETTER YU */ \ - UNI(0x61, 0x0410); /* CYRILLIC CAPITAL LETTER A */ \ - UNI(0x62, 0x0411); /* CYRILLIC CAPITAL LETTER BE */ \ - UNI(0x63, 0x0426); /* CYRILLIC CAPITAL LETTER TSE */ \ - UNI(0x64, 0x0414); /* CYRILLIC CAPITAL LETTER DE */ \ - UNI(0x65, 0x0415); /* CYRILLIC CAPITAL LETTER IE */ \ - UNI(0x66, 0x0424); /* CYRILLIC CAPITAL LETTER EF */ \ - UNI(0x67, 0x0413); /* CYRILLIC CAPITAL LETTER GHE */ \ - UNI(0x68, 0x0425); /* CYRILLIC CAPITAL LETTER HA */ \ - UNI(0x69, 0x0418); /* CYRILLIC CAPITAL LETTER I */ \ - UNI(0x6a, 0x0419); /* CYRILLIC CAPITAL LETTER SHORT I */ \ - UNI(0x6b, 0x041a); /* CYRILLIC CAPITAL LETTER KA */ \ - UNI(0x6c, 0x041b); /* CYRILLIC CAPITAL LETTER EL */ \ - UNI(0x6d, 0x041c); /* CYRILLIC CAPITAL LETTER EM */ \ - UNI(0x6e, 0x041d); /* CYRILLIC CAPITAL LETTER EN */ \ - UNI(0x6f, 0x041e); /* CYRILLIC CAPITAL LETTER O */ \ - UNI(0x70, 0x041f); /* CYRILLIC CAPITAL LETTER PE */ \ - UNI(0x71, 0x042f); /* CYRILLIC CAPITAL LETTER YA */ \ - UNI(0x72, 0x0420); /* CYRILLIC CAPITAL LETTER ER */ \ - UNI(0x73, 0x0421); /* CYRILLIC CAPITAL LETTER ES */ \ - UNI(0x74, 0x0422); /* CYRILLIC CAPITAL LETTER TE */ \ - UNI(0x75, 0x0423); /* CYRILLIC CAPITAL LETTER U */ \ - UNI(0x76, 0x0416); /* CYRILLIC CAPITAL LETTER ZHE */ \ - UNI(0x77, 0x0412); /* CYRILLIC CAPITAL LETTER VE */ \ - UNI(0x78, 0x042c); /* CYRILLIC CAPITAL LETTER SOFT SIGN */ \ - UNI(0x79, 0x042b); /* CYRILLIC CAPITAL LETTER YERU */ \ - UNI(0x7a, 0x0417); /* CYRILLIC CAPITAL LETTER ZE */ \ - UNI(0x7b, 0x0428); /* CYRILLIC CAPITAL LETTER SHA */ \ - UNI(0x7c, 0x042d); /* CYRILLIC CAPITAL LETTER E */ \ - UNI(0x7d, 0x0429); /* CYRILLIC CAPITAL LETTER SHCHA */ \ - UNI(0x7e, 0x0427); /* CYRILLIC CAPITAL LETTER CHE */ \ - XXX(0x7f, UNDEF); \ - \ - } \ - end_CODEPAGE() - /* figure A-24 "DEC Greek Supplemental Character Set" */ -#define map_DEC_Greek_Supp(code) \ - begin_CODEPAGE(); \ - switch (code) { \ - MAP(0x20, 0x00a0); /* NO-BREAK SPACE */ \ - UNI(0x21, 0x00a1); /* LEFT SINGLE QUOTATION MARK */ \ - UNI(0x22, 0x00a2); /* RIGHT SINGLE QUOTATION MARK */ \ - UNI(0x23, 0x00a3); /* POUND SIGN */ \ - XXX(0x24, UNDEF); /* EURO SIGN */ \ - UNI(0x25, 0x00a5); /* YEN SIGN */ \ - XXX(0x26, UNDEF); /* BROKEN BAR */ \ - UNI(0x27, 0x00a7); /* SECTION SIGN */ \ - UNI(0x28, 0x00a4); /* CURRENCY SIGN */ \ - UNI(0x29, 0x00a9); /* COPYRIGHT SIGN */ \ - UNI(0x2a, 0x00aa); /* FEMININE ORDINAL INDICATOR */ \ - UNI(0x2b, 0x00ab); /* LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ - XXX(0x2c, UNDEF); /* reserved */ \ - XXX(0x2d, UNDEF); /* reserved */ \ - XXX(0x2e, UNDEF); /* reserved */ \ - XXX(0x2f, UNDEF); /* reserved */ \ - UNI(0x30, 0x00b0); /* DEGREE SIGN */ \ - UNI(0x31, 0x00b1); /* PLUS-MINUS SIGN */ \ - UNI(0x32, 0x00b2); /* SUPERSCRIPT TWO */ \ - UNI(0x33, 0x00b3); /* SUPERSCRIPT THREE */ \ - XXX(0x34, UNDEF); /* reserved */ \ - UNI(0x35, 0x00b5); /* MICRO SIGN */ \ - UNI(0x36, 0x00b6); /* PILCROW SIGN */ \ - UNI(0x37, 0x00b7); /* MIDDLE DOT */ \ - XXX(0x38, UNDEF); /* reserved */ \ - UNI(0x39, 0x00b9); /* SUPERSCRIPT ONE */ \ - UNI(0x3a, 0x00ba); /* MASCULINE ORDINAL INDICATOR */ \ - UNI(0x3b, 0x00bb); /* RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ - UNI(0x3c, 0x00bc); /* VULGAR FRACTION ONE QUARTER */ \ - UNI(0x3d, 0x00bd); /* VULGAR FRACTION ONE HALF */ \ - XXX(0x3e, UNDEF); /* reserved */ \ - UNI(0x3f, 0x00BF); /* INVERTED QUESTION MARK */ \ - UNI(0x40, 0x03ca); /* GREEK SMALL LETTER IOTA WITH DIALYTIKA */ \ - UNI(0x41, 0x0391); /* GREEK CAPITAL LETTER ALPHA */ \ - UNI(0x42, 0x0392); /* GREEK CAPITAL LETTER BETA */ \ - UNI(0x43, 0x0393); /* GREEK CAPITAL LETTER GAMMA */ \ - UNI(0x44, 0x0394); /* GREEK CAPITAL LETTER DELTA */ \ - UNI(0x45, 0x0395); /* GREEK CAPITAL LETTER EPSILON */ \ - UNI(0x46, 0x0396); /* GREEK CAPITAL LETTER ZETA */ \ - UNI(0x47, 0x0397); /* GREEK CAPITAL LETTER ETA */ \ - UNI(0x48, 0x0398); /* GREEK CAPITAL LETTER THETA */ \ - UNI(0x49, 0x0399); /* GREEK CAPITAL LETTER IOTA */ \ - UNI(0x4a, 0x039a); /* GREEK CAPITAL LETTER KAPPA */ \ - UNI(0x4b, 0x039b); /* GREEK CAPITAL LETTER LAMDA */ \ - UNI(0x4c, 0x039c); /* GREEK CAPITAL LETTER MU */ \ - UNI(0x4d, 0x039d); /* GREEK CAPITAL LETTER NU */ \ - UNI(0x4e, 0x039e); /* GREEK CAPITAL LETTER XI */ \ - UNI(0x4f, 0x039f); /* GREEK CAPITAL LETTER OMICRON */ \ - XXX(0x50, UNDEF); /* reserved */ \ - UNI(0x51, 0x03a0); /* GREEK CAPITAL LETTER PI */ \ - UNI(0x52, 0x03a1); /* GREEK CAPITAL LETTER RHO */ \ - UNI(0x53, 0x03a3); /* GREEK CAPITAL LETTER SIGMA */ \ - UNI(0x54, 0x03a4); /* GREEK CAPITAL LETTER TAU */ \ - UNI(0x55, 0x03a5); /* GREEK CAPITAL LETTER UPSILON */ \ - UNI(0x56, 0x03a6); /* GREEK CAPITAL LETTER PHI */ \ - UNI(0x57, 0x03a7); /* GREEK CAPITAL LETTER CHI */ \ - UNI(0x58, 0x03a8); /* GREEK CAPITAL LETTER PSI */ \ - UNI(0x59, 0x03a9); /* GREEK CAPITAL LETTER OMEGA */ \ - UNI(0x5a, 0x03ac); /* GREEK SMALL LETTER ALPHA WITH TONOS */ \ - UNI(0x5b, 0x03ad); /* GREEK SMALL LETTER EPSILON WITH TONOS */ \ - UNI(0x5c, 0x03ae); /* GREEK SMALL LETTER ETA WITH TONOS */ \ - UNI(0x5d, 0x03af); /* GREEK SMALL LETTER IOTA WITH TONOS */ \ - XXX(0x5e, UNDEF); /* reserved */ \ - UNI(0x5f, 0x03cc); /* GREEK SMALL LETTER OMICRON WITH TONOS */ \ - UNI(0x60, 0x03cb); /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA */ \ - UNI(0x61, 0x03b1); /* GREEK SMALL LETTER ALPHA */ \ - UNI(0x62, 0x03b2); /* GREEK SMALL LETTER BETA */ \ - UNI(0x63, 0x03b3); /* GREEK SMALL LETTER GAMMA */ \ - UNI(0x64, 0x03b4); /* GREEK SMALL LETTER DELTA */ \ - UNI(0x65, 0x03b5); /* GREEK SMALL LETTER EPSILON */ \ - UNI(0x66, 0x03b6); /* GREEK SMALL LETTER ZETA */ \ - UNI(0x67, 0x03b7); /* GREEK SMALL LETTER ETA */ \ - UNI(0x68, 0x03b8); /* GREEK SMALL LETTER THETA */ \ - UNI(0x69, 0x03b9); /* GREEK SMALL LETTER IOTA */ \ - UNI(0x6a, 0x03ba); /* GREEK SMALL LETTER KAPPA */ \ - UNI(0x6b, 0x03bb); /* GREEK SMALL LETTER LAMDA */ \ - UNI(0x6c, 0x03bc); /* GREEK SMALL LETTER MU */ \ - UNI(0x6d, 0x03bd); /* GREEK SMALL LETTER NU */ \ - UNI(0x6e, 0x03be); /* GREEK SMALL LETTER XI */ \ - UNI(0x6f, 0x03bf); /* GREEK SMALL LETTER OMICRON */ \ - XXX(0x70, UNDEF); /* reserved */ \ - UNI(0x71, 0x03c0); /* GREEK SMALL LETTER PI */ \ - UNI(0x72, 0x03c1); /* GREEK SMALL LETTER RHO */ \ - UNI(0x73, 0x03c3); /* GREEK SMALL LETTER SIGMA */ \ - UNI(0x74, 0x03c4); /* GREEK SMALL LETTER TAU */ \ - UNI(0x75, 0x03c5); /* GREEK SMALL LETTER UPSILON */ \ - UNI(0x76, 0x03c6); /* GREEK SMALL LETTER PHI */ \ - UNI(0x77, 0x03c7); /* GREEK SMALL LETTER CHI */ \ - UNI(0x78, 0x03c8); /* GREEK SMALL LETTER PSI */ \ - UNI(0x79, 0x03c9); /* GREEK SMALL LETTER OMEGA */ \ - UNI(0x7a, 0x03c2); /* GREEK SMALL LETTER FINAL SIGMA */ \ - UNI(0x7b, 0x03cd); /* GREEK SMALL LETTER UPSILON WITH TONOS */ \ - UNI(0x7c, 0x03ce); /* GREEK SMALL LETTER OMEGA WITH TONOS */ \ - UNI(0x7d, 0x0384); /* GREEK TONOS */ \ - XXX(0x7e, UNDEF); /* reserved */ \ - } \ - end_CODEPAGE() - /* figure A-22 "DEC Hebrew Supplemental Character Set" */ -#define map_DEC_Hebrew_Supp(code) \ - begin_CODEPAGE(); \ - switch (code) { \ - UNI(0x21, 0x00a1); /* INVERTED EXCLAMATION MARK */ \ - UNI(0x22, 0x00a2); /* CENT SIGN */ \ - UNI(0x23, 0x00a3); /* POUND SIGN */ \ - XXX(0x24, UNDEF); /* CURRENCY SIGN */ \ - UNI(0x25, 0x00a5); /* YEN SIGN */ \ - XXX(0x26, UNDEF); /* BROKEN BAR */ \ - UNI(0x27, 0x00a7); /* SECTION SIGN */ \ - UNI(0x28, 0x00a8); /* DIAERESIS */ \ - UNI(0x29, 0x00a9); /* COPYRIGHT SIGN */ \ - UNI(0x2a, 0x00d7); /* MULTIPLICATION SIGN */ \ - UNI(0x2b, 0x00ab); /* LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ - XXX(0x2c, UNDEF); /* NOT SIGN */ \ - XXX(0x2d, UNDEF); /* SOFT HYPHEN */ \ - XXX(0x2e, UNDEF); /* REGISTERED SIGN */ \ - XXX(0x2f, UNDEF); /* MACRON */ \ - UNI(0x30, 0x00b0); /* DEGREE SIGN */ \ - UNI(0x31, 0x00b1); /* PLUS-MINUS SIGN */ \ - UNI(0x32, 0x00b2); /* SUPERSCRIPT TWO */ \ - UNI(0x33, 0x00b3); /* SUPERSCRIPT THREE */ \ - XXX(0x34, UNDEF); /* ACUTE ACCENT */ \ - UNI(0x35, 0x00b5); /* MICRO SIGN */ \ - UNI(0x36, 0x00b6); /* PILCROW SIGN */ \ - UNI(0x37, 0x00b7); /* MIDDLE DOT */ \ - XXX(0x38, UNDEF); /* CEDILLA */ \ - UNI(0x39, 0x00b9); /* SUPERSCRIPT ONE */ \ - UNI(0x3a, 0x00f7); /* DIVISION SIGN */ \ - UNI(0x3b, 0x00bb); /* RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ - UNI(0x3c, 0x00bc); /* VULGAR FRACTION ONE QUARTER */ \ - UNI(0x3d, 0x00bd); /* VULGAR FRACTION ONE HALF */ \ - XXX(0x3e, UNDEF); /* VULGAR FRACTION THREE QUARTERS */ \ - UNI(0x3f, 0x00bf); /* INVERTED QUESTION MARK */ \ - XXX(0x40, UNDEF); /* reserved */ \ - XXX(0x41, UNDEF); /* reserved */ \ - XXX(0x42, UNDEF); /* reserved */ \ - XXX(0x43, UNDEF); /* reserved */ \ - XXX(0x44, UNDEF); /* reserved */ \ - XXX(0x45, UNDEF); /* reserved */ \ - XXX(0x46, UNDEF); /* reserved */ \ - XXX(0x47, UNDEF); /* reserved */ \ - XXX(0x48, UNDEF); /* reserved */ \ - XXX(0x49, UNDEF); /* reserved */ \ - XXX(0x4a, UNDEF); /* reserved */ \ - XXX(0x4b, UNDEF); /* reserved */ \ - XXX(0x4c, UNDEF); /* reserved */ \ - XXX(0x4d, UNDEF); /* reserved */ \ - XXX(0x4e, UNDEF); /* reserved */ \ - XXX(0x4f, UNDEF); /* reserved */ \ - XXX(0x50, UNDEF); /* reserved */ \ - XXX(0x51, UNDEF); /* reserved */ \ - XXX(0x52, UNDEF); /* reserved */ \ - XXX(0x53, UNDEF); /* reserved */ \ - XXX(0x54, UNDEF); /* reserved */ \ - XXX(0x55, UNDEF); /* reserved */ \ - XXX(0x56, UNDEF); /* reserved */ \ - XXX(0x57, UNDEF); /* reserved */ \ - XXX(0x58, UNDEF); /* reserved */ \ - XXX(0x59, UNDEF); /* reserved */ \ - XXX(0x5a, UNDEF); /* reserved */ \ - XXX(0x5b, UNDEF); /* reserved */ \ - XXX(0x5c, UNDEF); /* reserved */ \ - XXX(0x5d, UNDEF); /* reserved */ \ - XXX(0x5e, UNDEF); /* reserved */ \ - XXX(0x5f, UNDEF); /* reserved */ \ - UNI(0x60, 0x05d0); /* HEBREW LETTER ALEF */ \ - UNI(0x61, 0x05d1); /* HEBREW LETTER BET */ \ - UNI(0x62, 0x05d2); /* HEBREW LETTER GIMEL */ \ - UNI(0x63, 0x05d3); /* HEBREW LETTER DALET */ \ - UNI(0x64, 0x05d4); /* HEBREW LETTER HE */ \ - UNI(0x65, 0x05d5); /* HEBREW LETTER VAV */ \ - UNI(0x66, 0x05d6); /* HEBREW LETTER ZAYIN */ \ - UNI(0x67, 0x05d7); /* HEBREW LETTER HET */ \ - UNI(0x68, 0x05d8); /* HEBREW LETTER TET */ \ - UNI(0x69, 0x05d9); /* HEBREW LETTER YOD */ \ - UNI(0x6a, 0x05da); /* HEBREW LETTER FINAL KAF */ \ - UNI(0x6b, 0x05db); /* HEBREW LETTER KAF */ \ - UNI(0x6c, 0x05dc); /* HEBREW LETTER LAMED */ \ - UNI(0x6d, 0x05dd); /* HEBREW LETTER FINAL MEM */ \ - UNI(0x6e, 0x05de); /* HEBREW LETTER MEM */ \ - UNI(0x6f, 0x05df); /* HEBREW LETTER FINAL NUN */ \ - UNI(0x70, 0x05e0); /* HEBREW LETTER NUN */ \ - UNI(0x71, 0x05e1); /* HEBREW LETTER SAMEKH */ \ - UNI(0x72, 0x05e2); /* HEBREW LETTER AYIN */ \ - UNI(0x73, 0x05e3); /* HEBREW LETTER FINAL PE */ \ - UNI(0x74, 0x05e4); /* HEBREW LETTER PE */ \ - UNI(0x75, 0x05e5); /* HEBREW LETTER FINAL TSADI */ \ - UNI(0x76, 0x05e6); /* HEBREW LETTER TSADI */ \ - UNI(0x77, 0x05e7); /* HEBREW LETTER QOF */ \ - UNI(0x78, 0x05e8); /* HEBREW LETTER RESH */ \ - UNI(0x79, 0x05e9); /* HEBREW LETTER SHIN */ \ - UNI(0x7a, 0x05ea); /* HEBREW LETTER TAV */ \ - XXX(0x7b, UNDEF); /* reserved */ \ - XXX(0x7c, UNDEF); /* reserved */ \ - XXX(0x7d, UNDEF); /* reserved */ \ - XXX(0x7e, UNDEF); /* reserved */ \ - } \ - end_CODEPAGE() - /* figure A-27 "DEC 8-Bit Turkish Supplemental Character Set" */ -#define map_DEC_Turkish_Supp(code) \ - begin_CODEPAGE(); \ - switch (code) { \ - UNI(0x21, 0x00A1); /* INVERTED EXCLAMATION MARK */ \ - UNI(0x22, 0x00A2); /* CENT SIGN */ \ - UNI(0x23, 0x00A3); /* POUND SIGN */ \ - XXX(0x24, UNDEF); /* reserved */ \ - UNI(0x25, 0x00A5); /* YEN SIGN */ \ - XXX(0x26, UNDEF); /* reserved */ \ - UNI(0x27, 0x00A7); /* SECTION SIGN */ \ - UNI(0x28, 0x00A8); /* DIAERESIS */ \ - UNI(0x29, 0x00A9); /* COPYRIGHT SIGN */ \ - UNI(0x2A, 0x00AA); /* FEMININE ORDINAL INDICATOR */ \ - UNI(0x2B, 0x00AB); /* LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ - XXX(0x2C, UNDEF); /* reserved */ \ - XXX(0x2D, UNDEF); /* reserved */ \ - UNI(0x2E, 0x0130); /* LATIN CAPITAL LETTER I WITH DOT ABOVE */ \ - XXX(0x2F, UNDEF); /* reserved */ \ - UNI(0x30, 0x00B0); /* DEGREE SIGN */ \ - UNI(0x31, 0x00B1); /* PLUS-MINUS SIGN */ \ - UNI(0x32, 0x00B2); /* SUPERSCRIPT TWO */ \ - UNI(0x33, 0x00B3); /* SUPERSCRIPT THREE */ \ - XXX(0x34, UNDEF); /* reserved */ \ - UNI(0x35, 0x00B5); /* MICRO SIGN */ \ - UNI(0x36, 0x00B6); /* PILCROW SIGN */ \ - UNI(0x37, 0x00B7); /* MIDDLE DOT */ \ - XXX(0x38, UNDEF); /* reserved */ \ - UNI(0x39, 0x00B9); /* SUPERSCRIPT ONE */ \ - UNI(0x3A, 0x00BA); /* MASCULINE ORDINAL INDICATOR */ \ - UNI(0x3B, 0x00BB); /* RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ - UNI(0x3C, 0x00BC); /* VULGAR FRACTION ONE QUARTER */ \ - UNI(0x3D, 0x00BD); /* VULGAR FRACTION ONE HALF */ \ - UNI(0x3E, 0x0131); /* LATIN SMALL LETTER DOTLESS I */ \ - UNI(0x3F, 0x00BF); /* INVERTED QUESTION MARK */ \ - UNI(0x40, 0x00C0); /* LATIN CAPITAL LETTER A WITH GRAVE */ \ - UNI(0x41, 0x00C1); /* LATIN CAPITAL LETTER A WITH ACUTE */ \ - UNI(0x42, 0x00C2); /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX */ \ - UNI(0x43, 0x00C3); /* LATIN CAPITAL LETTER A WITH TILDE */ \ - UNI(0x44, 0x00C4); /* LATIN CAPITAL LETTER A WITH DIAERESIS */ \ - UNI(0x45, 0x00C5); /* LATIN CAPITAL LETTER A WITH RING ABOVE */ \ - UNI(0x46, 0x00C6); /* LATIN CAPITAL LETTER AE */ \ - UNI(0x47, 0x00C7); /* LATIN CAPITAL LETTER C WITH CEDILLA */ \ - UNI(0x48, 0x00C8); /* LATIN CAPITAL LETTER E WITH GRAVE */ \ - UNI(0x49, 0x00C9); /* LATIN CAPITAL LETTER E WITH ACUTE */ \ - UNI(0x4A, 0x00CA); /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX */ \ - UNI(0x4B, 0x00CB); /* LATIN CAPITAL LETTER E WITH DIAERESIS */ \ - UNI(0x4C, 0x00CC); /* LATIN CAPITAL LETTER I WITH GRAVE */ \ - UNI(0x4D, 0x00CD); /* LATIN CAPITAL LETTER I WITH ACUTE */ \ - UNI(0x4E, 0x00CE); /* LATIN CAPITAL LETTER I WITH CIRCUMFLEX */ \ - UNI(0x4F, 0x00CF); /* LATIN CAPITAL LETTER I WITH DIAERESIS */ \ - UNI(0x50, 0x011E); /* LATIN CAPITAL LETTER G WITH BREVE */ \ - UNI(0x51, 0x00D1); /* LATIN CAPITAL LETTER N WITH TILDE */ \ - UNI(0x52, 0x00D2); /* LATIN CAPITAL LETTER O WITH GRAVE */ \ - UNI(0x53, 0x00D3); /* LATIN CAPITAL LETTER O WITH ACUTE */ \ - UNI(0x54, 0x00D4); /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX */ \ - UNI(0x55, 0x00D5); /* LATIN CAPITAL LETTER O WITH TILDE */ \ - UNI(0x56, 0x00D6); /* LATIN CAPITAL LETTER O WITH DIAERESIS */ \ - UNI(0x57, 0x0152); /* LATIN CAPITAL LIGATURE OE */ \ - UNI(0x58, 0x00D8); /* LATIN CAPITAL LETTER O WITH STROKE */ \ - UNI(0x59, 0x00D9); /* LATIN CAPITAL LETTER U WITH GRAVE */ \ - UNI(0x5A, 0x00DA); /* LATIN CAPITAL LETTER U WITH ACUTE */ \ - UNI(0x5B, 0x00DB); /* LATIN CAPITAL LETTER U WITH CIRCUMFLEX */ \ - UNI(0x5C, 0x00DC); /* LATIN CAPITAL LETTER U WITH DIAERESIS */ \ - UNI(0x5D, 0x0178); /* LATIN CAPITAL LETTER Y WITH DIAERESIS */ \ - UNI(0x5E, 0x015E); /* LATIN CAPITAL LETTER S WITH CEDILLA */ \ - UNI(0x5F, 0x00DF); /* LATIN SMALL LETTER SHARP S */ \ - UNI(0x60, 0x00E0); /* LATIN SMALL LETTER A WITH GRAVE */ \ - UNI(0x61, 0x00E1); /* LATIN SMALL LETTER A WITH ACUTE */ \ - UNI(0x62, 0x00E2); /* LATIN SMALL LETTER A WITH CIRCUMFLEX */ \ - UNI(0x63, 0x00E3); /* LATIN SMALL LETTER A WITH TILDE */ \ - UNI(0x64, 0x00E4); /* LATIN SMALL LETTER A WITH DIAERESIS */ \ - UNI(0x65, 0x00E5); /* LATIN SMALL LETTER A WITH RING ABOVE */ \ - UNI(0x66, 0x00E6); /* LATIN SMALL LETTER AE */ \ - UNI(0x67, 0x00E7); /* LATIN SMALL LETTER C WITH CEDILLA */ \ - UNI(0x68, 0x00E8); /* LATIN SMALL LETTER E WITH GRAVE */ \ - UNI(0x69, 0x00E9); /* LATIN SMALL LETTER E WITH ACUTE */ \ - UNI(0x6A, 0x00EA); /* LATIN SMALL LETTER E WITH CIRCUMFLEX */ \ - UNI(0x6B, 0x00EB); /* LATIN SMALL LETTER E WITH DIAERESIS */ \ - UNI(0x6C, 0x00EC); /* LATIN SMALL LETTER I WITH GRAVE */ \ - UNI(0x6D, 0x00ED); /* LATIN SMALL LETTER I WITH ACUTE */ \ - UNI(0x6E, 0x00EE); /* LATIN SMALL LETTER I WITH CIRCUMFLEX */ \ - UNI(0x6F, 0x00EF); /* LATIN SMALL LETTER I WITH DIAERESIS */ \ - UNI(0x70, 0x011F); /* LATIN SMALL LETTER G WITH BREVE */ \ - UNI(0x71, 0x00F1); /* LATIN SMALL LETTER N WITH TILDE */ \ - UNI(0x72, 0x00F2); /* LATIN SMALL LETTER O WITH GRAVE */ \ - UNI(0x73, 0x00F3); /* LATIN SMALL LETTER O WITH ACUTE */ \ - UNI(0x74, 0x00F4); /* LATIN SMALL LETTER O WITH CIRCUMFLEX */ \ - UNI(0x75, 0x00F5); /* LATIN SMALL LETTER O WITH TILDE */ \ - UNI(0x76, 0x00F6); /* LATIN SMALL LETTER O WITH DIAERESIS */ \ - UNI(0x77, 0x0153); /* LATIN SMALL LIGATURE OE */ \ - UNI(0x78, 0x00F8); /* LATIN SMALL LETTER O WITH STROKE */ \ - UNI(0x79, 0x00F9); /* LATIN SMALL LETTER U WITH GRAVE */ \ - UNI(0x7A, 0x00FA); /* LATIN SMALL LETTER U WITH ACUTE */ \ - UNI(0x7B, 0x00FB); /* LATIN SMALL LETTER U WITH CIRCUMFLEX */ \ - UNI(0x7C, 0x00FC); /* LATIN SMALL LETTER U WITH DIAERESIS */ \ - UNI(0x7D, 0x00FF); /* LATIN SMALL LETTER Y WITH DIAERESIS */ \ - UNI(0x7E, 0x015F); /* LATIN SMALL LETTER S WITH CEDILLA */ \ - } \ - end_CODEPAGE() - /* - * mentioned, but not documented in VT510 manual, etc., this uses - * the ELOT927 table from Kermit 95: - */ -#define map_NRCS_Greek(code) \ - switch (code) { \ - MAP(0x61, 0x0391); /* CAPITAL GREEK LETTER ALPHA */ \ - MAP(0x62, 0x0392); /* CAPITAL GREEK LETTER BETA */ \ - MAP(0x63, 0x0393); /* CAPITAL GREEK LETTER GAMMA */ \ - MAP(0x64, 0x0394); /* CAPITAL GREEK LETTER DELTA */ \ - MAP(0x65, 0x0395); /* CAPITAL GREEK LETTER EPSILON */ \ - MAP(0x66, 0x0396); /* CAPITAL GREEK LETTER ZETA */ \ - MAP(0x67, 0x0397); /* CAPITAL GREEK LETTER ETA */ \ - MAP(0x68, 0x0398); /* CAPITAL GREEK LETTER THETA */ \ - MAP(0x69, 0x0399); /* CAPITAL GREEK LETTER IOTA */ \ - MAP(0x6a, 0x039a); /* CAPITAL GREEK LETTER KAPPA */ \ - MAP(0x6b, 0x039b); /* CAPITAL GREEK LETTER LAMDA */ \ - MAP(0x6c, 0x039c); /* CAPITAL GREEK LETTER MU */ \ - MAP(0x6d, 0x039d); /* CAPITAL GREEK LETTER NU */ \ - MAP(0x6e, 0x03a7); /* CAPITAL GREEK LETTER KSI (CHI) */ \ - MAP(0x6f, 0x039f); /* CAPITAL GREEK LETTER OMICRON */ \ - MAP(0x70, 0x03a0); /* CAPITAL GREEK LETTER PI */ \ - MAP(0x71, 0x03a1); /* CAPITAL GREEK LETTER RHO */ \ - MAP(0x72, 0x03a3); /* CAPITAL GREEK LETTER SIGMA */ \ - MAP(0x73, 0x03a4); /* CAPITAL GREEK LETTER TAU */ \ - MAP(0x74, 0x03a5); /* CAPITAL GREEK LETTER UPSILON */ \ - MAP(0x75, 0x03a6); /* CAPITAL GREEK LETTER FI (PHI) */ \ - MAP(0x76, 0x039e); /* CAPITAL GREEK LETTER XI */ \ - MAP(0x77, 0x03a8); /* CAPITAL GREEK LETTER PSI */ \ - MAP(0x78, 0x03a9); /* CAPITAL GREEK LETTER OMEGA */ \ - XXX(0x79, BLANK); /* unused */ \ - XXX(0x7a, BLANK); /* unused */ \ - } - /* figure A-21 "DEC 7-Bit Hebrew Character Set" */ -#define map_NRCS_Hebrew(code) \ - switch (code) { \ - UNI(0x60, 0x05d0); /* HEBREW LETTER ALEF */ \ - UNI(0x61, 0x05d1); /* HEBREW LETTER BET */ \ - UNI(0x62, 0x05d2); /* HEBREW LETTER GIMEL */ \ - UNI(0x63, 0x05d3); /* HEBREW LETTER DALET */ \ - UNI(0x64, 0x05d4); /* HEBREW LETTER HE */ \ - UNI(0x65, 0x05d5); /* HEBREW LETTER VAV */ \ - UNI(0x66, 0x05d6); /* HEBREW LETTER ZAYIN */ \ - UNI(0x67, 0x05d7); /* HEBREW LETTER HET */ \ - UNI(0x68, 0x05d8); /* HEBREW LETTER TET */ \ - UNI(0x69, 0x05d9); /* HEBREW LETTER YOD */ \ - UNI(0x6a, 0x05da); /* HEBREW LETTER FINAL KAF */ \ - UNI(0x6b, 0x05db); /* HEBREW LETTER KAF */ \ - UNI(0x6c, 0x05dc); /* HEBREW LETTER LAMED */ \ - UNI(0x6d, 0x05dd); /* HEBREW LETTER FINAL MEM */ \ - UNI(0x6e, 0x05de); /* HEBREW LETTER MEM */ \ - UNI(0x6f, 0x05df); /* HEBREW LETTER FINAL NUN */ \ - UNI(0x70, 0x05e0); /* HEBREW LETTER NUN */ \ - UNI(0x71, 0x05e1); /* HEBREW LETTER SAMEKH */ \ - UNI(0x72, 0x05e2); /* HEBREW LETTER AYIN */ \ - UNI(0x73, 0x05e3); /* HEBREW LETTER FINAL PE */ \ - UNI(0x74, 0x05e4); /* HEBREW LETTER PE */ \ - UNI(0x75, 0x05e5); /* HEBREW LETTER FINAL TSADI */ \ - UNI(0x76, 0x05e6); /* HEBREW LETTER TSADI */ \ - UNI(0x77, 0x05e7); /* HEBREW LETTER QOF */ \ - UNI(0x78, 0x05e8); /* HEBREW LETTER RESH */ \ - UNI(0x79, 0x05e9); /* HEBREW LETTER SHIN */ \ - UNI(0x7a, 0x05ea); /* HEBREW LETTER TAV */ \ - } - /* figure A-26 "DEC 7-Bit Turkish Character Set" */ -#define map_NRCS_Turkish(code) \ - switch (code) { \ - UNI(0x26, 0x011f); /* LATIN SMALL LETTER G WITH BREVE */ \ - UNI(0x40, 0x0130); /* LATIN CAPITAL LETTER I WITH DOT ABOVE */ \ - UNI(0x5b, 0x015e); /* LATIN CAPITAL LETTER S WITH CEDILLA */ \ - UNI(0x5c, 0x00d6); /* LATIN CAPITAL LETTER O WITH DIAERESIS */ \ - UNI(0x5d, 0x00c7); /* LATIN CAPITAL LETTER C WITH CEDILLA */ \ - UNI(0x5e, 0x00dC); /* LATIN CAPITAL LETTER U WITH DIAERESIS */ \ - UNI(0x60, 0x011e); /* LATIN CAPITAL LETTER G WITH BREVE */ \ - UNI(0x7b, 0x015f); /* LATIN SMALL LETTER S WITH CEDILLA */ \ - UNI(0x7c, 0x00f6); /* LATIN SMALL LETTER O WITH DIAERESIS */ \ - UNI(0x7d, 0x00e7); /* LATIN SMALL LETTER C WITH CEDILLA */ \ - UNI(0x7e, 0x00fc); /* LATIN SMALL LETTER U WITH DIAERESIS */ \ - } -#else -#define map_DEC_Cyrillic(code) /* nothing */ -#define map_DEC_Greek_Supp(code) /* nothing */ -#define map_DEC_Hebrew_Supp(code) /* nothing */ -#define map_DEC_Technical(code) /* nothing */ -#define map_DEC_Turkish_Supp(code) /* nothing */ -#define map_ISO_Greek_Supp(code) /* nothing */ -#define map_ISO_Hebrew(code) /* nothing */ -#define map_ISO_Latin_2(code) /* nothing */ -#define map_ISO_Latin_5(code) /* nothing */ -#define map_ISO_Latin_Cyrillic(code) /* nothing */ -#define map_NRCS_Greek(code) /* nothing */ -#define map_NRCS_Hebrew(code) /* nothing */ -#define map_NRCS_Turkish(code) /* nothing */ -#endif /* OPT_WIDE_CHARS */ +static Boolean +isSevenBit(DECNRCM_codes cs) +{ + Boolean result = False; + + switch (cs) { + case nrc_ISO_Greek_Supp: + case nrc_ISO_Hebrew_Supp: + case nrc_ISO_Latin_1_Supp: + case nrc_ISO_Latin_2_Supp: + case nrc_ISO_Latin_5_Supp: + case nrc_ISO_Latin_Cyrillic: + case nrc_DEC_UPSS: + break; + /* VT100 character sets */ + case nrc_ASCII: + case nrc_British: + case nrc_DEC_Alt_Chars: + case nrc_DEC_Spec_Graphic: + /* VT220 character sets */ + case nrc_DEC_Alt_Graphics: + case nrc_DEC_Supp: + /* VT320 character sets */ + case nrc_DEC_Supp_Graphic: + case nrc_DEC_Technical: + /* NRCS character sets (VT320 to VT520) */ + case nrc_British_Latin_1: + case nrc_Dutch: + case nrc_Finnish2: + case nrc_Finnish: + case nrc_French2: + case nrc_French: + case nrc_French_Canadian2: + case nrc_French_Canadian: + case nrc_German: + case nrc_Greek: + case nrc_Hebrew: + case nrc_Italian: + case nrc_Norwegian_Danish2: + case nrc_Norwegian_Danish3: + case nrc_Norwegian_Danish: + case nrc_Portugese: + case nrc_Russian: + case nrc_SCS_NRCS: + case nrc_Spanish: + case nrc_Swedish2: + case nrc_Swedish: + case nrc_Swiss: + case nrc_Turkish: + /* other DEC character sets */ + case nrc_DEC_Cyrillic: + case nrc_DEC_Greek_Supp: + case nrc_DEC_Hebrew_Supp: + case nrc_DEC_Turkish_Supp: + result = True; + break; + case nrc_Unknown: + break; + } + return result; +} /* * Translate an input keysym to the corresponding NRC keysym. @@ -1401,12 +141,12 @@ unsigned xtermCharSetIn(XtermWidget xw, unsigned code, DECNRCM_codes charset) { TScreen *screen = TScreenOf(xw); -#define MAP(to, from) case from: code = to; break +#define MAP(to, from) case from: code = to; break; #if OPT_WIDE_CHARS -#define UNI(to, from) case from: if (screen->utf8_nrc_mode) code = to; break +#define UNI(to, from) case from: if (screen->utf8_nrc_mode) code = to; break; #else -#define UNI(to, from) case from: break +#define UNI(to, from) case from: break; #endif #define XXX(to, from) /* no defined mapping to 0..255 */ @@ -1417,7 +157,8 @@ xtermCharSetIn(XtermWidget xw, unsigned code, DECNRCM_codes charset) screen->curss, visibleUChar(code))); - (void) screen; + HandleUPSS(charset); + switch (charset) { case nrc_British: /* United Kingdom set (or Latin 1) */ if (code == XK_sterling) @@ -1517,7 +258,7 @@ xtermCharSetIn(XtermWidget xw, unsigned code, DECNRCM_codes charset) map_NRCS_Portuguese(code); break; - case nrc_SCS_NRCS: /* vt5xx - probably Serbo/Croatian */ + case nrc_SCS_NRCS: /* vt5xx - Serbo/Croatian */ /* FIXME */ break; @@ -1551,6 +292,7 @@ xtermCharSetIn(XtermWidget xw, unsigned code, DECNRCM_codes charset) case nrc_Russian: case nrc_French_Canadian2: case nrc_Unknown: + case nrc_DEC_UPSS: default: /* any character sets we don't recognize */ break; } @@ -1567,21 +309,26 @@ xtermCharSetIn(XtermWidget xw, unsigned code, DECNRCM_codes charset) * Translate a string to the display form. This assumes the font has the * DEC graphic characters in cells 0-31, and otherwise is ISO-8859-1. */ -int -xtermCharSetOut(XtermWidget xw, IChar *buf, IChar *ptr, DECNRCM_codes leftset) +Cardinal +xtermCharSetOut(XtermWidget xw, Cardinal length, DECNRCM_codes leftset) { + IChar *buf = xw->work.write_text; + IChar *ptr = buf + length; IChar *s; TScreen *screen = TScreenOf(xw); - int count = 0; + Cardinal count = 0; DECNRCM_codes rightset = screen->gsets[(int) (screen->curgr)]; +#if OPT_DEC_RECTOPS + int sums = 0; +#endif -#define MAP(from, to) case from: chr = to; break +#define MAP(from, to) case from: chr = to; break; #if OPT_WIDE_CHARS -#define UNI(from, to) case from: if (screen->utf8_nrc_mode) chr = to; break +#define UNI(from, to) case from: if (screen->utf8_nrc_mode) chr = to; break; #define XXX(from, to) UNI(from, to) #else -#define UNI(old, new) chr = old; break +#define UNI(old, new) case new: chr = old; break; #define XXX(from, to) /* nothing */ #endif @@ -1589,7 +336,19 @@ xtermCharSetOut(XtermWidget xw, IChar *buf, IChar *ptr, DECNRCM_codes leftset) visibleScsCode(leftset), screen->curgl, visibleScsCode(rightset), screen->curgr, screen->curss, - visibleIChars(buf, (unsigned) (ptr - buf)))); + visibleIChars(buf, (size_t) length))); + + assert(length != 0); +#if OPT_DEC_RECTOPS + if (length != 0 && length > xw->work.sizeof_sums) { + xw->work.sizeof_sums += length + 80; + xw->work.buffer_sums = realloc(xw->work.buffer_sums, + xw->work.sizeof_sums); + xw->work.buffer_sets = realloc(xw->work.buffer_sets, + xw->work.sizeof_sums); + } + xw->work.write_sums = xw->work.buffer_sums; +#endif for (s = buf; s < ptr; ++s) { int eight = CharOf(E2A(*s)); @@ -1597,6 +356,17 @@ xtermCharSetOut(XtermWidget xw, IChar *buf, IChar *ptr, DECNRCM_codes leftset) DECNRCM_codes cs = (eight >= 128) ? rightset : leftset; int chr = eight; + HandleUPSS(cs); + +#if OPT_DEC_RECTOPS + if (xw->work.buffer_sums != NULL && xw->work.buffer_sets != NULL) { + xw->work.buffer_sums[sums] = (Char) ((eight < 32 || eight > 255) + ? ANSI_ESC + : eight); + xw->work.buffer_sets[sums] = cs; + ++sums; + } +#endif count++; #if OPT_WIDE_CHARS /* @@ -1613,10 +383,11 @@ xtermCharSetOut(XtermWidget xw, IChar *buf, IChar *ptr, DECNRCM_codes leftset) continue; switch (cs) { + case nrc_DEC_UPSS: + break; + case nrc_ISO_Latin_1_Supp: - /* FALLTHRU */ case nrc_British_Latin_1: - /* FALLTHRU */ case nrc_British: /* United Kingdom set (or Latin 1) */ if ((xw->flags & NATIONAL) || (screen->vtXX_level <= 1)) { @@ -1631,8 +402,6 @@ xtermCharSetOut(XtermWidget xw, IChar *buf, IChar *ptr, DECNRCM_codes leftset) } #endif } - } else { - chr = (seven | 0x80); } break; @@ -1657,11 +426,8 @@ xtermCharSetOut(XtermWidget xw, IChar *buf, IChar *ptr, DECNRCM_codes leftset) break; case nrc_DEC_Supp: - map_DEC_Supp_Graphic(chr = seven, chr |= 0x80); - break; - case nrc_DEC_Supp_Graphic: - map_DEC_Supp_Graphic(chr = seven, chr |= 0x80); + map_DEC_Supp_Graphic(chr = seven, chr = eight); break; case nrc_DEC_Technical: @@ -1741,7 +507,7 @@ xtermCharSetOut(XtermWidget xw, IChar *buf, IChar *ptr, DECNRCM_codes leftset) map_NRCS_Portuguese(chr = seven); break; - case nrc_SCS_NRCS: /* vt5xx - probably Serbo/Croatian */ + case nrc_SCS_NRCS: /* vt5xx - Serbo/Croatian */ /* FIXME */ break; @@ -1773,28 +539,241 @@ xtermCharSetOut(XtermWidget xw, IChar *buf, IChar *ptr, DECNRCM_codes leftset) case nrc_Russian: case nrc_Unknown: default: /* any character sets we don't recognize */ - count--; break; } /* * The state machine already treated DEL as a nonprinting and * nonspacing character. If we have DEL now, remove it. */ - if (chr == ANSI_DEL) { + if (chr == ANSI_DEL && isSevenBit(cs)) { IChar *s1; --ptr; for (s1 = s; s1 < ptr; ++s1) { s1[0] = s1[1]; } + --count; +#if OPT_DEC_RECTOPS + --sums; +#endif } else { + if (eight >= 128 && chr < 128 && chr > 32) + chr |= 128; *s = (IChar) A2E(chr); } } TRACE(("%d\t%s\n", count, - visibleIChars(buf, (unsigned) (ptr - buf)))); + visibleIChars(buf, (size_t) length))); return count; #undef MAP #undef UNI #undef XXX } + +#if OPT_DEC_RECTOPS +/* + * Given a mapped character, e.g., a Unicode value returned by xtermCharSetIn, + * match it against the current GL/GR selection and return the corresponding + * DEC internal character-set code for DECRQCRA. + * + * A hardware terminal presumably stores the original and mapped characters, + * as well as the character set which was selected at that time Doing that + * in xterm adds a couple of bytes to every cell. + */ +int +xtermCharSetDec(XtermWidget xw, IChar chr, DECNRCM_codes cs) +{ +#define MAP(from, to) case from: result = to; break; + +#define DFTMAP() result = (actual | 0x80) +#define DFT_94(chr) result = ((actual) & 0x7f) +#define DFT_96(chr) result = ((actual) | 0x80) + +#if OPT_WIDE_CHARS +#define UNI(from, to) case from: if (screen->utf8_nrc_mode) result = to; break; +#define XXX(from, to) UNI(from, to) +#else +#define UNI(old, new) case new: result = old; break; +#define XXX(from, to) /* nothing */ +#endif + + int result; + + if (chr < 0x20 +#if OPT_WIDE_CHARS + || chr > 0xff +#endif + ) { + result = ANSI_ESC; + } else { + Boolean isSeven = isSevenBit(cs); + TScreen *screen = TScreenOf(xw); + + result = -1; + + HandleUPSS(cs); + + if (chr == 0xa0 && isSeven) { + result = ANSI_ESC; + } else if (chr == ANSI_SPA && isSeven) { + result = ANSI_SPA; + } else if ((chr == ANSI_DEL || chr == 0xff) && isSeven) { + result = 0; + } else { + int actual = (int) chr; + chr &= 0x7f; + + switch (cs) { + case nrc_DEC_Alt_Chars: + case nrc_DEC_Alt_Graphics: + case nrc_ASCII: + result = (int) chr; + break; + + case nrc_British: + if (chr >= 0xa0 && chr < 0xff) { + if (chr == 0x23) + chr = 0xA3; + result = (int) chr; + } + break; + + case nrc_DEC_Cyrillic: + unmap_DEC_Cyrillic(chr, DFT_94(chr)); + break; + + case nrc_DEC_Spec_Graphic: + unmap_DEC_Spec_Graphic(chr, DFT_94(chr)); + break; + + case nrc_DEC_Supp: + /* FALLTHRU */ + case nrc_DEC_Supp_Graphic: + unmap_DEC_Supp_Graphic(chr, DFTMAP()); + break; + + case nrc_DEC_Technical: + unmap_DEC_Technical(chr, DFTMAP()); + break; + + case nrc_Dutch: + unmap_NRCS_Dutch(chr, DFT_94(chr)); + break; + + case nrc_Finnish: + case nrc_Finnish2: + unmap_NRCS_Finnish(chr, DFT_94(chr)); + break; + + case nrc_French: + case nrc_French2: + unmap_NRCS_French(chr, DFT_94(chr)); + break; + + case nrc_French_Canadian: + case nrc_French_Canadian2: + unmap_NRCS_French_Canadian(chr, DFT_94(chr)); + break; + + case nrc_German: + unmap_NRCS_German(chr, DFT_94(chr)); + break; + + case nrc_Greek: + unmap_NRCS_Greek(chr, DFT_94(chr)); + break; + + case nrc_DEC_Greek_Supp: + unmap_DEC_Greek_Supp(chr, DFTMAP()); + break; + + case nrc_ISO_Greek_Supp: + unmap_ISO_Greek_Supp(chr, DFTMAP()); + break; + + case nrc_DEC_Hebrew_Supp: + unmap_DEC_Hebrew_Supp(chr, DFTMAP()); + break; + + case nrc_Hebrew: + unmap_NRCS_Hebrew(chr, DFT_94(chr)); + break; + + case nrc_ISO_Hebrew_Supp: + unmap_ISO_Hebrew(chr, DFTMAP()); + break; + + case nrc_Italian: + unmap_NRCS_Italian(chr, DFT_94(chr)); + break; + + case nrc_ISO_Latin_1_Supp: + unmap_ISO_Latin_1(chr, DFTMAP()); + break; + + case nrc_ISO_Latin_2_Supp: + unmap_ISO_Latin_2(chr, DFTMAP()); + break; + + case nrc_ISO_Latin_5_Supp: + unmap_ISO_Latin_5(chr, DFTMAP()); + break; + + case nrc_ISO_Latin_Cyrillic: + unmap_ISO_Latin_Cyrillic(chr, DFTMAP()); + break; + + case nrc_Norwegian_Danish: + case nrc_Norwegian_Danish2: + case nrc_Norwegian_Danish3: + unmap_NRCS_Norwegian_Danish(chr, DFT_94(chr)); + break; + + case nrc_Portugese: + unmap_NRCS_Portuguese(chr, DFT_94(chr)); + break; + + case nrc_Spanish: + unmap_NRCS_Spanish(chr, DFT_94(chr)); + break; + + case nrc_Swedish: + case nrc_Swedish2: + unmap_NRCS_Swedish(chr, DFT_94(chr)); + break; + + case nrc_Swiss: + unmap_NRCS_Swiss(chr, DFT_94(chr)); + break; + + case nrc_DEC_Turkish_Supp: + unmap_DEC_Turkish_Supp(chr, DFTMAP()); + break; + + case nrc_Turkish: + unmap_NRCS_Turkish(chr, DFT_94(chr)); + break; + + case nrc_British_Latin_1: + case nrc_SCS_NRCS: + case nrc_Russian: + case nrc_Unknown: + case nrc_DEC_UPSS: + default: /* anything we cannot unmap */ + break; + } + if (result < 0) { + if (isSeven) { + DFT_94(chr); + } else { + DFT_96(chr); + } + } + } + } + return result; +#undef MAP +#undef UNI +#undef XXX +} +#endif /* OPT_DEC_RECTOPS */ diff --git a/app/xterm/charsets.dat b/app/xterm/charsets.dat new file mode 100644 index 000000000..125388233 --- /dev/null +++ b/app/xterm/charsets.dat @@ -0,0 +1,1302 @@ +# $XTermId: charsets.dat,v 1.32 2024/02/08 08:52:10 tom Exp $ + +# Copyright 2023,2024 by Thomas E. Dickey +# +# All Rights Reserved +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name(s) of the above copyright +# holders shall not be used in advertising or otherwise to promote the +# sale, use or other dealings in this Software without prior written +# authorization. + +# According to +# Digital ANSI-Compliant Printing Protocol +# Level 2 Programming Reference Manual +# EK-PPLV2-PM. B01 +# +# the supplementary character sets Greek, Hebrew, Latin-5 and Latin/Cyrillic +# are standardized by ISO: +# ISO Greek is 8859-7 +# ISO Hebrew is 8859-8 +# ISO Latin-5 is 8859-9 +# ISO Latin/Cyrillic is 8859-5 +# +# These are derived from the data at +# ftp://www.unicode.org/Public/MAPPINGS/ISO8859/ +# +# Note: the "figure A-xx" comments refer to EK-PPLV2-PM. + +# A "codepage" is treated different from the NRC mode: it is always enabled. +# Reuse the UNI() macros by temporarily setting its state. + +# xterm's original implementation of NRCS in 1998 was before Unicode became +# prevalent. Most of the necessary mappings could be done using definitions +# from X11/keysymdef.h, using ISO-8859-1 as the default. + +map_ASCII + A0 UNDEF 1B + FF UNDEF 10000 + +map_DEC_Spec_Graphic + 5F UNDEF 10000 + 60 U+0020 14 # nbsp, treat as blank + 61 U+0020 78 # reserved, treat as blank + 62 U+25AE 0A # black vertical rectangle + 63 U+215F 0D # "1/" + 64 U+0020 0E # "3/", not in Unicode, ignore + 65 U+0020 0B # "5/", not in Unicode, ignore + 66 U+0020 B0 # "7/", not in Unicode, ignore + 67 U+00B0 B1 # degree sign + 68 U+00B1 15 # plus-minus sign + 69 U+2192 0C # right-arrow + 6A U+2026 16 # ellipsis + 6B U+00F7 17 # divide by + 6C U+2193 18 # down arrow + 6D U+23BA 19 # bar at scan 0 + 6E U+23BA 1A # bar at scan 1 + 6F U+23BB 1B # bar at scan 2 + 70 U+23BB 1C # bar at scan 3 + 71 U+23BC 1D # bar at scan 4 + 72 U+23BC 1E # bar at scan 5 + 73 U+23BD 1F # bar at scan 6 + 74 U+23BD 80 # bar at scan 7 + 75 U+2080 81 # subscript 0 + 76 U+2081 82 # subscript 1 + 77 U+2082 83 # subscript 2 + 78 U+2083 84 # subscript 3 + 79 U+2084 85 # subscript 4 + 7A U+2085 86 # subscript 5 + 7B U+2086 C6 # subscript 6 + 7C U+2087 87 # subscript 7 + 7D U+2088 A3 # subscript 8 + 7E U+2089 B7 # subscript 9 + +map_ISO_Latin_1 + +map_NRCS_Dutch + 23 XK_sterling # U+00A3 POUND SIGN + 40 XK_threequarters # U+00BE VULGAR FRACTION THREE QUARTERS + 5B U+0133 # LATIN SMALL LIGATURE IJ + 5C XK_onehalf # U+00BD VULGAR FRACTION ONE HALF + 5D XK_bar # U+007C VERTICAL LINE + 7B XK_diaeresis # U+00A8 DIAERESIS + 7C U+0192 # LATIN SMALL LETTER F WITH HOOK (florin) + 7D XK_onequarter # U+00BC VULGAR FRACTION ONE QUARTER + 7E XK_acute # U+00B4 ACUTE ACCENT + +map_NRCS_Finnish + 5B XK_Adiaeresis # U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS + 5C XK_Odiaeresis # U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS + 5D XK_Aring # U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE + 5E XK_Udiaeresis # U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS + 60 XK_eacute # U+00E9 LATIN SMALL LETTER E WITH ACUTE + 7B XK_adiaeresis # U+00E4 LATIN SMALL LETTER A WITH DIAERESIS + 7C XK_odiaeresis # U+00F6 LATIN SMALL LETTER O WITH DIAERESIS + 7D XK_aring # U+00E5 LATIN SMALL LETTER A WITH RING ABOVE + 7E XK_udiaeresis # U+00FC LATIN SMALL LETTER U WITH DIAERESIS + +map_NRCS_French + 23 XK_sterling # U+00A3 POUND SIGN + 40 XK_agrave # U+00E0 LATIN SMALL LETTER A WITH GRAVE + 5B XK_degree # U+00B0 DEGREE SIGN + 5C XK_ccedilla # U+00E7 LATIN SMALL LETTER C WITH CEDILLA + 5D XK_section # U+00A7 SECTION SIGN + 7B XK_eacute # U+00E9 LATIN SMALL LETTER E WITH ACUTE + 7C XK_ugrave # U+00F9 LATIN SMALL LETTER U WITH GRAVE + 7D XK_egrave # U+00E8 LATIN SMALL LETTER E WITH GRAVE + 7E XK_diaeresis # U+00A8 DIAERESIS + +map_NRCS_French_Canadian + 40 XK_agrave # U+00E0 LATIN SMALL LETTER A WITH GRAVE + 5B XK_acircumflex # U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX + 5C XK_ccedilla # U+00E7 LATIN SMALL LETTER C WITH CEDILLA + 5D XK_ecircumflex # U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX + 5E XK_icircumflex # U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX + 60 XK_ocircumflex # U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX + 7B XK_eacute # U+00E9 LATIN SMALL LETTER E WITH ACUTE + 7C XK_ugrave # U+00F9 LATIN SMALL LETTER U WITH GRAVE + 7D XK_egrave # U+00E8 LATIN SMALL LETTER E WITH GRAVE + 7E XK_ucircumflex # U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX + +map_NRCS_German + 40 XK_section # U+00A7 SECTION SIGN + 5B XK_Adiaeresis # U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS + 5C XK_Odiaeresis # U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS + 5D XK_Udiaeresis # U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS + 7B XK_adiaeresis # U+00E4 LATIN SMALL LETTER A WITH DIAERESIS + 7C XK_odiaeresis # U+00F6 LATIN SMALL LETTER O WITH DIAERESIS + 7D XK_udiaeresis # U+00FC LATIN SMALL LETTER U WITH DIAERESIS + 7E XK_ssharp # U+00DF LATIN SMALL LETTER SHARP S + +map_NRCS_Italian + 23 XK_sterling # U+00A3 POUND SIGN + 40 XK_section # U+00A7 SECTION SIGN + 5B XK_degree # U+00B0 DEGREE SIGN + 5C XK_ccedilla # U+00E7 LATIN SMALL LETTER C WITH CEDILLA + 5D XK_eacute # U+00E9 LATIN SMALL LETTER E WITH ACUTE + 60 XK_ugrave # U+00F9 LATIN SMALL LETTER U WITH GRAVE + 7B XK_agrave # U+00E0 LATIN SMALL LETTER A WITH GRAVE + 7C XK_ograve # U+00F2 LATIN SMALL LETTER O WITH GRAVE + 7D XK_egrave # U+00E8 LATIN SMALL LETTER E WITH GRAVE + 7E XK_igrave # U+00EC LATIN SMALL LETTER I WITH GRAVE + +map_NRCS_Norwegian_Danish + 40 XK_Adiaeresis # U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS + 5B XK_AE # U+00C6 LATIN CAPITAL LETTER AE + 5C XK_Ooblique # U+00D8 LATIN CAPITAL LETTER O WITH STROKE + 5D XK_Aring # U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE + 5E XK_Udiaeresis # U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS + 60 XK_adiaeresis # U+00E4 LATIN SMALL LETTER A WITH DIAERESIS + 7B XK_ae # U+00E6 LATIN SMALL LETTER AE + 7C XK_oslash # U+00F8 LATIN SMALL LETTER O WITH STROKE + 7D XK_aring # U+00E5 LATIN SMALL LETTER A WITH RING ABOVE + 7E XK_udiaeresis # U+00FC LATIN SMALL LETTER U WITH DIAERESIS + +map_NRCS_Portuguese + 5B XK_Atilde # U+00C3 LATIN CAPITAL LETTER A WITH TILDE + 5C XK_Ccedilla # U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA + 5D XK_Otilde # U+00D5 LATIN CAPITAL LETTER O WITH TILDE + 7B XK_atilde # U+00E3 LATIN SMALL LETTER A WITH TILDE + 7C XK_ccedilla # U+00E7 LATIN SMALL LETTER C WITH CEDILLA + 7D XK_otilde # U+00F5 LATIN SMALL LETTER O WITH TILDE + +map_NRCS_Spanish + 23 XK_sterling # U+00A3 POUND SIGN + 40 XK_section # U+00A7 SECTION SIGN + 5B XK_exclamdown # U+00A1 INVERTED EXCLAMATION MARK + 5C XK_Ntilde # U+00D1 LATIN CAPITAL LETTER N WITH TILDE + 5D XK_questiondown # U+00BF INVERTED QUESTION MARK + 7B XK_degree # U+00B0 DEGREE SIGN + 7C XK_ntilde # U+00F1 LATIN SMALL LETTER N WITH TILDE + 7D XK_ccedilla # U+00E7 LATIN SMALL LETTER C WITH CEDILLA + +map_NRCS_Swedish + 40 XK_Eacute + 5B XK_Adiaeresis # U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS + 5C XK_Odiaeresis # U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS + 5D XK_Aring # U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE + 5E XK_Udiaeresis # U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS + 60 XK_eacute # U+00E9 LATIN SMALL LETTER E WITH ACUTE + 7B XK_adiaeresis # U+00E4 LATIN SMALL LETTER A WITH DIAERESIS + 7C XK_odiaeresis # U+00F6 LATIN SMALL LETTER O WITH DIAERESIS + 7D XK_aring # U+00E5 LATIN SMALL LETTER A WITH RING ABOVE + 7E XK_udiaeresis # U+00FC LATIN SMALL LETTER U WITH DIAERESIS + +map_NRCS_Swiss + 23 XK_ugrave # U+00F9 LATIN SMALL LETTER U WITH GRAVE + 40 XK_agrave # U+00E0 LATIN SMALL LETTER A WITH GRAVE + 5B XK_eacute # U+00E9 LATIN SMALL LETTER E WITH ACUTE + 5C XK_ccedilla # U+00E7 LATIN SMALL LETTER C WITH CEDILLA + 5D XK_ecircumflex # U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX + 5E XK_icircumflex # U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX + 5F XK_egrave # U+00E8 LATIN SMALL LETTER E WITH GRAVE + 60 XK_ocircumflex # U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX + 7B XK_adiaeresis # U+00E4 LATIN SMALL LETTER A WITH DIAERESIS + 7C XK_odiaeresis # U+00F6 LATIN SMALL LETTER O WITH DIAERESIS + 7D XK_udiaeresis # U+00FC LATIN SMALL LETTER U WITH DIAERESIS + 7E XK_ucircumflex # U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX + +# Unlike NRCS, which splices a few characters onto ISO-8859-1, the +# supplementary character sets are complete, normally mapped to GR. Most of +# these mappings rely upon glyphs not found in ISO-8859-1. We can display most +# of those using Unicode, thereby supporting specialized applications that use +# SCS with luit, subject to the limitation that select/paste will give +# meaningless results in terms of the application which uses these mappings. +# +# Since the codepages introduced with VT320, etc, use 8-bit encodings, there is +# no plausible argument to be made that these mappings "use" UTF-8, even though +# there is a hidden step in the terminal emulator which relies upon UTF-8. + +map_DEC_Supp_Graphic(code,dft) + 24 UNDEF 1B + 26 UNDEF 1B + 28 U+00A4 A4 # CURRENCY SIGN + 2C UNDEF 1B + 2D UNDEF 1B + 2E UNDEF 1B + 2F UNDEF 1B + 34 UNDEF 1B + 38 UNDEF 1B + 3E UNDEF 1B + 50 UNDEF 1B + 57 U+0152 97 # LATIN CAPITAL LIGATURE OE + 5D U+0178 98 # LATIN CAPITAL LETTER Y WITH DIAERESIS + 5E UNDEF 1B + 5F U+005F DF + 70 UNDEF 1B + 77 U+0153 99 # LATIN SMALL LIGATURE OE + 7D U+00FF FF # LATIN SMALL LETTER Y WITH DIAERESIS + 7E UNDEF 1B + +# derived from http://www.vt100.net/charsets/technical.html +map_DEC_Technical + 21 U+23B7 D5 # RADICAL SYMBOL BOTTOM Centred left to right, so that it joins up with 02/02 + 22 U+250C D6 # BOX DRAWINGS LIGHT DOWN AND RIGHT + 23 U+2500 1D # BOX DRAWINGS LIGHT HORIZONTAL + 24 U+2320 D7 # TOP HALF INTEGRAL with the proviso that the stem is vertical, to join with 02/06 + 25 U+2321 D8 # BOTTOM HALF INTEGRAL with the proviso above. + 26 U+2502 84 # BOX DRAWINGS LIGHT VERTICAL + 27 U+23A1 D9 # LEFT SQUARE BRACKET UPPER CORNER Joins vertically to 02/06, 02/08. Doesn't join to its right. + 28 U+23A3 DA # LEFT SQUARE BRACKET LOWER CORNER Joins vertically to 02/06, 02/07. Doesn't join to its right. + 29 U+23A4 DB # RIGHT SQUARE BRACKET UPPER CORNER Joins vertically to 026, 02a. Doesn't join to its left. + 2A U+23A6 DC # RIGHT SQUARE BRACKET LOWER CORNER Joins vertically to 026, 029. Doesn't join to its left. + 2B U+23A7 DD # LEFT CURLY BRACKET UPPER HOOK Joins vertically to 026, 02c, 02/15. Doesn't join to its right. + 2C U+23A9 DE # LEFT CURLY BRACKET LOWER HOOK Joins vertically to 026, 02b, 02/15. Doesn't join to its right. + 2D U+23AB DF # RIGHT CURLY BRACKET UPPER HOOK Joins vertically to 026, 02e, 03/00. Doesn't join to its left. + 2E U+23AD E0 # RIGHT CURLY BRACKET LOWER HOOK Joins vertically to 026, 02d, 03/00. Doesn't join to its left. + 2F U+23A8 E1 # LEFT CURLY BRACKET MIDDLE PIECE Joins vertically to 026, 02b, 02c. + 30 U+23AC E2 # RIGHT CURLY BRACKET MIDDLE PIECE Joins vertically to 02/06, 02d, 02e. + 31 PUA(0) E3 # Top Left Sigma. Joins to right with 02/03, 03/05. Joins diagonally below right with 03/03, 03/07. + 32 PUA(1) E4 # Bottom Left Sigma. Joins to right with 02/03, 03/06. Joins diagonally above right with 03/04, 03/07. + 33 PUA(2) E5 # Top Diagonal Sigma. Line for joining 03/01 to 03/04 or 03/07. + 34 PUA(3) E6 # Bottom Diagonal Sigma. Line for joining 03/02 to 03/03 or 03/07. + 35 PUA(4) E7 # Top Right Sigma. Joins to left with 02/03, 03/01. + 36 PUA(5) E8 # Bottom Right Sigma. Joins to left with 02/03, 03/02. + 37 PUA(6) E9 # Middle Sigma. Joins diagonally with 03/01, 03/02, 03/03, 03/04. + 38 UNDEF 1B # undefined + 39 UNDEF 1B # undefined + 3A UNDEF 1B # undefined + 3B UNDEF 1B # undefined + 3C U+2264 85 # LESS-THAN OR EQUAL TO + 3D U+2260 87 # NOT EQUAL TO + 3E U+2265 86 # GREATER-THAN OR EQUAL TO + 3F U+222B EA # INTEGRAL + 40 U+2234 EB # THEREFORE + 41 U+221D EC # PROPORTIONAL TO + 42 U+221E ED # INFINITY + 43 U+00F7 F7 # DIVISION SIGN + 44 U+0394 EE # GREEK CAPITAL DELTA + 45 U+2207 EF # NABLA + 46 U+03A6 AC # GREEK CAPITAL LETTER PHI + 47 U+0393 78 # GREEK CAPITAL LETTER GAMMA + 48 U+223C F0 # TILDE OPERATOR + 49 U+2243 F1 # ASYMPTOTICALLY EQUAL TO + 4A U+0398 7D # GREEK CAPITAL LETTER THETA + 4B U+00D7 D7 # MULTIPLICATION SIGN + 4C U+039B A2 # GREEK CAPITAL LETTER LAMDA + 4D U+21D4 F2 # LEFT RIGHT DOUBLE ARROW + 4E U+21D2 F3 # RIGHTWARDS DOUBLE ARROW + 4F U+2261 F4 # IDENTICAL TO + 50 U+03A0 A7 # GREEK CAPITAL LETTER PI + 51 U+03A8 AE # GREEK CAPITAL LETTER PSI + 52 UNDEF 1B # undefined + 53 U+03A3 A9 # GREEK CAPITAL LETTER SIGMA + 54 UNDEF 1B # undefined + 55 UNDEF 1B # undefined + 56 U+221A F5 # SQUARE ROOT + 57 U+03A9 AF # GREEK CAPITAL LETTER OMEGA + 58 U+039E A5 # GREEK CAPITAL LETTER XI + 59 U+03A5 AB # GREEK CAPITAL LETTER UPSILON + 5A U+2282 F6 # SUBSET OF + 5B U+2283 F7 # SUPERSET OF + 5C U+2229 F8 # INTERSECTION + 5D U+222A F9 # UNION + 5E U+2227 FA # LOGICAL AND + 5F U+2228 FB # LOGICAL OR + 60 U+00AC AC # NOT SIGN + 61 U+03B1 B7 # GREEK SMALL LETTER ALPHA + 62 U+03B2 B8 # GREEK SMALL LETTER BETA + 63 U+03C7 CD # GREEK SMALL LETTER CHI + 64 U+03B4 BA # GREEK SMALL LETTER DELTA + 65 U+03B5 BB # GREEK SMALL LETTER EPSILON + 66 U+03C6 CC # GREEK SMALL LETTER PHI + 67 U+03B3 B9 # GREEK SMALL LETTER GAMMA + 68 U+03B7 BD # GREEK SMALL LETTER ETA + 69 U+03B9 BF # GREEK SMALL LETTER IOTA + 6A U+03B8 BE # GREEK SMALL LETTER THETA + 6B U+03BA C0 # GREEK SMALL LETTER KAPPA + 6C U+03BB C1 # GREEK SMALL LETTER LAMDA + 6D UNDEF 1B # undefined + 6E U+03BD C3 # GREEK SMALL LETTER NU + 6F U+2202 FC # PARTIAL DIFFERENTIAL + 70 U+03C0 C6 # GREEK SMALL LETTER PI + 71 U+03C8 CE # GREEK SMALL LETTER PSI + 72 U+03C1 C7 # GREEK SMALL LETTER RHO + 73 U+03C3 C9 # GREEK SMALL LETTER SIGMA + 74 U+03C4 CA # GREEK SMALL LETTER TAU + 75 UNDEF 1B # undefined + 76 U+0192 FD # LATIN SMALL LETTER F WITH HOOK Probably chosen for its meaning of "function" + 77 U+03C9 CF # GREEK SMALL LETTER OMEGA + 78 U+03BE C4 # GREEK SMALL LETTER XI + 79 U+03C5 CB # GREEK SMALL LETTER UPSILON + 7A U+03B6 BC # GREEK SMALL LETTER ZETA + 7B U+2190 FE # LEFTWARDS ARROW + 7C U+2191 FF # UPWARDS ARROW + 7D U+2192 100 # RIGHTWARDS ARROW + 7E U+2193 02 # DOWNWARDS ARROW + +# ISO Latin/Cyrillic is 8859-5 +map_ISO_Latin_Cyrillic + 20 U+00A0 # NO-BREAK SPACE + 21 U+0401 03 # CYRILLIC CAPITAL LETTER IO + 22 U+0402 04 # CYRILLIC CAPITAL LETTER DJE + 23 U+0403 05 # CYRILLIC CAPITAL LETTER GJE + 24 U+0404 06 # CYRILLIC CAPITAL LETTER UKRAINIAN IE + 25 U+0405 07 # CYRILLIC CAPITAL LETTER DZE + 26 U+0406 08 # CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I + 27 U+0407 09 # CYRILLIC CAPITAL LETTER YI + 28 U+0408 0A # CYRILLIC CAPITAL LETTER JE + 29 U+0409 0B # CYRILLIC CAPITAL LETTER LJE + 2A U+040A 0C # CYRILLIC CAPITAL LETTER NJE + 2B U+040B 0D # CYRILLIC CAPITAL LETTER TSHE + 2C U+040C 0E # CYRILLIC CAPITAL LETTER KJE + 2D U+00AD # SOFT HYPHEN + 2E U+040E 0F # CYRILLIC CAPITAL LETTER SHORT U + 2F U+040F 10 # CYRILLIC CAPITAL LETTER DZHE + 30 U+0410 11 # CYRILLIC CAPITAL LETTER A + 31 U+0411 12 # CYRILLIC CAPITAL LETTER BE + 32 U+0412 13 # CYRILLIC CAPITAL LETTER VE + 33 U+0413 14 # CYRILLIC CAPITAL LETTER GHE + 34 U+0414 15 # CYRILLIC CAPITAL LETTER DE + 35 U+0415 16 # CYRILLIC CAPITAL LETTER IE + 36 U+0416 17 # CYRILLIC CAPITAL LETTER ZHE + 37 U+0417 18 # CYRILLIC CAPITAL LETTER ZE + 38 U+0418 19 # CYRILLIC CAPITAL LETTER I + 39 U+0419 1A # CYRILLIC CAPITAL LETTER SHORT I + 3A U+041A 1B # CYRILLIC CAPITAL LETTER KA + 3B U+041B 1C # CYRILLIC CAPITAL LETTER EL + 3C U+041C 1D # CYRILLIC CAPITAL LETTER EM + 3D U+041D 1E # CYRILLIC CAPITAL LETTER EN + 3E U+041E 1F # CYRILLIC CAPITAL LETTER O + 3F U+041F 20 # CYRILLIC CAPITAL LETTER PE + 40 U+0420 21 # CYRILLIC CAPITAL LETTER ER + 41 U+0421 22 # CYRILLIC CAPITAL LETTER ES + 42 U+0422 23 # CYRILLIC CAPITAL LETTER TE + 43 U+0423 24 # CYRILLIC CAPITAL LETTER U + 44 U+0424 25 # CYRILLIC CAPITAL LETTER EF + 45 U+0425 26 # CYRILLIC CAPITAL LETTER HA + 46 U+0426 27 # CYRILLIC CAPITAL LETTER TSE + 47 U+0427 28 # CYRILLIC CAPITAL LETTER CHE + 48 U+0428 29 # CYRILLIC CAPITAL LETTER SHA + 49 U+0429 2A # CYRILLIC CAPITAL LETTER SHCHA + 4A U+042A 2B # CYRILLIC CAPITAL LETTER HARD SIGN + 4B U+042B 2C # CYRILLIC CAPITAL LETTER YERU + 4C U+042C 2D # CYRILLIC CAPITAL LETTER SOFT SIGN + 4D U+042D 2E # CYRILLIC CAPITAL LETTER E + 4E U+042E 2F # CYRILLIC CAPITAL LETTER YU + 4F U+042F 30 # CYRILLIC CAPITAL LETTER YA + 50 U+0430 31 # CYRILLIC SMALL LETTER A + 51 U+0431 32 # CYRILLIC SMALL LETTER BE + 52 U+0432 33 # CYRILLIC SMALL LETTER VE + 53 U+0433 34 # CYRILLIC SMALL LETTER GHE + 54 U+0434 35 # CYRILLIC SMALL LETTER DE + 55 U+0435 36 # CYRILLIC SMALL LETTER IE + 56 U+0436 37 # CYRILLIC SMALL LETTER ZHE + 57 U+0437 38 # CYRILLIC SMALL LETTER ZE + 58 U+0438 39 # CYRILLIC SMALL LETTER I + 59 U+0439 3A # CYRILLIC SMALL LETTER SHORT I + 5A U+043A 3B # CYRILLIC SMALL LETTER KA + 5B U+043B 3C # CYRILLIC SMALL LETTER EL + 5C U+043C 3D # CYRILLIC SMALL LETTER EM + 5D U+043D 3E # CYRILLIC SMALL LETTER EN + 5E U+043E 3F # CYRILLIC SMALL LETTER O + 5F U+043F 40 # CYRILLIC SMALL LETTER PE + 60 U+0440 41 # CYRILLIC SMALL LETTER ER + 61 U+0441 42 # CYRILLIC SMALL LETTER ES + 62 U+0442 43 # CYRILLIC SMALL LETTER TE + 63 U+0443 44 # CYRILLIC SMALL LETTER U + 64 U+0444 45 # CYRILLIC SMALL LETTER EF + 65 U+0445 46 # CYRILLIC SMALL LETTER HA + 66 U+0446 47 # CYRILLIC SMALL LETTER TSE + 67 U+0447 48 # CYRILLIC SMALL LETTER CHE + 68 U+0448 49 # CYRILLIC SMALL LETTER SHA + 69 U+0449 4A # CYRILLIC SMALL LETTER SHCHA + 6A U+044A 4B # CYRILLIC SMALL LETTER HARD SIGN + 6B U+044B 4C # CYRILLIC SMALL LETTER YERU + 6C U+044C 4D # CYRILLIC SMALL LETTER SOFT SIGN + 6D U+044D 4E # CYRILLIC SMALL LETTER E + 6E U+044E 4F # CYRILLIC SMALL LETTER YU + 6F U+044F 50 # CYRILLIC SMALL LETTER YA + 70 U+2116 51 # NUMERO SIGN + 71 U+0451 52 # CYRILLIC SMALL LETTER IO + 72 U+0452 53 # CYRILLIC SMALL LETTER DJE + 73 U+0453 54 # CYRILLIC SMALL LETTER GJE + 74 U+0454 55 # CYRILLIC SMALL LETTER UKRAINIAN IE + 75 U+0455 56 # CYRILLIC SMALL LETTER DZE + 76 U+0456 57 # CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I + 77 U+0457 58 # CYRILLIC SMALL LETTER YI + 78 U+0458 59 # CYRILLIC SMALL LETTER JE + 79 U+0459 5A # CYRILLIC SMALL LETTER LJE + 7A U+045A 5B # CYRILLIC SMALL LETTER NJE + 7B U+045B 5C # CYRILLIC SMALL LETTER TSHE + 7C U+045C 5D # CYRILLIC SMALL LETTER KJE + 7D U+00A7 A7 # SECTION SIGN + 7E U+045E 5E # CYRILLIC SMALL LETTER SHORT U + 7F U+045F 5F # CYRILLIC SMALL LETTER DZHE + +# ISO Greek is 8859-7 +map_ISO_Greek_Supp + 20 U+00A0 # NO-BREAK SPACE + 21 U+2018 60 # LEFT SINGLE QUOTATION MARK + 22 U+2019 27 # RIGHT SINGLE QUOTATION MARK + 23 U+00A3 # POUND SIGN + 24 UNDEF 1B # undefined + 25 UNDEF 1B # undefined + 26 U+00A6 # BROKEN BAR + 27 U+00A7 # SECTION SIGN + 28 U+00A8 # DIAERESIS + 29 U+00A9 # COPYRIGHT SIGN + 2A UNDEF 1B # undefined + 2B U+00AB # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK + 2C U+00AC # NOT SIGN + 2D U+00AD # SOFT HYPHEN + 2E UNDEF 1B # undefined + 2F U+2015 2D # HORIZONTAL BAR + 30 U+00B0 # DEGREE SIGN + 31 U+00B1 # PLUS-MINUS SIGN + 32 U+00B2 # SUPERSCRIPT TWO + 33 U+00B3 # SUPERSCRIPT THREE + 34 U+0384 96 # GREEK TONOS + 35 U+0385 95 # GREEK DIALYTIKA TONOS + 36 U+0386 6E # GREEK CAPITAL LETTER ALPHA WITH TONOS + 37 U+00B7 # MIDDLE DOT + 38 U+0388 6F # GREEK CAPITAL LETTER EPSILON WITH TONOS + 39 U+0389 70 # GREEK CAPITAL LETTER ETA WITH TONOS + 3A U+038A 71 # GREEK CAPITAL LETTER IOTA WITH TONOS + 3B U+00BB # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK + 3C U+038C 72 # GREEK CAPITAL LETTER OMICRON WITH TONOS + 3D U+00BD # VULGAR FRACTION ONE HALF + 3E U+038E 73 # GREEK CAPITAL LETTER UPSILON WITH TONOS + 3F U+038F 74 # GREEK CAPITAL LETTER OMEGA WITH TONOS + 40 U+0390 75 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS + 41 U+0391 76 # GREEK CAPITAL LETTER ALPHA + 42 U+0392 77 # GREEK CAPITAL LETTER BETA + 43 U+0393 78 # GREEK CAPITAL LETTER GAMMA + 44 U+0394 79 # GREEK CAPITAL LETTER DELTA + 45 U+0395 7A # GREEK CAPITAL LETTER EPSILON + 46 U+0396 7B # GREEK CAPITAL LETTER ZETA + 47 U+0397 7C # GREEK CAPITAL LETTER ETA + 48 U+0398 7D # GREEK CAPITAL LETTER THETA + 49 U+0399 7E # GREEK CAPITAL LETTER IOTA + 4A U+039A 7F # GREEK CAPITAL LETTER KAPPA + 4B U+039B A2 # GREEK CAPITAL LETTER LAMDA + 4C U+039C A3 # GREEK CAPITAL LETTER MU + 4D U+039D A4 # GREEK CAPITAL LETTER NU + 4E U+039E A5 # GREEK CAPITAL LETTER XI + 4F U+039F A6 # GREEK CAPITAL LETTER OMICRON + 50 U+03A0 A7 # GREEK CAPITAL LETTER PI + 51 U+03A1 A8 # GREEK CAPITAL LETTER RHO + 52 UNDEF 1B # undefined + 53 U+03A3 A9 # GREEK CAPITAL LETTER SIGMA + 54 U+03A4 AA # GREEK CAPITAL LETTER TAU + 55 U+03A5 AB # GREEK CAPITAL LETTER UPSILON + 56 U+03A6 AC # GREEK CAPITAL LETTER PHI + 57 U+03A7 AD # GREEK CAPITAL LETTER CHI + 58 U+03A8 AE # GREEK CAPITAL LETTER PSI + 59 U+03A9 AF # GREEK CAPITAL LETTER OMEGA + 5A U+03AA B0 # GREEK CAPITAL LETTER IOTA WITH DIALYTIKA + 5B U+03AB B1 # GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA + 5C U+03AC B2 # GREEK SMALL LETTER ALPHA WITH TONOS + 5D U+03AD B3 # GREEK SMALL LETTER EPSILON WITH TONOS + 5E U+03AE B4 # GREEK SMALL LETTER ETA WITH TONOS + 5F U+03AF B5 # GREEK SMALL LETTER IOTA WITH TONOS + 60 U+03B0 B6 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS + 61 U+03B1 B7 # GREEK SMALL LETTER ALPHA + 62 U+03B2 B8 # GREEK SMALL LETTER BETA + 63 U+03B3 B9 # GREEK SMALL LETTER GAMMA + 64 U+03B4 BA # GREEK SMALL LETTER DELTA + 65 U+03B5 BB # GREEK SMALL LETTER EPSILON + 66 U+03B6 BC # GREEK SMALL LETTER ZETA + 67 U+03B7 BD # GREEK SMALL LETTER ETA + 68 U+03B8 BE # GREEK SMALL LETTER THETA + 69 U+03B9 BF # GREEK SMALL LETTER IOTA + 6A U+03BA C0 # GREEK SMALL LETTER KAPPA + 6B U+03BB C1 # GREEK SMALL LETTER LAMDA + 6C U+03BC C2 # GREEK SMALL LETTER MU + 6D U+03BD C3 # GREEK SMALL LETTER NU + 6E U+03BE C4 # GREEK SMALL LETTER XI + 6F U+03BF C5 # GREEK SMALL LETTER OMICRON + 70 U+03C0 C6 # GREEK SMALL LETTER PI + 71 U+03C1 C7 # GREEK SMALL LETTER RHO + 72 U+03C2 C8 # GREEK SMALL LETTER FINAL SIGMA + 73 U+03C3 C9 # GREEK SMALL LETTER SIGMA + 74 U+03C4 CA # GREEK SMALL LETTER TAU + 75 U+03C5 CB # GREEK SMALL LETTER UPSILON + 76 U+03C6 CC # GREEK SMALL LETTER PHI + 77 U+03C7 CD # GREEK SMALL LETTER CHI + 78 U+03C8 CE # GREEK SMALL LETTER PSI + 79 U+03C9 CF # GREEK SMALL LETTER OMEGA + 7A U+03CA D0 # GREEK SMALL LETTER IOTA WITH DIALYTIKA + 7B U+03CB D1 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA + 7C U+03CC D2 # GREEK SMALL LETTER OMICRON WITH TONOS + 7D U+03CD D3 # GREEK SMALL LETTER UPSILON WITH TONOS + 7E U+03CE D4 # GREEK SMALL LETTER OMEGA WITH TONOS + 7F UNDEF 1B # undefined + +# figure A-23 "ISO Latin-Hebrew Supplemental Character Set" +map_ISO_Hebrew + 20 U+00A0 # NO-BREAK SPACE + 21 UNDEF 1B # undefined + 22 U+00A2 # CENT SIGN + 23 U+00A3 # POUND SIGN + 24 U+00A4 # CURRENCY SIGN + 25 U+00A5 # YEN SIGN + 26 U+00A6 # BROKEN BAR + 27 U+00A7 # SECTION SIGN + 28 U+00A8 # DIAERESIS + 29 U+00A9 # COPYRIGHT SIGN + 2A U+00D7 D7 # MULTIPLICATION SIGN + 2B U+00AB # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK + 2C U+00AC # NOT SIGN + 2D U+00AD # SOFT HYPHEN + 2E U+00AE # REGISTERED SIGN + 2F U+00AF # MACRON + 30 U+00B0 # DEGREE SIGN + 31 U+00B1 # PLUS-MINUS SIGN + 32 U+00B2 # SUPERSCRIPT TWO + 33 U+00B3 # SUPERSCRIPT THREE + 34 U+00B4 # ACUTE ACCENT + 35 U+00B5 # MICRO SIGN + 36 U+00B6 # PILCROW SIGN + 37 U+00B7 # MIDDLE DOT + 38 U+00B8 # CEDILLA + 39 U+00B9 # SUPERSCRIPT ONE + 3A U+00F7 F7 # DIVISION SIGN + 3B U+00BB # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK + 3C U+00BC # VULGAR FRACTION ONE QUARTER + 3D U+00BD # VULGAR FRACTION ONE HALF + 3E U+00BE # VULGAR FRACTION THREE QUARTERS + 3F UNDEF 1B # undefined + 40 UNDEF 1B # undefined + 41 UNDEF 1B # undefined + 42 UNDEF 1B # undefined + 43 UNDEF 1B # undefined + 44 UNDEF 1B # undefined + 45 UNDEF 1B # undefined + 46 UNDEF 1B # undefined + 47 UNDEF 1B # undefined + 48 UNDEF 1B # undefined + 49 UNDEF 1B # undefined + 4A UNDEF 1B # undefined + 4B UNDEF 1B # undefined + 4C UNDEF 1B # undefined + 4D UNDEF 1B # undefined + 4E UNDEF 1B # undefined + 4F UNDEF 1B # undefined + 50 UNDEF 1B # undefined + 51 UNDEF 1B # undefined + 52 UNDEF 1B # undefined + 53 UNDEF 1B # undefined + 54 UNDEF 1B # undefined + 55 UNDEF 1B # undefined + 56 UNDEF 1B # undefined + 57 UNDEF 1B # undefined + 58 UNDEF 1B # undefined + 59 UNDEF 1B # undefined + 5A UNDEF 1B # undefined + 5B UNDEF 1B # undefined + 5C UNDEF 1B # undefined + 5D UNDEF 1B # undefined + 5E UNDEF 1B # undefined + 5F U+2017 52 # DOUBLE LOW LINE + 60 U+05D0 53 # HEBREW LETTER ALEF + 61 U+05D1 54 # HEBREW LETTER BET + 62 U+05D2 55 # HEBREW LETTER GIMEL + 63 U+05D3 56 # HEBREW LETTER DALET + 64 U+05D4 57 # HEBREW LETTER HE + 65 U+05D5 58 # HEBREW LETTER VAV + 66 U+05D6 59 # HEBREW LETTER ZAYIN + 67 U+05D7 5A # HEBREW LETTER HET + 68 U+05D8 5B # HEBREW LETTER TET + 69 U+05D9 5C # HEBREW LETTER YOD + 6A U+05DA 5D # HEBREW LETTER FINAL KAF + 6B U+05DB 5E # HEBREW LETTER KAF + 6C U+05DC 5F # HEBREW LETTER LAMED + 6D U+05DD 60 # HEBREW LETTER FINAL MEM + 6E U+05DE 61 # HEBREW LETTER MEM + 6F U+05DF 62 # HEBREW LETTER FINAL NUN + 70 U+05E0 63 # HEBREW LETTER NUN + 71 U+05E1 64 # HEBREW LETTER SAMEKH + 72 U+05E2 65 # HEBREW LETTER AYIN + 73 U+05E3 66 # HEBREW LETTER FINAL PE + 74 U+05E4 67 # HEBREW LETTER PE + 75 U+05E5 68 # HEBREW LETTER FINAL TSADI + 76 U+05E6 69 # HEBREW LETTER TSADI + 77 U+05E7 6A # HEBREW LETTER QOF + 78 U+05E8 6B # HEBREW LETTER RESH + 79 U+05E9 6C # HEBREW LETTER SHIN + 7A U+05EA 6D # HEBREW LETTER TAV + 7B UNDEF 1B # undefined + 7C UNDEF 1B # undefined + 7D UNDEF 1B # undefined + 7E UNDEF 1B # undefined + 7F UNDEF 1B # undefined + +# ISO Latin-2 is 8859-2 +map_ISO_Latin_2 + 20 U+00A0 # NO-BREAK SPACE + 21 U+0104 9A # LATIN CAPITAL LETTER A WITH OGONEK + 22 U+02D8 90 # BREVE + 23 U+0141 9B # LATIN CAPITAL LETTER L WITH STROKE + 24 U+00A4 # CURRENCY SIGN + 25 U+013D 9C # LATIN CAPITAL LETTER L WITH CARON + 26 U+015A 9D # LATIN CAPITAL LETTER S WITH ACUTE + 27 U+00A7 # SECTION SIGN + 28 U+00A8 # DIAERESIS + 29 U+0160 9E # LATIN CAPITAL LETTER S WITH CARON + 2A U+015E 9F # LATIN CAPITAL LETTER S WITH CEDILLA + 2B U+0164 21 # LATIN CAPITAL LETTER T WITH CARON + 2C U+0179 22 # LATIN CAPITAL LETTER Z WITH ACUTE + 2D U+00AD # SOFT HYPHEN + 2E U+017D 23 # LATIN CAPITAL LETTER Z WITH CARON + 2F U+017B 24 # LATIN CAPITAL LETTER Z WITH DOT ABOVE + 30 U+00B0 # DEGREE SIGN + 31 U+0105 25 # LATIN SMALL LETTER A WITH OGONEK + 32 U+02DB 91 # OGONEK + 33 U+0142 26 # LATIN SMALL LETTER L WITH STROKE + 34 U+00B4 # ACUTE ACCENT + 35 U+013E 27 # LATIN SMALL LETTER L WITH CARON + 36 U+015B 28 # LATIN SMALL LETTER S WITH ACUTE + 37 U+02C7 92 # CARON + 38 U+00B8 # CEDILLA + 39 U+0161 29 # LATIN SMALL LETTER S WITH CARON + 3A U+015F 2A # LATIN SMALL LETTER S WITH CEDILLA + 3B U+0165 2B # LATIN SMALL LETTER T WITH CARON + 3C U+017A 2C # LATIN SMALL LETTER Z WITH ACUTE + 3D U+02DD 93 # DOUBLE ACUTE ACCENT + 3E U+017E 2D # LATIN SMALL LETTER Z WITH CARON + 3F U+017C 2E # LATIN SMALL LETTER Z WITH DOT ABOVE + 40 U+0154 2F # LATIN CAPITAL LETTER R WITH ACUTE + 41 U+00C1 # LATIN CAPITAL LETTER A WITH ACUTE + 42 U+00C2 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX + 43 U+0102 30 # LATIN CAPITAL LETTER A WITH BREVE + 44 U+00C4 # LATIN CAPITAL LETTER A WITH DIAERESIS + 45 U+0139 31 # LATIN CAPITAL LETTER L WITH ACUTE + 46 U+0106 32 # LATIN CAPITAL LETTER C WITH ACUTE + 47 U+00C7 # LATIN CAPITAL LETTER C WITH CEDILLA + 48 U+010C 33 # LATIN CAPITAL LETTER C WITH CARON + 49 U+00C9 # LATIN CAPITAL LETTER E WITH ACUTE + 4A U+0118 34 # LATIN CAPITAL LETTER E WITH OGONEK + 4B U+00CB # LATIN CAPITAL LETTER E WITH DIAERESIS + 4C U+011A 35 # LATIN CAPITAL LETTER E WITH CARON + 4D U+00CD # LATIN CAPITAL LETTER I WITH ACUTE + 4E U+00CE # LATIN CAPITAL LETTER I WITH CIRCUMFLEX + 4F U+010E 36 # LATIN CAPITAL LETTER D WITH CARON + 50 U+0110 # LATIN CAPITAL LETTER D WITH STROKE + 51 U+0143 37 # LATIN CAPITAL LETTER N WITH ACUTE + 52 U+0147 38 # LATIN CAPITAL LETTER N WITH CARON + 53 U+00D3 # LATIN CAPITAL LETTER O WITH ACUTE + 54 U+00D4 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX + 55 U+0150 39 # LATIN CAPITAL LETTER O WITH DOUBLE ACUTE + 56 U+00D6 # LATIN CAPITAL LETTER O WITH DIAERESIS + 57 U+00D7 # MULTIPLICATION SIGN + 58 U+0158 3A # LATIN CAPITAL LETTER R WITH CARON + 59 U+016E 3B # LATIN CAPITAL LETTER U WITH RING ABOVE + 5A U+00DA # LATIN CAPITAL LETTER U WITH ACUTE + 5B U+0170 3C # LATIN CAPITAL LETTER U WITH DOUBLE ACUTE + 5C U+00DC # LATIN CAPITAL LETTER U WITH DIAERESIS + 5D U+00DD # LATIN CAPITAL LETTER Y WITH ACUTE + 5E U+0162 3D # LATIN CAPITAL LETTER T WITH CEDILLA + 5F U+00DF # LATIN SMALL LETTER SHARP S + 60 U+0155 3E # LATIN SMALL LETTER R WITH ACUTE + 61 U+00E1 # LATIN SMALL LETTER A WITH ACUTE + 62 U+00E2 # LATIN SMALL LETTER A WITH CIRCUMFLEX + 63 U+0103 3F # LATIN SMALL LETTER A WITH BREVE + 64 U+00E4 # LATIN SMALL LETTER A WITH DIAERESIS + 65 U+013A 40 # LATIN SMALL LETTER L WITH ACUTE + 66 U+0107 41 # LATIN SMALL LETTER C WITH ACUTE + 67 U+00E7 # LATIN SMALL LETTER C WITH CEDILLA + 68 U+010D 42 # LATIN SMALL LETTER C WITH CARON + 69 U+00E9 # LATIN SMALL LETTER E WITH ACUTE + 6A U+0119 43 # LATIN SMALL LETTER E WITH OGONEK + 6B U+00EB # LATIN SMALL LETTER E WITH DIAERESIS + 6C U+011B 44 # LATIN SMALL LETTER E WITH CARON + 6D U+00ED # LATIN SMALL LETTER I WITH ACUTE + 6E U+00EE # LATIN SMALL LETTER I WITH CIRCUMFLEX + 6F U+010F 45 # LATIN SMALL LETTER D WITH CARON + 70 U+0111 46 # LATIN SMALL LETTER D WITH STROKE + 71 U+0144 47 # LATIN SMALL LETTER N WITH ACUTE + 72 U+0148 48 # LATIN SMALL LETTER N WITH CARON + 73 U+00F3 # LATIN SMALL LETTER O WITH ACUTE + 74 U+00F4 # LATIN SMALL LETTER O WITH CIRCUMFLEX + 75 U+0151 49 # LATIN SMALL LETTER O WITH DOUBLE ACUTE + 76 U+00F6 # LATIN SMALL LETTER O WITH DIAERESIS + 77 U+00F7 # DIVISION SIGN + 78 U+0159 4A # LATIN SMALL LETTER R WITH CARON + 79 U+016F 4B # LATIN SMALL LETTER U WITH RING ABOVE + 7A U+00FA # LATIN SMALL LETTER U WITH ACUTE + 7B U+0171 4C # LATIN SMALL LETTER U WITH DOUBLE ACUTE + 7C U+00FC # LATIN SMALL LETTER U WITH DIAERESIS + 7D U+00FD # LATIN SMALL LETTER Y WITH ACUTE + 7E U+0163 4D # LATIN SMALL LETTER T WITH CEDILLA + 7F U+02D9 94 # DOT ABOVE + +# ISO Latin-5 is 8859-9 +map_ISO_Latin_5 + 20 U+00A0 # NO-BREAK SPACE + 21 U+00A1 # INVERTED EXCLAMATION MARK + 22 U+00A2 # CENT SIGN + 23 U+00A3 # POUND SIGN + 24 U+00A4 # CURRENCY SIGN + 25 U+00A5 # YEN SIGN + 26 U+00A6 # BROKEN BAR + 27 U+00A7 # SECTION SIGN + 28 U+00A8 # DIAERESIS + 29 U+00A9 # COPYRIGHT SIGN + 2A U+00AA # FEMININE ORDINAL INDICATOR + 2B U+00AB # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK + 2C U+00AC # NOT SIGN + 2D U+00AD # SOFT HYPHEN + 2E U+00AE # REGISTERED SIGN + 2F U+00AF # MACRON + 30 U+00B0 # DEGREE SIGN + 31 U+00B1 # PLUS-MINUS SIGN + 32 U+00B2 # SUPERSCRIPT TWO + 33 U+00B3 # SUPERSCRIPT THREE + 34 U+00B4 # ACUTE ACCENT + 35 U+00B5 # MICRO SIGN + 36 U+00B6 # PILCROW SIGN + 37 U+00B7 # MIDDLE DOT + 38 U+00B8 # CEDILLA + 39 U+00B9 # SUPERSCRIPT ONE + 3A U+00BA # MASCULINE ORDINAL INDICATOR + 3B U+00BB # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK + 3C U+00BC # VULGAR FRACTION ONE QUARTER + 3D U+00BD # VULGAR FRACTION ONE HALF + 3E U+00BE # VULGAR FRACTION THREE QUARTERS + 3F U+00BF # INVERTED QUESTION MARK + 40 U+00C0 # LATIN CAPITAL LETTER A WITH GRAVE + 41 U+00C1 # LATIN CAPITAL LETTER A WITH ACUTE + 42 U+00C2 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX + 43 U+00C3 # LATIN CAPITAL LETTER A WITH TILDE + 44 U+00C4 # LATIN CAPITAL LETTER A WITH DIAERESIS + 45 U+00C5 # LATIN CAPITAL LETTER A WITH RING ABOVE + 46 U+00C6 # LATIN CAPITAL LETTER AE + 47 U+00C7 # LATIN CAPITAL LETTER C WITH CEDILLA + 48 U+00C8 # LATIN CAPITAL LETTER E WITH GRAVE + 49 U+00C9 # LATIN CAPITAL LETTER E WITH ACUTE + 4A U+00CA # LATIN CAPITAL LETTER E WITH CIRCUMFLEX + 4B U+00CB # LATIN CAPITAL LETTER E WITH DIAERESIS + 4C U+00CC # LATIN CAPITAL LETTER I WITH GRAVE + 4D U+00CD # LATIN CAPITAL LETTER I WITH ACUTE + 4E U+00CE # LATIN CAPITAL LETTER I WITH CIRCUMFLEX + 4F U+00CF # LATIN CAPITAL LETTER I WITH DIAERESIS + 50 U+011E 4E # LATIN CAPITAL LETTER G WITH BREVE + 51 U+00D1 # LATIN CAPITAL LETTER N WITH TILDE + 52 U+00D2 # LATIN CAPITAL LETTER O WITH GRAVE + 53 U+00D3 # LATIN CAPITAL LETTER O WITH ACUTE + 54 U+00D4 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX + 55 U+00D5 # LATIN CAPITAL LETTER O WITH TILDE + 56 U+00D6 # LATIN CAPITAL LETTER O WITH DIAERESIS + 57 U+00D7 # MULTIPLICATION SIGN + 58 U+00D8 # LATIN CAPITAL LETTER O WITH STROKE + 59 U+00D9 # LATIN CAPITAL LETTER U WITH GRAVE + 5A U+00DA # LATIN CAPITAL LETTER U WITH ACUTE + 5B U+00DB # LATIN CAPITAL LETTER U WITH CIRCUMFLEX + 5C U+00DC # LATIN CAPITAL LETTER U WITH DIAERESIS + 5D U+0130 4F # LATIN CAPITAL LETTER I WITH DOT ABOVE + 5E U+015E 9F # LATIN CAPITAL LETTER S WITH CEDILLA + 5F U+00DF # LATIN SMALL LETTER SHARP S + 60 U+00E0 # LATIN SMALL LETTER A WITH GRAVE + 61 U+00E1 # LATIN SMALL LETTER A WITH ACUTE + 62 U+00E2 # LATIN SMALL LETTER A WITH CIRCUMFLEX + 63 U+00E3 # LATIN SMALL LETTER A WITH TILDE + 64 U+00E4 # LATIN SMALL LETTER A WITH DIAERESIS + 65 U+00E5 # LATIN SMALL LETTER A WITH RING ABOVE + 66 U+00E6 # LATIN SMALL LETTER AE + 67 U+00E7 # LATIN SMALL LETTER C WITH CEDILLA + 68 U+00E8 # LATIN SMALL LETTER E WITH GRAVE + 69 U+00E9 # LATIN SMALL LETTER E WITH ACUTE + 6A U+00EA # LATIN SMALL LETTER E WITH CIRCUMFLEX + 6B U+00EB # LATIN SMALL LETTER E WITH DIAERESIS + 6C U+00EC # LATIN SMALL LETTER I WITH GRAVE + 6D U+00ED # LATIN SMALL LETTER I WITH ACUTE + 6E U+00EE # LATIN SMALL LETTER I WITH CIRCUMFLEX + 6F U+00EF # LATIN SMALL LETTER I WITH DIAERESIS + 70 U+011F 50 # LATIN SMALL LETTER G WITH BREVE + 71 U+00F1 # LATIN SMALL LETTER N WITH TILDE + 72 U+00F2 # LATIN SMALL LETTER O WITH GRAVE + 73 U+00F3 # LATIN SMALL LETTER O WITH ACUTE + 74 U+00F4 # LATIN SMALL LETTER O WITH CIRCUMFLEX + 75 U+00F5 # LATIN SMALL LETTER O WITH TILDE + 76 U+00F6 # LATIN SMALL LETTER O WITH DIAERESIS + 77 U+00F7 # DIVISION SIGN + 78 U+00F8 # LATIN SMALL LETTER O WITH STROKE + 79 U+00F9 # LATIN SMALL LETTER U WITH GRAVE + 7A U+00FA # LATIN SMALL LETTER U WITH ACUTE + 7B U+00FB # LATIN SMALL LETTER U WITH CIRCUMFLEX + 7C U+00FC # LATIN SMALL LETTER U WITH DIAERESIS + 7D U+0131 51 # LATIN SMALL LETTER DOTLESS I + 7E U+015F 2A # LATIN SMALL LETTER S WITH CEDILLA + 7F U+00FF # LATIN SMALL LETTER Y WITH DIAERESIS + +# DEC Cyrillic from screenshot +map_DEC_Cyrillic + 21 UNDEF 1B # undefined + 22 UNDEF 1B # undefined + 23 UNDEF 1B # undefined + 24 UNDEF 1B # undefined + 25 UNDEF 1B # undefined + 26 UNDEF 1B # undefined + 27 UNDEF 1B # undefined + 28 UNDEF 1B # undefined + 29 UNDEF 1B # undefined + 2A UNDEF 1B # undefined + 2B UNDEF 1B # undefined + 2C UNDEF 1B # undefined + 2D UNDEF 1B # undefined + 2E UNDEF 1B # undefined + 2F UNDEF 1B # undefined + 30 UNDEF 1B # undefined + 31 UNDEF 1B # undefined + 32 UNDEF 1B # undefined + 33 UNDEF 1B # undefined + 34 UNDEF 1B # undefined + 35 UNDEF 1B # undefined + 36 UNDEF 1B # undefined + 37 UNDEF 1B # undefined + 38 UNDEF 1B # undefined + 39 UNDEF 1B # undefined + 3A UNDEF 1B # undefined + 3B UNDEF 1B # undefined + 3C UNDEF 1B # undefined + 3D UNDEF 1B # undefined + 3E UNDEF 1B # undefined + 3F UNDEF 1B # undefined + 40 U+044E 4F # CYRILLIC SMALL LETTER YU + 41 U+0430 31 # CYRILLIC SMALL LETTER A + 42 U+0431 32 # CYRILLIC SMALL LETTER BE + 43 U+0446 47 # CYRILLIC SMALL LETTER TSE + 44 U+0434 35 # CYRILLIC SMALL LETTER DE + 45 U+0435 36 # CYRILLIC SMALL LETTER IE + 46 U+0444 45 # CYRILLIC SMALL LETTER EF + 47 U+0433 34 # CYRILLIC SMALL LETTER GHE + 48 U+0445 46 # CYRILLIC SMALL LETTER HA + 49 U+0438 39 # CYRILLIC SMALL LETTER I + 4A U+0439 3A # CYRILLIC SMALL LETTER SHORT I + 4B U+043A 3B # CYRILLIC SMALL LETTER KA + 4C U+043B 3C # CYRILLIC SMALL LETTER EL + 4D U+043C 3D # CYRILLIC SMALL LETTER EM + 4E U+043D 3E # CYRILLIC SMALL LETTER EN + 4F U+043E 3F # CYRILLIC SMALL LETTER O + 50 U+043F 40 # CYRILLIC SMALL LETTER PE + 51 U+044F 50 # CYRILLIC SMALL LETTER YA + 52 U+0440 41 # CYRILLIC SMALL LETTER ER + 53 U+0441 42 # CYRILLIC SMALL LETTER ES + 54 U+0442 43 # CYRILLIC SMALL LETTER TE + 55 U+0443 44 # CYRILLIC SMALL LETTER U + 56 U+0436 37 # CYRILLIC SMALL LETTER ZHE + 57 U+0432 33 # CYRILLIC SMALL LETTER VE + 58 U+044C 4D # CYRILLIC SMALL LETTER SOFT SIGN + 59 U+044B 4C # CYRILLIC SMALL LETTER YERU + 5A U+0437 38 # CYRILLIC SMALL LETTER ZE + 5B U+0448 49 # CYRILLIC SMALL LETTER SHA + 5C U+044D 4E # CYRILLIC SMALL LETTER E + 5D U+0449 4A # CYRILLIC SMALL LETTER SHCHA + 5E U+0447 48 # CYRILLIC SMALL LETTER CHE + 5F U+044A 4B # CYRILLIC SMALL LETTER HARD SIGN + 60 U+042E 2F # CYRILLIC CAPITAL LETTER YU + 61 U+0410 11 # CYRILLIC CAPITAL LETTER A + 62 U+0411 12 # CYRILLIC CAPITAL LETTER BE + 63 U+0426 27 # CYRILLIC CAPITAL LETTER TSE + 64 U+0414 15 # CYRILLIC CAPITAL LETTER DE + 65 U+0415 16 # CYRILLIC CAPITAL LETTER IE + 66 U+0424 25 # CYRILLIC CAPITAL LETTER EF + 67 U+0413 14 # CYRILLIC CAPITAL LETTER GHE + 68 U+0425 26 # CYRILLIC CAPITAL LETTER HA + 69 U+0418 19 # CYRILLIC CAPITAL LETTER I + 6A U+0419 1A # CYRILLIC CAPITAL LETTER SHORT I + 6B U+041A 1B # CYRILLIC CAPITAL LETTER KA + 6C U+041B 1C # CYRILLIC CAPITAL LETTER EL + 6D U+041C 1D # CYRILLIC CAPITAL LETTER EM + 6E U+041D 1E # CYRILLIC CAPITAL LETTER EN + 6F U+041E 1F # CYRILLIC CAPITAL LETTER O + 70 U+041F 20 # CYRILLIC CAPITAL LETTER PE + 71 U+042F 30 # CYRILLIC CAPITAL LETTER YA + 72 U+0420 21 # CYRILLIC CAPITAL LETTER ER + 73 U+0421 22 # CYRILLIC CAPITAL LETTER ES + 74 U+0422 23 # CYRILLIC CAPITAL LETTER TE + 75 U+0423 24 # CYRILLIC CAPITAL LETTER U + 76 U+0416 17 # CYRILLIC CAPITAL LETTER ZHE + 77 U+0412 13 # CYRILLIC CAPITAL LETTER VE + 78 U+042C 2D # CYRILLIC CAPITAL LETTER SOFT SIGN + 79 U+042B 2C # CYRILLIC CAPITAL LETTER YERU + 7A U+0417 18 # CYRILLIC CAPITAL LETTER ZE + 7B U+0428 29 # CYRILLIC CAPITAL LETTER SHA + 7C U+042D 2E # CYRILLIC CAPITAL LETTER E + 7D U+0429 2A # CYRILLIC CAPITAL LETTER SHCHA + 7E U+0427 28 # CYRILLIC CAPITAL LETTER CHE + +# figure A-24 "DEC Greek Supplemental Character Set" +map_DEC_Greek_Supp + 21 U+00A1 # LEFT SINGLE QUOTATION MARK + 22 U+00A2 # RIGHT SINGLE QUOTATION MARK + 23 U+00A3 # POUND SIGN + 24 UNDEF 1B # EURO SIGN + 25 U+00A5 # YEN SIGN + 26 UNDEF 1B # BROKEN BAR + 27 U+00A7 # SECTION SIGN + 28 U+00A4 A4 # CURRENCY SIGN + 29 U+00A9 # COPYRIGHT SIGN + 2A U+00AA # FEMININE ORDINAL INDICATOR + 2B U+00AB # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK + 2C UNDEF 1B # reserved + 2D UNDEF 1B # reserved + 2E UNDEF 1B # reserved + 2F UNDEF 1B # reserved + 30 U+00B0 # DEGREE SIGN + 31 U+00B1 # PLUS-MINUS SIGN + 32 U+00B2 # SUPERSCRIPT TWO + 33 U+00B3 # SUPERSCRIPT THREE + 34 UNDEF 1B # reserved + 35 U+00B5 # MICRO SIGN + 36 U+00B6 # PILCROW SIGN + 37 U+00B7 # MIDDLE DOT + 38 UNDEF 1B # reserved + 39 U+00B9 # SUPERSCRIPT ONE + 3A U+00BA # MASCULINE ORDINAL INDICATOR + 3B U+00BB # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK + 3C U+00BC # VULGAR FRACTION ONE QUARTER + 3D U+00BD # VULGAR FRACTION ONE HALF + 3E UNDEF 1B # reserved + 3F U+00BF # INVERTED QUESTION MARK + 40 U+03CA D0 # GREEK SMALL LETTER IOTA WITH DIALYTIKA + 41 U+0391 76 # GREEK CAPITAL LETTER ALPHA + 42 U+0392 77 # GREEK CAPITAL LETTER BETA + 43 U+0393 78 # GREEK CAPITAL LETTER GAMMA + 44 U+0394 79 # GREEK CAPITAL LETTER DELTA + 45 U+0395 7A # GREEK CAPITAL LETTER EPSILON + 46 U+0396 7B # GREEK CAPITAL LETTER ZETA + 47 U+0397 7C # GREEK CAPITAL LETTER ETA + 48 U+0398 7D # GREEK CAPITAL LETTER THETA + 49 U+0399 7E # GREEK CAPITAL LETTER IOTA + 4A U+039A 7F # GREEK CAPITAL LETTER KAPPA + 4B U+039B A2 # GREEK CAPITAL LETTER LAMDA + 4C U+039C A3 # GREEK CAPITAL LETTER MU + 4D U+039D A4 # GREEK CAPITAL LETTER NU + 4E U+039E A5 # GREEK CAPITAL LETTER XI + 4F U+039F A6 # GREEK CAPITAL LETTER OMICRON + 50 UNDEF 1B # reserved + 51 U+03A0 A7 # GREEK CAPITAL LETTER PI + 52 U+03A1 A8 # GREEK CAPITAL LETTER RHO + 53 U+03A3 A9 # GREEK CAPITAL LETTER SIGMA + 54 U+03A4 AA # GREEK CAPITAL LETTER TAU + 55 U+03A5 AB # GREEK CAPITAL LETTER UPSILON + 56 U+03A6 AC # GREEK CAPITAL LETTER PHI + 57 U+03A7 AD # GREEK CAPITAL LETTER CHI + 58 U+03A8 AE # GREEK CAPITAL LETTER PSI + 59 U+03A9 AF # GREEK CAPITAL LETTER OMEGA + 5A U+03AC B2 # GREEK SMALL LETTER ALPHA WITH TONOS + 5B U+03AD B3 # GREEK SMALL LETTER EPSILON WITH TONOS + 5C U+03AE B4 # GREEK SMALL LETTER ETA WITH TONOS + 5D U+03AF B5 # GREEK SMALL LETTER IOTA WITH TONOS + 5E UNDEF 1B # reserved + 5F U+03CC D2 # GREEK SMALL LETTER OMICRON WITH TONOS + 60 U+03CB D1 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA + 61 U+03B1 B7 # GREEK SMALL LETTER ALPHA + 62 U+03B2 B8 # GREEK SMALL LETTER BETA + 63 U+03B3 B9 # GREEK SMALL LETTER GAMMA + 64 U+03B4 BA # GREEK SMALL LETTER DELTA + 65 U+03B5 BB # GREEK SMALL LETTER EPSILON + 66 U+03B6 BC # GREEK SMALL LETTER ZETA + 67 U+03B7 BD # GREEK SMALL LETTER ETA + 68 U+03B8 BE # GREEK SMALL LETTER THETA + 69 U+03B9 BF # GREEK SMALL LETTER IOTA + 6A U+03BA C0 # GREEK SMALL LETTER KAPPA + 6B U+03BB C1 # GREEK SMALL LETTER LAMDA + 6C U+03BC C2 # GREEK SMALL LETTER MU + 6D U+03BD C3 # GREEK SMALL LETTER NU + 6E U+03BE C4 # GREEK SMALL LETTER XI + 6F U+03BF C5 # GREEK SMALL LETTER OMICRON + 70 UNDEF 1B # reserved + 71 U+03C0 C6 # GREEK SMALL LETTER PI + 72 U+03C1 C7 # GREEK SMALL LETTER RHO + 73 U+03C3 C9 # GREEK SMALL LETTER SIGMA + 74 U+03C4 CA # GREEK SMALL LETTER TAU + 75 U+03C5 CB # GREEK SMALL LETTER UPSILON + 76 U+03C6 CC # GREEK SMALL LETTER PHI + 77 U+03C7 CD # GREEK SMALL LETTER CHI + 78 U+03C8 CE # GREEK SMALL LETTER PSI + 79 U+03C9 CF # GREEK SMALL LETTER OMEGA + 7A U+03C2 C8 # GREEK SMALL LETTER FINAL SIGMA + 7B U+03CD D3 # GREEK SMALL LETTER UPSILON WITH TONOS + 7C U+03CE D4 # GREEK SMALL LETTER OMEGA WITH TONOS + 7D U+0384 96 # GREEK TONOS + 7E UNDEF 1B # reserved + +# figure A-22 "DEC Hebrew Supplemental Character Set" +map_DEC_Hebrew_Supp + 21 U+00A1 # INVERTED EXCLAMATION MARK + 22 U+00A2 # CENT SIGN + 23 U+00A3 # POUND SIGN + 24 UNDEF 1B # CURRENCY SIGN + 25 U+00A5 # YEN SIGN + 26 UNDEF 1B # BROKEN BAR + 27 U+00A7 # SECTION SIGN + 28 U+00A8 A4 # DIAERESIS + 29 U+00A9 # COPYRIGHT SIGN + 2A U+00D7 # MULTIPLICATION SIGN + 2B U+00AB # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK + 2C UNDEF 1B # NOT SIGN + 2D UNDEF 1B # SOFT HYPHEN + 2E UNDEF 1B # REGISTERED SIGN + 2F UNDEF 1B # MACRON + 30 U+00B0 # DEGREE SIGN + 31 U+00B1 # PLUS-MINUS SIGN + 32 U+00B2 # SUPERSCRIPT TWO + 33 U+00B3 # SUPERSCRIPT THREE + 34 UNDEF 1B # ACUTE ACCENT + 35 U+00B5 # MICRO SIGN + 36 U+00B6 # PILCROW SIGN + 37 U+00B7 # MIDDLE DOT + 38 UNDEF 1B # CEDILLA + 39 U+00B9 # SUPERSCRIPT ONE + 3A U+00F7 # DIVISION SIGN + 3B U+00BB # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK + 3C U+00BC # VULGAR FRACTION ONE QUARTER + 3D U+00BD # VULGAR FRACTION ONE HALF + 3E UNDEF 1B # VULGAR FRACTION THREE QUARTERS + 3F U+00BF # INVERTED QUESTION MARK + 40 UNDEF 1B # reserved + 41 UNDEF 1B # reserved + 42 UNDEF 1B # reserved + 43 UNDEF 1B # reserved + 44 UNDEF 1B # reserved + 45 UNDEF 1B # reserved + 46 UNDEF 1B # reserved + 47 UNDEF 1B # reserved + 48 UNDEF 1B # reserved + 49 UNDEF 1B # reserved + 4A UNDEF 1B # reserved + 4B UNDEF 1B # reserved + 4C UNDEF 1B # reserved + 4D UNDEF 1B # reserved + 4E UNDEF 1B # reserved + 4F UNDEF 1B # reserved + 50 UNDEF 1B # reserved + 51 UNDEF 1B # reserved + 52 UNDEF 1B # reserved + 53 UNDEF 1B # reserved + 54 UNDEF 1B # reserved + 55 UNDEF 1B # reserved + 56 UNDEF 1B # reserved + 57 UNDEF 1B # reserved + 58 UNDEF 1B # reserved + 59 UNDEF 1B # reserved + 5A UNDEF 1B # reserved + 5B UNDEF 1B # reserved + 5C UNDEF 1B # reserved + 5D UNDEF 1B # reserved + 5E UNDEF 1B # reserved + 5F UNDEF 1B # reserved + 60 U+05D0 53 # HEBREW LETTER ALEF + 61 U+05D1 54 # HEBREW LETTER BET + 62 U+05D2 55 # HEBREW LETTER GIMEL + 63 U+05D3 56 # HEBREW LETTER DALET + 64 U+05D4 57 # HEBREW LETTER HE + 65 U+05D5 58 # HEBREW LETTER VAV + 66 U+05D6 59 # HEBREW LETTER ZAYIN + 67 U+05D7 5A # HEBREW LETTER HET + 68 U+05D8 5B # HEBREW LETTER TET + 69 U+05D9 5C # HEBREW LETTER YOD + 6A U+05DA 5D # HEBREW LETTER FINAL KAF + 6B U+05DB 5E # HEBREW LETTER KAF + 6C U+05DC 5F # HEBREW LETTER LAMED + 6D U+05DD 60 # HEBREW LETTER FINAL MEM + 6E U+05DE 61 # HEBREW LETTER MEM + 6F U+05DF 62 # HEBREW LETTER FINAL NUN + 70 U+05E0 63 # HEBREW LETTER NUN + 71 U+05E1 64 # HEBREW LETTER SAMEKH + 72 U+05E2 65 # HEBREW LETTER AYIN + 73 U+05E3 66 # HEBREW LETTER FINAL PE + 74 U+05E4 67 # HEBREW LETTER PE + 75 U+05E5 68 # HEBREW LETTER FINAL TSADI + 76 U+05E6 69 # HEBREW LETTER TSADI + 77 U+05E7 6A # HEBREW LETTER QOF + 78 U+05E8 6B # HEBREW LETTER RESH + 79 U+05E9 6C # HEBREW LETTER SHIN + 7A U+05EA 6D # HEBREW LETTER TAV + 7B UNDEF 1B # reserved + 7C UNDEF 1B # reserved + 7D UNDEF 1B # reserved + 7E UNDEF 1B # reserved + +# figure A-27 "DEC 8-Bit Turkish Supplemental Character Set" +map_DEC_Turkish_Supp + 21 U+00A1 # INVERTED EXCLAMATION MARK + 22 U+00A2 # CENT SIGN + 23 U+00A3 # POUND SIGN + 24 UNDEF 1B # reserved + 25 U+00A5 # YEN SIGN + 26 UNDEF 1B # reserved + 27 U+00A7 # SECTION SIGN + 28 U+00A8 A4 # DIAERESIS + 29 U+00A9 # COPYRIGHT SIGN + 2A U+00AA # FEMININE ORDINAL INDICATOR + 2B U+00AB # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK + 2C UNDEF 1B # reserved + 2D UNDEF 1B # reserved + 2E U+0130 4F # LATIN CAPITAL LETTER I WITH DOT ABOVE + 2F UNDEF 1B # reserved + 30 U+00B0 # DEGREE SIGN + 31 U+00B1 # PLUS-MINUS SIGN + 32 U+00B2 # SUPERSCRIPT TWO + 33 U+00B3 # SUPERSCRIPT THREE + 34 UNDEF 1B # reserved + 35 U+00B5 # MICRO SIGN + 36 U+00B6 # PILCROW SIGN + 37 U+00B7 # MIDDLE DOT + 38 UNDEF 1B # reserved + 39 U+00B9 # SUPERSCRIPT ONE + 3A U+00BA # MASCULINE ORDINAL INDICATOR + 3B U+00BB # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK + 3C U+00BC # VULGAR FRACTION ONE QUARTER + 3D U+00BD # VULGAR FRACTION ONE HALF + 3E U+0131 51 # LATIN SMALL LETTER DOTLESS I + 3F U+00BF # INVERTED QUESTION MARK + 40 U+00C0 # LATIN CAPITAL LETTER A WITH GRAVE + 41 U+00C1 # LATIN CAPITAL LETTER A WITH ACUTE + 42 U+00C2 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX + 43 U+00C3 # LATIN CAPITAL LETTER A WITH TILDE + 44 U+00C4 # LATIN CAPITAL LETTER A WITH DIAERESIS + 45 U+00C5 # LATIN CAPITAL LETTER A WITH RING ABOVE + 46 U+00C6 # LATIN CAPITAL LETTER AE + 47 U+00C7 # LATIN CAPITAL LETTER C WITH CEDILLA + 48 U+00C8 # LATIN CAPITAL LETTER E WITH GRAVE + 49 U+00C9 # LATIN CAPITAL LETTER E WITH ACUTE + 4A U+00CA # LATIN CAPITAL LETTER E WITH CIRCUMFLEX + 4B U+00CB # LATIN CAPITAL LETTER E WITH DIAERESIS + 4C U+00CC # LATIN CAPITAL LETTER I WITH GRAVE + 4D U+00CD # LATIN CAPITAL LETTER I WITH ACUTE + 4E U+00CE # LATIN CAPITAL LETTER I WITH CIRCUMFLEX + 4F U+00CF # LATIN CAPITAL LETTER I WITH DIAERESIS + 50 U+011E 4E # LATIN CAPITAL LETTER G WITH BREVE + 51 U+00D1 # LATIN CAPITAL LETTER N WITH TILDE + 52 U+00D2 # LATIN CAPITAL LETTER O WITH GRAVE + 53 U+00D3 # LATIN CAPITAL LETTER O WITH ACUTE + 54 U+00D4 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX + 55 U+00D5 # LATIN CAPITAL LETTER O WITH TILDE + 56 U+00D6 # LATIN CAPITAL LETTER O WITH DIAERESIS + 57 U+0152 97 # LATIN CAPITAL LIGATURE OE + 58 U+00D8 # LATIN CAPITAL LETTER O WITH STROKE + 59 U+00D9 # LATIN CAPITAL LETTER U WITH GRAVE + 5A U+00DA # LATIN CAPITAL LETTER U WITH ACUTE + 5B U+00DB # LATIN CAPITAL LETTER U WITH CIRCUMFLEX + 5C U+00DC # LATIN CAPITAL LETTER U WITH DIAERESIS + 5D U+0178 98 # LATIN CAPITAL LETTER Y WITH DIAERESIS + 5E U+015E 9F # LATIN CAPITAL LETTER S WITH CEDILLA + 5F U+00DF # LATIN SMALL LETTER SHARP S + 60 U+00E0 # LATIN SMALL LETTER A WITH GRAVE + 61 U+00E1 # LATIN SMALL LETTER A WITH ACUTE + 62 U+00E2 # LATIN SMALL LETTER A WITH CIRCUMFLEX + 63 U+00E3 # LATIN SMALL LETTER A WITH TILDE + 64 U+00E4 # LATIN SMALL LETTER A WITH DIAERESIS + 65 U+00E5 # LATIN SMALL LETTER A WITH RING ABOVE + 66 U+00E6 # LATIN SMALL LETTER AE + 67 U+00E7 # LATIN SMALL LETTER C WITH CEDILLA + 68 U+00E8 # LATIN SMALL LETTER E WITH GRAVE + 69 U+00E9 # LATIN SMALL LETTER E WITH ACUTE + 6A U+00EA # LATIN SMALL LETTER E WITH CIRCUMFLEX + 6B U+00EB # LATIN SMALL LETTER E WITH DIAERESIS + 6C U+00EC # LATIN SMALL LETTER I WITH GRAVE + 6D U+00ED # LATIN SMALL LETTER I WITH ACUTE + 6E U+00EE # LATIN SMALL LETTER I WITH CIRCUMFLEX + 6F U+00EF # LATIN SMALL LETTER I WITH DIAERESIS + 70 U+011F 50 # LATIN SMALL LETTER G WITH BREVE + 71 U+00F1 # LATIN SMALL LETTER N WITH TILDE + 72 U+00F2 # LATIN SMALL LETTER O WITH GRAVE + 73 U+00F3 # LATIN SMALL LETTER O WITH ACUTE + 74 U+00F4 # LATIN SMALL LETTER O WITH CIRCUMFLEX + 75 U+00F5 # LATIN SMALL LETTER O WITH TILDE + 76 U+00F6 # LATIN SMALL LETTER O WITH DIAERESIS + 77 U+0153 99 # LATIN SMALL LIGATURE OE + 78 U+00F8 # LATIN SMALL LETTER O WITH STROKE + 79 U+00F9 # LATIN SMALL LETTER U WITH GRAVE + 7A U+00FA # LATIN SMALL LETTER U WITH ACUTE + 7B U+00FB # LATIN SMALL LETTER U WITH CIRCUMFLEX + 7C U+00FC # LATIN SMALL LETTER U WITH DIAERESIS + 7D U+00FF FF # LATIN SMALL LETTER Y WITH DIAERESIS + 7E U+015F 2A # LATIN SMALL LETTER S WITH CEDILLA + +# mentioned, but not documented in VT510 manual, etc., this uses +# the ELOT927 table from Kermit 95: +map_NRCS_Greek + 61 U+0391 # CAPITAL GREEK LETTER ALPHA + 62 U+0392 # CAPITAL GREEK LETTER BETA + 63 U+0393 # CAPITAL GREEK LETTER GAMMA + 64 U+0394 # CAPITAL GREEK LETTER DELTA + 65 U+0395 # CAPITAL GREEK LETTER EPSILON + 66 U+0396 # CAPITAL GREEK LETTER ZETA + 67 U+0397 # CAPITAL GREEK LETTER ETA + 68 U+0398 # CAPITAL GREEK LETTER THETA + 69 U+0399 # CAPITAL GREEK LETTER IOTA + 6a U+039A # CAPITAL GREEK LETTER KAPPA + 6b U+039B # CAPITAL GREEK LETTER LAMDA + 6c U+039C # CAPITAL GREEK LETTER MU + 6d U+039D # CAPITAL GREEK LETTER NU + 6e U+03A7 # CAPITAL GREEK LETTER KSI (CHI) + 6f U+039F # CAPITAL GREEK LETTER OMICRON + 70 U+03A0 # CAPITAL GREEK LETTER PI + 71 U+03A1 # CAPITAL GREEK LETTER RHO + 72 U+03A3 # CAPITAL GREEK LETTER SIGMA + 73 U+03A4 # CAPITAL GREEK LETTER TAU + 74 U+03A5 # CAPITAL GREEK LETTER UPSILON + 75 U+03A6 # CAPITAL GREEK LETTER FI (PHI) + 76 U+039E # CAPITAL GREEK LETTER XI + 77 U+03A8 # CAPITAL GREEK LETTER PSI + 78 U+03A9 # CAPITAL GREEK LETTER OMEGA + 79 UNDEF 1B # unused + 7a UNDEF 1B # unused + +# figure A-21 "DEC 7-Bit Hebrew Character Set" +map_NRCS_Hebrew + 60 U+05D0 # HEBREW LETTER ALEF + 61 U+05D1 # HEBREW LETTER BET + 62 U+05D2 # HEBREW LETTER GIMEL + 63 U+05D3 # HEBREW LETTER DALET + 64 U+05D4 # HEBREW LETTER HE + 65 U+05D5 # HEBREW LETTER VAV + 66 U+05D6 # HEBREW LETTER ZAYIN + 67 U+05D7 # HEBREW LETTER HET + 68 U+05D8 # HEBREW LETTER TET + 69 U+05D9 # HEBREW LETTER YOD + 6a U+05DA # HEBREW LETTER FINAL KAF + 6b U+05DB # HEBREW LETTER KAF + 6c U+05DC # HEBREW LETTER LAMED + 6d U+05DD # HEBREW LETTER FINAL MEM + 6e U+05DE # HEBREW LETTER MEM + 6f U+05DF # HEBREW LETTER FINAL NUN + 70 U+05E0 # HEBREW LETTER NUN + 71 U+05E1 # HEBREW LETTER SAMEKH + 72 U+05E2 # HEBREW LETTER AYIN + 73 U+05E3 # HEBREW LETTER FINAL PE + 74 U+05E4 # HEBREW LETTER PE + 75 U+05E5 # HEBREW LETTER FINAL TSADI + 76 U+05E6 # HEBREW LETTER TSADI + 77 U+05E7 # HEBREW LETTER QOF + 78 U+05E8 # HEBREW LETTER RESH + 79 U+05E9 # HEBREW LETTER SHIN + 7a U+05EA # HEBREW LETTER TAV + +# figure A-26 "DEC 7-Bit Turkish Character Set" +map_NRCS_Turkish + 26 U+011F # LATIN SMALL LETTER G WITH BREVE + 40 U+0130 # LATIN CAPITAL LETTER I WITH DOT ABOVE + 5b U+015E # LATIN CAPITAL LETTER S WITH CEDILLA + 5c U+00D6 # LATIN CAPITAL LETTER O WITH DIAERESIS + 5d U+00C7 # LATIN CAPITAL LETTER C WITH CEDILLA + 5e U+00dC # LATIN CAPITAL LETTER U WITH DIAERESIS + 60 U+011E # LATIN CAPITAL LETTER G WITH BREVE + 7b U+015F # LATIN SMALL LETTER S WITH CEDILLA + 7c U+00F6 # LATIN SMALL LETTER O WITH DIAERESIS + 7d U+00E7 # LATIN SMALL LETTER C WITH CEDILLA + 7e U+00FC # LATIN SMALL LETTER U WITH DIAERESIS diff --git a/app/xterm/charsets.h b/app/xterm/charsets.h new file mode 100644 index 000000000..5d876e6c6 --- /dev/null +++ b/app/xterm/charsets.h @@ -0,0 +1,2286 @@ +/* + * $XTermId: charsets.h,v 1.29 2024/02/08 08:52:16 tom Exp $ + */ + +/* + * Copyright 2023,2024 by Thomas E. Dickey + * + * All Rights Reserved + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the + * sale, use or other dealings in this Software without prior written + * authorization. + */ + +#ifndef included_charsets_h +#define included_charsets_h 1 + +/* + * According to + * Digital ANSI-Compliant Printing Protocol + * Level 2 Programming Reference Manual + * EK-PPLV2-PM. B01 + * + * the supplementary character sets Greek, Hebrew, Latin-5 and Latin/Cyrillic + * are standardized by ISO: + * ISO Greek is 8859-7 + * ISO Hebrew is 8859-8 + * ISO Latin-5 is 8859-9 + * ISO Latin/Cyrillic is 8859-5 + * + * These are derived from the data at + * ftp://www.unicode.org/Public/MAPPINGS/ISO8859/ + * + * Note: the "figure A-xx" comments refer to EK-PPLV2-PM. + */ + +#ifndef PUA +#define PUA(n) (0xEEEE + (n)) +#endif +#define UNDEF 0x2426 /* rendered as a backwards "?" */ + +/* + * A "codepage" is treated different from the NRC mode: it is always enabled. + * Reuse the UNI() macros by temporarily setting its state. + */ + +#if OPT_WIDE_CHARS +#define begin_CODEPAGE(size) \ + if (!(xw->flags & NATIONAL)) { \ + screen->utf8_nrc_mode++; \ + } +#define end_CODEPAGE() \ + if (!(xw->flags & NATIONAL)) { \ + screen->utf8_nrc_mode--; \ + } +#else +#define begin_CODEPAGE(size) /* nothing */ +#define end_CODEPAGE() /* nothing */ +#endif + +/* + * xterm's original implementation of NRCS in 1998 was before Unicode became + * prevalent. Most of the necessary mappings could be done using definitions + * from X11/keysymdef.h, using ISO-8859-1 as the default. + */ + +#define map_ASCII(code) \ + switch (code) { \ + XXX(0xA0, UNDEF) \ + XXX(0xFF, UNDEF) \ + } + +#define unmap_ASCII(code,dft) \ + switch (code) { \ + MAP(0xA0, 0x1B) \ + MAP(0xFF, 0x10000) \ + default: dft; break; \ + } + +#define map_DEC_Spec_Graphic(code) \ + begin_CODEPAGE(94) \ + switch (code) { \ + XXX(0x5F, UNDEF) \ + UNI(0x60, 0x0020) /* nbsp, treat as blank */ \ + UNI(0x61, 0x0020) /* reserved, treat as blank */ \ + UNI(0x62, 0x25AE) /* black vertical rectangle */ \ + UNI(0x63, 0x215F) /* "1/" */ \ + UNI(0x64, 0x0020) /* "3/", not in Unicode, ignore */ \ + UNI(0x65, 0x0020) /* "5/", not in Unicode, ignore */ \ + UNI(0x66, 0x0020) /* "7/", not in Unicode, ignore */ \ + UNI(0x67, 0x00B0) /* degree sign */ \ + UNI(0x68, 0x00B1) /* plus-minus sign */ \ + UNI(0x69, 0x2192) /* right-arrow */ \ + UNI(0x6A, 0x2026) /* ellipsis */ \ + UNI(0x6B, 0x00F7) /* divide by */ \ + UNI(0x6C, 0x2193) /* down arrow */ \ + UNI(0x6D, 0x23BA) /* bar at scan 0 */ \ + UNI(0x6E, 0x23BA) /* bar at scan 1 */ \ + UNI(0x6F, 0x23BB) /* bar at scan 2 */ \ + UNI(0x70, 0x23BB) /* bar at scan 3 */ \ + UNI(0x71, 0x23BC) /* bar at scan 4 */ \ + UNI(0x72, 0x23BC) /* bar at scan 5 */ \ + UNI(0x73, 0x23BD) /* bar at scan 6 */ \ + UNI(0x74, 0x23BD) /* bar at scan 7 */ \ + UNI(0x75, 0x2080) /* subscript 0 */ \ + UNI(0x76, 0x2081) /* subscript 1 */ \ + UNI(0x77, 0x2082) /* subscript 2 */ \ + UNI(0x78, 0x2083) /* subscript 3 */ \ + UNI(0x79, 0x2084) /* subscript 4 */ \ + UNI(0x7A, 0x2085) /* subscript 5 */ \ + UNI(0x7B, 0x2086) /* subscript 6 */ \ + UNI(0x7C, 0x2087) /* subscript 7 */ \ + UNI(0x7D, 0x2088) /* subscript 8 */ \ + UNI(0x7E, 0x2089) /* subscript 9 */ \ + } \ + end_CODEPAGE() + +#define unmap_DEC_Spec_Graphic(code,dft) \ + switch (code) { \ + MAP(0x5F, 0x10000) \ + MAP(0x60, 0x14) /* nbsp, treat as blank */ \ + MAP(0x61, 0x78) /* reserved, treat as blank */ \ + MAP(0x62, 0x0A) /* black vertical rectangle */ \ + MAP(0x63, 0x0D) /* "1/" */ \ + MAP(0x64, 0x0E) /* "3/", not in Unicode, ignore */ \ + MAP(0x65, 0x0B) /* "5/", not in Unicode, ignore */ \ + MAP(0x66, 0xB0) /* "7/", not in Unicode, ignore */ \ + MAP(0x67, 0xB1) /* degree sign */ \ + MAP(0x68, 0x15) /* plus-minus sign */ \ + MAP(0x69, 0x0C) /* right-arrow */ \ + MAP(0x6A, 0x16) /* ellipsis */ \ + MAP(0x6B, 0x17) /* divide by */ \ + MAP(0x6C, 0x18) /* down arrow */ \ + MAP(0x6D, 0x19) /* bar at scan 0 */ \ + MAP(0x6E, 0x1A) /* bar at scan 1 */ \ + MAP(0x6F, 0x1B) /* bar at scan 2 */ \ + MAP(0x70, 0x1C) /* bar at scan 3 */ \ + MAP(0x71, 0x1D) /* bar at scan 4 */ \ + MAP(0x72, 0x1E) /* bar at scan 5 */ \ + MAP(0x73, 0x1F) /* bar at scan 6 */ \ + MAP(0x74, 0x80) /* bar at scan 7 */ \ + MAP(0x75, 0x81) /* subscript 0 */ \ + MAP(0x76, 0x82) /* subscript 1 */ \ + MAP(0x77, 0x83) /* subscript 2 */ \ + MAP(0x78, 0x84) /* subscript 3 */ \ + MAP(0x79, 0x85) /* subscript 4 */ \ + MAP(0x7A, 0x86) /* subscript 5 */ \ + MAP(0x7B, 0xC6) /* subscript 6 */ \ + MAP(0x7C, 0x87) /* subscript 7 */ \ + MAP(0x7D, 0xA3) /* subscript 8 */ \ + MAP(0x7E, 0xB7) /* subscript 9 */ \ + default: dft; break; \ + } + +#define map_ISO_Latin_1(code) \ + begin_CODEPAGE(96) \ + switch (code) { \ + } \ + end_CODEPAGE() + +#define unmap_ISO_Latin_1(code,dft) /* nothing */ + +#define map_NRCS_Dutch(code) \ + switch (code) { \ + MAP(0x23, XK_sterling) /* U+00A3 POUND SIGN */ \ + MAP(0x40, XK_threequarters) /* U+00BE VULGAR FRACTION THREE QUARTERS */ \ + UNI(0x5B, 0x0133) /* LATIN SMALL LIGATURE IJ */ \ + MAP(0x5C, XK_onehalf) /* U+00BD VULGAR FRACTION ONE HALF */ \ + MAP(0x5D, XK_bar) /* U+007C VERTICAL LINE */ \ + MAP(0x7B, XK_diaeresis) /* U+00A8 DIAERESIS */ \ + UNI(0x7C, 0x0192) /* LATIN SMALL LETTER F WITH HOOK (florin) */ \ + MAP(0x7D, XK_onequarter) /* U+00BC VULGAR FRACTION ONE QUARTER */ \ + MAP(0x7E, XK_acute) /* U+00B4 ACUTE ACCENT */ \ + } + +#define unmap_NRCS_Dutch(code,dft) /* nothing */ + +#define map_NRCS_Finnish(code) \ + switch (code) { \ + MAP(0x5B, XK_Adiaeresis) /* U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS */ \ + MAP(0x5C, XK_Odiaeresis) /* U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS */ \ + MAP(0x5D, XK_Aring) /* U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE */ \ + MAP(0x5E, XK_Udiaeresis) /* U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS */ \ + MAP(0x60, XK_eacute) /* U+00E9 LATIN SMALL LETTER E WITH ACUTE */ \ + MAP(0x7B, XK_adiaeresis) /* U+00E4 LATIN SMALL LETTER A WITH DIAERESIS */ \ + MAP(0x7C, XK_odiaeresis) /* U+00F6 LATIN SMALL LETTER O WITH DIAERESIS */ \ + MAP(0x7D, XK_aring) /* U+00E5 LATIN SMALL LETTER A WITH RING ABOVE */ \ + MAP(0x7E, XK_udiaeresis) /* U+00FC LATIN SMALL LETTER U WITH DIAERESIS */ \ + } + +#define unmap_NRCS_Finnish(code,dft) /* nothing */ + +#define map_NRCS_French(code) \ + switch (code) { \ + MAP(0x23, XK_sterling) /* U+00A3 POUND SIGN */ \ + MAP(0x40, XK_agrave) /* U+00E0 LATIN SMALL LETTER A WITH GRAVE */ \ + MAP(0x5B, XK_degree) /* U+00B0 DEGREE SIGN */ \ + MAP(0x5C, XK_ccedilla) /* U+00E7 LATIN SMALL LETTER C WITH CEDILLA */ \ + MAP(0x5D, XK_section) /* U+00A7 SECTION SIGN */ \ + MAP(0x7B, XK_eacute) /* U+00E9 LATIN SMALL LETTER E WITH ACUTE */ \ + MAP(0x7C, XK_ugrave) /* U+00F9 LATIN SMALL LETTER U WITH GRAVE */ \ + MAP(0x7D, XK_egrave) /* U+00E8 LATIN SMALL LETTER E WITH GRAVE */ \ + MAP(0x7E, XK_diaeresis) /* U+00A8 DIAERESIS */ \ + } + +#define unmap_NRCS_French(code,dft) /* nothing */ + +#define map_NRCS_French_Canadian(code) \ + switch (code) { \ + MAP(0x40, XK_agrave) /* U+00E0 LATIN SMALL LETTER A WITH GRAVE */ \ + MAP(0x5B, XK_acircumflex) /* U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX */ \ + MAP(0x5C, XK_ccedilla) /* U+00E7 LATIN SMALL LETTER C WITH CEDILLA */ \ + MAP(0x5D, XK_ecircumflex) /* U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX */ \ + MAP(0x5E, XK_icircumflex) /* U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX */ \ + MAP(0x60, XK_ocircumflex) /* U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX */ \ + MAP(0x7B, XK_eacute) /* U+00E9 LATIN SMALL LETTER E WITH ACUTE */ \ + MAP(0x7C, XK_ugrave) /* U+00F9 LATIN SMALL LETTER U WITH GRAVE */ \ + MAP(0x7D, XK_egrave) /* U+00E8 LATIN SMALL LETTER E WITH GRAVE */ \ + MAP(0x7E, XK_ucircumflex) /* U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX */ \ + } + +#define unmap_NRCS_French_Canadian(code,dft) /* nothing */ + +#define map_NRCS_German(code) \ + switch (code) { \ + MAP(0x40, XK_section) /* U+00A7 SECTION SIGN */ \ + MAP(0x5B, XK_Adiaeresis) /* U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS */ \ + MAP(0x5C, XK_Odiaeresis) /* U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS */ \ + MAP(0x5D, XK_Udiaeresis) /* U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS */ \ + MAP(0x7B, XK_adiaeresis) /* U+00E4 LATIN SMALL LETTER A WITH DIAERESIS */ \ + MAP(0x7C, XK_odiaeresis) /* U+00F6 LATIN SMALL LETTER O WITH DIAERESIS */ \ + MAP(0x7D, XK_udiaeresis) /* U+00FC LATIN SMALL LETTER U WITH DIAERESIS */ \ + MAP(0x7E, XK_ssharp) /* U+00DF LATIN SMALL LETTER SHARP S */ \ + } + +#define unmap_NRCS_German(code,dft) /* nothing */ + +#define map_NRCS_Italian(code) \ + switch (code) { \ + MAP(0x23, XK_sterling) /* U+00A3 POUND SIGN */ \ + MAP(0x40, XK_section) /* U+00A7 SECTION SIGN */ \ + MAP(0x5B, XK_degree) /* U+00B0 DEGREE SIGN */ \ + MAP(0x5C, XK_ccedilla) /* U+00E7 LATIN SMALL LETTER C WITH CEDILLA */ \ + MAP(0x5D, XK_eacute) /* U+00E9 LATIN SMALL LETTER E WITH ACUTE */ \ + MAP(0x60, XK_ugrave) /* U+00F9 LATIN SMALL LETTER U WITH GRAVE */ \ + MAP(0x7B, XK_agrave) /* U+00E0 LATIN SMALL LETTER A WITH GRAVE */ \ + MAP(0x7C, XK_ograve) /* U+00F2 LATIN SMALL LETTER O WITH GRAVE */ \ + MAP(0x7D, XK_egrave) /* U+00E8 LATIN SMALL LETTER E WITH GRAVE */ \ + MAP(0x7E, XK_igrave) /* U+00EC LATIN SMALL LETTER I WITH GRAVE */ \ + } + +#define unmap_NRCS_Italian(code,dft) /* nothing */ + +#define map_NRCS_Norwegian_Danish(code) \ + switch (code) { \ + MAP(0x40, XK_Adiaeresis) /* U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS */ \ + MAP(0x5B, XK_AE) /* U+00C6 LATIN CAPITAL LETTER AE */ \ + MAP(0x5C, XK_Ooblique) /* U+00D8 LATIN CAPITAL LETTER O WITH STROKE */ \ + MAP(0x5D, XK_Aring) /* U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE */ \ + MAP(0x5E, XK_Udiaeresis) /* U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS */ \ + MAP(0x60, XK_adiaeresis) /* U+00E4 LATIN SMALL LETTER A WITH DIAERESIS */ \ + MAP(0x7B, XK_ae) /* U+00E6 LATIN SMALL LETTER AE */ \ + MAP(0x7C, XK_oslash) /* U+00F8 LATIN SMALL LETTER O WITH STROKE */ \ + MAP(0x7D, XK_aring) /* U+00E5 LATIN SMALL LETTER A WITH RING ABOVE */ \ + MAP(0x7E, XK_udiaeresis) /* U+00FC LATIN SMALL LETTER U WITH DIAERESIS */ \ + } + +#define unmap_NRCS_Norwegian_Danish(code,dft) /* nothing */ + +#define map_NRCS_Portuguese(code) \ + switch (code) { \ + MAP(0x5B, XK_Atilde) /* U+00C3 LATIN CAPITAL LETTER A WITH TILDE */ \ + MAP(0x5C, XK_Ccedilla) /* U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA */ \ + MAP(0x5D, XK_Otilde) /* U+00D5 LATIN CAPITAL LETTER O WITH TILDE */ \ + MAP(0x7B, XK_atilde) /* U+00E3 LATIN SMALL LETTER A WITH TILDE */ \ + MAP(0x7C, XK_ccedilla) /* U+00E7 LATIN SMALL LETTER C WITH CEDILLA */ \ + MAP(0x7D, XK_otilde) /* U+00F5 LATIN SMALL LETTER O WITH TILDE */ \ + } + +#define unmap_NRCS_Portuguese(code,dft) /* nothing */ + +#define map_NRCS_Spanish(code) \ + switch (code) { \ + MAP(0x23, XK_sterling) /* U+00A3 POUND SIGN */ \ + MAP(0x40, XK_section) /* U+00A7 SECTION SIGN */ \ + MAP(0x5B, XK_exclamdown) /* U+00A1 INVERTED EXCLAMATION MARK */ \ + MAP(0x5C, XK_Ntilde) /* U+00D1 LATIN CAPITAL LETTER N WITH TILDE */ \ + MAP(0x5D, XK_questiondown) /* U+00BF INVERTED QUESTION MARK */ \ + MAP(0x7B, XK_degree) /* U+00B0 DEGREE SIGN */ \ + MAP(0x7C, XK_ntilde) /* U+00F1 LATIN SMALL LETTER N WITH TILDE */ \ + MAP(0x7D, XK_ccedilla) /* U+00E7 LATIN SMALL LETTER C WITH CEDILLA */ \ + } + +#define unmap_NRCS_Spanish(code,dft) /* nothing */ + +#define map_NRCS_Swedish(code) \ + switch (code) { \ + MAP(0x40, XK_Eacute) \ + MAP(0x5B, XK_Adiaeresis) /* U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS */ \ + MAP(0x5C, XK_Odiaeresis) /* U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS */ \ + MAP(0x5D, XK_Aring) /* U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE */ \ + MAP(0x5E, XK_Udiaeresis) /* U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS */ \ + MAP(0x60, XK_eacute) /* U+00E9 LATIN SMALL LETTER E WITH ACUTE */ \ + MAP(0x7B, XK_adiaeresis) /* U+00E4 LATIN SMALL LETTER A WITH DIAERESIS */ \ + MAP(0x7C, XK_odiaeresis) /* U+00F6 LATIN SMALL LETTER O WITH DIAERESIS */ \ + MAP(0x7D, XK_aring) /* U+00E5 LATIN SMALL LETTER A WITH RING ABOVE */ \ + MAP(0x7E, XK_udiaeresis) /* U+00FC LATIN SMALL LETTER U WITH DIAERESIS */ \ + } + +#define unmap_NRCS_Swedish(code,dft) /* nothing */ + +#define map_NRCS_Swiss(code) \ + switch (code) { \ + MAP(0x23, XK_ugrave) /* U+00F9 LATIN SMALL LETTER U WITH GRAVE */ \ + MAP(0x40, XK_agrave) /* U+00E0 LATIN SMALL LETTER A WITH GRAVE */ \ + MAP(0x5B, XK_eacute) /* U+00E9 LATIN SMALL LETTER E WITH ACUTE */ \ + MAP(0x5C, XK_ccedilla) /* U+00E7 LATIN SMALL LETTER C WITH CEDILLA */ \ + MAP(0x5D, XK_ecircumflex) /* U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX */ \ + MAP(0x5E, XK_icircumflex) /* U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX */ \ + MAP(0x5F, XK_egrave) /* U+00E8 LATIN SMALL LETTER E WITH GRAVE */ \ + MAP(0x60, XK_ocircumflex) /* U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX */ \ + MAP(0x7B, XK_adiaeresis) /* U+00E4 LATIN SMALL LETTER A WITH DIAERESIS */ \ + MAP(0x7C, XK_odiaeresis) /* U+00F6 LATIN SMALL LETTER O WITH DIAERESIS */ \ + MAP(0x7D, XK_udiaeresis) /* U+00FC LATIN SMALL LETTER U WITH DIAERESIS */ \ + MAP(0x7E, XK_ucircumflex) /* U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX */ \ + } + +#define unmap_NRCS_Swiss(code,dft) /* nothing */ + +/* + * Unlike NRCS, which splices a few characters onto ISO-8859-1, the + * supplementary character sets are complete, normally mapped to GR. Most of + * these mappings rely upon glyphs not found in ISO-8859-1. We can display most + * of those using Unicode, thereby supporting specialized applications that use + * SCS with luit, subject to the limitation that select/paste will give + * meaningless results in terms of the application which uses these mappings. + * + * Since the codepages introduced with VT320, etc, use 8-bit encodings, there is + * no plausible argument to be made that these mappings "use" UTF-8, even though + * there is a hidden step in the terminal emulator which relies upon UTF-8. + */ + +#define map_DEC_Supp_Graphic(code,dft) \ + begin_CODEPAGE(94) \ + switch (code) { \ + XXX(0x24, UNDEF) \ + XXX(0x26, UNDEF) \ + UNI(0x28, 0x00A4) /* CURRENCY SIGN */ \ + XXX(0x2C, UNDEF) \ + XXX(0x2D, UNDEF) \ + XXX(0x2E, UNDEF) \ + XXX(0x2F, UNDEF) \ + XXX(0x34, UNDEF) \ + XXX(0x38, UNDEF) \ + XXX(0x3E, UNDEF) \ + XXX(0x50, UNDEF) \ + UNI(0x57, 0x0152) /* LATIN CAPITAL LIGATURE OE */ \ + UNI(0x5D, 0x0178) /* LATIN CAPITAL LETTER Y WITH DIAERESIS */ \ + XXX(0x5E, UNDEF) \ + UNI(0x5F, 0x005F) \ + XXX(0x70, UNDEF) \ + UNI(0x77, 0x0153) /* LATIN SMALL LIGATURE OE */ \ + UNI(0x7D, 0x00FF) /* LATIN SMALL LETTER Y WITH DIAERESIS */ \ + XXX(0x7E, UNDEF) \ + default: dft; break; \ + } \ + end_CODEPAGE() + +#define unmap_DEC_Supp_Graphic(code,dft) \ + switch (code) { \ + MAP(0x24, 0x1B) \ + MAP(0x26, 0x1B) \ + MAP(0x28, 0xA4) /* CURRENCY SIGN */ \ + MAP(0x2C, 0x1B) \ + MAP(0x2D, 0x1B) \ + MAP(0x2E, 0x1B) \ + MAP(0x2F, 0x1B) \ + MAP(0x34, 0x1B) \ + MAP(0x38, 0x1B) \ + MAP(0x3E, 0x1B) \ + MAP(0x50, 0x1B) \ + MAP(0x57, 0x97) /* LATIN CAPITAL LIGATURE OE */ \ + MAP(0x5D, 0x98) /* LATIN CAPITAL LETTER Y WITH DIAERESIS */ \ + MAP(0x5E, 0x1B) \ + MAP(0x5F, 0xDF) \ + MAP(0x70, 0x1B) \ + MAP(0x77, 0x99) /* LATIN SMALL LIGATURE OE */ \ + MAP(0x7D, 0xFF) /* LATIN SMALL LETTER Y WITH DIAERESIS */ \ + MAP(0x7E, 0x1B) \ + default: dft; break; \ + } + +#if OPT_WIDE_CHARS + +/* + * derived from http://www.vt100.net/charsets/technical.html + */ +#define map_DEC_Technical(code) \ + begin_CODEPAGE(94) \ + switch (code) { \ + UNI(0x21, 0x23B7) /* RADICAL SYMBOL BOTTOM Centred left to right, so that it joins up with 02/02 */ \ + UNI(0x22, 0x250C) /* BOX DRAWINGS LIGHT DOWN AND RIGHT */ \ + UNI(0x23, 0x2500) /* BOX DRAWINGS LIGHT HORIZONTAL */ \ + UNI(0x24, 0x2320) /* TOP HALF INTEGRAL with the proviso that the stem is vertical, to join with 02/06 */ \ + UNI(0x25, 0x2321) /* BOTTOM HALF INTEGRAL with the proviso above. */ \ + UNI(0x26, 0x2502) /* BOX DRAWINGS LIGHT VERTICAL */ \ + UNI(0x27, 0x23A1) /* LEFT SQUARE BRACKET UPPER CORNER Joins vertically to 02/06, 02/08. Doesn't join to its right. */ \ + UNI(0x28, 0x23A3) /* LEFT SQUARE BRACKET LOWER CORNER Joins vertically to 02/06, 02/07. Doesn't join to its right. */ \ + UNI(0x29, 0x23A4) /* RIGHT SQUARE BRACKET UPPER CORNER Joins vertically to 026, 02a. Doesn't join to its left. */ \ + UNI(0x2A, 0x23A6) /* RIGHT SQUARE BRACKET LOWER CORNER Joins vertically to 026, 029. Doesn't join to its left. */ \ + UNI(0x2B, 0x23A7) /* LEFT CURLY BRACKET UPPER HOOK Joins vertically to 026, 02c, 02/15. Doesn't join to its right. */ \ + UNI(0x2C, 0x23A9) /* LEFT CURLY BRACKET LOWER HOOK Joins vertically to 026, 02b, 02/15. Doesn't join to its right. */ \ + UNI(0x2D, 0x23AB) /* RIGHT CURLY BRACKET UPPER HOOK Joins vertically to 026, 02e, 03/00. Doesn't join to its left. */ \ + UNI(0x2E, 0x23AD) /* RIGHT CURLY BRACKET LOWER HOOK Joins vertically to 026, 02d, 03/00. Doesn't join to its left. */ \ + UNI(0x2F, 0x23A8) /* LEFT CURLY BRACKET MIDDLE PIECE Joins vertically to 026, 02b, 02c. */ \ + UNI(0x30, 0x23AC) /* RIGHT CURLY BRACKET MIDDLE PIECE Joins vertically to 02/06, 02d, 02e. */ \ + XXX(0x31, PUA(0)) /* Top Left Sigma. Joins to right with 02/03, 03/05. Joins diagonally below right with 03/03, 03/07. */ \ + XXX(0x32, PUA(1)) /* Bottom Left Sigma. Joins to right with 02/03, 03/06. Joins diagonally above right with 03/04, 03/07. */ \ + XXX(0x33, PUA(2)) /* Top Diagonal Sigma. Line for joining 03/01 to 03/04 or 03/07. */ \ + XXX(0x34, PUA(3)) /* Bottom Diagonal Sigma. Line for joining 03/02 to 03/03 or 03/07. */ \ + XXX(0x35, PUA(4)) /* Top Right Sigma. Joins to left with 02/03, 03/01. */ \ + XXX(0x36, PUA(5)) /* Bottom Right Sigma. Joins to left with 02/03, 03/02. */ \ + XXX(0x37, PUA(6)) /* Middle Sigma. Joins diagonally with 03/01, 03/02, 03/03, 03/04. */ \ + XXX(0x38, UNDEF) /* undefined */ \ + XXX(0x39, UNDEF) /* undefined */ \ + XXX(0x3A, UNDEF) /* undefined */ \ + XXX(0x3B, UNDEF) /* undefined */ \ + UNI(0x3C, 0x2264) /* LESS-THAN OR EQUAL TO */ \ + UNI(0x3D, 0x2260) /* NOT EQUAL TO */ \ + UNI(0x3E, 0x2265) /* GREATER-THAN OR EQUAL TO */ \ + UNI(0x3F, 0x222B) /* INTEGRAL */ \ + UNI(0x40, 0x2234) /* THEREFORE */ \ + UNI(0x41, 0x221D) /* PROPORTIONAL TO */ \ + UNI(0x42, 0x221E) /* INFINITY */ \ + UNI(0x43, 0x00F7) /* DIVISION SIGN */ \ + UNI(0x44, 0x0394) /* GREEK CAPITAL DELTA */ \ + UNI(0x45, 0x2207) /* NABLA */ \ + UNI(0x46, 0x03A6) /* GREEK CAPITAL LETTER PHI */ \ + UNI(0x47, 0x0393) /* GREEK CAPITAL LETTER GAMMA */ \ + UNI(0x48, 0x223C) /* TILDE OPERATOR */ \ + UNI(0x49, 0x2243) /* ASYMPTOTICALLY EQUAL TO */ \ + UNI(0x4A, 0x0398) /* GREEK CAPITAL LETTER THETA */ \ + UNI(0x4B, 0x00D7) /* MULTIPLICATION SIGN */ \ + UNI(0x4C, 0x039B) /* GREEK CAPITAL LETTER LAMDA */ \ + UNI(0x4D, 0x21D4) /* LEFT RIGHT DOUBLE ARROW */ \ + UNI(0x4E, 0x21D2) /* RIGHTWARDS DOUBLE ARROW */ \ + UNI(0x4F, 0x2261) /* IDENTICAL TO */ \ + UNI(0x50, 0x03A0) /* GREEK CAPITAL LETTER PI */ \ + UNI(0x51, 0x03A8) /* GREEK CAPITAL LETTER PSI */ \ + XXX(0x52, UNDEF) /* undefined */ \ + UNI(0x53, 0x03A3) /* GREEK CAPITAL LETTER SIGMA */ \ + XXX(0x54, UNDEF) /* undefined */ \ + XXX(0x55, UNDEF) /* undefined */ \ + UNI(0x56, 0x221A) /* SQUARE ROOT */ \ + UNI(0x57, 0x03A9) /* GREEK CAPITAL LETTER OMEGA */ \ + UNI(0x58, 0x039E) /* GREEK CAPITAL LETTER XI */ \ + UNI(0x59, 0x03A5) /* GREEK CAPITAL LETTER UPSILON */ \ + UNI(0x5A, 0x2282) /* SUBSET OF */ \ + UNI(0x5B, 0x2283) /* SUPERSET OF */ \ + UNI(0x5C, 0x2229) /* INTERSECTION */ \ + UNI(0x5D, 0x222A) /* UNION */ \ + UNI(0x5E, 0x2227) /* LOGICAL AND */ \ + UNI(0x5F, 0x2228) /* LOGICAL OR */ \ + UNI(0x60, 0x00AC) /* NOT SIGN */ \ + UNI(0x61, 0x03B1) /* GREEK SMALL LETTER ALPHA */ \ + UNI(0x62, 0x03B2) /* GREEK SMALL LETTER BETA */ \ + UNI(0x63, 0x03C7) /* GREEK SMALL LETTER CHI */ \ + UNI(0x64, 0x03B4) /* GREEK SMALL LETTER DELTA */ \ + UNI(0x65, 0x03B5) /* GREEK SMALL LETTER EPSILON */ \ + UNI(0x66, 0x03C6) /* GREEK SMALL LETTER PHI */ \ + UNI(0x67, 0x03B3) /* GREEK SMALL LETTER GAMMA */ \ + UNI(0x68, 0x03B7) /* GREEK SMALL LETTER ETA */ \ + UNI(0x69, 0x03B9) /* GREEK SMALL LETTER IOTA */ \ + UNI(0x6A, 0x03B8) /* GREEK SMALL LETTER THETA */ \ + UNI(0x6B, 0x03BA) /* GREEK SMALL LETTER KAPPA */ \ + UNI(0x6C, 0x03BB) /* GREEK SMALL LETTER LAMDA */ \ + XXX(0x6D, UNDEF) /* undefined */ \ + UNI(0x6E, 0x03BD) /* GREEK SMALL LETTER NU */ \ + UNI(0x6F, 0x2202) /* PARTIAL DIFFERENTIAL */ \ + UNI(0x70, 0x03C0) /* GREEK SMALL LETTER PI */ \ + UNI(0x71, 0x03C8) /* GREEK SMALL LETTER PSI */ \ + UNI(0x72, 0x03C1) /* GREEK SMALL LETTER RHO */ \ + UNI(0x73, 0x03C3) /* GREEK SMALL LETTER SIGMA */ \ + UNI(0x74, 0x03C4) /* GREEK SMALL LETTER TAU */ \ + XXX(0x75, UNDEF) /* undefined */ \ + UNI(0x76, 0x0192) /* LATIN SMALL LETTER F WITH HOOK Probably chosen for its meaning of "function" */ \ + UNI(0x77, 0x03C9) /* GREEK SMALL LETTER OMEGA */ \ + UNI(0x78, 0x03BE) /* GREEK SMALL LETTER XI */ \ + UNI(0x79, 0x03C5) /* GREEK SMALL LETTER UPSILON */ \ + UNI(0x7A, 0x03B6) /* GREEK SMALL LETTER ZETA */ \ + UNI(0x7B, 0x2190) /* LEFTWARDS ARROW */ \ + UNI(0x7C, 0x2191) /* UPWARDS ARROW */ \ + UNI(0x7D, 0x2192) /* RIGHTWARDS ARROW */ \ + UNI(0x7E, 0x2193) /* DOWNWARDS ARROW */ \ + } \ + end_CODEPAGE() + +#define unmap_DEC_Technical(code,dft) \ + switch (code) { \ + MAP(0x21, 0xD5) /* RADICAL SYMBOL BOTTOM Centred left to right, so that it joins up with 02/02 */ \ + MAP(0x22, 0xD6) /* BOX DRAWINGS LIGHT DOWN AND RIGHT */ \ + MAP(0x23, 0x1D) /* BOX DRAWINGS LIGHT HORIZONTAL */ \ + MAP(0x24, 0xD7) /* TOP HALF INTEGRAL with the proviso that the stem is vertical, to join with 02/06 */ \ + MAP(0x25, 0xD8) /* BOTTOM HALF INTEGRAL with the proviso above. */ \ + MAP(0x26, 0x84) /* BOX DRAWINGS LIGHT VERTICAL */ \ + MAP(0x27, 0xD9) /* LEFT SQUARE BRACKET UPPER CORNER Joins vertically to 02/06, 02/08. Doesn't join to its right. */ \ + MAP(0x28, 0xDA) /* LEFT SQUARE BRACKET LOWER CORNER Joins vertically to 02/06, 02/07. Doesn't join to its right. */ \ + MAP(0x29, 0xDB) /* RIGHT SQUARE BRACKET UPPER CORNER Joins vertically to 026, 02a. Doesn't join to its left. */ \ + MAP(0x2A, 0xDC) /* RIGHT SQUARE BRACKET LOWER CORNER Joins vertically to 026, 029. Doesn't join to its left. */ \ + MAP(0x2B, 0xDD) /* LEFT CURLY BRACKET UPPER HOOK Joins vertically to 026, 02c, 02/15. Doesn't join to its right. */ \ + MAP(0x2C, 0xDE) /* LEFT CURLY BRACKET LOWER HOOK Joins vertically to 026, 02b, 02/15. Doesn't join to its right. */ \ + MAP(0x2D, 0xDF) /* RIGHT CURLY BRACKET UPPER HOOK Joins vertically to 026, 02e, 03/00. Doesn't join to its left. */ \ + MAP(0x2E, 0xE0) /* RIGHT CURLY BRACKET LOWER HOOK Joins vertically to 026, 02d, 03/00. Doesn't join to its left. */ \ + MAP(0x2F, 0xE1) /* LEFT CURLY BRACKET MIDDLE PIECE Joins vertically to 026, 02b, 02c. */ \ + MAP(0x30, 0xE2) /* RIGHT CURLY BRACKET MIDDLE PIECE Joins vertically to 02/06, 02d, 02e. */ \ + MAP(0x31, 0xE3) /* Top Left Sigma. Joins to right with 02/03, 03/05. Joins diagonally below right with 03/03, 03/07. */ \ + MAP(0x32, 0xE4) /* Bottom Left Sigma. Joins to right with 02/03, 03/06. Joins diagonally above right with 03/04, 03/07. */ \ + MAP(0x33, 0xE5) /* Top Diagonal Sigma. Line for joining 03/01 to 03/04 or 03/07. */ \ + MAP(0x34, 0xE6) /* Bottom Diagonal Sigma. Line for joining 03/02 to 03/03 or 03/07. */ \ + MAP(0x35, 0xE7) /* Top Right Sigma. Joins to left with 02/03, 03/01. */ \ + MAP(0x36, 0xE8) /* Bottom Right Sigma. Joins to left with 02/03, 03/02. */ \ + MAP(0x37, 0xE9) /* Middle Sigma. Joins diagonally with 03/01, 03/02, 03/03, 03/04. */ \ + MAP(0x38, 0x1B) /* undefined */ \ + MAP(0x39, 0x1B) /* undefined */ \ + MAP(0x3A, 0x1B) /* undefined */ \ + MAP(0x3B, 0x1B) /* undefined */ \ + MAP(0x3C, 0x85) /* LESS-THAN OR EQUAL TO */ \ + MAP(0x3D, 0x87) /* NOT EQUAL TO */ \ + MAP(0x3E, 0x86) /* GREATER-THAN OR EQUAL TO */ \ + MAP(0x3F, 0xEA) /* INTEGRAL */ \ + MAP(0x40, 0xEB) /* THEREFORE */ \ + MAP(0x41, 0xEC) /* PROPORTIONAL TO */ \ + MAP(0x42, 0xED) /* INFINITY */ \ + MAP(0x43, 0xF7) /* DIVISION SIGN */ \ + MAP(0x44, 0xEE) /* GREEK CAPITAL DELTA */ \ + MAP(0x45, 0xEF) /* NABLA */ \ + MAP(0x46, 0xAC) /* GREEK CAPITAL LETTER PHI */ \ + MAP(0x47, 0x78) /* GREEK CAPITAL LETTER GAMMA */ \ + MAP(0x48, 0xF0) /* TILDE OPERATOR */ \ + MAP(0x49, 0xF1) /* ASYMPTOTICALLY EQUAL TO */ \ + MAP(0x4A, 0x7D) /* GREEK CAPITAL LETTER THETA */ \ + MAP(0x4B, 0xD7) /* MULTIPLICATION SIGN */ \ + MAP(0x4C, 0xA2) /* GREEK CAPITAL LETTER LAMDA */ \ + MAP(0x4D, 0xF2) /* LEFT RIGHT DOUBLE ARROW */ \ + MAP(0x4E, 0xF3) /* RIGHTWARDS DOUBLE ARROW */ \ + MAP(0x4F, 0xF4) /* IDENTICAL TO */ \ + MAP(0x50, 0xA7) /* GREEK CAPITAL LETTER PI */ \ + MAP(0x51, 0xAE) /* GREEK CAPITAL LETTER PSI */ \ + MAP(0x52, 0x1B) /* undefined */ \ + MAP(0x53, 0xA9) /* GREEK CAPITAL LETTER SIGMA */ \ + MAP(0x54, 0x1B) /* undefined */ \ + MAP(0x55, 0x1B) /* undefined */ \ + MAP(0x56, 0xF5) /* SQUARE ROOT */ \ + MAP(0x57, 0xAF) /* GREEK CAPITAL LETTER OMEGA */ \ + MAP(0x58, 0xA5) /* GREEK CAPITAL LETTER XI */ \ + MAP(0x59, 0xAB) /* GREEK CAPITAL LETTER UPSILON */ \ + MAP(0x5A, 0xF6) /* SUBSET OF */ \ + MAP(0x5B, 0xF7) /* SUPERSET OF */ \ + MAP(0x5C, 0xF8) /* INTERSECTION */ \ + MAP(0x5D, 0xF9) /* UNION */ \ + MAP(0x5E, 0xFA) /* LOGICAL AND */ \ + MAP(0x5F, 0xFB) /* LOGICAL OR */ \ + MAP(0x60, 0xAC) /* NOT SIGN */ \ + MAP(0x61, 0xB7) /* GREEK SMALL LETTER ALPHA */ \ + MAP(0x62, 0xB8) /* GREEK SMALL LETTER BETA */ \ + MAP(0x63, 0xCD) /* GREEK SMALL LETTER CHI */ \ + MAP(0x64, 0xBA) /* GREEK SMALL LETTER DELTA */ \ + MAP(0x65, 0xBB) /* GREEK SMALL LETTER EPSILON */ \ + MAP(0x66, 0xCC) /* GREEK SMALL LETTER PHI */ \ + MAP(0x67, 0xB9) /* GREEK SMALL LETTER GAMMA */ \ + MAP(0x68, 0xBD) /* GREEK SMALL LETTER ETA */ \ + MAP(0x69, 0xBF) /* GREEK SMALL LETTER IOTA */ \ + MAP(0x6A, 0xBE) /* GREEK SMALL LETTER THETA */ \ + MAP(0x6B, 0xC0) /* GREEK SMALL LETTER KAPPA */ \ + MAP(0x6C, 0xC1) /* GREEK SMALL LETTER LAMDA */ \ + MAP(0x6D, 0x1B) /* undefined */ \ + MAP(0x6E, 0xC3) /* GREEK SMALL LETTER NU */ \ + MAP(0x6F, 0xFC) /* PARTIAL DIFFERENTIAL */ \ + MAP(0x70, 0xC6) /* GREEK SMALL LETTER PI */ \ + MAP(0x71, 0xCE) /* GREEK SMALL LETTER PSI */ \ + MAP(0x72, 0xC7) /* GREEK SMALL LETTER RHO */ \ + MAP(0x73, 0xC9) /* GREEK SMALL LETTER SIGMA */ \ + MAP(0x74, 0xCA) /* GREEK SMALL LETTER TAU */ \ + MAP(0x75, 0x1B) /* undefined */ \ + MAP(0x76, 0xFD) /* LATIN SMALL LETTER F WITH HOOK Probably chosen for its meaning of "function" */ \ + MAP(0x77, 0xCF) /* GREEK SMALL LETTER OMEGA */ \ + MAP(0x78, 0xC4) /* GREEK SMALL LETTER XI */ \ + MAP(0x79, 0xCB) /* GREEK SMALL LETTER UPSILON */ \ + MAP(0x7A, 0xBC) /* GREEK SMALL LETTER ZETA */ \ + MAP(0x7B, 0xFE) /* LEFTWARDS ARROW */ \ + MAP(0x7C, 0xFF) /* UPWARDS ARROW */ \ + MAP(0x7D, 0x100) /* RIGHTWARDS ARROW */ \ + MAP(0x7E, 0x02) /* DOWNWARDS ARROW */ \ + default: dft; break; \ + } + +/* + * ISO Latin/Cyrillic is 8859-5 + */ +#define map_ISO_Latin_Cyrillic(code) \ + begin_CODEPAGE(96) \ + switch (code) { \ + UNI(0x20, 0x00A0) /* NO-BREAK SPACE */ \ + UNI(0x21, 0x0401) /* CYRILLIC CAPITAL LETTER IO */ \ + UNI(0x22, 0x0402) /* CYRILLIC CAPITAL LETTER DJE */ \ + UNI(0x23, 0x0403) /* CYRILLIC CAPITAL LETTER GJE */ \ + UNI(0x24, 0x0404) /* CYRILLIC CAPITAL LETTER UKRAINIAN IE */ \ + UNI(0x25, 0x0405) /* CYRILLIC CAPITAL LETTER DZE */ \ + UNI(0x26, 0x0406) /* CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I */ \ + UNI(0x27, 0x0407) /* CYRILLIC CAPITAL LETTER YI */ \ + UNI(0x28, 0x0408) /* CYRILLIC CAPITAL LETTER JE */ \ + UNI(0x29, 0x0409) /* CYRILLIC CAPITAL LETTER LJE */ \ + UNI(0x2A, 0x040A) /* CYRILLIC CAPITAL LETTER NJE */ \ + UNI(0x2B, 0x040B) /* CYRILLIC CAPITAL LETTER TSHE */ \ + UNI(0x2C, 0x040C) /* CYRILLIC CAPITAL LETTER KJE */ \ + UNI(0x2D, 0x00AD) /* SOFT HYPHEN */ \ + UNI(0x2E, 0x040E) /* CYRILLIC CAPITAL LETTER SHORT U */ \ + UNI(0x2F, 0x040F) /* CYRILLIC CAPITAL LETTER DZHE */ \ + UNI(0x30, 0x0410) /* CYRILLIC CAPITAL LETTER A */ \ + UNI(0x31, 0x0411) /* CYRILLIC CAPITAL LETTER BE */ \ + UNI(0x32, 0x0412) /* CYRILLIC CAPITAL LETTER VE */ \ + UNI(0x33, 0x0413) /* CYRILLIC CAPITAL LETTER GHE */ \ + UNI(0x34, 0x0414) /* CYRILLIC CAPITAL LETTER DE */ \ + UNI(0x35, 0x0415) /* CYRILLIC CAPITAL LETTER IE */ \ + UNI(0x36, 0x0416) /* CYRILLIC CAPITAL LETTER ZHE */ \ + UNI(0x37, 0x0417) /* CYRILLIC CAPITAL LETTER ZE */ \ + UNI(0x38, 0x0418) /* CYRILLIC CAPITAL LETTER I */ \ + UNI(0x39, 0x0419) /* CYRILLIC CAPITAL LETTER SHORT I */ \ + UNI(0x3A, 0x041A) /* CYRILLIC CAPITAL LETTER KA */ \ + UNI(0x3B, 0x041B) /* CYRILLIC CAPITAL LETTER EL */ \ + UNI(0x3C, 0x041C) /* CYRILLIC CAPITAL LETTER EM */ \ + UNI(0x3D, 0x041D) /* CYRILLIC CAPITAL LETTER EN */ \ + UNI(0x3E, 0x041E) /* CYRILLIC CAPITAL LETTER O */ \ + UNI(0x3F, 0x041F) /* CYRILLIC CAPITAL LETTER PE */ \ + UNI(0x40, 0x0420) /* CYRILLIC CAPITAL LETTER ER */ \ + UNI(0x41, 0x0421) /* CYRILLIC CAPITAL LETTER ES */ \ + UNI(0x42, 0x0422) /* CYRILLIC CAPITAL LETTER TE */ \ + UNI(0x43, 0x0423) /* CYRILLIC CAPITAL LETTER U */ \ + UNI(0x44, 0x0424) /* CYRILLIC CAPITAL LETTER EF */ \ + UNI(0x45, 0x0425) /* CYRILLIC CAPITAL LETTER HA */ \ + UNI(0x46, 0x0426) /* CYRILLIC CAPITAL LETTER TSE */ \ + UNI(0x47, 0x0427) /* CYRILLIC CAPITAL LETTER CHE */ \ + UNI(0x48, 0x0428) /* CYRILLIC CAPITAL LETTER SHA */ \ + UNI(0x49, 0x0429) /* CYRILLIC CAPITAL LETTER SHCHA */ \ + UNI(0x4A, 0x042A) /* CYRILLIC CAPITAL LETTER HARD SIGN */ \ + UNI(0x4B, 0x042B) /* CYRILLIC CAPITAL LETTER YERU */ \ + UNI(0x4C, 0x042C) /* CYRILLIC CAPITAL LETTER SOFT SIGN */ \ + UNI(0x4D, 0x042D) /* CYRILLIC CAPITAL LETTER E */ \ + UNI(0x4E, 0x042E) /* CYRILLIC CAPITAL LETTER YU */ \ + UNI(0x4F, 0x042F) /* CYRILLIC CAPITAL LETTER YA */ \ + UNI(0x50, 0x0430) /* CYRILLIC SMALL LETTER A */ \ + UNI(0x51, 0x0431) /* CYRILLIC SMALL LETTER BE */ \ + UNI(0x52, 0x0432) /* CYRILLIC SMALL LETTER VE */ \ + UNI(0x53, 0x0433) /* CYRILLIC SMALL LETTER GHE */ \ + UNI(0x54, 0x0434) /* CYRILLIC SMALL LETTER DE */ \ + UNI(0x55, 0x0435) /* CYRILLIC SMALL LETTER IE */ \ + UNI(0x56, 0x0436) /* CYRILLIC SMALL LETTER ZHE */ \ + UNI(0x57, 0x0437) /* CYRILLIC SMALL LETTER ZE */ \ + UNI(0x58, 0x0438) /* CYRILLIC SMALL LETTER I */ \ + UNI(0x59, 0x0439) /* CYRILLIC SMALL LETTER SHORT I */ \ + UNI(0x5A, 0x043A) /* CYRILLIC SMALL LETTER KA */ \ + UNI(0x5B, 0x043B) /* CYRILLIC SMALL LETTER EL */ \ + UNI(0x5C, 0x043C) /* CYRILLIC SMALL LETTER EM */ \ + UNI(0x5D, 0x043D) /* CYRILLIC SMALL LETTER EN */ \ + UNI(0x5E, 0x043E) /* CYRILLIC SMALL LETTER O */ \ + UNI(0x5F, 0x043F) /* CYRILLIC SMALL LETTER PE */ \ + UNI(0x60, 0x0440) /* CYRILLIC SMALL LETTER ER */ \ + UNI(0x61, 0x0441) /* CYRILLIC SMALL LETTER ES */ \ + UNI(0x62, 0x0442) /* CYRILLIC SMALL LETTER TE */ \ + UNI(0x63, 0x0443) /* CYRILLIC SMALL LETTER U */ \ + UNI(0x64, 0x0444) /* CYRILLIC SMALL LETTER EF */ \ + UNI(0x65, 0x0445) /* CYRILLIC SMALL LETTER HA */ \ + UNI(0x66, 0x0446) /* CYRILLIC SMALL LETTER TSE */ \ + UNI(0x67, 0x0447) /* CYRILLIC SMALL LETTER CHE */ \ + UNI(0x68, 0x0448) /* CYRILLIC SMALL LETTER SHA */ \ + UNI(0x69, 0x0449) /* CYRILLIC SMALL LETTER SHCHA */ \ + UNI(0x6A, 0x044A) /* CYRILLIC SMALL LETTER HARD SIGN */ \ + UNI(0x6B, 0x044B) /* CYRILLIC SMALL LETTER YERU */ \ + UNI(0x6C, 0x044C) /* CYRILLIC SMALL LETTER SOFT SIGN */ \ + UNI(0x6D, 0x044D) /* CYRILLIC SMALL LETTER E */ \ + UNI(0x6E, 0x044E) /* CYRILLIC SMALL LETTER YU */ \ + UNI(0x6F, 0x044F) /* CYRILLIC SMALL LETTER YA */ \ + UNI(0x70, 0x2116) /* NUMERO SIGN */ \ + UNI(0x71, 0x0451) /* CYRILLIC SMALL LETTER IO */ \ + UNI(0x72, 0x0452) /* CYRILLIC SMALL LETTER DJE */ \ + UNI(0x73, 0x0453) /* CYRILLIC SMALL LETTER GJE */ \ + UNI(0x74, 0x0454) /* CYRILLIC SMALL LETTER UKRAINIAN IE */ \ + UNI(0x75, 0x0455) /* CYRILLIC SMALL LETTER DZE */ \ + UNI(0x76, 0x0456) /* CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I */ \ + UNI(0x77, 0x0457) /* CYRILLIC SMALL LETTER YI */ \ + UNI(0x78, 0x0458) /* CYRILLIC SMALL LETTER JE */ \ + UNI(0x79, 0x0459) /* CYRILLIC SMALL LETTER LJE */ \ + UNI(0x7A, 0x045A) /* CYRILLIC SMALL LETTER NJE */ \ + UNI(0x7B, 0x045B) /* CYRILLIC SMALL LETTER TSHE */ \ + UNI(0x7C, 0x045C) /* CYRILLIC SMALL LETTER KJE */ \ + UNI(0x7D, 0x00A7) /* SECTION SIGN */ \ + UNI(0x7E, 0x045E) /* CYRILLIC SMALL LETTER SHORT U */ \ + UNI(0x7F, 0x045F) /* CYRILLIC SMALL LETTER DZHE */ \ + } \ + end_CODEPAGE() + +#define unmap_ISO_Latin_Cyrillic(code,dft) \ + switch (code) { \ + MAP(0x21, 0x03) /* CYRILLIC CAPITAL LETTER IO */ \ + MAP(0x22, 0x04) /* CYRILLIC CAPITAL LETTER DJE */ \ + MAP(0x23, 0x05) /* CYRILLIC CAPITAL LETTER GJE */ \ + MAP(0x24, 0x06) /* CYRILLIC CAPITAL LETTER UKRAINIAN IE */ \ + MAP(0x25, 0x07) /* CYRILLIC CAPITAL LETTER DZE */ \ + MAP(0x26, 0x08) /* CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I */ \ + MAP(0x27, 0x09) /* CYRILLIC CAPITAL LETTER YI */ \ + MAP(0x28, 0x0A) /* CYRILLIC CAPITAL LETTER JE */ \ + MAP(0x29, 0x0B) /* CYRILLIC CAPITAL LETTER LJE */ \ + MAP(0x2A, 0x0C) /* CYRILLIC CAPITAL LETTER NJE */ \ + MAP(0x2B, 0x0D) /* CYRILLIC CAPITAL LETTER TSHE */ \ + MAP(0x2C, 0x0E) /* CYRILLIC CAPITAL LETTER KJE */ \ + MAP(0x2E, 0x0F) /* CYRILLIC CAPITAL LETTER SHORT U */ \ + MAP(0x2F, 0x10) /* CYRILLIC CAPITAL LETTER DZHE */ \ + MAP(0x30, 0x11) /* CYRILLIC CAPITAL LETTER A */ \ + MAP(0x31, 0x12) /* CYRILLIC CAPITAL LETTER BE */ \ + MAP(0x32, 0x13) /* CYRILLIC CAPITAL LETTER VE */ \ + MAP(0x33, 0x14) /* CYRILLIC CAPITAL LETTER GHE */ \ + MAP(0x34, 0x15) /* CYRILLIC CAPITAL LETTER DE */ \ + MAP(0x35, 0x16) /* CYRILLIC CAPITAL LETTER IE */ \ + MAP(0x36, 0x17) /* CYRILLIC CAPITAL LETTER ZHE */ \ + MAP(0x37, 0x18) /* CYRILLIC CAPITAL LETTER ZE */ \ + MAP(0x38, 0x19) /* CYRILLIC CAPITAL LETTER I */ \ + MAP(0x39, 0x1A) /* CYRILLIC CAPITAL LETTER SHORT I */ \ + MAP(0x3A, 0x1B) /* CYRILLIC CAPITAL LETTER KA */ \ + MAP(0x3B, 0x1C) /* CYRILLIC CAPITAL LETTER EL */ \ + MAP(0x3C, 0x1D) /* CYRILLIC CAPITAL LETTER EM */ \ + MAP(0x3D, 0x1E) /* CYRILLIC CAPITAL LETTER EN */ \ + MAP(0x3E, 0x1F) /* CYRILLIC CAPITAL LETTER O */ \ + MAP(0x3F, 0x20) /* CYRILLIC CAPITAL LETTER PE */ \ + MAP(0x40, 0x21) /* CYRILLIC CAPITAL LETTER ER */ \ + MAP(0x41, 0x22) /* CYRILLIC CAPITAL LETTER ES */ \ + MAP(0x42, 0x23) /* CYRILLIC CAPITAL LETTER TE */ \ + MAP(0x43, 0x24) /* CYRILLIC CAPITAL LETTER U */ \ + MAP(0x44, 0x25) /* CYRILLIC CAPITAL LETTER EF */ \ + MAP(0x45, 0x26) /* CYRILLIC CAPITAL LETTER HA */ \ + MAP(0x46, 0x27) /* CYRILLIC CAPITAL LETTER TSE */ \ + MAP(0x47, 0x28) /* CYRILLIC CAPITAL LETTER CHE */ \ + MAP(0x48, 0x29) /* CYRILLIC CAPITAL LETTER SHA */ \ + MAP(0x49, 0x2A) /* CYRILLIC CAPITAL LETTER SHCHA */ \ + MAP(0x4A, 0x2B) /* CYRILLIC CAPITAL LETTER HARD SIGN */ \ + MAP(0x4B, 0x2C) /* CYRILLIC CAPITAL LETTER YERU */ \ + MAP(0x4C, 0x2D) /* CYRILLIC CAPITAL LETTER SOFT SIGN */ \ + MAP(0x4D, 0x2E) /* CYRILLIC CAPITAL LETTER E */ \ + MAP(0x4E, 0x2F) /* CYRILLIC CAPITAL LETTER YU */ \ + MAP(0x4F, 0x30) /* CYRILLIC CAPITAL LETTER YA */ \ + MAP(0x50, 0x31) /* CYRILLIC SMALL LETTER A */ \ + MAP(0x51, 0x32) /* CYRILLIC SMALL LETTER BE */ \ + MAP(0x52, 0x33) /* CYRILLIC SMALL LETTER VE */ \ + MAP(0x53, 0x34) /* CYRILLIC SMALL LETTER GHE */ \ + MAP(0x54, 0x35) /* CYRILLIC SMALL LETTER DE */ \ + MAP(0x55, 0x36) /* CYRILLIC SMALL LETTER IE */ \ + MAP(0x56, 0x37) /* CYRILLIC SMALL LETTER ZHE */ \ + MAP(0x57, 0x38) /* CYRILLIC SMALL LETTER ZE */ \ + MAP(0x58, 0x39) /* CYRILLIC SMALL LETTER I */ \ + MAP(0x59, 0x3A) /* CYRILLIC SMALL LETTER SHORT I */ \ + MAP(0x5A, 0x3B) /* CYRILLIC SMALL LETTER KA */ \ + MAP(0x5B, 0x3C) /* CYRILLIC SMALL LETTER EL */ \ + MAP(0x5C, 0x3D) /* CYRILLIC SMALL LETTER EM */ \ + MAP(0x5D, 0x3E) /* CYRILLIC SMALL LETTER EN */ \ + MAP(0x5E, 0x3F) /* CYRILLIC SMALL LETTER O */ \ + MAP(0x5F, 0x40) /* CYRILLIC SMALL LETTER PE */ \ + MAP(0x60, 0x41) /* CYRILLIC SMALL LETTER ER */ \ + MAP(0x61, 0x42) /* CYRILLIC SMALL LETTER ES */ \ + MAP(0x62, 0x43) /* CYRILLIC SMALL LETTER TE */ \ + MAP(0x63, 0x44) /* CYRILLIC SMALL LETTER U */ \ + MAP(0x64, 0x45) /* CYRILLIC SMALL LETTER EF */ \ + MAP(0x65, 0x46) /* CYRILLIC SMALL LETTER HA */ \ + MAP(0x66, 0x47) /* CYRILLIC SMALL LETTER TSE */ \ + MAP(0x67, 0x48) /* CYRILLIC SMALL LETTER CHE */ \ + MAP(0x68, 0x49) /* CYRILLIC SMALL LETTER SHA */ \ + MAP(0x69, 0x4A) /* CYRILLIC SMALL LETTER SHCHA */ \ + MAP(0x6A, 0x4B) /* CYRILLIC SMALL LETTER HARD SIGN */ \ + MAP(0x6B, 0x4C) /* CYRILLIC SMALL LETTER YERU */ \ + MAP(0x6C, 0x4D) /* CYRILLIC SMALL LETTER SOFT SIGN */ \ + MAP(0x6D, 0x4E) /* CYRILLIC SMALL LETTER E */ \ + MAP(0x6E, 0x4F) /* CYRILLIC SMALL LETTER YU */ \ + MAP(0x6F, 0x50) /* CYRILLIC SMALL LETTER YA */ \ + MAP(0x70, 0x51) /* NUMERO SIGN */ \ + MAP(0x71, 0x52) /* CYRILLIC SMALL LETTER IO */ \ + MAP(0x72, 0x53) /* CYRILLIC SMALL LETTER DJE */ \ + MAP(0x73, 0x54) /* CYRILLIC SMALL LETTER GJE */ \ + MAP(0x74, 0x55) /* CYRILLIC SMALL LETTER UKRAINIAN IE */ \ + MAP(0x75, 0x56) /* CYRILLIC SMALL LETTER DZE */ \ + MAP(0x76, 0x57) /* CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I */ \ + MAP(0x77, 0x58) /* CYRILLIC SMALL LETTER YI */ \ + MAP(0x78, 0x59) /* CYRILLIC SMALL LETTER JE */ \ + MAP(0x79, 0x5A) /* CYRILLIC SMALL LETTER LJE */ \ + MAP(0x7A, 0x5B) /* CYRILLIC SMALL LETTER NJE */ \ + MAP(0x7B, 0x5C) /* CYRILLIC SMALL LETTER TSHE */ \ + MAP(0x7C, 0x5D) /* CYRILLIC SMALL LETTER KJE */ \ + MAP(0x7D, 0xA7) /* SECTION SIGN */ \ + MAP(0x7E, 0x5E) /* CYRILLIC SMALL LETTER SHORT U */ \ + MAP(0x7F, 0x5F) /* CYRILLIC SMALL LETTER DZHE */ \ + default: dft; break; \ + } + +/* + * ISO Greek is 8859-7 + */ +#define map_ISO_Greek_Supp(code) \ + begin_CODEPAGE(96) \ + switch (code) { \ + UNI(0x20, 0x00A0) /* NO-BREAK SPACE */ \ + UNI(0x21, 0x2018) /* LEFT SINGLE QUOTATION MARK */ \ + UNI(0x22, 0x2019) /* RIGHT SINGLE QUOTATION MARK */ \ + UNI(0x23, 0x00A3) /* POUND SIGN */ \ + XXX(0x24, UNDEF) /* undefined */ \ + XXX(0x25, UNDEF) /* undefined */ \ + UNI(0x26, 0x00A6) /* BROKEN BAR */ \ + UNI(0x27, 0x00A7) /* SECTION SIGN */ \ + UNI(0x28, 0x00A8) /* DIAERESIS */ \ + UNI(0x29, 0x00A9) /* COPYRIGHT SIGN */ \ + XXX(0x2A, UNDEF) /* undefined */ \ + UNI(0x2B, 0x00AB) /* LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ + UNI(0x2C, 0x00AC) /* NOT SIGN */ \ + UNI(0x2D, 0x00AD) /* SOFT HYPHEN */ \ + XXX(0x2E, UNDEF) /* undefined */ \ + UNI(0x2F, 0x2015) /* HORIZONTAL BAR */ \ + UNI(0x30, 0x00B0) /* DEGREE SIGN */ \ + UNI(0x31, 0x00B1) /* PLUS-MINUS SIGN */ \ + UNI(0x32, 0x00B2) /* SUPERSCRIPT TWO */ \ + UNI(0x33, 0x00B3) /* SUPERSCRIPT THREE */ \ + UNI(0x34, 0x0384) /* GREEK TONOS */ \ + UNI(0x35, 0x0385) /* GREEK DIALYTIKA TONOS */ \ + UNI(0x36, 0x0386) /* GREEK CAPITAL LETTER ALPHA WITH TONOS */ \ + UNI(0x37, 0x00B7) /* MIDDLE DOT */ \ + UNI(0x38, 0x0388) /* GREEK CAPITAL LETTER EPSILON WITH TONOS */ \ + UNI(0x39, 0x0389) /* GREEK CAPITAL LETTER ETA WITH TONOS */ \ + UNI(0x3A, 0x038A) /* GREEK CAPITAL LETTER IOTA WITH TONOS */ \ + UNI(0x3B, 0x00BB) /* RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ + UNI(0x3C, 0x038C) /* GREEK CAPITAL LETTER OMICRON WITH TONOS */ \ + UNI(0x3D, 0x00BD) /* VULGAR FRACTION ONE HALF */ \ + UNI(0x3E, 0x038E) /* GREEK CAPITAL LETTER UPSILON WITH TONOS */ \ + UNI(0x3F, 0x038F) /* GREEK CAPITAL LETTER OMEGA WITH TONOS */ \ + UNI(0x40, 0x0390) /* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS */ \ + UNI(0x41, 0x0391) /* GREEK CAPITAL LETTER ALPHA */ \ + UNI(0x42, 0x0392) /* GREEK CAPITAL LETTER BETA */ \ + UNI(0x43, 0x0393) /* GREEK CAPITAL LETTER GAMMA */ \ + UNI(0x44, 0x0394) /* GREEK CAPITAL LETTER DELTA */ \ + UNI(0x45, 0x0395) /* GREEK CAPITAL LETTER EPSILON */ \ + UNI(0x46, 0x0396) /* GREEK CAPITAL LETTER ZETA */ \ + UNI(0x47, 0x0397) /* GREEK CAPITAL LETTER ETA */ \ + UNI(0x48, 0x0398) /* GREEK CAPITAL LETTER THETA */ \ + UNI(0x49, 0x0399) /* GREEK CAPITAL LETTER IOTA */ \ + UNI(0x4A, 0x039A) /* GREEK CAPITAL LETTER KAPPA */ \ + UNI(0x4B, 0x039B) /* GREEK CAPITAL LETTER LAMDA */ \ + UNI(0x4C, 0x039C) /* GREEK CAPITAL LETTER MU */ \ + UNI(0x4D, 0x039D) /* GREEK CAPITAL LETTER NU */ \ + UNI(0x4E, 0x039E) /* GREEK CAPITAL LETTER XI */ \ + UNI(0x4F, 0x039F) /* GREEK CAPITAL LETTER OMICRON */ \ + UNI(0x50, 0x03A0) /* GREEK CAPITAL LETTER PI */ \ + UNI(0x51, 0x03A1) /* GREEK CAPITAL LETTER RHO */ \ + XXX(0x52, UNDEF) /* undefined */ \ + UNI(0x53, 0x03A3) /* GREEK CAPITAL LETTER SIGMA */ \ + UNI(0x54, 0x03A4) /* GREEK CAPITAL LETTER TAU */ \ + UNI(0x55, 0x03A5) /* GREEK CAPITAL LETTER UPSILON */ \ + UNI(0x56, 0x03A6) /* GREEK CAPITAL LETTER PHI */ \ + UNI(0x57, 0x03A7) /* GREEK CAPITAL LETTER CHI */ \ + UNI(0x58, 0x03A8) /* GREEK CAPITAL LETTER PSI */ \ + UNI(0x59, 0x03A9) /* GREEK CAPITAL LETTER OMEGA */ \ + UNI(0x5A, 0x03AA) /* GREEK CAPITAL LETTER IOTA WITH DIALYTIKA */ \ + UNI(0x5B, 0x03AB) /* GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA */ \ + UNI(0x5C, 0x03AC) /* GREEK SMALL LETTER ALPHA WITH TONOS */ \ + UNI(0x5D, 0x03AD) /* GREEK SMALL LETTER EPSILON WITH TONOS */ \ + UNI(0x5E, 0x03AE) /* GREEK SMALL LETTER ETA WITH TONOS */ \ + UNI(0x5F, 0x03AF) /* GREEK SMALL LETTER IOTA WITH TONOS */ \ + UNI(0x60, 0x03B0) /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS */ \ + UNI(0x61, 0x03B1) /* GREEK SMALL LETTER ALPHA */ \ + UNI(0x62, 0x03B2) /* GREEK SMALL LETTER BETA */ \ + UNI(0x63, 0x03B3) /* GREEK SMALL LETTER GAMMA */ \ + UNI(0x64, 0x03B4) /* GREEK SMALL LETTER DELTA */ \ + UNI(0x65, 0x03B5) /* GREEK SMALL LETTER EPSILON */ \ + UNI(0x66, 0x03B6) /* GREEK SMALL LETTER ZETA */ \ + UNI(0x67, 0x03B7) /* GREEK SMALL LETTER ETA */ \ + UNI(0x68, 0x03B8) /* GREEK SMALL LETTER THETA */ \ + UNI(0x69, 0x03B9) /* GREEK SMALL LETTER IOTA */ \ + UNI(0x6A, 0x03BA) /* GREEK SMALL LETTER KAPPA */ \ + UNI(0x6B, 0x03BB) /* GREEK SMALL LETTER LAMDA */ \ + UNI(0x6C, 0x03BC) /* GREEK SMALL LETTER MU */ \ + UNI(0x6D, 0x03BD) /* GREEK SMALL LETTER NU */ \ + UNI(0x6E, 0x03BE) /* GREEK SMALL LETTER XI */ \ + UNI(0x6F, 0x03BF) /* GREEK SMALL LETTER OMICRON */ \ + UNI(0x70, 0x03C0) /* GREEK SMALL LETTER PI */ \ + UNI(0x71, 0x03C1) /* GREEK SMALL LETTER RHO */ \ + UNI(0x72, 0x03C2) /* GREEK SMALL LETTER FINAL SIGMA */ \ + UNI(0x73, 0x03C3) /* GREEK SMALL LETTER SIGMA */ \ + UNI(0x74, 0x03C4) /* GREEK SMALL LETTER TAU */ \ + UNI(0x75, 0x03C5) /* GREEK SMALL LETTER UPSILON */ \ + UNI(0x76, 0x03C6) /* GREEK SMALL LETTER PHI */ \ + UNI(0x77, 0x03C7) /* GREEK SMALL LETTER CHI */ \ + UNI(0x78, 0x03C8) /* GREEK SMALL LETTER PSI */ \ + UNI(0x79, 0x03C9) /* GREEK SMALL LETTER OMEGA */ \ + UNI(0x7A, 0x03CA) /* GREEK SMALL LETTER IOTA WITH DIALYTIKA */ \ + UNI(0x7B, 0x03CB) /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA */ \ + UNI(0x7C, 0x03CC) /* GREEK SMALL LETTER OMICRON WITH TONOS */ \ + UNI(0x7D, 0x03CD) /* GREEK SMALL LETTER UPSILON WITH TONOS */ \ + UNI(0x7E, 0x03CE) /* GREEK SMALL LETTER OMEGA WITH TONOS */ \ + XXX(0x7F, UNDEF) /* undefined */ \ + } \ + end_CODEPAGE() + +#define unmap_ISO_Greek_Supp(code,dft) \ + switch (code) { \ + MAP(0x21, 0x60) /* LEFT SINGLE QUOTATION MARK */ \ + MAP(0x22, 0x27) /* RIGHT SINGLE QUOTATION MARK */ \ + MAP(0x24, 0x1B) /* undefined */ \ + MAP(0x25, 0x1B) /* undefined */ \ + MAP(0x2A, 0x1B) /* undefined */ \ + MAP(0x2E, 0x1B) /* undefined */ \ + MAP(0x2F, 0x2D) /* HORIZONTAL BAR */ \ + MAP(0x34, 0x96) /* GREEK TONOS */ \ + MAP(0x35, 0x95) /* GREEK DIALYTIKA TONOS */ \ + MAP(0x36, 0x6E) /* GREEK CAPITAL LETTER ALPHA WITH TONOS */ \ + MAP(0x38, 0x6F) /* GREEK CAPITAL LETTER EPSILON WITH TONOS */ \ + MAP(0x39, 0x70) /* GREEK CAPITAL LETTER ETA WITH TONOS */ \ + MAP(0x3A, 0x71) /* GREEK CAPITAL LETTER IOTA WITH TONOS */ \ + MAP(0x3C, 0x72) /* GREEK CAPITAL LETTER OMICRON WITH TONOS */ \ + MAP(0x3E, 0x73) /* GREEK CAPITAL LETTER UPSILON WITH TONOS */ \ + MAP(0x3F, 0x74) /* GREEK CAPITAL LETTER OMEGA WITH TONOS */ \ + MAP(0x40, 0x75) /* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS */ \ + MAP(0x41, 0x76) /* GREEK CAPITAL LETTER ALPHA */ \ + MAP(0x42, 0x77) /* GREEK CAPITAL LETTER BETA */ \ + MAP(0x43, 0x78) /* GREEK CAPITAL LETTER GAMMA */ \ + MAP(0x44, 0x79) /* GREEK CAPITAL LETTER DELTA */ \ + MAP(0x45, 0x7A) /* GREEK CAPITAL LETTER EPSILON */ \ + MAP(0x46, 0x7B) /* GREEK CAPITAL LETTER ZETA */ \ + MAP(0x47, 0x7C) /* GREEK CAPITAL LETTER ETA */ \ + MAP(0x48, 0x7D) /* GREEK CAPITAL LETTER THETA */ \ + MAP(0x49, 0x7E) /* GREEK CAPITAL LETTER IOTA */ \ + MAP(0x4A, 0x7F) /* GREEK CAPITAL LETTER KAPPA */ \ + MAP(0x4B, 0xA2) /* GREEK CAPITAL LETTER LAMDA */ \ + MAP(0x4C, 0xA3) /* GREEK CAPITAL LETTER MU */ \ + MAP(0x4D, 0xA4) /* GREEK CAPITAL LETTER NU */ \ + MAP(0x4E, 0xA5) /* GREEK CAPITAL LETTER XI */ \ + MAP(0x4F, 0xA6) /* GREEK CAPITAL LETTER OMICRON */ \ + MAP(0x50, 0xA7) /* GREEK CAPITAL LETTER PI */ \ + MAP(0x51, 0xA8) /* GREEK CAPITAL LETTER RHO */ \ + MAP(0x52, 0x1B) /* undefined */ \ + MAP(0x53, 0xA9) /* GREEK CAPITAL LETTER SIGMA */ \ + MAP(0x54, 0xAA) /* GREEK CAPITAL LETTER TAU */ \ + MAP(0x55, 0xAB) /* GREEK CAPITAL LETTER UPSILON */ \ + MAP(0x56, 0xAC) /* GREEK CAPITAL LETTER PHI */ \ + MAP(0x57, 0xAD) /* GREEK CAPITAL LETTER CHI */ \ + MAP(0x58, 0xAE) /* GREEK CAPITAL LETTER PSI */ \ + MAP(0x59, 0xAF) /* GREEK CAPITAL LETTER OMEGA */ \ + MAP(0x5A, 0xB0) /* GREEK CAPITAL LETTER IOTA WITH DIALYTIKA */ \ + MAP(0x5B, 0xB1) /* GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA */ \ + MAP(0x5C, 0xB2) /* GREEK SMALL LETTER ALPHA WITH TONOS */ \ + MAP(0x5D, 0xB3) /* GREEK SMALL LETTER EPSILON WITH TONOS */ \ + MAP(0x5E, 0xB4) /* GREEK SMALL LETTER ETA WITH TONOS */ \ + MAP(0x5F, 0xB5) /* GREEK SMALL LETTER IOTA WITH TONOS */ \ + MAP(0x60, 0xB6) /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS */ \ + MAP(0x61, 0xB7) /* GREEK SMALL LETTER ALPHA */ \ + MAP(0x62, 0xB8) /* GREEK SMALL LETTER BETA */ \ + MAP(0x63, 0xB9) /* GREEK SMALL LETTER GAMMA */ \ + MAP(0x64, 0xBA) /* GREEK SMALL LETTER DELTA */ \ + MAP(0x65, 0xBB) /* GREEK SMALL LETTER EPSILON */ \ + MAP(0x66, 0xBC) /* GREEK SMALL LETTER ZETA */ \ + MAP(0x67, 0xBD) /* GREEK SMALL LETTER ETA */ \ + MAP(0x68, 0xBE) /* GREEK SMALL LETTER THETA */ \ + MAP(0x69, 0xBF) /* GREEK SMALL LETTER IOTA */ \ + MAP(0x6A, 0xC0) /* GREEK SMALL LETTER KAPPA */ \ + MAP(0x6B, 0xC1) /* GREEK SMALL LETTER LAMDA */ \ + MAP(0x6C, 0xC2) /* GREEK SMALL LETTER MU */ \ + MAP(0x6D, 0xC3) /* GREEK SMALL LETTER NU */ \ + MAP(0x6E, 0xC4) /* GREEK SMALL LETTER XI */ \ + MAP(0x6F, 0xC5) /* GREEK SMALL LETTER OMICRON */ \ + MAP(0x70, 0xC6) /* GREEK SMALL LETTER PI */ \ + MAP(0x71, 0xC7) /* GREEK SMALL LETTER RHO */ \ + MAP(0x72, 0xC8) /* GREEK SMALL LETTER FINAL SIGMA */ \ + MAP(0x73, 0xC9) /* GREEK SMALL LETTER SIGMA */ \ + MAP(0x74, 0xCA) /* GREEK SMALL LETTER TAU */ \ + MAP(0x75, 0xCB) /* GREEK SMALL LETTER UPSILON */ \ + MAP(0x76, 0xCC) /* GREEK SMALL LETTER PHI */ \ + MAP(0x77, 0xCD) /* GREEK SMALL LETTER CHI */ \ + MAP(0x78, 0xCE) /* GREEK SMALL LETTER PSI */ \ + MAP(0x79, 0xCF) /* GREEK SMALL LETTER OMEGA */ \ + MAP(0x7A, 0xD0) /* GREEK SMALL LETTER IOTA WITH DIALYTIKA */ \ + MAP(0x7B, 0xD1) /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA */ \ + MAP(0x7C, 0xD2) /* GREEK SMALL LETTER OMICRON WITH TONOS */ \ + MAP(0x7D, 0xD3) /* GREEK SMALL LETTER UPSILON WITH TONOS */ \ + MAP(0x7E, 0xD4) /* GREEK SMALL LETTER OMEGA WITH TONOS */ \ + MAP(0x7F, 0x1B) /* undefined */ \ + default: dft; break; \ + } + +/* + * figure A-23 "ISO Latin-Hebrew Supplemental Character Set" + */ +#define map_ISO_Hebrew(code) \ + begin_CODEPAGE(96) \ + switch (code) { \ + UNI(0x20, 0x00A0) /* NO-BREAK SPACE */ \ + XXX(0x21, UNDEF) /* undefined */ \ + UNI(0x22, 0x00A2) /* CENT SIGN */ \ + UNI(0x23, 0x00A3) /* POUND SIGN */ \ + UNI(0x24, 0x00A4) /* CURRENCY SIGN */ \ + UNI(0x25, 0x00A5) /* YEN SIGN */ \ + UNI(0x26, 0x00A6) /* BROKEN BAR */ \ + UNI(0x27, 0x00A7) /* SECTION SIGN */ \ + UNI(0x28, 0x00A8) /* DIAERESIS */ \ + UNI(0x29, 0x00A9) /* COPYRIGHT SIGN */ \ + UNI(0x2A, 0x00D7) /* MULTIPLICATION SIGN */ \ + UNI(0x2B, 0x00AB) /* LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ + UNI(0x2C, 0x00AC) /* NOT SIGN */ \ + UNI(0x2D, 0x00AD) /* SOFT HYPHEN */ \ + UNI(0x2E, 0x00AE) /* REGISTERED SIGN */ \ + UNI(0x2F, 0x00AF) /* MACRON */ \ + UNI(0x30, 0x00B0) /* DEGREE SIGN */ \ + UNI(0x31, 0x00B1) /* PLUS-MINUS SIGN */ \ + UNI(0x32, 0x00B2) /* SUPERSCRIPT TWO */ \ + UNI(0x33, 0x00B3) /* SUPERSCRIPT THREE */ \ + UNI(0x34, 0x00B4) /* ACUTE ACCENT */ \ + UNI(0x35, 0x00B5) /* MICRO SIGN */ \ + UNI(0x36, 0x00B6) /* PILCROW SIGN */ \ + UNI(0x37, 0x00B7) /* MIDDLE DOT */ \ + UNI(0x38, 0x00B8) /* CEDILLA */ \ + UNI(0x39, 0x00B9) /* SUPERSCRIPT ONE */ \ + UNI(0x3A, 0x00F7) /* DIVISION SIGN */ \ + UNI(0x3B, 0x00BB) /* RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ + UNI(0x3C, 0x00BC) /* VULGAR FRACTION ONE QUARTER */ \ + UNI(0x3D, 0x00BD) /* VULGAR FRACTION ONE HALF */ \ + UNI(0x3E, 0x00BE) /* VULGAR FRACTION THREE QUARTERS */ \ + XXX(0x3F, UNDEF) /* undefined */ \ + XXX(0x40, UNDEF) /* undefined */ \ + XXX(0x41, UNDEF) /* undefined */ \ + XXX(0x42, UNDEF) /* undefined */ \ + XXX(0x43, UNDEF) /* undefined */ \ + XXX(0x44, UNDEF) /* undefined */ \ + XXX(0x45, UNDEF) /* undefined */ \ + XXX(0x46, UNDEF) /* undefined */ \ + XXX(0x47, UNDEF) /* undefined */ \ + XXX(0x48, UNDEF) /* undefined */ \ + XXX(0x49, UNDEF) /* undefined */ \ + XXX(0x4A, UNDEF) /* undefined */ \ + XXX(0x4B, UNDEF) /* undefined */ \ + XXX(0x4C, UNDEF) /* undefined */ \ + XXX(0x4D, UNDEF) /* undefined */ \ + XXX(0x4E, UNDEF) /* undefined */ \ + XXX(0x4F, UNDEF) /* undefined */ \ + XXX(0x50, UNDEF) /* undefined */ \ + XXX(0x51, UNDEF) /* undefined */ \ + XXX(0x52, UNDEF) /* undefined */ \ + XXX(0x53, UNDEF) /* undefined */ \ + XXX(0x54, UNDEF) /* undefined */ \ + XXX(0x55, UNDEF) /* undefined */ \ + XXX(0x56, UNDEF) /* undefined */ \ + XXX(0x57, UNDEF) /* undefined */ \ + XXX(0x58, UNDEF) /* undefined */ \ + XXX(0x59, UNDEF) /* undefined */ \ + XXX(0x5A, UNDEF) /* undefined */ \ + XXX(0x5B, UNDEF) /* undefined */ \ + XXX(0x5C, UNDEF) /* undefined */ \ + XXX(0x5D, UNDEF) /* undefined */ \ + XXX(0x5E, UNDEF) /* undefined */ \ + UNI(0x5F, 0x2017) /* DOUBLE LOW LINE */ \ + UNI(0x60, 0x05D0) /* HEBREW LETTER ALEF */ \ + UNI(0x61, 0x05D1) /* HEBREW LETTER BET */ \ + UNI(0x62, 0x05D2) /* HEBREW LETTER GIMEL */ \ + UNI(0x63, 0x05D3) /* HEBREW LETTER DALET */ \ + UNI(0x64, 0x05D4) /* HEBREW LETTER HE */ \ + UNI(0x65, 0x05D5) /* HEBREW LETTER VAV */ \ + UNI(0x66, 0x05D6) /* HEBREW LETTER ZAYIN */ \ + UNI(0x67, 0x05D7) /* HEBREW LETTER HET */ \ + UNI(0x68, 0x05D8) /* HEBREW LETTER TET */ \ + UNI(0x69, 0x05D9) /* HEBREW LETTER YOD */ \ + UNI(0x6A, 0x05DA) /* HEBREW LETTER FINAL KAF */ \ + UNI(0x6B, 0x05DB) /* HEBREW LETTER KAF */ \ + UNI(0x6C, 0x05DC) /* HEBREW LETTER LAMED */ \ + UNI(0x6D, 0x05DD) /* HEBREW LETTER FINAL MEM */ \ + UNI(0x6E, 0x05DE) /* HEBREW LETTER MEM */ \ + UNI(0x6F, 0x05DF) /* HEBREW LETTER FINAL NUN */ \ + UNI(0x70, 0x05E0) /* HEBREW LETTER NUN */ \ + UNI(0x71, 0x05E1) /* HEBREW LETTER SAMEKH */ \ + UNI(0x72, 0x05E2) /* HEBREW LETTER AYIN */ \ + UNI(0x73, 0x05E3) /* HEBREW LETTER FINAL PE */ \ + UNI(0x74, 0x05E4) /* HEBREW LETTER PE */ \ + UNI(0x75, 0x05E5) /* HEBREW LETTER FINAL TSADI */ \ + UNI(0x76, 0x05E6) /* HEBREW LETTER TSADI */ \ + UNI(0x77, 0x05E7) /* HEBREW LETTER QOF */ \ + UNI(0x78, 0x05E8) /* HEBREW LETTER RESH */ \ + UNI(0x79, 0x05E9) /* HEBREW LETTER SHIN */ \ + UNI(0x7A, 0x05EA) /* HEBREW LETTER TAV */ \ + XXX(0x7B, UNDEF) /* undefined */ \ + XXX(0x7C, UNDEF) /* undefined */ \ + XXX(0x7D, UNDEF) /* undefined */ \ + XXX(0x7E, UNDEF) /* undefined */ \ + XXX(0x7F, UNDEF) /* undefined */ \ + } \ + end_CODEPAGE() + +#define unmap_ISO_Hebrew(code,dft) \ + switch (code) { \ + MAP(0x21, 0x1B) /* undefined */ \ + MAP(0x2A, 0xD7) /* MULTIPLICATION SIGN */ \ + MAP(0x3A, 0xF7) /* DIVISION SIGN */ \ + MAP(0x3F, 0x1B) /* undefined */ \ + MAP(0x40, 0x1B) /* undefined */ \ + MAP(0x41, 0x1B) /* undefined */ \ + MAP(0x42, 0x1B) /* undefined */ \ + MAP(0x43, 0x1B) /* undefined */ \ + MAP(0x44, 0x1B) /* undefined */ \ + MAP(0x45, 0x1B) /* undefined */ \ + MAP(0x46, 0x1B) /* undefined */ \ + MAP(0x47, 0x1B) /* undefined */ \ + MAP(0x48, 0x1B) /* undefined */ \ + MAP(0x49, 0x1B) /* undefined */ \ + MAP(0x4A, 0x1B) /* undefined */ \ + MAP(0x4B, 0x1B) /* undefined */ \ + MAP(0x4C, 0x1B) /* undefined */ \ + MAP(0x4D, 0x1B) /* undefined */ \ + MAP(0x4E, 0x1B) /* undefined */ \ + MAP(0x4F, 0x1B) /* undefined */ \ + MAP(0x50, 0x1B) /* undefined */ \ + MAP(0x51, 0x1B) /* undefined */ \ + MAP(0x52, 0x1B) /* undefined */ \ + MAP(0x53, 0x1B) /* undefined */ \ + MAP(0x54, 0x1B) /* undefined */ \ + MAP(0x55, 0x1B) /* undefined */ \ + MAP(0x56, 0x1B) /* undefined */ \ + MAP(0x57, 0x1B) /* undefined */ \ + MAP(0x58, 0x1B) /* undefined */ \ + MAP(0x59, 0x1B) /* undefined */ \ + MAP(0x5A, 0x1B) /* undefined */ \ + MAP(0x5B, 0x1B) /* undefined */ \ + MAP(0x5C, 0x1B) /* undefined */ \ + MAP(0x5D, 0x1B) /* undefined */ \ + MAP(0x5E, 0x1B) /* undefined */ \ + MAP(0x5F, 0x52) /* DOUBLE LOW LINE */ \ + MAP(0x60, 0x53) /* HEBREW LETTER ALEF */ \ + MAP(0x61, 0x54) /* HEBREW LETTER BET */ \ + MAP(0x62, 0x55) /* HEBREW LETTER GIMEL */ \ + MAP(0x63, 0x56) /* HEBREW LETTER DALET */ \ + MAP(0x64, 0x57) /* HEBREW LETTER HE */ \ + MAP(0x65, 0x58) /* HEBREW LETTER VAV */ \ + MAP(0x66, 0x59) /* HEBREW LETTER ZAYIN */ \ + MAP(0x67, 0x5A) /* HEBREW LETTER HET */ \ + MAP(0x68, 0x5B) /* HEBREW LETTER TET */ \ + MAP(0x69, 0x5C) /* HEBREW LETTER YOD */ \ + MAP(0x6A, 0x5D) /* HEBREW LETTER FINAL KAF */ \ + MAP(0x6B, 0x5E) /* HEBREW LETTER KAF */ \ + MAP(0x6C, 0x5F) /* HEBREW LETTER LAMED */ \ + MAP(0x6D, 0x60) /* HEBREW LETTER FINAL MEM */ \ + MAP(0x6E, 0x61) /* HEBREW LETTER MEM */ \ + MAP(0x6F, 0x62) /* HEBREW LETTER FINAL NUN */ \ + MAP(0x70, 0x63) /* HEBREW LETTER NUN */ \ + MAP(0x71, 0x64) /* HEBREW LETTER SAMEKH */ \ + MAP(0x72, 0x65) /* HEBREW LETTER AYIN */ \ + MAP(0x73, 0x66) /* HEBREW LETTER FINAL PE */ \ + MAP(0x74, 0x67) /* HEBREW LETTER PE */ \ + MAP(0x75, 0x68) /* HEBREW LETTER FINAL TSADI */ \ + MAP(0x76, 0x69) /* HEBREW LETTER TSADI */ \ + MAP(0x77, 0x6A) /* HEBREW LETTER QOF */ \ + MAP(0x78, 0x6B) /* HEBREW LETTER RESH */ \ + MAP(0x79, 0x6C) /* HEBREW LETTER SHIN */ \ + MAP(0x7A, 0x6D) /* HEBREW LETTER TAV */ \ + MAP(0x7B, 0x1B) /* undefined */ \ + MAP(0x7C, 0x1B) /* undefined */ \ + MAP(0x7D, 0x1B) /* undefined */ \ + MAP(0x7E, 0x1B) /* undefined */ \ + MAP(0x7F, 0x1B) /* undefined */ \ + default: dft; break; \ + } + +/* + * ISO Latin-2 is 8859-2 + */ +#define map_ISO_Latin_2(code) \ + begin_CODEPAGE(96) \ + switch (code) { \ + UNI(0x20, 0x00A0) /* NO-BREAK SPACE */ \ + UNI(0x21, 0x0104) /* LATIN CAPITAL LETTER A WITH OGONEK */ \ + UNI(0x22, 0x02D8) /* BREVE */ \ + UNI(0x23, 0x0141) /* LATIN CAPITAL LETTER L WITH STROKE */ \ + UNI(0x24, 0x00A4) /* CURRENCY SIGN */ \ + UNI(0x25, 0x013D) /* LATIN CAPITAL LETTER L WITH CARON */ \ + UNI(0x26, 0x015A) /* LATIN CAPITAL LETTER S WITH ACUTE */ \ + UNI(0x27, 0x00A7) /* SECTION SIGN */ \ + UNI(0x28, 0x00A8) /* DIAERESIS */ \ + UNI(0x29, 0x0160) /* LATIN CAPITAL LETTER S WITH CARON */ \ + UNI(0x2A, 0x015E) /* LATIN CAPITAL LETTER S WITH CEDILLA */ \ + UNI(0x2B, 0x0164) /* LATIN CAPITAL LETTER T WITH CARON */ \ + UNI(0x2C, 0x0179) /* LATIN CAPITAL LETTER Z WITH ACUTE */ \ + UNI(0x2D, 0x00AD) /* SOFT HYPHEN */ \ + UNI(0x2E, 0x017D) /* LATIN CAPITAL LETTER Z WITH CARON */ \ + UNI(0x2F, 0x017B) /* LATIN CAPITAL LETTER Z WITH DOT ABOVE */ \ + UNI(0x30, 0x00B0) /* DEGREE SIGN */ \ + UNI(0x31, 0x0105) /* LATIN SMALL LETTER A WITH OGONEK */ \ + UNI(0x32, 0x02DB) /* OGONEK */ \ + UNI(0x33, 0x0142) /* LATIN SMALL LETTER L WITH STROKE */ \ + UNI(0x34, 0x00B4) /* ACUTE ACCENT */ \ + UNI(0x35, 0x013E) /* LATIN SMALL LETTER L WITH CARON */ \ + UNI(0x36, 0x015B) /* LATIN SMALL LETTER S WITH ACUTE */ \ + UNI(0x37, 0x02C7) /* CARON */ \ + UNI(0x38, 0x00B8) /* CEDILLA */ \ + UNI(0x39, 0x0161) /* LATIN SMALL LETTER S WITH CARON */ \ + UNI(0x3A, 0x015F) /* LATIN SMALL LETTER S WITH CEDILLA */ \ + UNI(0x3B, 0x0165) /* LATIN SMALL LETTER T WITH CARON */ \ + UNI(0x3C, 0x017A) /* LATIN SMALL LETTER Z WITH ACUTE */ \ + UNI(0x3D, 0x02DD) /* DOUBLE ACUTE ACCENT */ \ + UNI(0x3E, 0x017E) /* LATIN SMALL LETTER Z WITH CARON */ \ + UNI(0x3F, 0x017C) /* LATIN SMALL LETTER Z WITH DOT ABOVE */ \ + UNI(0x40, 0x0154) /* LATIN CAPITAL LETTER R WITH ACUTE */ \ + UNI(0x41, 0x00C1) /* LATIN CAPITAL LETTER A WITH ACUTE */ \ + UNI(0x42, 0x00C2) /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX */ \ + UNI(0x43, 0x0102) /* LATIN CAPITAL LETTER A WITH BREVE */ \ + UNI(0x44, 0x00C4) /* LATIN CAPITAL LETTER A WITH DIAERESIS */ \ + UNI(0x45, 0x0139) /* LATIN CAPITAL LETTER L WITH ACUTE */ \ + UNI(0x46, 0x0106) /* LATIN CAPITAL LETTER C WITH ACUTE */ \ + UNI(0x47, 0x00C7) /* LATIN CAPITAL LETTER C WITH CEDILLA */ \ + UNI(0x48, 0x010C) /* LATIN CAPITAL LETTER C WITH CARON */ \ + UNI(0x49, 0x00C9) /* LATIN CAPITAL LETTER E WITH ACUTE */ \ + UNI(0x4A, 0x0118) /* LATIN CAPITAL LETTER E WITH OGONEK */ \ + UNI(0x4B, 0x00CB) /* LATIN CAPITAL LETTER E WITH DIAERESIS */ \ + UNI(0x4C, 0x011A) /* LATIN CAPITAL LETTER E WITH CARON */ \ + UNI(0x4D, 0x00CD) /* LATIN CAPITAL LETTER I WITH ACUTE */ \ + UNI(0x4E, 0x00CE) /* LATIN CAPITAL LETTER I WITH CIRCUMFLEX */ \ + UNI(0x4F, 0x010E) /* LATIN CAPITAL LETTER D WITH CARON */ \ + UNI(0x50, 0x0110) /* LATIN CAPITAL LETTER D WITH STROKE */ \ + UNI(0x51, 0x0143) /* LATIN CAPITAL LETTER N WITH ACUTE */ \ + UNI(0x52, 0x0147) /* LATIN CAPITAL LETTER N WITH CARON */ \ + UNI(0x53, 0x00D3) /* LATIN CAPITAL LETTER O WITH ACUTE */ \ + UNI(0x54, 0x00D4) /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX */ \ + UNI(0x55, 0x0150) /* LATIN CAPITAL LETTER O WITH DOUBLE ACUTE */ \ + UNI(0x56, 0x00D6) /* LATIN CAPITAL LETTER O WITH DIAERESIS */ \ + UNI(0x57, 0x00D7) /* MULTIPLICATION SIGN */ \ + UNI(0x58, 0x0158) /* LATIN CAPITAL LETTER R WITH CARON */ \ + UNI(0x59, 0x016E) /* LATIN CAPITAL LETTER U WITH RING ABOVE */ \ + UNI(0x5A, 0x00DA) /* LATIN CAPITAL LETTER U WITH ACUTE */ \ + UNI(0x5B, 0x0170) /* LATIN CAPITAL LETTER U WITH DOUBLE ACUTE */ \ + UNI(0x5C, 0x00DC) /* LATIN CAPITAL LETTER U WITH DIAERESIS */ \ + UNI(0x5D, 0x00DD) /* LATIN CAPITAL LETTER Y WITH ACUTE */ \ + UNI(0x5E, 0x0162) /* LATIN CAPITAL LETTER T WITH CEDILLA */ \ + UNI(0x5F, 0x00DF) /* LATIN SMALL LETTER SHARP S */ \ + UNI(0x60, 0x0155) /* LATIN SMALL LETTER R WITH ACUTE */ \ + UNI(0x61, 0x00E1) /* LATIN SMALL LETTER A WITH ACUTE */ \ + UNI(0x62, 0x00E2) /* LATIN SMALL LETTER A WITH CIRCUMFLEX */ \ + UNI(0x63, 0x0103) /* LATIN SMALL LETTER A WITH BREVE */ \ + UNI(0x64, 0x00E4) /* LATIN SMALL LETTER A WITH DIAERESIS */ \ + UNI(0x65, 0x013A) /* LATIN SMALL LETTER L WITH ACUTE */ \ + UNI(0x66, 0x0107) /* LATIN SMALL LETTER C WITH ACUTE */ \ + UNI(0x67, 0x00E7) /* LATIN SMALL LETTER C WITH CEDILLA */ \ + UNI(0x68, 0x010D) /* LATIN SMALL LETTER C WITH CARON */ \ + UNI(0x69, 0x00E9) /* LATIN SMALL LETTER E WITH ACUTE */ \ + UNI(0x6A, 0x0119) /* LATIN SMALL LETTER E WITH OGONEK */ \ + UNI(0x6B, 0x00EB) /* LATIN SMALL LETTER E WITH DIAERESIS */ \ + UNI(0x6C, 0x011B) /* LATIN SMALL LETTER E WITH CARON */ \ + UNI(0x6D, 0x00ED) /* LATIN SMALL LETTER I WITH ACUTE */ \ + UNI(0x6E, 0x00EE) /* LATIN SMALL LETTER I WITH CIRCUMFLEX */ \ + UNI(0x6F, 0x010F) /* LATIN SMALL LETTER D WITH CARON */ \ + UNI(0x70, 0x0111) /* LATIN SMALL LETTER D WITH STROKE */ \ + UNI(0x71, 0x0144) /* LATIN SMALL LETTER N WITH ACUTE */ \ + UNI(0x72, 0x0148) /* LATIN SMALL LETTER N WITH CARON */ \ + UNI(0x73, 0x00F3) /* LATIN SMALL LETTER O WITH ACUTE */ \ + UNI(0x74, 0x00F4) /* LATIN SMALL LETTER O WITH CIRCUMFLEX */ \ + UNI(0x75, 0x0151) /* LATIN SMALL LETTER O WITH DOUBLE ACUTE */ \ + UNI(0x76, 0x00F6) /* LATIN SMALL LETTER O WITH DIAERESIS */ \ + UNI(0x77, 0x00F7) /* DIVISION SIGN */ \ + UNI(0x78, 0x0159) /* LATIN SMALL LETTER R WITH CARON */ \ + UNI(0x79, 0x016F) /* LATIN SMALL LETTER U WITH RING ABOVE */ \ + UNI(0x7A, 0x00FA) /* LATIN SMALL LETTER U WITH ACUTE */ \ + UNI(0x7B, 0x0171) /* LATIN SMALL LETTER U WITH DOUBLE ACUTE */ \ + UNI(0x7C, 0x00FC) /* LATIN SMALL LETTER U WITH DIAERESIS */ \ + UNI(0x7D, 0x00FD) /* LATIN SMALL LETTER Y WITH ACUTE */ \ + UNI(0x7E, 0x0163) /* LATIN SMALL LETTER T WITH CEDILLA */ \ + UNI(0x7F, 0x02D9) /* DOT ABOVE */ \ + } \ + end_CODEPAGE() + +#define unmap_ISO_Latin_2(code,dft) \ + switch (code) { \ + MAP(0x21, 0x9A) /* LATIN CAPITAL LETTER A WITH OGONEK */ \ + MAP(0x22, 0x90) /* BREVE */ \ + MAP(0x23, 0x9B) /* LATIN CAPITAL LETTER L WITH STROKE */ \ + MAP(0x25, 0x9C) /* LATIN CAPITAL LETTER L WITH CARON */ \ + MAP(0x26, 0x9D) /* LATIN CAPITAL LETTER S WITH ACUTE */ \ + MAP(0x29, 0x9E) /* LATIN CAPITAL LETTER S WITH CARON */ \ + MAP(0x2A, 0x9F) /* LATIN CAPITAL LETTER S WITH CEDILLA */ \ + MAP(0x2B, 0x21) /* LATIN CAPITAL LETTER T WITH CARON */ \ + MAP(0x2C, 0x22) /* LATIN CAPITAL LETTER Z WITH ACUTE */ \ + MAP(0x2E, 0x23) /* LATIN CAPITAL LETTER Z WITH CARON */ \ + MAP(0x2F, 0x24) /* LATIN CAPITAL LETTER Z WITH DOT ABOVE */ \ + MAP(0x31, 0x25) /* LATIN SMALL LETTER A WITH OGONEK */ \ + MAP(0x32, 0x91) /* OGONEK */ \ + MAP(0x33, 0x26) /* LATIN SMALL LETTER L WITH STROKE */ \ + MAP(0x35, 0x27) /* LATIN SMALL LETTER L WITH CARON */ \ + MAP(0x36, 0x28) /* LATIN SMALL LETTER S WITH ACUTE */ \ + MAP(0x37, 0x92) /* CARON */ \ + MAP(0x39, 0x29) /* LATIN SMALL LETTER S WITH CARON */ \ + MAP(0x3A, 0x2A) /* LATIN SMALL LETTER S WITH CEDILLA */ \ + MAP(0x3B, 0x2B) /* LATIN SMALL LETTER T WITH CARON */ \ + MAP(0x3C, 0x2C) /* LATIN SMALL LETTER Z WITH ACUTE */ \ + MAP(0x3D, 0x93) /* DOUBLE ACUTE ACCENT */ \ + MAP(0x3E, 0x2D) /* LATIN SMALL LETTER Z WITH CARON */ \ + MAP(0x3F, 0x2E) /* LATIN SMALL LETTER Z WITH DOT ABOVE */ \ + MAP(0x40, 0x2F) /* LATIN CAPITAL LETTER R WITH ACUTE */ \ + MAP(0x43, 0x30) /* LATIN CAPITAL LETTER A WITH BREVE */ \ + MAP(0x45, 0x31) /* LATIN CAPITAL LETTER L WITH ACUTE */ \ + MAP(0x46, 0x32) /* LATIN CAPITAL LETTER C WITH ACUTE */ \ + MAP(0x48, 0x33) /* LATIN CAPITAL LETTER C WITH CARON */ \ + MAP(0x4A, 0x34) /* LATIN CAPITAL LETTER E WITH OGONEK */ \ + MAP(0x4C, 0x35) /* LATIN CAPITAL LETTER E WITH CARON */ \ + MAP(0x4F, 0x36) /* LATIN CAPITAL LETTER D WITH CARON */ \ + MAP(0x51, 0x37) /* LATIN CAPITAL LETTER N WITH ACUTE */ \ + MAP(0x52, 0x38) /* LATIN CAPITAL LETTER N WITH CARON */ \ + MAP(0x55, 0x39) /* LATIN CAPITAL LETTER O WITH DOUBLE ACUTE */ \ + MAP(0x58, 0x3A) /* LATIN CAPITAL LETTER R WITH CARON */ \ + MAP(0x59, 0x3B) /* LATIN CAPITAL LETTER U WITH RING ABOVE */ \ + MAP(0x5B, 0x3C) /* LATIN CAPITAL LETTER U WITH DOUBLE ACUTE */ \ + MAP(0x5E, 0x3D) /* LATIN CAPITAL LETTER T WITH CEDILLA */ \ + MAP(0x60, 0x3E) /* LATIN SMALL LETTER R WITH ACUTE */ \ + MAP(0x63, 0x3F) /* LATIN SMALL LETTER A WITH BREVE */ \ + MAP(0x65, 0x40) /* LATIN SMALL LETTER L WITH ACUTE */ \ + MAP(0x66, 0x41) /* LATIN SMALL LETTER C WITH ACUTE */ \ + MAP(0x68, 0x42) /* LATIN SMALL LETTER C WITH CARON */ \ + MAP(0x6A, 0x43) /* LATIN SMALL LETTER E WITH OGONEK */ \ + MAP(0x6C, 0x44) /* LATIN SMALL LETTER E WITH CARON */ \ + MAP(0x6F, 0x45) /* LATIN SMALL LETTER D WITH CARON */ \ + MAP(0x70, 0x46) /* LATIN SMALL LETTER D WITH STROKE */ \ + MAP(0x71, 0x47) /* LATIN SMALL LETTER N WITH ACUTE */ \ + MAP(0x72, 0x48) /* LATIN SMALL LETTER N WITH CARON */ \ + MAP(0x75, 0x49) /* LATIN SMALL LETTER O WITH DOUBLE ACUTE */ \ + MAP(0x78, 0x4A) /* LATIN SMALL LETTER R WITH CARON */ \ + MAP(0x79, 0x4B) /* LATIN SMALL LETTER U WITH RING ABOVE */ \ + MAP(0x7B, 0x4C) /* LATIN SMALL LETTER U WITH DOUBLE ACUTE */ \ + MAP(0x7E, 0x4D) /* LATIN SMALL LETTER T WITH CEDILLA */ \ + MAP(0x7F, 0x94) /* DOT ABOVE */ \ + default: dft; break; \ + } + +/* + * ISO Latin-5 is 8859-9 + */ +#define map_ISO_Latin_5(code) \ + begin_CODEPAGE(96) \ + switch (code) { \ + UNI(0x20, 0x00A0) /* NO-BREAK SPACE */ \ + UNI(0x21, 0x00A1) /* INVERTED EXCLAMATION MARK */ \ + UNI(0x22, 0x00A2) /* CENT SIGN */ \ + UNI(0x23, 0x00A3) /* POUND SIGN */ \ + UNI(0x24, 0x00A4) /* CURRENCY SIGN */ \ + UNI(0x25, 0x00A5) /* YEN SIGN */ \ + UNI(0x26, 0x00A6) /* BROKEN BAR */ \ + UNI(0x27, 0x00A7) /* SECTION SIGN */ \ + UNI(0x28, 0x00A8) /* DIAERESIS */ \ + UNI(0x29, 0x00A9) /* COPYRIGHT SIGN */ \ + UNI(0x2A, 0x00AA) /* FEMININE ORDINAL INDICATOR */ \ + UNI(0x2B, 0x00AB) /* LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ + UNI(0x2C, 0x00AC) /* NOT SIGN */ \ + UNI(0x2D, 0x00AD) /* SOFT HYPHEN */ \ + UNI(0x2E, 0x00AE) /* REGISTERED SIGN */ \ + UNI(0x2F, 0x00AF) /* MACRON */ \ + UNI(0x30, 0x00B0) /* DEGREE SIGN */ \ + UNI(0x31, 0x00B1) /* PLUS-MINUS SIGN */ \ + UNI(0x32, 0x00B2) /* SUPERSCRIPT TWO */ \ + UNI(0x33, 0x00B3) /* SUPERSCRIPT THREE */ \ + UNI(0x34, 0x00B4) /* ACUTE ACCENT */ \ + UNI(0x35, 0x00B5) /* MICRO SIGN */ \ + UNI(0x36, 0x00B6) /* PILCROW SIGN */ \ + UNI(0x37, 0x00B7) /* MIDDLE DOT */ \ + UNI(0x38, 0x00B8) /* CEDILLA */ \ + UNI(0x39, 0x00B9) /* SUPERSCRIPT ONE */ \ + UNI(0x3A, 0x00BA) /* MASCULINE ORDINAL INDICATOR */ \ + UNI(0x3B, 0x00BB) /* RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ + UNI(0x3C, 0x00BC) /* VULGAR FRACTION ONE QUARTER */ \ + UNI(0x3D, 0x00BD) /* VULGAR FRACTION ONE HALF */ \ + UNI(0x3E, 0x00BE) /* VULGAR FRACTION THREE QUARTERS */ \ + UNI(0x3F, 0x00BF) /* INVERTED QUESTION MARK */ \ + UNI(0x40, 0x00C0) /* LATIN CAPITAL LETTER A WITH GRAVE */ \ + UNI(0x41, 0x00C1) /* LATIN CAPITAL LETTER A WITH ACUTE */ \ + UNI(0x42, 0x00C2) /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX */ \ + UNI(0x43, 0x00C3) /* LATIN CAPITAL LETTER A WITH TILDE */ \ + UNI(0x44, 0x00C4) /* LATIN CAPITAL LETTER A WITH DIAERESIS */ \ + UNI(0x45, 0x00C5) /* LATIN CAPITAL LETTER A WITH RING ABOVE */ \ + UNI(0x46, 0x00C6) /* LATIN CAPITAL LETTER AE */ \ + UNI(0x47, 0x00C7) /* LATIN CAPITAL LETTER C WITH CEDILLA */ \ + UNI(0x48, 0x00C8) /* LATIN CAPITAL LETTER E WITH GRAVE */ \ + UNI(0x49, 0x00C9) /* LATIN CAPITAL LETTER E WITH ACUTE */ \ + UNI(0x4A, 0x00CA) /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX */ \ + UNI(0x4B, 0x00CB) /* LATIN CAPITAL LETTER E WITH DIAERESIS */ \ + UNI(0x4C, 0x00CC) /* LATIN CAPITAL LETTER I WITH GRAVE */ \ + UNI(0x4D, 0x00CD) /* LATIN CAPITAL LETTER I WITH ACUTE */ \ + UNI(0x4E, 0x00CE) /* LATIN CAPITAL LETTER I WITH CIRCUMFLEX */ \ + UNI(0x4F, 0x00CF) /* LATIN CAPITAL LETTER I WITH DIAERESIS */ \ + UNI(0x50, 0x011E) /* LATIN CAPITAL LETTER G WITH BREVE */ \ + UNI(0x51, 0x00D1) /* LATIN CAPITAL LETTER N WITH TILDE */ \ + UNI(0x52, 0x00D2) /* LATIN CAPITAL LETTER O WITH GRAVE */ \ + UNI(0x53, 0x00D3) /* LATIN CAPITAL LETTER O WITH ACUTE */ \ + UNI(0x54, 0x00D4) /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX */ \ + UNI(0x55, 0x00D5) /* LATIN CAPITAL LETTER O WITH TILDE */ \ + UNI(0x56, 0x00D6) /* LATIN CAPITAL LETTER O WITH DIAERESIS */ \ + UNI(0x57, 0x00D7) /* MULTIPLICATION SIGN */ \ + UNI(0x58, 0x00D8) /* LATIN CAPITAL LETTER O WITH STROKE */ \ + UNI(0x59, 0x00D9) /* LATIN CAPITAL LETTER U WITH GRAVE */ \ + UNI(0x5A, 0x00DA) /* LATIN CAPITAL LETTER U WITH ACUTE */ \ + UNI(0x5B, 0x00DB) /* LATIN CAPITAL LETTER U WITH CIRCUMFLEX */ \ + UNI(0x5C, 0x00DC) /* LATIN CAPITAL LETTER U WITH DIAERESIS */ \ + UNI(0x5D, 0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */ \ + UNI(0x5E, 0x015E) /* LATIN CAPITAL LETTER S WITH CEDILLA */ \ + UNI(0x5F, 0x00DF) /* LATIN SMALL LETTER SHARP S */ \ + UNI(0x60, 0x00E0) /* LATIN SMALL LETTER A WITH GRAVE */ \ + UNI(0x61, 0x00E1) /* LATIN SMALL LETTER A WITH ACUTE */ \ + UNI(0x62, 0x00E2) /* LATIN SMALL LETTER A WITH CIRCUMFLEX */ \ + UNI(0x63, 0x00E3) /* LATIN SMALL LETTER A WITH TILDE */ \ + UNI(0x64, 0x00E4) /* LATIN SMALL LETTER A WITH DIAERESIS */ \ + UNI(0x65, 0x00E5) /* LATIN SMALL LETTER A WITH RING ABOVE */ \ + UNI(0x66, 0x00E6) /* LATIN SMALL LETTER AE */ \ + UNI(0x67, 0x00E7) /* LATIN SMALL LETTER C WITH CEDILLA */ \ + UNI(0x68, 0x00E8) /* LATIN SMALL LETTER E WITH GRAVE */ \ + UNI(0x69, 0x00E9) /* LATIN SMALL LETTER E WITH ACUTE */ \ + UNI(0x6A, 0x00EA) /* LATIN SMALL LETTER E WITH CIRCUMFLEX */ \ + UNI(0x6B, 0x00EB) /* LATIN SMALL LETTER E WITH DIAERESIS */ \ + UNI(0x6C, 0x00EC) /* LATIN SMALL LETTER I WITH GRAVE */ \ + UNI(0x6D, 0x00ED) /* LATIN SMALL LETTER I WITH ACUTE */ \ + UNI(0x6E, 0x00EE) /* LATIN SMALL LETTER I WITH CIRCUMFLEX */ \ + UNI(0x6F, 0x00EF) /* LATIN SMALL LETTER I WITH DIAERESIS */ \ + UNI(0x70, 0x011F) /* LATIN SMALL LETTER G WITH BREVE */ \ + UNI(0x71, 0x00F1) /* LATIN SMALL LETTER N WITH TILDE */ \ + UNI(0x72, 0x00F2) /* LATIN SMALL LETTER O WITH GRAVE */ \ + UNI(0x73, 0x00F3) /* LATIN SMALL LETTER O WITH ACUTE */ \ + UNI(0x74, 0x00F4) /* LATIN SMALL LETTER O WITH CIRCUMFLEX */ \ + UNI(0x75, 0x00F5) /* LATIN SMALL LETTER O WITH TILDE */ \ + UNI(0x76, 0x00F6) /* LATIN SMALL LETTER O WITH DIAERESIS */ \ + UNI(0x77, 0x00F7) /* DIVISION SIGN */ \ + UNI(0x78, 0x00F8) /* LATIN SMALL LETTER O WITH STROKE */ \ + UNI(0x79, 0x00F9) /* LATIN SMALL LETTER U WITH GRAVE */ \ + UNI(0x7A, 0x00FA) /* LATIN SMALL LETTER U WITH ACUTE */ \ + UNI(0x7B, 0x00FB) /* LATIN SMALL LETTER U WITH CIRCUMFLEX */ \ + UNI(0x7C, 0x00FC) /* LATIN SMALL LETTER U WITH DIAERESIS */ \ + UNI(0x7D, 0x0131) /* LATIN SMALL LETTER DOTLESS I */ \ + UNI(0x7E, 0x015F) /* LATIN SMALL LETTER S WITH CEDILLA */ \ + UNI(0x7F, 0x00FF) /* LATIN SMALL LETTER Y WITH DIAERESIS */ \ + } \ + end_CODEPAGE() + +#define unmap_ISO_Latin_5(code,dft) \ + switch (code) { \ + MAP(0x50, 0x4E) /* LATIN CAPITAL LETTER G WITH BREVE */ \ + MAP(0x5D, 0x4F) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */ \ + MAP(0x5E, 0x9F) /* LATIN CAPITAL LETTER S WITH CEDILLA */ \ + MAP(0x70, 0x50) /* LATIN SMALL LETTER G WITH BREVE */ \ + MAP(0x7D, 0x51) /* LATIN SMALL LETTER DOTLESS I */ \ + MAP(0x7E, 0x2A) /* LATIN SMALL LETTER S WITH CEDILLA */ \ + default: dft; break; \ + } + +/* + * DEC Cyrillic from screenshot + */ +#define map_DEC_Cyrillic(code) \ + begin_CODEPAGE(94) \ + switch (code) { \ + XXX(0x21, UNDEF) /* undefined */ \ + XXX(0x22, UNDEF) /* undefined */ \ + XXX(0x23, UNDEF) /* undefined */ \ + XXX(0x24, UNDEF) /* undefined */ \ + XXX(0x25, UNDEF) /* undefined */ \ + XXX(0x26, UNDEF) /* undefined */ \ + XXX(0x27, UNDEF) /* undefined */ \ + XXX(0x28, UNDEF) /* undefined */ \ + XXX(0x29, UNDEF) /* undefined */ \ + XXX(0x2A, UNDEF) /* undefined */ \ + XXX(0x2B, UNDEF) /* undefined */ \ + XXX(0x2C, UNDEF) /* undefined */ \ + XXX(0x2D, UNDEF) /* undefined */ \ + XXX(0x2E, UNDEF) /* undefined */ \ + XXX(0x2F, UNDEF) /* undefined */ \ + XXX(0x30, UNDEF) /* undefined */ \ + XXX(0x31, UNDEF) /* undefined */ \ + XXX(0x32, UNDEF) /* undefined */ \ + XXX(0x33, UNDEF) /* undefined */ \ + XXX(0x34, UNDEF) /* undefined */ \ + XXX(0x35, UNDEF) /* undefined */ \ + XXX(0x36, UNDEF) /* undefined */ \ + XXX(0x37, UNDEF) /* undefined */ \ + XXX(0x38, UNDEF) /* undefined */ \ + XXX(0x39, UNDEF) /* undefined */ \ + XXX(0x3A, UNDEF) /* undefined */ \ + XXX(0x3B, UNDEF) /* undefined */ \ + XXX(0x3C, UNDEF) /* undefined */ \ + XXX(0x3D, UNDEF) /* undefined */ \ + XXX(0x3E, UNDEF) /* undefined */ \ + XXX(0x3F, UNDEF) /* undefined */ \ + UNI(0x40, 0x044E) /* CYRILLIC SMALL LETTER YU */ \ + UNI(0x41, 0x0430) /* CYRILLIC SMALL LETTER A */ \ + UNI(0x42, 0x0431) /* CYRILLIC SMALL LETTER BE */ \ + UNI(0x43, 0x0446) /* CYRILLIC SMALL LETTER TSE */ \ + UNI(0x44, 0x0434) /* CYRILLIC SMALL LETTER DE */ \ + UNI(0x45, 0x0435) /* CYRILLIC SMALL LETTER IE */ \ + UNI(0x46, 0x0444) /* CYRILLIC SMALL LETTER EF */ \ + UNI(0x47, 0x0433) /* CYRILLIC SMALL LETTER GHE */ \ + UNI(0x48, 0x0445) /* CYRILLIC SMALL LETTER HA */ \ + UNI(0x49, 0x0438) /* CYRILLIC SMALL LETTER I */ \ + UNI(0x4A, 0x0439) /* CYRILLIC SMALL LETTER SHORT I */ \ + UNI(0x4B, 0x043A) /* CYRILLIC SMALL LETTER KA */ \ + UNI(0x4C, 0x043B) /* CYRILLIC SMALL LETTER EL */ \ + UNI(0x4D, 0x043C) /* CYRILLIC SMALL LETTER EM */ \ + UNI(0x4E, 0x043D) /* CYRILLIC SMALL LETTER EN */ \ + UNI(0x4F, 0x043E) /* CYRILLIC SMALL LETTER O */ \ + UNI(0x50, 0x043F) /* CYRILLIC SMALL LETTER PE */ \ + UNI(0x51, 0x044F) /* CYRILLIC SMALL LETTER YA */ \ + UNI(0x52, 0x0440) /* CYRILLIC SMALL LETTER ER */ \ + UNI(0x53, 0x0441) /* CYRILLIC SMALL LETTER ES */ \ + UNI(0x54, 0x0442) /* CYRILLIC SMALL LETTER TE */ \ + UNI(0x55, 0x0443) /* CYRILLIC SMALL LETTER U */ \ + UNI(0x56, 0x0436) /* CYRILLIC SMALL LETTER ZHE */ \ + UNI(0x57, 0x0432) /* CYRILLIC SMALL LETTER VE */ \ + UNI(0x58, 0x044C) /* CYRILLIC SMALL LETTER SOFT SIGN */ \ + UNI(0x59, 0x044B) /* CYRILLIC SMALL LETTER YERU */ \ + UNI(0x5A, 0x0437) /* CYRILLIC SMALL LETTER ZE */ \ + UNI(0x5B, 0x0448) /* CYRILLIC SMALL LETTER SHA */ \ + UNI(0x5C, 0x044D) /* CYRILLIC SMALL LETTER E */ \ + UNI(0x5D, 0x0449) /* CYRILLIC SMALL LETTER SHCHA */ \ + UNI(0x5E, 0x0447) /* CYRILLIC SMALL LETTER CHE */ \ + UNI(0x5F, 0x044A) /* CYRILLIC SMALL LETTER HARD SIGN */ \ + UNI(0x60, 0x042E) /* CYRILLIC CAPITAL LETTER YU */ \ + UNI(0x61, 0x0410) /* CYRILLIC CAPITAL LETTER A */ \ + UNI(0x62, 0x0411) /* CYRILLIC CAPITAL LETTER BE */ \ + UNI(0x63, 0x0426) /* CYRILLIC CAPITAL LETTER TSE */ \ + UNI(0x64, 0x0414) /* CYRILLIC CAPITAL LETTER DE */ \ + UNI(0x65, 0x0415) /* CYRILLIC CAPITAL LETTER IE */ \ + UNI(0x66, 0x0424) /* CYRILLIC CAPITAL LETTER EF */ \ + UNI(0x67, 0x0413) /* CYRILLIC CAPITAL LETTER GHE */ \ + UNI(0x68, 0x0425) /* CYRILLIC CAPITAL LETTER HA */ \ + UNI(0x69, 0x0418) /* CYRILLIC CAPITAL LETTER I */ \ + UNI(0x6A, 0x0419) /* CYRILLIC CAPITAL LETTER SHORT I */ \ + UNI(0x6B, 0x041A) /* CYRILLIC CAPITAL LETTER KA */ \ + UNI(0x6C, 0x041B) /* CYRILLIC CAPITAL LETTER EL */ \ + UNI(0x6D, 0x041C) /* CYRILLIC CAPITAL LETTER EM */ \ + UNI(0x6E, 0x041D) /* CYRILLIC CAPITAL LETTER EN */ \ + UNI(0x6F, 0x041E) /* CYRILLIC CAPITAL LETTER O */ \ + UNI(0x70, 0x041F) /* CYRILLIC CAPITAL LETTER PE */ \ + UNI(0x71, 0x042F) /* CYRILLIC CAPITAL LETTER YA */ \ + UNI(0x72, 0x0420) /* CYRILLIC CAPITAL LETTER ER */ \ + UNI(0x73, 0x0421) /* CYRILLIC CAPITAL LETTER ES */ \ + UNI(0x74, 0x0422) /* CYRILLIC CAPITAL LETTER TE */ \ + UNI(0x75, 0x0423) /* CYRILLIC CAPITAL LETTER U */ \ + UNI(0x76, 0x0416) /* CYRILLIC CAPITAL LETTER ZHE */ \ + UNI(0x77, 0x0412) /* CYRILLIC CAPITAL LETTER VE */ \ + UNI(0x78, 0x042C) /* CYRILLIC CAPITAL LETTER SOFT SIGN */ \ + UNI(0x79, 0x042B) /* CYRILLIC CAPITAL LETTER YERU */ \ + UNI(0x7A, 0x0417) /* CYRILLIC CAPITAL LETTER ZE */ \ + UNI(0x7B, 0x0428) /* CYRILLIC CAPITAL LETTER SHA */ \ + UNI(0x7C, 0x042D) /* CYRILLIC CAPITAL LETTER E */ \ + UNI(0x7D, 0x0429) /* CYRILLIC CAPITAL LETTER SHCHA */ \ + UNI(0x7E, 0x0427) /* CYRILLIC CAPITAL LETTER CHE */ \ + } \ + end_CODEPAGE() + +#define unmap_DEC_Cyrillic(code,dft) \ + switch (code) { \ + MAP(0x21, 0x1B) /* undefined */ \ + MAP(0x22, 0x1B) /* undefined */ \ + MAP(0x23, 0x1B) /* undefined */ \ + MAP(0x24, 0x1B) /* undefined */ \ + MAP(0x25, 0x1B) /* undefined */ \ + MAP(0x26, 0x1B) /* undefined */ \ + MAP(0x27, 0x1B) /* undefined */ \ + MAP(0x28, 0x1B) /* undefined */ \ + MAP(0x29, 0x1B) /* undefined */ \ + MAP(0x2A, 0x1B) /* undefined */ \ + MAP(0x2B, 0x1B) /* undefined */ \ + MAP(0x2C, 0x1B) /* undefined */ \ + MAP(0x2D, 0x1B) /* undefined */ \ + MAP(0x2E, 0x1B) /* undefined */ \ + MAP(0x2F, 0x1B) /* undefined */ \ + MAP(0x30, 0x1B) /* undefined */ \ + MAP(0x31, 0x1B) /* undefined */ \ + MAP(0x32, 0x1B) /* undefined */ \ + MAP(0x33, 0x1B) /* undefined */ \ + MAP(0x34, 0x1B) /* undefined */ \ + MAP(0x35, 0x1B) /* undefined */ \ + MAP(0x36, 0x1B) /* undefined */ \ + MAP(0x37, 0x1B) /* undefined */ \ + MAP(0x38, 0x1B) /* undefined */ \ + MAP(0x39, 0x1B) /* undefined */ \ + MAP(0x3A, 0x1B) /* undefined */ \ + MAP(0x3B, 0x1B) /* undefined */ \ + MAP(0x3C, 0x1B) /* undefined */ \ + MAP(0x3D, 0x1B) /* undefined */ \ + MAP(0x3E, 0x1B) /* undefined */ \ + MAP(0x3F, 0x1B) /* undefined */ \ + MAP(0x40, 0x4F) /* CYRILLIC SMALL LETTER YU */ \ + MAP(0x41, 0x31) /* CYRILLIC SMALL LETTER A */ \ + MAP(0x42, 0x32) /* CYRILLIC SMALL LETTER BE */ \ + MAP(0x43, 0x47) /* CYRILLIC SMALL LETTER TSE */ \ + MAP(0x44, 0x35) /* CYRILLIC SMALL LETTER DE */ \ + MAP(0x45, 0x36) /* CYRILLIC SMALL LETTER IE */ \ + MAP(0x46, 0x45) /* CYRILLIC SMALL LETTER EF */ \ + MAP(0x47, 0x34) /* CYRILLIC SMALL LETTER GHE */ \ + MAP(0x48, 0x46) /* CYRILLIC SMALL LETTER HA */ \ + MAP(0x49, 0x39) /* CYRILLIC SMALL LETTER I */ \ + MAP(0x4A, 0x3A) /* CYRILLIC SMALL LETTER SHORT I */ \ + MAP(0x4B, 0x3B) /* CYRILLIC SMALL LETTER KA */ \ + MAP(0x4C, 0x3C) /* CYRILLIC SMALL LETTER EL */ \ + MAP(0x4D, 0x3D) /* CYRILLIC SMALL LETTER EM */ \ + MAP(0x4E, 0x3E) /* CYRILLIC SMALL LETTER EN */ \ + MAP(0x4F, 0x3F) /* CYRILLIC SMALL LETTER O */ \ + MAP(0x50, 0x40) /* CYRILLIC SMALL LETTER PE */ \ + MAP(0x51, 0x50) /* CYRILLIC SMALL LETTER YA */ \ + MAP(0x52, 0x41) /* CYRILLIC SMALL LETTER ER */ \ + MAP(0x53, 0x42) /* CYRILLIC SMALL LETTER ES */ \ + MAP(0x54, 0x43) /* CYRILLIC SMALL LETTER TE */ \ + MAP(0x55, 0x44) /* CYRILLIC SMALL LETTER U */ \ + MAP(0x56, 0x37) /* CYRILLIC SMALL LETTER ZHE */ \ + MAP(0x57, 0x33) /* CYRILLIC SMALL LETTER VE */ \ + MAP(0x58, 0x4D) /* CYRILLIC SMALL LETTER SOFT SIGN */ \ + MAP(0x59, 0x4C) /* CYRILLIC SMALL LETTER YERU */ \ + MAP(0x5A, 0x38) /* CYRILLIC SMALL LETTER ZE */ \ + MAP(0x5B, 0x49) /* CYRILLIC SMALL LETTER SHA */ \ + MAP(0x5C, 0x4E) /* CYRILLIC SMALL LETTER E */ \ + MAP(0x5D, 0x4A) /* CYRILLIC SMALL LETTER SHCHA */ \ + MAP(0x5E, 0x48) /* CYRILLIC SMALL LETTER CHE */ \ + MAP(0x5F, 0x4B) /* CYRILLIC SMALL LETTER HARD SIGN */ \ + MAP(0x60, 0x2F) /* CYRILLIC CAPITAL LETTER YU */ \ + MAP(0x61, 0x11) /* CYRILLIC CAPITAL LETTER A */ \ + MAP(0x62, 0x12) /* CYRILLIC CAPITAL LETTER BE */ \ + MAP(0x63, 0x27) /* CYRILLIC CAPITAL LETTER TSE */ \ + MAP(0x64, 0x15) /* CYRILLIC CAPITAL LETTER DE */ \ + MAP(0x65, 0x16) /* CYRILLIC CAPITAL LETTER IE */ \ + MAP(0x66, 0x25) /* CYRILLIC CAPITAL LETTER EF */ \ + MAP(0x67, 0x14) /* CYRILLIC CAPITAL LETTER GHE */ \ + MAP(0x68, 0x26) /* CYRILLIC CAPITAL LETTER HA */ \ + MAP(0x69, 0x19) /* CYRILLIC CAPITAL LETTER I */ \ + MAP(0x6A, 0x1A) /* CYRILLIC CAPITAL LETTER SHORT I */ \ + MAP(0x6B, 0x1B) /* CYRILLIC CAPITAL LETTER KA */ \ + MAP(0x6C, 0x1C) /* CYRILLIC CAPITAL LETTER EL */ \ + MAP(0x6D, 0x1D) /* CYRILLIC CAPITAL LETTER EM */ \ + MAP(0x6E, 0x1E) /* CYRILLIC CAPITAL LETTER EN */ \ + MAP(0x6F, 0x1F) /* CYRILLIC CAPITAL LETTER O */ \ + MAP(0x70, 0x20) /* CYRILLIC CAPITAL LETTER PE */ \ + MAP(0x71, 0x30) /* CYRILLIC CAPITAL LETTER YA */ \ + MAP(0x72, 0x21) /* CYRILLIC CAPITAL LETTER ER */ \ + MAP(0x73, 0x22) /* CYRILLIC CAPITAL LETTER ES */ \ + MAP(0x74, 0x23) /* CYRILLIC CAPITAL LETTER TE */ \ + MAP(0x75, 0x24) /* CYRILLIC CAPITAL LETTER U */ \ + MAP(0x76, 0x17) /* CYRILLIC CAPITAL LETTER ZHE */ \ + MAP(0x77, 0x13) /* CYRILLIC CAPITAL LETTER VE */ \ + MAP(0x78, 0x2D) /* CYRILLIC CAPITAL LETTER SOFT SIGN */ \ + MAP(0x79, 0x2C) /* CYRILLIC CAPITAL LETTER YERU */ \ + MAP(0x7A, 0x18) /* CYRILLIC CAPITAL LETTER ZE */ \ + MAP(0x7B, 0x29) /* CYRILLIC CAPITAL LETTER SHA */ \ + MAP(0x7C, 0x2E) /* CYRILLIC CAPITAL LETTER E */ \ + MAP(0x7D, 0x2A) /* CYRILLIC CAPITAL LETTER SHCHA */ \ + MAP(0x7E, 0x28) /* CYRILLIC CAPITAL LETTER CHE */ \ + default: dft; break; \ + } + +/* + * figure A-24 "DEC Greek Supplemental Character Set" + */ +#define map_DEC_Greek_Supp(code) \ + begin_CODEPAGE(94) \ + switch (code) { \ + UNI(0x21, 0x00A1) /* LEFT SINGLE QUOTATION MARK */ \ + UNI(0x22, 0x00A2) /* RIGHT SINGLE QUOTATION MARK */ \ + UNI(0x23, 0x00A3) /* POUND SIGN */ \ + XXX(0x24, UNDEF) /* EURO SIGN */ \ + UNI(0x25, 0x00A5) /* YEN SIGN */ \ + XXX(0x26, UNDEF) /* BROKEN BAR */ \ + UNI(0x27, 0x00A7) /* SECTION SIGN */ \ + UNI(0x28, 0x00A4) /* CURRENCY SIGN */ \ + UNI(0x29, 0x00A9) /* COPYRIGHT SIGN */ \ + UNI(0x2A, 0x00AA) /* FEMININE ORDINAL INDICATOR */ \ + UNI(0x2B, 0x00AB) /* LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ + XXX(0x2C, UNDEF) /* reserved */ \ + XXX(0x2D, UNDEF) /* reserved */ \ + XXX(0x2E, UNDEF) /* reserved */ \ + XXX(0x2F, UNDEF) /* reserved */ \ + UNI(0x30, 0x00B0) /* DEGREE SIGN */ \ + UNI(0x31, 0x00B1) /* PLUS-MINUS SIGN */ \ + UNI(0x32, 0x00B2) /* SUPERSCRIPT TWO */ \ + UNI(0x33, 0x00B3) /* SUPERSCRIPT THREE */ \ + XXX(0x34, UNDEF) /* reserved */ \ + UNI(0x35, 0x00B5) /* MICRO SIGN */ \ + UNI(0x36, 0x00B6) /* PILCROW SIGN */ \ + UNI(0x37, 0x00B7) /* MIDDLE DOT */ \ + XXX(0x38, UNDEF) /* reserved */ \ + UNI(0x39, 0x00B9) /* SUPERSCRIPT ONE */ \ + UNI(0x3A, 0x00BA) /* MASCULINE ORDINAL INDICATOR */ \ + UNI(0x3B, 0x00BB) /* RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ + UNI(0x3C, 0x00BC) /* VULGAR FRACTION ONE QUARTER */ \ + UNI(0x3D, 0x00BD) /* VULGAR FRACTION ONE HALF */ \ + XXX(0x3E, UNDEF) /* reserved */ \ + UNI(0x3F, 0x00BF) /* INVERTED QUESTION MARK */ \ + UNI(0x40, 0x03CA) /* GREEK SMALL LETTER IOTA WITH DIALYTIKA */ \ + UNI(0x41, 0x0391) /* GREEK CAPITAL LETTER ALPHA */ \ + UNI(0x42, 0x0392) /* GREEK CAPITAL LETTER BETA */ \ + UNI(0x43, 0x0393) /* GREEK CAPITAL LETTER GAMMA */ \ + UNI(0x44, 0x0394) /* GREEK CAPITAL LETTER DELTA */ \ + UNI(0x45, 0x0395) /* GREEK CAPITAL LETTER EPSILON */ \ + UNI(0x46, 0x0396) /* GREEK CAPITAL LETTER ZETA */ \ + UNI(0x47, 0x0397) /* GREEK CAPITAL LETTER ETA */ \ + UNI(0x48, 0x0398) /* GREEK CAPITAL LETTER THETA */ \ + UNI(0x49, 0x0399) /* GREEK CAPITAL LETTER IOTA */ \ + UNI(0x4A, 0x039A) /* GREEK CAPITAL LETTER KAPPA */ \ + UNI(0x4B, 0x039B) /* GREEK CAPITAL LETTER LAMDA */ \ + UNI(0x4C, 0x039C) /* GREEK CAPITAL LETTER MU */ \ + UNI(0x4D, 0x039D) /* GREEK CAPITAL LETTER NU */ \ + UNI(0x4E, 0x039E) /* GREEK CAPITAL LETTER XI */ \ + UNI(0x4F, 0x039F) /* GREEK CAPITAL LETTER OMICRON */ \ + XXX(0x50, UNDEF) /* reserved */ \ + UNI(0x51, 0x03A0) /* GREEK CAPITAL LETTER PI */ \ + UNI(0x52, 0x03A1) /* GREEK CAPITAL LETTER RHO */ \ + UNI(0x53, 0x03A3) /* GREEK CAPITAL LETTER SIGMA */ \ + UNI(0x54, 0x03A4) /* GREEK CAPITAL LETTER TAU */ \ + UNI(0x55, 0x03A5) /* GREEK CAPITAL LETTER UPSILON */ \ + UNI(0x56, 0x03A6) /* GREEK CAPITAL LETTER PHI */ \ + UNI(0x57, 0x03A7) /* GREEK CAPITAL LETTER CHI */ \ + UNI(0x58, 0x03A8) /* GREEK CAPITAL LETTER PSI */ \ + UNI(0x59, 0x03A9) /* GREEK CAPITAL LETTER OMEGA */ \ + UNI(0x5A, 0x03AC) /* GREEK SMALL LETTER ALPHA WITH TONOS */ \ + UNI(0x5B, 0x03AD) /* GREEK SMALL LETTER EPSILON WITH TONOS */ \ + UNI(0x5C, 0x03AE) /* GREEK SMALL LETTER ETA WITH TONOS */ \ + UNI(0x5D, 0x03AF) /* GREEK SMALL LETTER IOTA WITH TONOS */ \ + XXX(0x5E, UNDEF) /* reserved */ \ + UNI(0x5F, 0x03CC) /* GREEK SMALL LETTER OMICRON WITH TONOS */ \ + UNI(0x60, 0x03CB) /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA */ \ + UNI(0x61, 0x03B1) /* GREEK SMALL LETTER ALPHA */ \ + UNI(0x62, 0x03B2) /* GREEK SMALL LETTER BETA */ \ + UNI(0x63, 0x03B3) /* GREEK SMALL LETTER GAMMA */ \ + UNI(0x64, 0x03B4) /* GREEK SMALL LETTER DELTA */ \ + UNI(0x65, 0x03B5) /* GREEK SMALL LETTER EPSILON */ \ + UNI(0x66, 0x03B6) /* GREEK SMALL LETTER ZETA */ \ + UNI(0x67, 0x03B7) /* GREEK SMALL LETTER ETA */ \ + UNI(0x68, 0x03B8) /* GREEK SMALL LETTER THETA */ \ + UNI(0x69, 0x03B9) /* GREEK SMALL LETTER IOTA */ \ + UNI(0x6A, 0x03BA) /* GREEK SMALL LETTER KAPPA */ \ + UNI(0x6B, 0x03BB) /* GREEK SMALL LETTER LAMDA */ \ + UNI(0x6C, 0x03BC) /* GREEK SMALL LETTER MU */ \ + UNI(0x6D, 0x03BD) /* GREEK SMALL LETTER NU */ \ + UNI(0x6E, 0x03BE) /* GREEK SMALL LETTER XI */ \ + UNI(0x6F, 0x03BF) /* GREEK SMALL LETTER OMICRON */ \ + XXX(0x70, UNDEF) /* reserved */ \ + UNI(0x71, 0x03C0) /* GREEK SMALL LETTER PI */ \ + UNI(0x72, 0x03C1) /* GREEK SMALL LETTER RHO */ \ + UNI(0x73, 0x03C3) /* GREEK SMALL LETTER SIGMA */ \ + UNI(0x74, 0x03C4) /* GREEK SMALL LETTER TAU */ \ + UNI(0x75, 0x03C5) /* GREEK SMALL LETTER UPSILON */ \ + UNI(0x76, 0x03C6) /* GREEK SMALL LETTER PHI */ \ + UNI(0x77, 0x03C7) /* GREEK SMALL LETTER CHI */ \ + UNI(0x78, 0x03C8) /* GREEK SMALL LETTER PSI */ \ + UNI(0x79, 0x03C9) /* GREEK SMALL LETTER OMEGA */ \ + UNI(0x7A, 0x03C2) /* GREEK SMALL LETTER FINAL SIGMA */ \ + UNI(0x7B, 0x03CD) /* GREEK SMALL LETTER UPSILON WITH TONOS */ \ + UNI(0x7C, 0x03CE) /* GREEK SMALL LETTER OMEGA WITH TONOS */ \ + UNI(0x7D, 0x0384) /* GREEK TONOS */ \ + XXX(0x7E, UNDEF) /* reserved */ \ + } \ + end_CODEPAGE() + +#define unmap_DEC_Greek_Supp(code,dft) \ + switch (code) { \ + MAP(0x24, 0x1B) /* EURO SIGN */ \ + MAP(0x26, 0x1B) /* BROKEN BAR */ \ + MAP(0x28, 0xA4) /* CURRENCY SIGN */ \ + MAP(0x2C, 0x1B) /* reserved */ \ + MAP(0x2D, 0x1B) /* reserved */ \ + MAP(0x2E, 0x1B) /* reserved */ \ + MAP(0x2F, 0x1B) /* reserved */ \ + MAP(0x34, 0x1B) /* reserved */ \ + MAP(0x38, 0x1B) /* reserved */ \ + MAP(0x3E, 0x1B) /* reserved */ \ + MAP(0x40, 0xD0) /* GREEK SMALL LETTER IOTA WITH DIALYTIKA */ \ + MAP(0x41, 0x76) /* GREEK CAPITAL LETTER ALPHA */ \ + MAP(0x42, 0x77) /* GREEK CAPITAL LETTER BETA */ \ + MAP(0x43, 0x78) /* GREEK CAPITAL LETTER GAMMA */ \ + MAP(0x44, 0x79) /* GREEK CAPITAL LETTER DELTA */ \ + MAP(0x45, 0x7A) /* GREEK CAPITAL LETTER EPSILON */ \ + MAP(0x46, 0x7B) /* GREEK CAPITAL LETTER ZETA */ \ + MAP(0x47, 0x7C) /* GREEK CAPITAL LETTER ETA */ \ + MAP(0x48, 0x7D) /* GREEK CAPITAL LETTER THETA */ \ + MAP(0x49, 0x7E) /* GREEK CAPITAL LETTER IOTA */ \ + MAP(0x4A, 0x7F) /* GREEK CAPITAL LETTER KAPPA */ \ + MAP(0x4B, 0xA2) /* GREEK CAPITAL LETTER LAMDA */ \ + MAP(0x4C, 0xA3) /* GREEK CAPITAL LETTER MU */ \ + MAP(0x4D, 0xA4) /* GREEK CAPITAL LETTER NU */ \ + MAP(0x4E, 0xA5) /* GREEK CAPITAL LETTER XI */ \ + MAP(0x4F, 0xA6) /* GREEK CAPITAL LETTER OMICRON */ \ + MAP(0x50, 0x1B) /* reserved */ \ + MAP(0x51, 0xA7) /* GREEK CAPITAL LETTER PI */ \ + MAP(0x52, 0xA8) /* GREEK CAPITAL LETTER RHO */ \ + MAP(0x53, 0xA9) /* GREEK CAPITAL LETTER SIGMA */ \ + MAP(0x54, 0xAA) /* GREEK CAPITAL LETTER TAU */ \ + MAP(0x55, 0xAB) /* GREEK CAPITAL LETTER UPSILON */ \ + MAP(0x56, 0xAC) /* GREEK CAPITAL LETTER PHI */ \ + MAP(0x57, 0xAD) /* GREEK CAPITAL LETTER CHI */ \ + MAP(0x58, 0xAE) /* GREEK CAPITAL LETTER PSI */ \ + MAP(0x59, 0xAF) /* GREEK CAPITAL LETTER OMEGA */ \ + MAP(0x5A, 0xB2) /* GREEK SMALL LETTER ALPHA WITH TONOS */ \ + MAP(0x5B, 0xB3) /* GREEK SMALL LETTER EPSILON WITH TONOS */ \ + MAP(0x5C, 0xB4) /* GREEK SMALL LETTER ETA WITH TONOS */ \ + MAP(0x5D, 0xB5) /* GREEK SMALL LETTER IOTA WITH TONOS */ \ + MAP(0x5E, 0x1B) /* reserved */ \ + MAP(0x5F, 0xD2) /* GREEK SMALL LETTER OMICRON WITH TONOS */ \ + MAP(0x60, 0xD1) /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA */ \ + MAP(0x61, 0xB7) /* GREEK SMALL LETTER ALPHA */ \ + MAP(0x62, 0xB8) /* GREEK SMALL LETTER BETA */ \ + MAP(0x63, 0xB9) /* GREEK SMALL LETTER GAMMA */ \ + MAP(0x64, 0xBA) /* GREEK SMALL LETTER DELTA */ \ + MAP(0x65, 0xBB) /* GREEK SMALL LETTER EPSILON */ \ + MAP(0x66, 0xBC) /* GREEK SMALL LETTER ZETA */ \ + MAP(0x67, 0xBD) /* GREEK SMALL LETTER ETA */ \ + MAP(0x68, 0xBE) /* GREEK SMALL LETTER THETA */ \ + MAP(0x69, 0xBF) /* GREEK SMALL LETTER IOTA */ \ + MAP(0x6A, 0xC0) /* GREEK SMALL LETTER KAPPA */ \ + MAP(0x6B, 0xC1) /* GREEK SMALL LETTER LAMDA */ \ + MAP(0x6C, 0xC2) /* GREEK SMALL LETTER MU */ \ + MAP(0x6D, 0xC3) /* GREEK SMALL LETTER NU */ \ + MAP(0x6E, 0xC4) /* GREEK SMALL LETTER XI */ \ + MAP(0x6F, 0xC5) /* GREEK SMALL LETTER OMICRON */ \ + MAP(0x70, 0x1B) /* reserved */ \ + MAP(0x71, 0xC6) /* GREEK SMALL LETTER PI */ \ + MAP(0x72, 0xC7) /* GREEK SMALL LETTER RHO */ \ + MAP(0x73, 0xC9) /* GREEK SMALL LETTER SIGMA */ \ + MAP(0x74, 0xCA) /* GREEK SMALL LETTER TAU */ \ + MAP(0x75, 0xCB) /* GREEK SMALL LETTER UPSILON */ \ + MAP(0x76, 0xCC) /* GREEK SMALL LETTER PHI */ \ + MAP(0x77, 0xCD) /* GREEK SMALL LETTER CHI */ \ + MAP(0x78, 0xCE) /* GREEK SMALL LETTER PSI */ \ + MAP(0x79, 0xCF) /* GREEK SMALL LETTER OMEGA */ \ + MAP(0x7A, 0xC8) /* GREEK SMALL LETTER FINAL SIGMA */ \ + MAP(0x7B, 0xD3) /* GREEK SMALL LETTER UPSILON WITH TONOS */ \ + MAP(0x7C, 0xD4) /* GREEK SMALL LETTER OMEGA WITH TONOS */ \ + MAP(0x7D, 0x96) /* GREEK TONOS */ \ + MAP(0x7E, 0x1B) /* reserved */ \ + default: dft; break; \ + } + +/* + * figure A-22 "DEC Hebrew Supplemental Character Set" + */ +#define map_DEC_Hebrew_Supp(code) \ + begin_CODEPAGE(94) \ + switch (code) { \ + UNI(0x21, 0x00A1) /* INVERTED EXCLAMATION MARK */ \ + UNI(0x22, 0x00A2) /* CENT SIGN */ \ + UNI(0x23, 0x00A3) /* POUND SIGN */ \ + XXX(0x24, UNDEF) /* CURRENCY SIGN */ \ + UNI(0x25, 0x00A5) /* YEN SIGN */ \ + XXX(0x26, UNDEF) /* BROKEN BAR */ \ + UNI(0x27, 0x00A7) /* SECTION SIGN */ \ + UNI(0x28, 0x00A8) /* DIAERESIS */ \ + UNI(0x29, 0x00A9) /* COPYRIGHT SIGN */ \ + UNI(0x2A, 0x00D7) /* MULTIPLICATION SIGN */ \ + UNI(0x2B, 0x00AB) /* LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ + XXX(0x2C, UNDEF) /* NOT SIGN */ \ + XXX(0x2D, UNDEF) /* SOFT HYPHEN */ \ + XXX(0x2E, UNDEF) /* REGISTERED SIGN */ \ + XXX(0x2F, UNDEF) /* MACRON */ \ + UNI(0x30, 0x00B0) /* DEGREE SIGN */ \ + UNI(0x31, 0x00B1) /* PLUS-MINUS SIGN */ \ + UNI(0x32, 0x00B2) /* SUPERSCRIPT TWO */ \ + UNI(0x33, 0x00B3) /* SUPERSCRIPT THREE */ \ + XXX(0x34, UNDEF) /* ACUTE ACCENT */ \ + UNI(0x35, 0x00B5) /* MICRO SIGN */ \ + UNI(0x36, 0x00B6) /* PILCROW SIGN */ \ + UNI(0x37, 0x00B7) /* MIDDLE DOT */ \ + XXX(0x38, UNDEF) /* CEDILLA */ \ + UNI(0x39, 0x00B9) /* SUPERSCRIPT ONE */ \ + UNI(0x3A, 0x00F7) /* DIVISION SIGN */ \ + UNI(0x3B, 0x00BB) /* RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ + UNI(0x3C, 0x00BC) /* VULGAR FRACTION ONE QUARTER */ \ + UNI(0x3D, 0x00BD) /* VULGAR FRACTION ONE HALF */ \ + XXX(0x3E, UNDEF) /* VULGAR FRACTION THREE QUARTERS */ \ + UNI(0x3F, 0x00BF) /* INVERTED QUESTION MARK */ \ + XXX(0x40, UNDEF) /* reserved */ \ + XXX(0x41, UNDEF) /* reserved */ \ + XXX(0x42, UNDEF) /* reserved */ \ + XXX(0x43, UNDEF) /* reserved */ \ + XXX(0x44, UNDEF) /* reserved */ \ + XXX(0x45, UNDEF) /* reserved */ \ + XXX(0x46, UNDEF) /* reserved */ \ + XXX(0x47, UNDEF) /* reserved */ \ + XXX(0x48, UNDEF) /* reserved */ \ + XXX(0x49, UNDEF) /* reserved */ \ + XXX(0x4A, UNDEF) /* reserved */ \ + XXX(0x4B, UNDEF) /* reserved */ \ + XXX(0x4C, UNDEF) /* reserved */ \ + XXX(0x4D, UNDEF) /* reserved */ \ + XXX(0x4E, UNDEF) /* reserved */ \ + XXX(0x4F, UNDEF) /* reserved */ \ + XXX(0x50, UNDEF) /* reserved */ \ + XXX(0x51, UNDEF) /* reserved */ \ + XXX(0x52, UNDEF) /* reserved */ \ + XXX(0x53, UNDEF) /* reserved */ \ + XXX(0x54, UNDEF) /* reserved */ \ + XXX(0x55, UNDEF) /* reserved */ \ + XXX(0x56, UNDEF) /* reserved */ \ + XXX(0x57, UNDEF) /* reserved */ \ + XXX(0x58, UNDEF) /* reserved */ \ + XXX(0x59, UNDEF) /* reserved */ \ + XXX(0x5A, UNDEF) /* reserved */ \ + XXX(0x5B, UNDEF) /* reserved */ \ + XXX(0x5C, UNDEF) /* reserved */ \ + XXX(0x5D, UNDEF) /* reserved */ \ + XXX(0x5E, UNDEF) /* reserved */ \ + XXX(0x5F, UNDEF) /* reserved */ \ + UNI(0x60, 0x05D0) /* HEBREW LETTER ALEF */ \ + UNI(0x61, 0x05D1) /* HEBREW LETTER BET */ \ + UNI(0x62, 0x05D2) /* HEBREW LETTER GIMEL */ \ + UNI(0x63, 0x05D3) /* HEBREW LETTER DALET */ \ + UNI(0x64, 0x05D4) /* HEBREW LETTER HE */ \ + UNI(0x65, 0x05D5) /* HEBREW LETTER VAV */ \ + UNI(0x66, 0x05D6) /* HEBREW LETTER ZAYIN */ \ + UNI(0x67, 0x05D7) /* HEBREW LETTER HET */ \ + UNI(0x68, 0x05D8) /* HEBREW LETTER TET */ \ + UNI(0x69, 0x05D9) /* HEBREW LETTER YOD */ \ + UNI(0x6A, 0x05DA) /* HEBREW LETTER FINAL KAF */ \ + UNI(0x6B, 0x05DB) /* HEBREW LETTER KAF */ \ + UNI(0x6C, 0x05DC) /* HEBREW LETTER LAMED */ \ + UNI(0x6D, 0x05DD) /* HEBREW LETTER FINAL MEM */ \ + UNI(0x6E, 0x05DE) /* HEBREW LETTER MEM */ \ + UNI(0x6F, 0x05DF) /* HEBREW LETTER FINAL NUN */ \ + UNI(0x70, 0x05E0) /* HEBREW LETTER NUN */ \ + UNI(0x71, 0x05E1) /* HEBREW LETTER SAMEKH */ \ + UNI(0x72, 0x05E2) /* HEBREW LETTER AYIN */ \ + UNI(0x73, 0x05E3) /* HEBREW LETTER FINAL PE */ \ + UNI(0x74, 0x05E4) /* HEBREW LETTER PE */ \ + UNI(0x75, 0x05E5) /* HEBREW LETTER FINAL TSADI */ \ + UNI(0x76, 0x05E6) /* HEBREW LETTER TSADI */ \ + UNI(0x77, 0x05E7) /* HEBREW LETTER QOF */ \ + UNI(0x78, 0x05E8) /* HEBREW LETTER RESH */ \ + UNI(0x79, 0x05E9) /* HEBREW LETTER SHIN */ \ + UNI(0x7A, 0x05EA) /* HEBREW LETTER TAV */ \ + XXX(0x7B, UNDEF) /* reserved */ \ + XXX(0x7C, UNDEF) /* reserved */ \ + XXX(0x7D, UNDEF) /* reserved */ \ + XXX(0x7E, UNDEF) /* reserved */ \ + } \ + end_CODEPAGE() + +#define unmap_DEC_Hebrew_Supp(code,dft) \ + switch (code) { \ + MAP(0x24, 0x1B) /* CURRENCY SIGN */ \ + MAP(0x26, 0x1B) /* BROKEN BAR */ \ + MAP(0x28, 0xA4) /* DIAERESIS */ \ + MAP(0x2C, 0x1B) /* NOT SIGN */ \ + MAP(0x2D, 0x1B) /* SOFT HYPHEN */ \ + MAP(0x2E, 0x1B) /* REGISTERED SIGN */ \ + MAP(0x2F, 0x1B) /* MACRON */ \ + MAP(0x34, 0x1B) /* ACUTE ACCENT */ \ + MAP(0x38, 0x1B) /* CEDILLA */ \ + MAP(0x3E, 0x1B) /* VULGAR FRACTION THREE QUARTERS */ \ + MAP(0x40, 0x1B) /* reserved */ \ + MAP(0x41, 0x1B) /* reserved */ \ + MAP(0x42, 0x1B) /* reserved */ \ + MAP(0x43, 0x1B) /* reserved */ \ + MAP(0x44, 0x1B) /* reserved */ \ + MAP(0x45, 0x1B) /* reserved */ \ + MAP(0x46, 0x1B) /* reserved */ \ + MAP(0x47, 0x1B) /* reserved */ \ + MAP(0x48, 0x1B) /* reserved */ \ + MAP(0x49, 0x1B) /* reserved */ \ + MAP(0x4A, 0x1B) /* reserved */ \ + MAP(0x4B, 0x1B) /* reserved */ \ + MAP(0x4C, 0x1B) /* reserved */ \ + MAP(0x4D, 0x1B) /* reserved */ \ + MAP(0x4E, 0x1B) /* reserved */ \ + MAP(0x4F, 0x1B) /* reserved */ \ + MAP(0x50, 0x1B) /* reserved */ \ + MAP(0x51, 0x1B) /* reserved */ \ + MAP(0x52, 0x1B) /* reserved */ \ + MAP(0x53, 0x1B) /* reserved */ \ + MAP(0x54, 0x1B) /* reserved */ \ + MAP(0x55, 0x1B) /* reserved */ \ + MAP(0x56, 0x1B) /* reserved */ \ + MAP(0x57, 0x1B) /* reserved */ \ + MAP(0x58, 0x1B) /* reserved */ \ + MAP(0x59, 0x1B) /* reserved */ \ + MAP(0x5A, 0x1B) /* reserved */ \ + MAP(0x5B, 0x1B) /* reserved */ \ + MAP(0x5C, 0x1B) /* reserved */ \ + MAP(0x5D, 0x1B) /* reserved */ \ + MAP(0x5E, 0x1B) /* reserved */ \ + MAP(0x5F, 0x1B) /* reserved */ \ + MAP(0x60, 0x53) /* HEBREW LETTER ALEF */ \ + MAP(0x61, 0x54) /* HEBREW LETTER BET */ \ + MAP(0x62, 0x55) /* HEBREW LETTER GIMEL */ \ + MAP(0x63, 0x56) /* HEBREW LETTER DALET */ \ + MAP(0x64, 0x57) /* HEBREW LETTER HE */ \ + MAP(0x65, 0x58) /* HEBREW LETTER VAV */ \ + MAP(0x66, 0x59) /* HEBREW LETTER ZAYIN */ \ + MAP(0x67, 0x5A) /* HEBREW LETTER HET */ \ + MAP(0x68, 0x5B) /* HEBREW LETTER TET */ \ + MAP(0x69, 0x5C) /* HEBREW LETTER YOD */ \ + MAP(0x6A, 0x5D) /* HEBREW LETTER FINAL KAF */ \ + MAP(0x6B, 0x5E) /* HEBREW LETTER KAF */ \ + MAP(0x6C, 0x5F) /* HEBREW LETTER LAMED */ \ + MAP(0x6D, 0x60) /* HEBREW LETTER FINAL MEM */ \ + MAP(0x6E, 0x61) /* HEBREW LETTER MEM */ \ + MAP(0x6F, 0x62) /* HEBREW LETTER FINAL NUN */ \ + MAP(0x70, 0x63) /* HEBREW LETTER NUN */ \ + MAP(0x71, 0x64) /* HEBREW LETTER SAMEKH */ \ + MAP(0x72, 0x65) /* HEBREW LETTER AYIN */ \ + MAP(0x73, 0x66) /* HEBREW LETTER FINAL PE */ \ + MAP(0x74, 0x67) /* HEBREW LETTER PE */ \ + MAP(0x75, 0x68) /* HEBREW LETTER FINAL TSADI */ \ + MAP(0x76, 0x69) /* HEBREW LETTER TSADI */ \ + MAP(0x77, 0x6A) /* HEBREW LETTER QOF */ \ + MAP(0x78, 0x6B) /* HEBREW LETTER RESH */ \ + MAP(0x79, 0x6C) /* HEBREW LETTER SHIN */ \ + MAP(0x7A, 0x6D) /* HEBREW LETTER TAV */ \ + MAP(0x7B, 0x1B) /* reserved */ \ + MAP(0x7C, 0x1B) /* reserved */ \ + MAP(0x7D, 0x1B) /* reserved */ \ + MAP(0x7E, 0x1B) /* reserved */ \ + default: dft; break; \ + } + +/* + * figure A-27 "DEC 8-Bit Turkish Supplemental Character Set" + */ +#define map_DEC_Turkish_Supp(code) \ + begin_CODEPAGE(94) \ + switch (code) { \ + UNI(0x21, 0x00A1) /* INVERTED EXCLAMATION MARK */ \ + UNI(0x22, 0x00A2) /* CENT SIGN */ \ + UNI(0x23, 0x00A3) /* POUND SIGN */ \ + XXX(0x24, UNDEF) /* reserved */ \ + UNI(0x25, 0x00A5) /* YEN SIGN */ \ + XXX(0x26, UNDEF) /* reserved */ \ + UNI(0x27, 0x00A7) /* SECTION SIGN */ \ + UNI(0x28, 0x00A8) /* DIAERESIS */ \ + UNI(0x29, 0x00A9) /* COPYRIGHT SIGN */ \ + UNI(0x2A, 0x00AA) /* FEMININE ORDINAL INDICATOR */ \ + UNI(0x2B, 0x00AB) /* LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ + XXX(0x2C, UNDEF) /* reserved */ \ + XXX(0x2D, UNDEF) /* reserved */ \ + UNI(0x2E, 0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */ \ + XXX(0x2F, UNDEF) /* reserved */ \ + UNI(0x30, 0x00B0) /* DEGREE SIGN */ \ + UNI(0x31, 0x00B1) /* PLUS-MINUS SIGN */ \ + UNI(0x32, 0x00B2) /* SUPERSCRIPT TWO */ \ + UNI(0x33, 0x00B3) /* SUPERSCRIPT THREE */ \ + XXX(0x34, UNDEF) /* reserved */ \ + UNI(0x35, 0x00B5) /* MICRO SIGN */ \ + UNI(0x36, 0x00B6) /* PILCROW SIGN */ \ + UNI(0x37, 0x00B7) /* MIDDLE DOT */ \ + XXX(0x38, UNDEF) /* reserved */ \ + UNI(0x39, 0x00B9) /* SUPERSCRIPT ONE */ \ + UNI(0x3A, 0x00BA) /* MASCULINE ORDINAL INDICATOR */ \ + UNI(0x3B, 0x00BB) /* RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */ \ + UNI(0x3C, 0x00BC) /* VULGAR FRACTION ONE QUARTER */ \ + UNI(0x3D, 0x00BD) /* VULGAR FRACTION ONE HALF */ \ + UNI(0x3E, 0x0131) /* LATIN SMALL LETTER DOTLESS I */ \ + UNI(0x3F, 0x00BF) /* INVERTED QUESTION MARK */ \ + UNI(0x40, 0x00C0) /* LATIN CAPITAL LETTER A WITH GRAVE */ \ + UNI(0x41, 0x00C1) /* LATIN CAPITAL LETTER A WITH ACUTE */ \ + UNI(0x42, 0x00C2) /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX */ \ + UNI(0x43, 0x00C3) /* LATIN CAPITAL LETTER A WITH TILDE */ \ + UNI(0x44, 0x00C4) /* LATIN CAPITAL LETTER A WITH DIAERESIS */ \ + UNI(0x45, 0x00C5) /* LATIN CAPITAL LETTER A WITH RING ABOVE */ \ + UNI(0x46, 0x00C6) /* LATIN CAPITAL LETTER AE */ \ + UNI(0x47, 0x00C7) /* LATIN CAPITAL LETTER C WITH CEDILLA */ \ + UNI(0x48, 0x00C8) /* LATIN CAPITAL LETTER E WITH GRAVE */ \ + UNI(0x49, 0x00C9) /* LATIN CAPITAL LETTER E WITH ACUTE */ \ + UNI(0x4A, 0x00CA) /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX */ \ + UNI(0x4B, 0x00CB) /* LATIN CAPITAL LETTER E WITH DIAERESIS */ \ + UNI(0x4C, 0x00CC) /* LATIN CAPITAL LETTER I WITH GRAVE */ \ + UNI(0x4D, 0x00CD) /* LATIN CAPITAL LETTER I WITH ACUTE */ \ + UNI(0x4E, 0x00CE) /* LATIN CAPITAL LETTER I WITH CIRCUMFLEX */ \ + UNI(0x4F, 0x00CF) /* LATIN CAPITAL LETTER I WITH DIAERESIS */ \ + UNI(0x50, 0x011E) /* LATIN CAPITAL LETTER G WITH BREVE */ \ + UNI(0x51, 0x00D1) /* LATIN CAPITAL LETTER N WITH TILDE */ \ + UNI(0x52, 0x00D2) /* LATIN CAPITAL LETTER O WITH GRAVE */ \ + UNI(0x53, 0x00D3) /* LATIN CAPITAL LETTER O WITH ACUTE */ \ + UNI(0x54, 0x00D4) /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX */ \ + UNI(0x55, 0x00D5) /* LATIN CAPITAL LETTER O WITH TILDE */ \ + UNI(0x56, 0x00D6) /* LATIN CAPITAL LETTER O WITH DIAERESIS */ \ + UNI(0x57, 0x0152) /* LATIN CAPITAL LIGATURE OE */ \ + UNI(0x58, 0x00D8) /* LATIN CAPITAL LETTER O WITH STROKE */ \ + UNI(0x59, 0x00D9) /* LATIN CAPITAL LETTER U WITH GRAVE */ \ + UNI(0x5A, 0x00DA) /* LATIN CAPITAL LETTER U WITH ACUTE */ \ + UNI(0x5B, 0x00DB) /* LATIN CAPITAL LETTER U WITH CIRCUMFLEX */ \ + UNI(0x5C, 0x00DC) /* LATIN CAPITAL LETTER U WITH DIAERESIS */ \ + UNI(0x5D, 0x0178) /* LATIN CAPITAL LETTER Y WITH DIAERESIS */ \ + UNI(0x5E, 0x015E) /* LATIN CAPITAL LETTER S WITH CEDILLA */ \ + UNI(0x5F, 0x00DF) /* LATIN SMALL LETTER SHARP S */ \ + UNI(0x60, 0x00E0) /* LATIN SMALL LETTER A WITH GRAVE */ \ + UNI(0x61, 0x00E1) /* LATIN SMALL LETTER A WITH ACUTE */ \ + UNI(0x62, 0x00E2) /* LATIN SMALL LETTER A WITH CIRCUMFLEX */ \ + UNI(0x63, 0x00E3) /* LATIN SMALL LETTER A WITH TILDE */ \ + UNI(0x64, 0x00E4) /* LATIN SMALL LETTER A WITH DIAERESIS */ \ + UNI(0x65, 0x00E5) /* LATIN SMALL LETTER A WITH RING ABOVE */ \ + UNI(0x66, 0x00E6) /* LATIN SMALL LETTER AE */ \ + UNI(0x67, 0x00E7) /* LATIN SMALL LETTER C WITH CEDILLA */ \ + UNI(0x68, 0x00E8) /* LATIN SMALL LETTER E WITH GRAVE */ \ + UNI(0x69, 0x00E9) /* LATIN SMALL LETTER E WITH ACUTE */ \ + UNI(0x6A, 0x00EA) /* LATIN SMALL LETTER E WITH CIRCUMFLEX */ \ + UNI(0x6B, 0x00EB) /* LATIN SMALL LETTER E WITH DIAERESIS */ \ + UNI(0x6C, 0x00EC) /* LATIN SMALL LETTER I WITH GRAVE */ \ + UNI(0x6D, 0x00ED) /* LATIN SMALL LETTER I WITH ACUTE */ \ + UNI(0x6E, 0x00EE) /* LATIN SMALL LETTER I WITH CIRCUMFLEX */ \ + UNI(0x6F, 0x00EF) /* LATIN SMALL LETTER I WITH DIAERESIS */ \ + UNI(0x70, 0x011F) /* LATIN SMALL LETTER G WITH BREVE */ \ + UNI(0x71, 0x00F1) /* LATIN SMALL LETTER N WITH TILDE */ \ + UNI(0x72, 0x00F2) /* LATIN SMALL LETTER O WITH GRAVE */ \ + UNI(0x73, 0x00F3) /* LATIN SMALL LETTER O WITH ACUTE */ \ + UNI(0x74, 0x00F4) /* LATIN SMALL LETTER O WITH CIRCUMFLEX */ \ + UNI(0x75, 0x00F5) /* LATIN SMALL LETTER O WITH TILDE */ \ + UNI(0x76, 0x00F6) /* LATIN SMALL LETTER O WITH DIAERESIS */ \ + UNI(0x77, 0x0153) /* LATIN SMALL LIGATURE OE */ \ + UNI(0x78, 0x00F8) /* LATIN SMALL LETTER O WITH STROKE */ \ + UNI(0x79, 0x00F9) /* LATIN SMALL LETTER U WITH GRAVE */ \ + UNI(0x7A, 0x00FA) /* LATIN SMALL LETTER U WITH ACUTE */ \ + UNI(0x7B, 0x00FB) /* LATIN SMALL LETTER U WITH CIRCUMFLEX */ \ + UNI(0x7C, 0x00FC) /* LATIN SMALL LETTER U WITH DIAERESIS */ \ + UNI(0x7D, 0x00FF) /* LATIN SMALL LETTER Y WITH DIAERESIS */ \ + UNI(0x7E, 0x015F) /* LATIN SMALL LETTER S WITH CEDILLA */ \ + } \ + end_CODEPAGE() + +#define unmap_DEC_Turkish_Supp(code,dft) \ + switch (code) { \ + MAP(0x24, 0x1B) /* reserved */ \ + MAP(0x26, 0x1B) /* reserved */ \ + MAP(0x28, 0xA4) /* DIAERESIS */ \ + MAP(0x2C, 0x1B) /* reserved */ \ + MAP(0x2D, 0x1B) /* reserved */ \ + MAP(0x2E, 0x4F) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */ \ + MAP(0x2F, 0x1B) /* reserved */ \ + MAP(0x34, 0x1B) /* reserved */ \ + MAP(0x38, 0x1B) /* reserved */ \ + MAP(0x3E, 0x51) /* LATIN SMALL LETTER DOTLESS I */ \ + MAP(0x50, 0x4E) /* LATIN CAPITAL LETTER G WITH BREVE */ \ + MAP(0x57, 0x97) /* LATIN CAPITAL LIGATURE OE */ \ + MAP(0x5D, 0x98) /* LATIN CAPITAL LETTER Y WITH DIAERESIS */ \ + MAP(0x5E, 0x9F) /* LATIN CAPITAL LETTER S WITH CEDILLA */ \ + MAP(0x70, 0x50) /* LATIN SMALL LETTER G WITH BREVE */ \ + MAP(0x77, 0x99) /* LATIN SMALL LIGATURE OE */ \ + MAP(0x7D, 0xFF) /* LATIN SMALL LETTER Y WITH DIAERESIS */ \ + MAP(0x7E, 0x2A) /* LATIN SMALL LETTER S WITH CEDILLA */ \ + default: dft; break; \ + } + +/* + * mentioned, but not documented in VT510 manual, etc., this uses + * the ELOT927 table from Kermit 95: + */ +#define map_NRCS_Greek(code) \ + switch (code) { \ + UNI(0x61, 0x0391) /* CAPITAL GREEK LETTER ALPHA */ \ + UNI(0x62, 0x0392) /* CAPITAL GREEK LETTER BETA */ \ + UNI(0x63, 0x0393) /* CAPITAL GREEK LETTER GAMMA */ \ + UNI(0x64, 0x0394) /* CAPITAL GREEK LETTER DELTA */ \ + UNI(0x65, 0x0395) /* CAPITAL GREEK LETTER EPSILON */ \ + UNI(0x66, 0x0396) /* CAPITAL GREEK LETTER ZETA */ \ + UNI(0x67, 0x0397) /* CAPITAL GREEK LETTER ETA */ \ + UNI(0x68, 0x0398) /* CAPITAL GREEK LETTER THETA */ \ + UNI(0x69, 0x0399) /* CAPITAL GREEK LETTER IOTA */ \ + UNI(0x6a, 0x039A) /* CAPITAL GREEK LETTER KAPPA */ \ + UNI(0x6b, 0x039B) /* CAPITAL GREEK LETTER LAMDA */ \ + UNI(0x6c, 0x039C) /* CAPITAL GREEK LETTER MU */ \ + UNI(0x6d, 0x039D) /* CAPITAL GREEK LETTER NU */ \ + UNI(0x6e, 0x03A7) /* CAPITAL GREEK LETTER KSI (CHI) */ \ + UNI(0x6f, 0x039F) /* CAPITAL GREEK LETTER OMICRON */ \ + UNI(0x70, 0x03A0) /* CAPITAL GREEK LETTER PI */ \ + UNI(0x71, 0x03A1) /* CAPITAL GREEK LETTER RHO */ \ + UNI(0x72, 0x03A3) /* CAPITAL GREEK LETTER SIGMA */ \ + UNI(0x73, 0x03A4) /* CAPITAL GREEK LETTER TAU */ \ + UNI(0x74, 0x03A5) /* CAPITAL GREEK LETTER UPSILON */ \ + UNI(0x75, 0x03A6) /* CAPITAL GREEK LETTER FI (PHI) */ \ + UNI(0x76, 0x039E) /* CAPITAL GREEK LETTER XI */ \ + UNI(0x77, 0x03A8) /* CAPITAL GREEK LETTER PSI */ \ + UNI(0x78, 0x03A9) /* CAPITAL GREEK LETTER OMEGA */ \ + XXX(0x79, UNDEF) /* unused */ \ + XXX(0x7a, UNDEF) /* unused */ \ + } + +#define unmap_NRCS_Greek(code,dft) \ + switch (code) { \ + MAP(0x79, 0x1B) /* unused */ \ + MAP(0x7a, 0x1B) /* unused */ \ + default: dft; break; \ + } + +/* + * figure A-21 "DEC 7-Bit Hebrew Character Set" + */ +#define map_NRCS_Hebrew(code) \ + switch (code) { \ + UNI(0x60, 0x05D0) /* HEBREW LETTER ALEF */ \ + UNI(0x61, 0x05D1) /* HEBREW LETTER BET */ \ + UNI(0x62, 0x05D2) /* HEBREW LETTER GIMEL */ \ + UNI(0x63, 0x05D3) /* HEBREW LETTER DALET */ \ + UNI(0x64, 0x05D4) /* HEBREW LETTER HE */ \ + UNI(0x65, 0x05D5) /* HEBREW LETTER VAV */ \ + UNI(0x66, 0x05D6) /* HEBREW LETTER ZAYIN */ \ + UNI(0x67, 0x05D7) /* HEBREW LETTER HET */ \ + UNI(0x68, 0x05D8) /* HEBREW LETTER TET */ \ + UNI(0x69, 0x05D9) /* HEBREW LETTER YOD */ \ + UNI(0x6a, 0x05DA) /* HEBREW LETTER FINAL KAF */ \ + UNI(0x6b, 0x05DB) /* HEBREW LETTER KAF */ \ + UNI(0x6c, 0x05DC) /* HEBREW LETTER LAMED */ \ + UNI(0x6d, 0x05DD) /* HEBREW LETTER FINAL MEM */ \ + UNI(0x6e, 0x05DE) /* HEBREW LETTER MEM */ \ + UNI(0x6f, 0x05DF) /* HEBREW LETTER FINAL NUN */ \ + UNI(0x70, 0x05E0) /* HEBREW LETTER NUN */ \ + UNI(0x71, 0x05E1) /* HEBREW LETTER SAMEKH */ \ + UNI(0x72, 0x05E2) /* HEBREW LETTER AYIN */ \ + UNI(0x73, 0x05E3) /* HEBREW LETTER FINAL PE */ \ + UNI(0x74, 0x05E4) /* HEBREW LETTER PE */ \ + UNI(0x75, 0x05E5) /* HEBREW LETTER FINAL TSADI */ \ + UNI(0x76, 0x05E6) /* HEBREW LETTER TSADI */ \ + UNI(0x77, 0x05E7) /* HEBREW LETTER QOF */ \ + UNI(0x78, 0x05E8) /* HEBREW LETTER RESH */ \ + UNI(0x79, 0x05E9) /* HEBREW LETTER SHIN */ \ + UNI(0x7a, 0x05EA) /* HEBREW LETTER TAV */ \ + } + +#define unmap_NRCS_Hebrew(code,dft) /* nothing */ + +/* + * figure A-26 "DEC 7-Bit Turkish Character Set" + */ +#define map_NRCS_Turkish(code) \ + switch (code) { \ + UNI(0x26, 0x011F) /* LATIN SMALL LETTER G WITH BREVE */ \ + UNI(0x40, 0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */ \ + UNI(0x5b, 0x015E) /* LATIN CAPITAL LETTER S WITH CEDILLA */ \ + UNI(0x5c, 0x00D6) /* LATIN CAPITAL LETTER O WITH DIAERESIS */ \ + UNI(0x5d, 0x00C7) /* LATIN CAPITAL LETTER C WITH CEDILLA */ \ + UNI(0x5e, 0x00dC) /* LATIN CAPITAL LETTER U WITH DIAERESIS */ \ + UNI(0x60, 0x011E) /* LATIN CAPITAL LETTER G WITH BREVE */ \ + UNI(0x7b, 0x015F) /* LATIN SMALL LETTER S WITH CEDILLA */ \ + UNI(0x7c, 0x00F6) /* LATIN SMALL LETTER O WITH DIAERESIS */ \ + UNI(0x7d, 0x00E7) /* LATIN SMALL LETTER C WITH CEDILLA */ \ + UNI(0x7e, 0x00FC) /* LATIN SMALL LETTER U WITH DIAERESIS */ \ + } + +#define unmap_NRCS_Turkish(code,dft) /* nothing */ +#else +#define map_DEC_Cyrillic(code) /* nothing */ +#define unmap_DEC_Cyrillic(code,dft) dft +#define map_DEC_Greek_Supp(code) /* nothing */ +#define unmap_DEC_Greek_Supp(code,dft) dft +#define map_DEC_Hebrew_Supp(code) /* nothing */ +#define unmap_DEC_Hebrew_Supp(code,dft) dft +#define map_DEC_Technical(code) /* nothing */ +#define unmap_DEC_Technical(code,dft) dft +#define map_DEC_Turkish_Supp(code) /* nothing */ +#define unmap_DEC_Turkish_Supp(code,dft) dft +#define map_ISO_Greek_Supp(code) /* nothing */ +#define unmap_ISO_Greek_Supp(code,dft) dft +#define map_ISO_Hebrew(code) /* nothing */ +#define unmap_ISO_Hebrew(code,dft) dft +#define map_ISO_Latin_2(code) /* nothing */ +#define unmap_ISO_Latin_2(code,dft) dft +#define map_ISO_Latin_5(code) /* nothing */ +#define unmap_ISO_Latin_5(code,dft) dft +#define map_ISO_Latin_Cyrillic(code) /* nothing */ +#define unmap_ISO_Latin_Cyrillic(code,dft) dft +#define map_NRCS_Greek(code) /* nothing */ +#define unmap_NRCS_Greek(code,dft) dft +#define map_NRCS_Hebrew(code) /* nothing */ +#define unmap_NRCS_Hebrew(code,dft) dft +#define map_NRCS_Turkish(code) /* nothing */ +#define unmap_NRCS_Turkish(code,dft) dft +#endif /* OPT_WIDE_CHARS */ + +#endif /* included_charsets_h */ diff --git a/app/xterm/configure.in b/app/xterm/configure.in index 602324207..21f075360 100644 --- a/app/xterm/configure.in +++ b/app/xterm/configure.in @@ -1,9 +1,9 @@ -dnl $XTermId: configure.in,v 1.392 2023/01/08 11:41:52 tom Exp $ +dnl $XTermId: configure.in,v 1.402 2024/05/11 17:24:20 tom Exp $ dnl dnl ----------------------------------------------------------------------------- dnl this file is part of xterm dnl -dnl Copyright 1997-2022,2023 by Thomas E. Dickey +dnl Copyright 1997-2023,2024 by Thomas E. Dickey dnl dnl All Rights Reserved dnl @@ -82,6 +82,7 @@ AM_LANGINFO_CODESET CF_SIG_ATOMIC_T AC_CHECK_TYPE(time_t, long) CF_TYPE_CC_T +CF_TYPE_NFDS_T AC_TYPE_MODE_T AC_TYPE_PID_T AC_TYPE_UID_T @@ -99,12 +100,15 @@ AC_CHECK_FUNCS( \ unsetenv \ sched_yield \ setpgid \ - strftime \ + setsid \ tcgetattr \ waitpid \ wcswidth \ wcwidth ) +CF_FUNC_GETTIME +CF_FUNC_STRFTIME CF_MKSTEMP +CF_SETITIMER CF_UTMP CF_STRUCT_LASTLOG CF_POSIX_SAVED_IDS @@ -163,7 +167,7 @@ cf_name=`echo "$program_transform_name" | sed -e '[s,\\$\\$,$,g]'` cf_name=`echo xterm |sed -e "$cf_name"` AC_MSG_CHECKING(for symbolic link to create to $cf_name) AC_ARG_WITH(xterm-symlink, - [ --with-xterm-symlink=XXX make symbolic link to installed xterm], + [[ --with-xterm-symlink[=XXX] make symbolic link to installed xterm]], [with_symlink=$withval], [with_symlink=xterm]) AC_MSG_RESULT($with_symlink) @@ -200,7 +204,7 @@ AC_MSG_RESULT($disable_setgid) AC_MSG_CHECKING(if you want to run xterm setuid to a given user) AC_ARG_WITH(setuid, - [ --with-setuid=XXX use the given setuid user], + [[ --with-setuid[=XXX] use the given setuid user]], [use_given_setuid=$withval], [use_given_setuid=no]) AC_MSG_RESULT($use_given_setuid) @@ -217,7 +221,7 @@ fi AC_MSG_CHECKING(if you want to run xterm setgid to match utmp/utmpx file) AC_ARG_WITH(utmp-setgid, - [ --with-utmp-setgid=XXX use setgid to match utmp/utmpx file], + [[ --with-utmp-setgid[=XXX] use setgid to match utmp/utmpx file]], [use_utmp_setgid=$withval], [use_utmp_setgid=no]) AC_MSG_RESULT($use_utmp_setgid) @@ -260,6 +264,10 @@ if test "$use_utempter" = yes ; then fi fi +# We use these for the manpage: +CF_WITH_UTMP_PATH +CF_WITH_WTMP_PATH + ### checks for external data CF_ERRNO CF_TTY_GROUP @@ -296,7 +304,7 @@ CF_TERMIOS_TYPES # the feature if it is unwanted. AC_MSG_CHECKING(if we expect to use the Xcursor library) CF_ARG_DISABLE(xcursor, - [ --disable-xcursor disable cursorTheme resource], + [ --disable-xcursor disable cursorTheme resource], [enable_xcursor=no], [enable_xcursor=yes]) AC_MSG_RESULT($enable_xcursor) @@ -343,6 +351,11 @@ AC_MSG_RESULT($default_termid) case $default_termid in (vt*) default_termid=`echo $default_termid | sed -e 's/^..//'` ;; +([[1-9]][[0-9]][[0-9]]|[[1-9]][[0-9]]) + ;; +(*) + AC_MSG_ERROR([expected a number, not $default_termid]) + ;; esac AC_DEFINE_UNQUOTED(DFT_DECID,"$default_termid",[default terminal-id]) AC_SUBST(default_termid) @@ -415,7 +428,7 @@ if test "$cf_tic_prog" = yes ; then fi AC_MSG_CHECKING(for private terminfo-directory) AC_ARG_WITH(own-terminfo, - [ --with-own-terminfo=P set default $TERMINFO (default: from environment)], + [[ --with-own-terminfo[=P] set default $TERMINFO (default: from environment)]], [TERMINFO_DIR=$withval], [TERMINFO_DIR=${TERMINFO-none}]) AC_MSG_RESULT($TERMINFO_DIR) @@ -759,7 +772,7 @@ CF_INPUT_METHOD test "$cf_cv_input_method" = no && enable_ximp=no if test "$enable_ximp" != no ; then if test "$enable_i18n" = no ; then - AC_MSG_WARN(input-methor relies upon internationalization) + AC_MSG_WARN(input-method relies upon internationalization) enable_ximp=no fi fi @@ -839,10 +852,10 @@ else fi AC_MSG_CHECKING(if you want support for mouse in readline applications) -CF_ARG_ENABLE(readline-mouse, - [ --enable-readline-mouse enable support for mouse in readline applications], - [enable_readline_mouse=yes], - [enable_readline_mouse=no]) +CF_ARG_DISABLE(readline-mouse, + [ --disable-readline-mouse disable support for mouse in readline applications], + [enable_readline_mouse=no], + [enable_readline_mouse=yes]) AC_MSG_RESULT($enable_readline_mouse) if test "$enable_readline_mouse" = yes ; then AC_DEFINE(OPT_READLINE,1,[Define to 1 to enable support for mouse in readline applications]) @@ -1084,7 +1097,11 @@ if test "$enable_regis_graphics" = yes || test "$enable_sixel_graphics" = yes ; EXTRAHDRS="$EXTRAHDRS graphics.h" EXTRASRCS="$EXTRASRCS graphics.c" EXTRAOBJS="$EXTRAOBJS graphics.o" + STRINGS_MAX=600000 +else + STRINGS_MAX=20000 fi +AC_SUBST(STRINGS_MAX) AC_MSG_CHECKING(if you want sixel screen dump support) CF_ARG_DISABLE(print-graphics, diff --git a/app/xterm/ctlseqs.ms b/app/xterm/ctlseqs.ms index 0c614c644..ff0b29649 100644 --- a/app/xterm/ctlseqs.ms +++ b/app/xterm/ctlseqs.ms @@ -1,9 +1,9 @@ .\"#! troff -ms $1 -*- Nroff -*- .\" "XTerm Control Sequences" document -.\" $XTermId: ctlseqs.ms,v 1.666 2023/01/07 01:30:20 tom Exp $ +.\" $XTermId: ctlseqs.ms,v 1.717 2024/05/25 16:43:09 tom Exp $ .\" .\" -.\" Copyright 1996-2022,2023 by Thomas E. Dickey +.\" Copyright 1996-2023,2024 by Thomas E. Dickey .\" .\" All Rights Reserved .\" @@ -69,8 +69,8 @@ .\" .ds XT XTerm .ds xt xterm -.ds LF Patch #378 -.ds RF 2023/01/06 +.ds LF Patch #392 +.ds RF 2024/05/25 .\" .if n .pl 9999v \" no page breaks in nroff .ND @@ -125,11 +125,33 @@ \\$* .br .. +.\" Fixed-pitch fonts +.ie n \{\ +. ds CW R +. ds CI I +.\} +.el \{ +. ie \n(.g \{\ +. ds CW CR +. ds CI CI +. \} +. el \{\ +. ds CW CW +. ds CI CW +. \} +.\} .\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds `` \(lq -.el .ds `` `` -.ie \n(.g .ds '' \(rq -.el .ds '' '' +.ie \n(.g \{\ +.ds `` \(lq +.ds '' \(rq +.\} +.el \{\ +.ie t .ds `` `` +.el .ds `` "" +.ie t .ds '' '' +.el .ds '' "" +.\} +. .ds CH \" as nothing .ds LH \*(XT Control Sequences .nr s 6*\n(PS/10 @@ -208,6 +230,7 @@ .[] $ $ .[] # # .[] % % +.[] & & .[] (( ( .[] ) ) .[] * * @@ -307,6 +330,7 @@ .ds Pc \fIP\v'.3m'\h'-.2m'\s-2c\s0\v'-.3m'\fP .ds Pd \fIP\v'.3m'\h'-.2m'\s-2d\s0\v'-.3m'\fP .ds Pe \fIP\v'.3m'\h'-.2m'\s-2e\s0\v'-.3m'\fP +.ds Pf \fIP\v'.3m'\h'-.2m'\s-2f\s0\v'-.3m'\fP .ds Pg \fIP\v'.3m'\h'-.2m'\s-2g\s0\v'-.3m'\fP .ds Ph \fIP\v'.3m'\h'-.2m'\s-2h\s0\v'-.3m'\fP .ds Pi \fIP\v'.3m'\h'-.2m'\s-2i\s0\v'-.3m'\fP @@ -319,6 +343,7 @@ .ds Pt \fIP\v'.3m'\h'-.2m'\s-2t\s0\v'-.3m'\fP .ds Pu \fIP\v'.3m'\h'-.2m'\s-2u\s0\v'-.3m'\fP .ds Pv \fIP\v'.3m'\h'-.2m'\s-2v\s0\v'-.3m'\fP +.ds Pw \fIP\v'.3m'\h'-.2m'\s-2w\s0\v'-.3m'\fP .ds Px \fIP\v'.3m'\h'-.2m'\s-2x\s0\v'-.3m'\fP .ds Py \fIP\v'.3m'\h'-.2m'\s-2y\s0\v'-.3m'\fP .ds Ix \fIx\fP @@ -346,7 +371,7 @@ X Consortium (1994) Thomas Dickey .AI XFree86 Project (1996-2006) -invisible-island.net (2006-2023) +invisible-island.net (2006-2024) updated for \*(XT \*(LF (\*(RF) .AU . @@ -563,7 +588,7 @@ Carriage Return (\*(Cr is Ctrl-M). .IP \\*(En Return Terminal Status (\*(En is Ctrl-E). Default response is an empty string, but may be overridden -by a resource \fBanswerbackString\fP. +by a resource \fB\%answerbackString\fP. . .iP .IP \\*(Ff @@ -718,6 +743,7 @@ used by the VT300-control for the 96-character British Latin-1. There are a few other 94-character sets: \*(Cc = \*0 \(-> DEC Special Character and Line Drawing Set, VT100. \*(Cc = \*< \(-> DEC Supplemental, VT200. + \*(Cc = \*< \(-> User Preferred Selection Set, VT300. \*(Cc = \*> \(-> DEC Technical, VT300. .br These are documented as 94-character sets (like USASCII) without NRCS: @@ -803,7 +829,7 @@ Normal Keypad (DECKPNM), VT100. .iP .IP \\*(Es\\*F Cursor to lower left corner of screen. -This is enabled by the \fBhpLowerleftBugCompat\fP resource. +This is enabled by the \fB\%hpLowerleftBugCompat\fP resource. . .iP .IP \\*(Es\\*c @@ -865,6 +891,32 @@ the key-code separated by a \*(``/\*('' from the hex-encoded key value. The key codes correspond to the DEC function-key codes (e.g., F6=17). . .iP +.IP \\*(Dc\\*(Ps\\*!\\*u\\*(Pt\\*s\\*(ST +Assigning User-Preferred Supplemental Sets (DECAUPSS), VT320, VT510. +\fI\*(XT\fP ignores this in UTF-8 mode, +and uses the \fBpreferLatin1\fP resource to choose the default setting. +.sp 0.3 +VT320 provides these: + \*(Dc\*0\*!\*u\*%\*5\*(ST \(-> DEC Supplemental Graphic + \*(Dc\*1\*!\*u\*A\*(ST \(-> ISO Latin-1 supplemental +.sp 0.3 +VT510 adds these: + \*(Dc\*0\*!\*u\*(Dq\*?\*(ST \(-> DEC Greek + \*(Dc\*0\*!\*u\*(Dq\*4\*(ST \(-> DEC Hebrew + \*(Dc\*0\*!\*u\*%\*0\*(ST \(-> DEC Turkish + \*(Dc\*0\*!\*u\*&\*4\*(ST \(-> DEC Cyrillic + \*(Dc\*1\*!\*u\*(cB\*(ST \(-> ISO Latin-2 Supplemental + \*(Dc\*1\*!\*u\*F\*(ST \(-> ISO Greek Supplemental + \*(Dc\*1\*!\*u\*H\*(ST \(-> ISO Hebrew Supplemental + \*(Dc\*1\*!\*u\*M\*(ST \(-> ISO Latin-5 Supplemental + \*(Dc\*1\*!\*u\*L\*(ST \(-> ISO Latin-Cyrillic +.sp 0.3 +VT520 accepts a few others (undocumented); xterm adds these: + \*(Dc\*0\*!\*u\*(cB\*(ST \(-> United States (USASCII). + \*(Dc\*0\*!\*u\*0\*(ST \(-> DEC Special Character and Line Drawing Set. + \*(Dc\*0\*!\*u\*>\*(ST \(-> DEC Technical. +. +.iP .IP \\*(Dc\\*$\\*q\\*(Pt\\*s\\*(ST Request Status String (DECRQSS), VT420 and up. .br @@ -879,7 +931,11 @@ The string following the \*(``q\*('' is one of the following: \*$\*| \(-> DECSCPP \*$\*} \(-> DECSASD \*$\*~ \(-> DECSSDT + \**\*x \(-> DECSACE \**\*| \(-> DECSNLS + \*,\*| \(-> DECAC (VT525 only) + \*,\*} \(-> DECATC (VT525 only) + \*>\*(Pm\*s\*m \(-> XTQMODKEYS (xterm) .br \fI\*(xt\fP responds with \*(Dc\*1\*$\*r\*(Pt\*s\*(ST @@ -938,7 +994,7 @@ Set Termcap/Terminfo Data (XTSETTCAP), \fI\*(xt\fP. The string following the \*(``p\*('' is encoded in hexadecimal. After decoding it, \fI\*(xt\fP will use the name to retrieve data from the terminal database. -If successful, that overrides the \fBtermName\fP resource when +If successful, that overrides the \fB\%termName\fP resource when handling the \*(``tcap\*('' keyboard configuration's function- and special-keys, as well as by the Request Termcap/Terminfo String control. @@ -1140,17 +1196,17 @@ but disallows modifying those sizes because that is done once, using resource-values. .bP Graphics geometry is not necessarily the same as \*(``window size\*('' -(see the \fBdtterm\fP window manipulation extensions). +(see the \fB\%XTWINOPS\fP window manipulation extensions). \fI\*(XT\fP limits the maximum graphics geometry -according to the \fBmaxGraphicSize\fP resource. +according to the \fB\%maxGraphicSize\fP resource. .IP -The \fBmaxGraphicSize\fP resource can be +The \fB\%maxGraphicSize\fP resource can be either an explicit \fIheight\fPx\fIwidth\fP (default: 1000x1000 as of version 328) or the word \*(``auto\*('' (telling \fI\*(XT\fP to use limits -the \fBdecGraphicsID\fP -or \fBdecTerminalID\fP resource to determine the limits). +the \fB\%decGraphicsID\fP +or \fB\%decTerminalID\fP resource to determine the limits). .bP \fI\*(XT\fP uses the minimum of the window size and the graphic size to obtain the maximum geometry. @@ -1191,6 +1247,9 @@ by compiling a different default for the title modes into \fI\*(xt\fP. \*(Ps = \*3 \(-> Do not query window/icon labels using UTF-8. .iP (See discussion of \fBTitle Modes\fP). +.iP +.IP \\*(Cs\\*?\\*5\\*W +Reset tab stops to start with column 9, every 8 columns (DECST8C), VT510. . .iP .IP \\*(Cs\\*(Ps\\*s\\*(XX @@ -1223,7 +1282,7 @@ Repeat the preceding graphic character \*(Ps times (REP). .IP \\*(Cs\\*(Ps\\*s\\*c Send Device Attributes (Primary DA). \*(Ps = \*0 or omitted \(-> request attributes from terminal. -The response depends on the \fBdecTerminalID\fP resource setting. +The response depends on the \fB\%decTerminalID\fP resource setting. \(->\ \*(Cs\*?\*1\*;\*2\*c (\*(``VT100 with Advanced Video Option\*('') \(->\ \*(Cs\*?\*1\*;\*0\*c (\*(``VT101 with No Options\*('') \(->\ \*(Cs\*?\*4\*;\*6\*c (\*(``VT132 with Advanced Video and Graphics\*('') @@ -1233,6 +1292,7 @@ The response depends on the \fBdecTerminalID\fP resource setting. \(->\ \*(Cs\*?\*6\*2\*;\*(Ps\*s\*c (\*(``VT220\*('') \(->\ \*(Cs\*?\*6\*3\*;\*(Ps\*s\*c (\*(``VT320\*('') \(->\ \*(Cs\*?\*6\*4\*;\*(Ps\*s\*c (\*(``VT420\*('') + \(->\ \*(Cs\*?\*6\*5\*;\*(Ps\*s\*c (\*(``VT510\*('' to (\*(``VT525\*('') .iP The VT100-style response parameters do not mean anything by themselves. VT220 (and higher) parameters do, @@ -1270,7 +1330,7 @@ Send Device Attributes (Tertiary DA). .IP \\*(Cs\\*>\\*(Ps\\*s\\*c Send Device Attributes (Secondary DA). \*(Ps = \*0 or omitted \(-> request the terminal's identification code. -The response depends on the \fBdecTerminalID\fP resource setting. +The response depends on the \fB\%decTerminalID\fP resource setting. It should apply only to VT220 and up, but \fI\*(xt\fP extends this to VT100. \(-> \*(Cs\*s\*>\*(Pp\*s\*;\*(Pv\*s\*;\*(Pc\*s\*c .br @@ -1351,19 +1411,20 @@ This is the X10 \fI\*(xt\fP mouse protocol. \*(Ps = \*4\*1 \(-> \fBmore\fP(1) fix (see \fBcurses\fP resource). \*(Ps = \*4\*2 \(-> Enable National Replacement Character sets (DECNRCM), VT220. - \*(Ps = \*4\*3 \(-> Enable Graphics Expanded Print Mode (DECGEPM). + \*(Ps = \*4\*3 \(-> Enable Graphic Expanded Print Mode (DECGEPM), VT340. \*(Ps = \*4\*4 \(-> Turn on margin bell, \fI\*(xt\fP. - \*(Ps = \*4\*4 \(-> Enable Graphics Print Color Mode (DECGPCM). - \*(Ps = \*4\*5 \(-> Reverse-wraparound mode, \fI\*(xt\fP. - \*(Ps = \*4\*5 \(-> Enable Graphics Print ColorSpace (DECGPCS). - \*(Ps = \*4\*6 \(-> Start logging, \fI\*(xt\fP. + \*(Ps = \*4\*4 \(-> Enable Graphic Print Color Mode (DECGPCM), VT340. + \*(Ps = \*4\*5 \(-> Reverse-wraparound mode (XTREVWRAP), \fI\*(xt\fP. + \*(Ps = \*4\*5 \(-> Enable Graphic Print Color Syntax (DECGPCS), VT340. + \*(Ps = \*4\*6 \(-> Start logging (XTLOGGING), \fI\*(xt\fP. This is normally disabled by a compile-time option. + \*(Ps = \*4\*6 \(-> Graphic Print Background Mode, VT340. \*(Ps = \*4\*7 \(-> Use \fIAlternate Screen Buffer\fP, \fI\*(xt\fP. -This may be disabled by the \fBtiteInhibit\fP resource. - \*(Ps = \*4\*7 \(-> Enable Graphics Rotated Print Mode (DECGRPM). +This may be disabled by the \fB\%titeInhibit\fP resource. + \*(Ps = \*4\*7 \(-> Enable Graphic Rotated Print Mode (DECGRPM), VT340. \*(Ps = \*6\*6 \(-> Application keypad mode (DECNKM), VT320. \*(Ps = \*6\*7 \(-> Backarrow key sends backspace (DECBKM), VT340, VT420. -This sets the \fBbackarrowKey\fP resource to \*(``true\*(''. +This sets the \fB\%backarrowKey\fP resource to \*(``true\*(''. \*(Ps = \*6\*9 \(-> Enable left and right margin mode (DECLRMM), VT420 and up. \*(Ps = \*8\*0 \(-> Enable \fISixel Display Mode\fP (DECSDM), VT330, VT340, VT382. \*(Ps = \*9\*5 \(-> Do not clear screen when DECCOLM is set/reset @@ -1380,50 +1441,52 @@ See the section \fBAny-event tracking\fP. \*(Ps = \*1\*0\*0\*5 \(-> Enable UTF-8 Mouse Mode, \fI\*(xt\fP. \*(Ps = \*1\*0\*0\*6 \(-> Enable SGR Mouse Mode, \fI\*(xt\fP. \*(Ps = \*1\*0\*0\*7 \(-> Enable \fIAlternate Scroll Mode\fP, \fI\*(xt\fP. -This corresponds to the \fBalternateScroll\fP resource. +This corresponds to the \fB\%alternateScroll\fP resource. \*(Ps = \*1\*0\*1\*0 \(-> Scroll to bottom on tty output (rxvt). -This sets the \fBscrollTtyOutput\fP resource to \*(``true\*(''. +This sets the \fB\%scrollTtyOutput\fP resource to \*(``true\*(''. \*(Ps = \*1\*0\*1\*1 \(-> Scroll to bottom on key press (rxvt). -This sets the \fBscrollKey\fP resource to \*(``true\*(''. +This sets the \fB\%scrollKey\fP resource to \*(``true\*(''. + \*(Ps = \*1\*0\*1\*4 \(-> Enable \fB\%fastScroll\fP resource, \fI\*(xt\fP. \*(Ps = \*1\*0\*1\*5 \(-> Enable urxvt Mouse Mode. \*(Ps = \*1\*0\*1\*6 \(-> Enable SGR Mouse PixelMode, \fI\*(xt\fP. \*(Ps = \*1\*0\*3\*4 \(-> Interpret \*(``meta\*('' key, \fI\*(xt\fP. This sets the eighth bit of keyboard input -(and enables the \fBeightBitInput\fP resource). +(and enables the \fB\%eightBitInput\fP resource). \*(Ps = \*1\*0\*3\*5 \(-> Enable special modifiers for Alt and NumLock keys, \fI\*(xt\fP. -This enables the \fBnumLock\fP resource. +This enables the \fB\%numLock\fP resource. \*(Ps = \*1\*0\*3\*6 \(-> Send \*(Es when Meta modifies a key, \fI\*(xt\fP. -This enables the \fBmetaSendsEscape\fP resource. +This enables the \fB\%metaSendsEscape\fP resource. \*(Ps = \*1\*0\*3\*7 \(-> Send DEL from the editing-keypad Delete key, \fI\*(xt\fP. \*(Ps = \*1\*0\*3\*9 \(-> Send \*(Es when Alt modifies a key, \fI\*(xt\fP. -This enables the \fBaltSendsEscape\fP resource, \fI\*(xt\fP. +This enables the \fB\%altSendsEscape\fP resource, \fI\*(xt\fP. \*(Ps = \*1\*0\*4\*0 \(-> Keep selection even if not highlighted, \fI\*(xt\fP. -This enables the \fBkeepSelection\fP resource. +This enables the \fB\%keepSelection\fP resource. \*(Ps = \*1\*0\*4\*1 \(-> Use the CLIPBOARD selection, \fI\*(xt\fP. -This enables the \fBselectToClipboard\fP resource. +This enables the \fB\%selectToClipboard\fP resource. \*(Ps = \*1\*0\*4\*2 \(-> Enable Urgency window manager hint when Control-G is received, \fI\*(xt\fP. -This enables the \fBbellIsUrgent\fP resource. +This enables the \fB\%bellIsUrgent\fP resource. \*(Ps = \*1\*0\*4\*3 \(-> Enable raising of the window when Control-G is received, \fI\*(xt\fP. -This enables the \fBpopOnBell\fP resource. +This enables the \fB\%popOnBell\fP resource. \*(Ps = \*1\*0\*4\*4 \(-> Reuse the most recent data copied to CLIPBOARD, \fI\*(xt\fP. -This enables the \fBkeepClipboard\fP resource. +This enables the \fB\%keepClipboard\fP resource. + \*(Ps = \*1\*0\*4\*5 \(-> Extended Reverse-wraparound mode (XTREVWRAP2), \fI\*(xt\fP. \*(Ps = \*1\*0\*4\*6 \(-> Enable switching to/from \fIAlternate Screen Buffer\fP, \fI\*(xt\fP. -This works for terminfo-based systems, updating the \fBtiteInhibit\fP resource. +This works for terminfo-based systems, updating the \fB\%titeInhibit\fP resource. \*(Ps = \*1\*0\*4\*7 \(-> Use \fIAlternate Screen Buffer\fP, \fI\*(xt\fP. -This may be disabled by the \fBtiteInhibit\fP resource. +This may be disabled by the \fB\%titeInhibit\fP resource. \*(Ps = \*1\*0\*4\*8 \(-> Save cursor as in DECSC, \fI\*(xt\fP. -This may be disabled by the \fBtiteInhibit\fP resource. +This may be disabled by the \fB\%titeInhibit\fP resource. \*(Ps = \*1\*0\*4\*9 \(-> Save cursor as in DECSC, \fI\*(xt\fP. After saving the cursor, switch to the \fIAlternate Screen Buffer\fP, clearing it first. This may be -disabled by the \fBtiteInhibit\fP resource. +disabled by the \fB\%titeInhibit\fP resource. This control combines the effects of the \*1\*0\*4\*7 and \*1\*0\*4\*8 modes. Use this with terminfo-based applications rather than the \*4\*7 mode. \*(Ps = \*1\*0\*5\*0 \(-> Set terminfo/termcap function-key mode, \fI\*(xt\fP. @@ -1433,7 +1496,12 @@ Use this with terminfo-based applications rather than the \*4\*7 mode. \*(Ps = \*1\*0\*6\*0 \(-> Set legacy keyboard emulation, i.e, X11R6, \fI\*(xt\fP. \*(Ps = \*1\*0\*6\*1 \(-> Set VT220 keyboard emulation, \fI\*(xt\fP. + \*(Ps = \*2\*0\*0\*1 \(-> Enable readline mouse button-1, \fI\*(xt\fP. + \*(Ps = \*2\*0\*0\*2 \(-> Enable readline mouse button-2, \fI\*(xt\fP. + \*(Ps = \*2\*0\*0\*3 \(-> Enable readline mouse button-3, \fI\*(xt\fP. \*(Ps = \*2\*0\*0\*4 \(-> Set bracketed paste mode, \fI\*(xt\fP. + \*(Ps = \*2\*0\*0\*5 \(-> Enable readline character-quoting, \fI\*(xt\fP. + \*(Ps = \*2\*0\*0\*6 \(-> Enable readline newline pasting, \fI\*(xt\fP. . .iP .IP \\*(Cs\\*(Ps\\*s\\*i @@ -1486,18 +1554,18 @@ DEC Private Mode Reset (DECRST). \*(Ps = \*4\*1 \(-> No \fBmore\fP(1) fix (see \fBcurses\fP resource). \*(Ps = \*4\*2 \(-> Disable National Replacement Character sets (DECNRCM), VT220. - \*(Ps = \*4\*3 \(-> Disable Graphics Expanded Print Mode (DECGEPM). + \*(Ps = \*4\*3 \(-> Disable Graphic Expanded Print Mode (DECGEPM), VT340. \*(Ps = \*4\*4 \(-> Turn off margin bell, \fI\*(xt\fP. - \*(Ps = \*4\*4 \(-> Disable Graphics Print Color Mode (DECGPCM). - \*(Ps = \*4\*5 \(-> No Reverse-wraparound mode, \fI\*(xt\fP. - \*(Ps = \*4\*5 \(-> Disable Graphics Print ColorSpace (DECGPCS). - \*(Ps = \*4\*6 \(-> Stop logging, \fI\*(xt\fP. + \*(Ps = \*4\*4 \(-> Disable Graphic Print Color Mode (DECGPCM), VT340. + \*(Ps = \*4\*5 \(-> No Reverse-wraparound mode (XTREVWRAP), \fI\*(xt\fP. + \*(Ps = \*4\*5 \(-> Disable Graphic Print Color Syntax (DECGPCS), VT340. + \*(Ps = \*4\*6 \(-> Stop logging (XTLOGGING), \fI\*(xt\fP. This is normally disabled by a compile-time option. \*(Ps = \*4\*7 \(-> Use \fINormal Screen Buffer\fP, \fI\*(xt\fP. - \*(Ps = \*4\*7 \(-> Disable Graphics Rotated Print Mode (DECGRPM). + \*(Ps = \*4\*7 \(-> Disable Graphic Rotated Print Mode (DECGRPM), VT340. \*(Ps = \*6\*6 \(-> Numeric keypad mode (DECNKM), VT320. \*(Ps = \*6\*7 \(-> Backarrow key sends delete (DECBKM), VT340, VT420. -This sets the \fBbackarrowKey\fP resource to \*(``false\*(''. +This sets the \fB\%backarrowKey\fP resource to \*(``false\*(''. \*(Ps = \*6\*9 \(-> Disable left and right margin mode (DECLRMM), VT420 and up. \*(Ps = \*8\*0 \(-> Disable \fISixel Display Mode\fP (DECSDM), VT330, VT340, VT382. @@ -1517,50 +1585,52 @@ See the section \fBAny-event tracking\fP. \*(Ps = \*1\*0\*0\*5 \(-> Disable UTF-8 Mouse Mode, \fI\*(xt\fP. \*(Ps = \*1\*0\*0\*6 \(-> Disable SGR Mouse Mode, \fI\*(xt\fP. \*(Ps = \*1\*0\*0\*7 \(-> Disable \fIAlternate Scroll Mode\fP, \fI\*(xt\fP. -This corresponds to the \fBalternateScroll\fP resource. +This corresponds to the \fB\%alternateScroll\fP resource. \*(Ps = \*1\*0\*1\*0 \(-> Don't scroll to bottom on tty output (rxvt). -This sets the \fBscrollTtyOutput\fP resource to \*(``false\*(''. +This sets the \fB\%scrollTtyOutput\fP resource to \*(``false\*(''. \*(Ps = \*1\*0\*1\*1 \(-> Don't scroll to bottom on key press (rxvt). -This sets the \fBscrollKey\fP resource to \*(``false\*(''. +This sets the \fB\%scrollKey\fP resource to \*(``false\*(''. + \*(Ps = \*1\*0\*1\*4 \(-> Disable \fB\%fastScroll\fP resource, \fI\*(xt\fP. \*(Ps = \*1\*0\*1\*5 \(-> Disable urxvt Mouse Mode. \*(Ps = \*1\*0\*1\*6 \(-> Disable SGR Mouse Pixel-Mode, \fI\*(xt\fP. \*(Ps = \*1\*0\*3\*4 \(-> Don't interpret \*(``meta\*('' key, \fI\*(xt\fP. -This disables the \fBeightBitInput\fP resource. +This disables the \fB\%eightBitInput\fP resource. \*(Ps = \*1\*0\*3\*5 \(-> Disable special modifiers for Alt and NumLock keys, \fI\*(xt\fP. -This disables the \fBnumLock\fP resource. +This disables the \fB\%numLock\fP resource. \*(Ps = \*1\*0\*3\*6 \(-> Don't send \*(Es when Meta modifies a key, \fI\*(xt\fP. -This disables the \fBmetaSendsEscape\fP resource. +This disables the \fB\%metaSendsEscape\fP resource. \*(Ps = \*1\*0\*3\*7 \(-> Send VT220 Remove from the editing-keypad \fIDelete\fP key, \fI\*(xt\fP. \*(Ps = \*1\*0\*3\*9 \(-> Don't send \*(Es when Alt modifies a key, \fI\*(xt\fP. -This disables the \fBaltSendsEscape\fP resource. +This disables the \fB\%altSendsEscape\fP resource. \*(Ps = \*1\*0\*4\*0 \(-> Do not keep selection when not highlighted, \fI\*(xt\fP. -This disables the \fBkeepSelection\fP resource. +This disables the \fB\%keepSelection\fP resource. \*(Ps = \*1\*0\*4\*1 \(-> Use the PRIMARY selection, \fI\*(xt\fP. -This disables the \fBselectToClipboard\fP resource. +This disables the \fB\%selectToClipboard\fP resource. \*(Ps = \*1\*0\*4\*2 \(-> Disable Urgency window manager hint when Control-G is received, \fI\*(xt\fP. -This disables the \fBbellIsUrgent\fP resource. +This disables the \fB\%bellIsUrgent\fP resource. \*(Ps = \*1\*0\*4\*3 \(-> Disable raising of the window when Control-G is received, \fI\*(xt\fP. -This disables the \fBpopOnBell\fP resource. +This disables the \fB\%popOnBell\fP resource. + \*(Ps = \*1\*0\*4\*5 \(-> No Extended Reverse-wraparound mode (XTREVWRAP2), \fI\*(xt\fP. \*(Ps = \*1\*0\*4\*6 \(-> Disable switching to/from \fIAlternate Screen Buffer\fP, \fI\*(xt\fP. -This works for terminfo-based systems, updating the \fBtiteInhibit\fP resource. +This works for terminfo-based systems, updating the \fB\%titeInhibit\fP resource. If currently using the \fIAlternate Screen Buffer\fP, \fI\*(xt\fP switches to the Normal Screen Buffer. \*(Ps = \*1\*0\*4\*7 \(-> Use Normal Screen Buffer, \fI\*(xt\fP. Clear the screen first if in the \fIAlternate Screen Buffer\fP. -This may be disabled by the \fBtiteInhibit\fP resource. +This may be disabled by the \fB\%titeInhibit\fP resource. \*(Ps = \*1\*0\*4\*8 \(-> Restore cursor as in DECRC, \fI\*(xt\fP. -This may be disabled by the \fBtiteInhibit\fP resource. +This may be disabled by the \fB\%titeInhibit\fP resource. \*(Ps = \*1\*0\*4\*9 \(-> Use Normal Screen Buffer and restore cursor as in DECRC, \fI\*(xt\fP. -This may be disabled by the \fBtiteInhibit\fP resource. +This may be disabled by the \fB\%titeInhibit\fP resource. This combines the effects of the \*1\*0\*4\*7 and \*1\*0\*4\*8 modes. Use this with terminfo-based applications rather than the \*4\*7 mode. \*(Ps = \*1\*0\*5\*0 \(-> Reset terminfo/termcap function-key mode, \fI\*(xt\fP. @@ -1569,7 +1639,12 @@ Use this with terminfo-based applications rather than the \*4\*7 mode. \*(Ps = \*1\*0\*5\*3 \(-> Reset SCO function-key mode, \fI\*(xt\fP. \*(Ps = \*1\*0\*6\*0 \(-> Reset legacy keyboard emulation, i.e, X11R6, \fI\*(xt\fP. \*(Ps = \*1\*0\*6\*1 \(-> Reset keyboard emulation to Sun/PC style, \fI\*(xt\fP. + \*(Ps = \*2\*0\*0\*1 \(-> Disable readline mouse button-1, \fI\*(xt\fP. + \*(Ps = \*2\*0\*0\*2 \(-> Disable readline mouse button-2, \fI\*(xt\fP. + \*(Ps = \*2\*0\*0\*3 \(-> Disable readline mouse button-3, \fI\*(xt\fP. \*(Ps = \*2\*0\*0\*4 \(-> Reset bracketed paste mode, \fI\*(xt\fP. + \*(Ps = \*2\*0\*0\*5 \(-> Disable readline character-quoting, \fI\*(xt\fP. + \*(Ps = \*2\*0\*0\*6 \(-> Disable readline newline pasting, \fI\*(xt\fP. . .iP .IP \\*(Cs\\*(Pm\\*s\\*m @@ -1804,7 +1879,7 @@ the shifted F1 key may send (with shift-, control-, alt-modifiers) .IP The second parameter encodes the modifiers; values range from 2 to 16. See the section \fBPC-Style Function Keys\fP for the codes. -The \fBmodifyFunctionKeys\fP and \fBmodifyKeyboard\fP resources +The \fB\%modifyFunctionKeys\fP and \fB\%modifyKeyboard\fP resources can change the form of the string sent from the modified F1 key. . .iP @@ -1824,8 +1899,8 @@ The parameter identifies the resource to be disabled: \*(Ps = \*2 \(-> \fBmodifyFunctionKeys\fP. \*(Ps = \*4 \(-> \fBmodifyOtherKeys\fP. .iP -If the parameter is omitted, \fBmodifyFunctionKeys\fP is disabled. -When \fBmodifyFunctionKeys\fP is disabled, \fI\*(xt\fP uses the +If the parameter is omitted, \fB\%modifyFunctionKeys\fP is disabled. +When \fB\%modifyFunctionKeys\fP is disabled, \fI\*(xt\fP uses the modifier keys to make an extended sequence of function keys rather than adding a parameter to each function key to denote the modifiers. . @@ -1862,14 +1937,10 @@ The response is The last two parameters apply to VT300 & up (keyboard ready) and VT400 & up (LK01) respectively. .iP - \*(Ps = \*5\*3 \(-> Report Locator status. -The response is -\*(Cs\*?\*5\*3\*n Locator available, if compiled-in, or -\*(Cs\*?\*5\*0\*n No Locator, if not. \*(Ps = \*5\*5 \(-> Report Locator status. The response is -\*(Cs\*?\*5\*3\*n Locator available, if compiled-in, or -\*(Cs\*?\*5\*0\*n No Locator, if not. +\*(Cs\*?\*5\*0\*n Locator available, if compiled-in, or +\*(Cs\*?\*5\*3\*n No Locator, if not. \*(Ps = \*5\*6 \(-> Report Locator type. The response is \*(Cs\*?\*5\*7\*;\*1\*n Mouse, if compiled-in, or @@ -1892,7 +1963,7 @@ The response is . .iP .IP \\*(Cs\\*>\\*(Ps\\*s\\*p -Set resource value \fBpointerMode\fP (XTSMPOINTER), \*(xt. +Set resource value \fB\%pointerMode\fP (XTSMPOINTER), \*(xt. This is used by \fI\*(xt\fP to decide whether to hide the pointer cursor as the user types. .iP @@ -1960,7 +2031,7 @@ where \*(Ps is the mode number as in DECSET/DECSET, .br Two private modes are read-only (i.e., \*1\*3 and \*1\*4), provided only for reporting their values using this control sequence. -They correspond to the resources \fBcursorBlink\fP and \fBcursorBlinkXOR\fP. +They correspond to the resources \fB\%cursorBlink\fP and \fB\%cursorBlinkXOR\fP. . .IP \\*(Cs\\*#\\*p .br @@ -1971,8 +2042,12 @@ used to work around language limitations of C#. . .iP .IP \\*(Cs\\*>\\*(Ps\\*s\\*q -\*(Ps = \*0 \(-> Report \fI\*(xt\fP name and version (XTVERSION). -The response is a DSR sequence identifying the version: \*(Dc\*>\*|text \*(ST +.br + \*(Ps = \*0 \(-> Report \fI\*(xt\fP name and version (XTVERSION). +.br +The response is a DSR sequence identifying the version: +.br + \*(Dc\*>\*|text \*(ST .iP .IP \\*(Cs\\*(Ps\\*s\\*q Load LEDs (DECLL), VT100. @@ -2043,7 +2118,7 @@ This is available only when DECLRMM is enabled. .iP .IP \\*(Cs\\*>\\*(Ps\\*s\\*(cs Set/reset shift-escape options (XTSHIFTESCAPE), \fI\*(xt\fP. -This corresponds to the \fBshiftEscape\fP resource. +This corresponds to the \fB\%shiftEscape\fP resource. .iP Valid values for the parameter: \*(Ps = \*0 \(-> allow shift-key to override mouse protocol. @@ -2069,7 +2144,7 @@ Only those modes listed as parameters are saved. .iP .IP \\*(Cs\\*(Ps\\*s\\*;\\*(Ps\\*s\\*;\\*(Ps\\*s\\*t Window manipulation (XTWINOPS), \fIdtterm\fP, extended by \fI\*(xt\fP. -These controls may be disabled using the \fBallowWindowOps\fP resource. +These controls may be disabled using the \fB\%allowWindowOps\fP resource. .iP \fI\*(xt\fP uses \fIExtended Window Manager Hints\fP (EWMH) to maximize the window. @@ -2166,6 +2241,13 @@ from stack. \*(Ps >= \*2\*4 \(-> Resize to \*(Ps lines (DECSLPP), VT340 and VT420. .br \fI\*(xt\fP adapts this by resizing its window. +.iP +XTWINOPS \*2\*2 (save/push title) and \*2\*3 (restore/pop title) +accept an optional third parameter for direct access to the stack. +Parameters in the range 1 through 10, +may be used to store the title into the stack +or retrieve the title from the stack +without pushing/popping. . .iP .IP \\*(Cs\\*>\\*(Pm\\*s\\*t @@ -2196,6 +2278,11 @@ Reverse Attributes in Rectangular Area (DECRARA), VT400 and up. Restore cursor (SCORC, also ANSI.SYS). . .iP +.IP \\*(Cs\\*&\\*u +User-Preferred Supplemental Set (DECRQUPSS), VT320, VT510. +Response is DECAUPSS. +. +.iP .IP \\*(Cs\\*(Ps\\*s\\*(Sp\\*u Set margin-bell volume (DECSMBV), VT520. \*(Ps = \*0, \*5, \*6, \*7, or \*8 \(-> high. @@ -2203,6 +2290,21 @@ Set margin-bell volume (DECSMBV), VT520. \*(Ps = \*2, \*3 or \*4 \(-> low. . .iP +.IP \\*(Cs\\*(Dq\\*v +Request Displayed Extent (DECRQDE), VT340, VT420. +.br +Response is +.br + \*(Cs\*(Ph\*;\*(Pw\*;\*(Pc\*;\*(Pr\*;\*(Pp\*s\*(Dq\*w +.br +where + \*(Ph is the number of lines of the current page + \*(Pw is the number of columns of the current page + \*(Pc is the column number at the top-left of the window + \*(Pr is the row number at the top-left of the window + \*(Pp is the current page number +. +.iP .IP \\*(Cs\\*(Pt\\*s\\*;\\*(Pl\\*s\\*;\\*(Pb\\*s\\*;\\*(Pr\\*s\\*;\\*(Pp\\*s\\*;\\*(Pt\\*s\\*;\\*(Pl\\*s\\*;\\*(Pp\\*s\\*$\\*v Copy Rectangular Area (DECCRA), VT400 and up. \*(Pt\*s\*;\*(Pl\*s\*;\*(Pb\*s\*;\*(Pr denotes the rectangle. @@ -2282,7 +2384,6 @@ The bits of \*(Ps modify the calculation of the checksum returned by DECRQCRA: \*2 \(-> do not omit checksum for blanks. \*3 \(-> omit checksum for cells not explicitly initialized. \*4 \(-> do not mask cell value to 8 bits or ignore combining characters. - \*5 \(-> do not mask cell value to 7 bits. . .iP .IP \\*(Cs\\*(Pi\\*s\\*;\\*(Pg\\*s\\*;\\*(Pt\\*s\\*;\\*(Pl\\*s\\*;\\*(Pb\\*s\\*;\\*(Pr\\*s\\**\\*y @@ -2424,6 +2525,45 @@ Select number of lines per screen (DECSNLS), VT420 and up. Pop video attributes from stack (XTPOPSGR), \fI\*(xt\fP. Popping restores the video-attributes which were saved using XTPUSHSGR to their previous state. +.iP +.IP \\*(Cs\\*(Ps\\*;\\*(Pf\\*;\\*(Pb\\*,\\*| +Assign Color (DECAC), VT525 only. + \*(Ps selects the color item + \*(Pf is the foreground color index 0..15 + \*(Pb is the background color index 0..15 +.IP +Color items: + \*(Ps = \*1 \(-> normal text + \*(Ps = \*2 \(-> window frame +.IP +\fI\*(xt\fP uses the SGR color palette with DECAC color item 1 to +update the VT100 window colors, +like \*(Os \*1\*0 and \*1\*1. +.iP +.IP \\*(Cs\\*(Ps\\*;\\*(Pf\\*;\\*(Pb\\*,\\*} +Alternate Text Color (DECATC), VT525 only. +This feature specifies the colors to use when \%DECSTGLT is selected to 1 or 2. + \*(Ps selects attribute combinations + \*(Pf is the foreground color index 0..15 + \*(Pb is the background color index 0..15 +.IP +Attribute combinations: + \*(Ps = \*0 \(-> normal text + \*(Ps = \*1 \(-> bold + \*(Ps = \*2 \(-> reverse + \*(Ps = \*3 \(-> underline + \*(Ps = \*4 \(-> blink + \*(Ps = \*5 \(-> bold reverse + \*(Ps = \*6 \(-> bold underline + \*(Ps = \*7 \(-> bold blink + \*(Ps = \*8 \(-> reverse underline + \*(Ps = \*9 \(-> reverse blink + \*(Ps = \*1\*0 \(-> underline blink + \*(Ps = \*1\*1 \(-> bold reverse underline + \*(Ps = \*1\*2 \(-> bold reverse blink + \*(Ps = \*1\*3 \(-> bold underline blink + \*(Ps = \*1\*4 \(-> reverse underline blink + \*(Ps = \*1\*5 \(-> bold reverse underline blink . .iP .IP \\*(Cs\\*(Ps\\*s\\*(qu\\*} @@ -2454,7 +2594,7 @@ Select status line type (DECSSDT), VT320 and up. .IP \\*(Os\\*(Ps\\*s\\*;\\*(Pt\\*s\\*(Be .iP .IP \\*(Os\\*(Ps\\*s\\*;\\*(Pt\\*s\\*(ST -Set Text Parameters. +Set Text Parameters, \fI\*(xt\fP. Some control sequences return information: .RS .bP @@ -2463,11 +2603,13 @@ if \*(Pt is a \*(``?\*('', the control sequence elicits a response which consists of the control sequence which would set the corresponding value. .bP -The \fIdtterm\fP control sequences allow you to determine the icon name -and window title. +A few of these control sequences began with \fIdtterm\fP +(codes \*0, \*1, and \*2). +Code \*3 in \fIdtterm\fP sets the working directory for the next session. +\fI\*(XT\fP does that with the \fB\%spawn\-new\-terminal\fP action. .RE .sP -\*(XT accepts either \*(Be or \*(ST for terminating \*(Os sequences, +\fI\*(XT\fP accepts either \*(Be or \*(ST for terminating \*(Os sequences, and when returning information, uses the same terminator used in a query. While the latter is preferred, the former is supported for legacy applications: @@ -2541,6 +2683,29 @@ At least one parameter is expected for \*(Pt. Each successive parameter changes the next color in the list. The value of \*(Ps tells the starting point in the list. The colors are specified by name or RGB specification as per \fIXParseColor\fP. +.TS H +center; +lf3w(2c) lf3w(2c) . +Resource Description +_ +.TH +.T& +l | l . +\fBforeground\fP VT100 text foreground color +\fBbackground\fP VT100 text background color +\fBcursorColor\fP text cursor color +\fBpointerColor\fP pointer foreground color +\fBpointerColorBackground\fP pointer background +(\fBforeground\fP) Tektronix foreground color +(\fBbackground\fP) Tektronix background color +\fBhighlightColor\fP highlight background color +(\fBcursorColor\fP) Tektronix cursor color +\fBhighlightTextColor\fP highlight foreground color +_ +.TE +.sP +The Tektronix colors are initially set from the VT100 colors, +but after that can be set independently using these control sequences. .sP If a \*(``?\*('' is given rather than a name or RGB specification, \fI\*(xt\fP replies with a control sequence of the same form which can be used @@ -2559,13 +2724,17 @@ be given in one control sequence, \fI\*(xt\fR can make more than one reply. \*(Ps = \*1\*8 \(-> Change Tektronix cursor color to \*(Pt. \*(Ps = \*1\*9 \(-> Change highlight foreground color to \*(Pt. .sp - \*(Ps = \*2\*2 \(-> Change pointer cursor to \*(Pt. + \*(Ps = \*2\*2 \(-> Change pointer cursor shape to \*(Pt. +The parameter \*(Pt sets the \fB\%pointerShape\fP resource. +If \*(Pt is empty, or does not match any of the standard names, +\fI\*n\fP uses the resource's default \*(``xterm\*('' shape. .sP \*(Ps = \*4\*6 \(-> Change Log File to \*(Pt. -This is normally disabled by a compile-time option. +The parameter \*(Pt sets the \fB\%logFile\fP resource. +Logging is normally disabled by a compile-time option. .sP \*(Ps = \*5\*0 \(-> Set Font to \*(Pt. -These controls may be disabled using the \fBallowFontOps\fP resource. +These controls may be disabled using the \fB\%allowFontOps\fP resource. If \*(Pt begins with a \*(``#\*('', index in the font menu, relative (if the next character is a plus or minus sign) or absolute. A number is @@ -2579,13 +2748,13 @@ The remainder of \*(Pt is ignored. A font can be specified after a \*(``#\*('' index expression, by adding a space and then the font specifier. .sP -If the \fBTrueType Fonts\fP menu entry is set (the \fBrenderFont\fP resource), -then this control sets/queries the \fBfaceName\fP resource. +If the \fBTrueType Fonts\fP menu entry is set (the \fB\%renderFont\fP resource), +then this control sets/queries the \fB\%faceName\fP resource. .sP \*(Ps = \*5\*1 \(-> reserved for Emacs shell. .sP \*(Ps = \*5\*2 \(-> Manipulate Selection Data. -These controls may be disabled using the \fBallowWindowOps\fP resource. +These controls may be disabled using the \fB\%allowWindowOps\fP resource. The parameter \*(Pt is parsed as .br \*(Pc\*s\*;\*(Pd @@ -2693,7 +2862,7 @@ The \fIdynamic colors\fR can also be reset to their default (resource) values: Sun shelltool, CDE dtterm. .br The file is expected to be XPM format, -and uses the same search logic as the \fBiconHint\fP resource. +and uses the same search logic as the \fB\%iconHint\fP resource. .sP \*(Ps = \*l\*s\*;\fIc\fP \(-> Set window title. Sun shelltool, CDE dtterm. @@ -2719,11 +2888,11 @@ e.g., in a text file, and special keys, which you would use to tell \fI\*(xt\fP to perform some action. .LP \fI\*(XT\fP detects all of these keys via X key-press and key-release events. -It uses the \fBtranslations\fP resource to decide what to do with these events. +It uses the \fB\%translations\fP resource to decide what to do with these events. .bP Ordinary keys are handled with the -\fBinsert-seven-bit\fP or -\fBinsert-eight-bit\fP action. +\fB\%insert\-seven\-bit\fP action, or the +\fB\%insert\-eight\-bit\fP action. .bP Special keys may be handled with other resources. However, \fI\*(xt\fP also has built-in logic to map commonly-used @@ -2745,7 +2914,7 @@ By using \fIxmodmap\fP one may have the modifier assigned to a different key, and have \*(``real\*('' alt and meta keys. Here is an example: .ID -.ft CW +.ft \*(CW ! put meta on mod3 to distinguish it from alt keycode 64 = Alt_L clear mod1 @@ -2753,29 +2922,29 @@ add mod1 = Alt_L keycode 115 = Meta_L clear mod3 add mod3 = Meta_L -.ft 1 +.ft R .DE .LP -The \fBmetaSendsEscape\fP resource -(and \fBaltSendsEscape\fP if \fBaltIsNotMeta\fP is set) +The \fB\%metaSendsEscape\fP resource +(and \fB\%altSendsEscape\fP if \fB\%altIsNotMeta\fP is set) can be used to control the way the \fIMeta\fP modifier applies to ordinary -keys unless the \fBmodifyOtherKeys\fP resource is set: +keys unless the \fB\%modifyOtherKeys\fP resource is set: .bP prefix a key with the \*(Es character. .bP shift the key from codes 0-127 to 128-255 by adding 128. .LP -When \fBmodifyOtherKeys\fP is set, +When \fB\%modifyOtherKeys\fP is set, ordinary keys may be sent as escape sequences: .bP -When \fBmodifyOtherKeys\fP is set to 1, +When \fB\%modifyOtherKeys\fP is set to 1, only the alt- and meta-modifiers apply. For example, \fIalt-Tab\fP sends \*(Cs\*2\*7\*;\*3\*;\*9\*~ (the second parameter is \*(``3\*('' for \fIalt\fP, and the third parameter is the ASCII value of tab, \*(``9\*(''). .bP -When \fBmodifyOtherKeys\fP is set to 2, +When \fB\%modifyOtherKeys\fP is set to 2, all of the modifiers apply. For example, \fIshift-Tab\fP sends \*(Cs\*2\*7\*;\*2\*;\*9\*~ @@ -2783,9 +2952,9 @@ rather than \*(Cs\*Z (the second parameter is \*(``2\*('' for \fIshift\fP). .LP -The \fBformatOtherKeys\fP resource tells \fI\*n\fP to change the -format of the escape sequences sent when \fBmodifyOtherKeys\fP applies. -When \fBmodifyOtherKeys\fP is set to 1, +The \fB\%formatOtherKeys\fP resource tells \fI\*n\fP to change the +format of the escape sequences sent when \fB\%modifyOtherKeys\fP applies. +When \fB\%modifyOtherKeys\fP is set to 1, for example \fIalt-Tab\fP sends \*(Cs\*9\*;\*3\*u (changing the order of parameters). @@ -2806,7 +2975,7 @@ go into greater detail on this topic. .LP The table shows the result for a given character \*(``x\*('' with modifiers according to the default translations with the resources set on or off. -This assumes \fBaltIsNotMeta\fP is set: +This assumes \fB\%altIsNotMeta\fP is set: .\" page-eject to work around grohtml bugs .if t .bp .TS H @@ -2847,7 +3016,7 @@ which duplicate the smaller cursor and scrolling keypads. X does not predefine NumLock (used for VT220 keyboards) or Alt (used as an extension for the Sun/PC keyboards) as modifiers. These keys are recognized as modifiers when enabled -by the \fBnumLock\fP resource, +by the \fB\%numLock\fP resource, or by the \*(``DECSET \*1\*0\*3\*5\*('' control sequence. .LP The cursor keys transmit the following escape sequences depending on the @@ -2953,7 +3122,7 @@ Note that F1 through F4 are prefixed with \*(S3, while the other keys are prefixed with \*(Cs. Older versions of \fI\*(xt\fP implement different escape sequences for F1 through F4, with a \*(Cs prefix. -These can be activated by setting the \fBoldXtermFKeys\fP resource. +These can be activated by setting the \fB\%oldXtermFKeys\fP resource. However, since they do not correspond to any hardware terminal, they have been deprecated. (The DEC VT220 reserves F1 through F5 for local functions such as \fISetup\fP). @@ -2972,9 +3141,9 @@ F4 \*(Cs\*1\*4\*~ _ .TE In normal mode, i.e., a Sun/PC keyboard -when the \fBsunKeyboard\fP resource is false +when the \fB\%sunKeyboard\fP resource is false (and none of the other keyboard resources -such as \fBoldXtermFKeys\fP resource is set), +such as \fB\%oldXtermFKeys\fP resource is set), \fI\*(xt\fP encodes function key modifiers as parameters appended before the \fIfinal\fP character of the control sequence. As a special case, @@ -3008,7 +3177,7 @@ _ For example, shift-F5 would be sent as \*(Cs\*1\*5\*;\*2\*~ .LP -If the \fBalwaysUseMods\fP resource is set, the Meta modifier also is +If the \fB\%alwaysUseMods\fP resource is set, the Meta modifier also is recognized, making parameters 9 through 16. .LP The codes used for the \fIPC-style function keys\fP were inspired @@ -3044,7 +3213,7 @@ assignment limited to two modifiers (\fIshift\fP and \fIcontrol\fP). .Ss "VT220-Style Function Keys" .LP However, \fI\*(xt\fP is most useful as a DEC VT102 or VT220 emulator. -Set the \fBsunKeyboard\fP resource to true to force a Sun/PC keyboard +Set the \fB\%sunKeyboard\fP resource to true to force a Sun/PC keyboard to act like a VT220 keyboard. .LP The VT102/VT220 application keypad transmits unique escape sequences in @@ -3257,7 +3426,7 @@ _ .LP \fI\*(XT\fP maintains two screen buffers. The Normal Screen Buffer allows you to scroll back to view saved lines -of output up to the maximum set by the \fBsaveLines\fP resource. +of output up to the maximum set by the \fB\%saveLines\fP resource. The \fIAlternate Screen Buffer\fP is exactly as large as the display, contains no additional saved lines. When the \fIAlternate Screen Buffer\fP is active, @@ -3269,7 +3438,7 @@ Most full-screen applications use terminfo or termcap to obtain strings used to start/stop full-screen mode, i.e., \fIsmcup\fP and \fIrmcup\fP for terminfo, or the corresponding \fIti\fP and \fIte\fP for termcap. -The \fBtiteInhibit\fP resource removes the \fIti\fP and \fIte\fP strings +The \fB\%titeInhibit\fP resource removes the \fIti\fP and \fIte\fP strings from the TERMCAP string which is set in the environment for some platforms. That is not done when \fI\*(xt\fP is built with terminfo libraries because terminfo does not provide the whole text of the termcap data in one piece. @@ -3304,6 +3473,57 @@ For background and discussion, see the FAQ: \fIXTerm - bracketed-paste\fP .DE . +.Sh "Readline Modes" +.LP +Several modes provide support for mouse button events in \fIreadline\fP. +Bracketed paste is one of these \fIreadline\fP modes, but is used more widely. +. +.LP +Some assumptions (particular mouse buttons) and limitations +(the mouse is clicked on the current row on the screen) apply: +. +.IP "\*2\*0\*0\*1" +If mouse button 1 is used to end or extend a selection +(the \fB\%select\-end\fP action), +and if the cursor position is on the same row as the mouse-click, +send left/right cursor control sequences to the host to +adjust the cursor position to match the mouse click. +. +.IP "\*2\*0\*0\*2" +When pasting text (the \fB\%insert\-selection\fP action +which is normally bound to mouse button 2), +if mouse protocol is not enabled, +and if the cursor position is on the same row as the mouse-click, +send left/right cursor control sequences to the host to +adjust the cursor position to match the mouse click. +.IP "\*2\*0\*0\*3" +If mouse button 3 is double-clicked when ending or extending a selection, +(the \fB\%select\-end\fP action), +and if the cursor position is on the same line as the mouse-click: +.RS +.bP +Send left/right cursor control sequences to the host to +adjust the cursor position to match the mouse click. +.bP +In addition to the same \fIrow\fP, +the selection may be part of a wrapped +line as in other \fI\*(xt\fP selections +(see the \fBSelection Functions\fR section in the manual page). +.bP +After adjusting the cursor position, +\fI\*(xt\fP sends erase-characters +(one for each character in the selection) +to tell the host to delete the selected text. +.RE +.IP "\*2\*0\*0\*5" +When writing a selection to the host +(i.e., pasting text), +escape each character with the \fIliteral-next\fP (Ctrl-V) character. +.IP "\*2\*0\*0\*6" +Normally when \fI\*(xt\fP writes selections to the host, +it translates newlines to carriage returns. +This mode disables the translation, passing newlines literally. +. .Sh "Title Modes" .LP The window- and icon-labels can be set or queried using control sequences. @@ -3322,7 +3542,7 @@ it is possible to use window- and icon-labels encoded using UTF-8. That is because the underlying X libraries (and many, but not all) window managers support this feature. .LP -The \fButf8Title\fP X resource setting tells \fI\*(xt\fP to disable +The \fB\%utf8Title\fP X resource setting tells \fI\*(xt\fP to disable a reconversion of the title string back to ISO-8859-1, allowing the title strings to be interpreted as UTF-8. The same feature can be enabled using the title mode control sequence @@ -3371,7 +3591,7 @@ Manifest constants for the parameter values are defined in \fIxcharmouse.h\fP as follows: . .ID -.ft CW +.ft \*(CW #define SET_X10_MOUSE 9 #define SET_VT200_MOUSE 1000 #define SET_VT200_HIGHLIGHT_MOUSE 1001 @@ -3386,7 +3606,7 @@ are defined in \fIxcharmouse.h\fP as follows: #define SET_SGR_EXT_MODE_MOUSE 1006 #define SET_URXVT_EXT_MODE_MOUSE 1015 #define SET_PIXEL_POSITION_MOUSE 1016 -.ft 1 +.ft R .DE .br The motion reporting modes are strictly \fI\*(xt\fP extensions, and are not @@ -3471,8 +3691,8 @@ Release events for the wheel buttons are not reported. .LP By default, the wheel mouse events (buttons 4 and 5) -are translated to \fBscroll-back\fP -and \fBscroll-forw\fP actions, respectively. +are translated to \fB\%scroll\-back\fP +and \fB\%scroll\-forw\fP actions, respectively. Those actions normally scroll the whole window, as if the scrollbar was used. .LP @@ -3480,7 +3700,7 @@ However if \fIAlternate Scroll\fP mode is set, then cursor up/down controls are sent when the terminal is displaying the \fIAlternate Screen Buffer\fP. The initial state of \fIAlternate Scroll\fP mode is set -using the \fBalternateScroll\fP resource. +using the \fB\%alternateScroll\fP resource. .Ss Other buttons .LP Some wheel mice can send additional button events, @@ -3496,7 +3716,7 @@ Past button 11, the encoding is ambiguous because the same code may correspond to different button/modifier combinations. .LP It is not possible to use these buttons (6-11) in \fI\*(xt\fP's -\fBtranslations\fP resource because their names are not in the X Toolkit's +\fB\%translations\fP resource because their names are not in the X Toolkit's symbol table. However, applications can check for the reports, e.g., button 7 (left) and button 6 (right) with a Logitech mouse. @@ -3680,8 +3900,8 @@ VT330, VT340 or VT382 using the -\fBdecTerminalID\fP or -\fBdecGraphicsID\fP +\fB\%decTerminalID\fP or +\fB\%decGraphicsID\fP resource, it supports Sixel Graphics controls, a paletted bitmap graphics system using sets of six vertical pixels as the basic element. @@ -3724,8 +3944,8 @@ VT241, VT330 or VT340 using the -\fBdecTerminalID\fP or -\fBdecGraphicsID\fP +\fB\%decTerminalID\fP or +\fB\%decGraphicsID\fP resource, it supports Remote Graphic Instruction Set, a graphics description language. .St @@ -3756,6 +3976,15 @@ with four possible values: \*(Pm = 2 \(-> resume command, use command display mode. \*(Pm = 3 \(-> start new command, use command display mode. .Ed +.LP +A few of the VT330/VT340 private modes conflict with \fI\*(xt\fP. +Codes \*4\*0 to \*4\*7 were first used by xterm in X10R4 (December 1986). +While X11R1 \fI\*(xt\fP dropped codes \*4\*1 and \*4\*2, the remaining +ones are still used. +The VT330/VT340 introduced in April 1987 uses \*4\*4 to \*4\*7 for +color graphics printing controls. +When configured for ReGIS, +\fI\*(xt\fP uses the VT330/VT340 interpretation of these private modes. . .Sh "Non-VT100 Modes" .Ss "Tektronix 4014 Mode" @@ -3974,8 +4203,11 @@ However long, the technical manuals have problems: DEC's manuals did not provide a comprehensive comparison of the features in different model. .IP -Peter Sichel's \fIHost Interface Functions Checklist\fP -spreadsheet is useful for noting +.\" https://invisible-island.net/xterm/ctlseqs/dec_term_function_checklist.pdf +\fIHost Interface Functions Checklist\fP +by Peter Sichel (January 12, 1994) +is helpful. +This spreadsheet is useful for noting which model introduced a given feature (although there are a few apparent errors such as the DECRQSS feature cited for VT320 whereas the technical manual omits it). @@ -4205,11 +4437,11 @@ The DEC terminal family (VT100 through VT525) is upward-compatible, using standards plus \fIextensions\fP, e.g., \*(``private modes\*(''. Not all commonly-used features are standard. For example, scrolling regions are not found in ECMA-48. -On the other hand, ECMA-48 was not intended to all-encompassing. +On the other hand, ECMA-48 was not intended to be all-encompassing. Quoting from the second edition: .in +4n .sp -.ft C +.ft \*(CW Full conformance to a standard means that all its requirements are met. For such conformance to be unique the standard must contain no options. This is typically the case for hardware standards, for instance Standard @@ -4221,7 +4453,8 @@ as defined hereunder. .sp This Standard addresses a whole class of devices which can vary greatly from each other depending on the application for which a device has -been specifically designed. Obviously, a +been specifically designed. +Obviously, a product which implements all facilities described in this standard \[en] thus being in \*(``full conformance\*('' with it \[en] whilst theoretically possible, would be technically and economically unthinkable. @@ -4253,11 +4486,14 @@ does not list color as a feature of the SGR sequence (page 49). .IP In Appendix A, it mentions ECMA-48: .in +4n -.ft C +.ft \*(CW .sp (8) This document represents a coordinated effort to develop a single technical standard in the United States and Europe (see ECMA-48 standard entitled -\fIAdditional Controls for Character Imaging Input/Output Devices\fP). +.ft \*(CI +Additional Controls for Character Imaging Input/Output Devices\c +.ft +). .in -4n .IP .ft R @@ -4266,21 +4502,30 @@ though it confuses the first two editions of ECMA-48. The typo for \*(``work\*('' versus \*(``owkr\*('' appears in the original document: .in +4n -.hy 0 .sp -.ft C +.ft \*(CW ANSI X3.64-1979, and ECMA-48, -\fIAdditional Controls for Character-Imaging I/O Devices\fP, +.ft \*(CI +Additional Controls for Character-Imaging I/O Devices\c +.ft +, were developed in parallel, with close liaison. -ISO DP 6429, Additional Control Functions for Character-Imaging -Devices, was developed as a synthesis of X3.04 and ECMA-48. +ISO DP 6429, +.ft \*(CI +Additional Control Functions for Character-Imaging Devices\c +.ft +, was developed as a synthesis of X3.64 and ECMA-48. During this process, some control functions as well as additional selective parameters were added. Except for point 1 below, X3.64 is a subset of ISO 6429. Although the two standards use different language, the intent is that the subset is technically identical. X3.64 was balloted and forwarded prior to the final resolution of ISO 6429 -and does not incorporate the \fIowkr\fP of IS0/TC97/SC2 in completing ISO 6429. +and does not incorporate the +.ft \*(CI +owkr +.ft +of IS0/TC97/SC2 in completing ISO 6429. Revision of X3.64 will attempt to incorporate those elements and assumptions of X3.64. .in -4n @@ -4304,7 +4549,7 @@ Here are the relevant standards: .\" https://nvlpubs.nist.gov/nistpubs/Legacy/FIPS/fipspub86.pdf \fIAdditional Controls for Use with American National Standard Code for Information Interchange, ANSI X3.64-1979\fP .br -FIPS Publication 86. July 18, 1979. +FIPS Publication 86.\ July 18, 1979. .br American National Standards Institute, Inc. .bP @@ -4433,13 +4678,14 @@ but that is coincidental. The latter was introduced in X10.4 (December 1986): .iP .RS -.ft C +.ft \*(CW .na Most Dec Private mode settings can be saved away internally using \\E[?\fIn\fPs, -where \fIn\fP is the same number to set or reset the Dec Private mode. The -mode can be restored using \\E[?\fIn\fPr. This can be used in termcap for \fBvi\fP, for -example, to turn off saving of lines, but restore whatever the original -state was on exit. +where \fIn\fP is the same number to set or reset the Dec Private mode. +The mode can be restored using \\E[?\fIn\fPr. +This can be used in termcap for \fBvi\fP(1), +for example, to turn off saving of lines, +but restore whatever the original state was on exit. .ad .ft R .RE @@ -4495,7 +4741,7 @@ That is implied by the description's mention of \fIHFT\fP: .iP .RS .na -.ft C +.ft \*(CW The aixterm command provides a standard terminal type for programs that do not interact directly with Enhanced X-Windows. This command provides @@ -4511,4 +4757,4 @@ The control sequences for colors 8-15 are not specified by ECMA-48, but rather (as done in other instances by \fI\*(xt\fP) chosen to not conflict with current or future standards. . -.if n .pl \n(nlu+1v +.if n .pl \n(nlu diff --git a/app/xterm/ctlseqs.txt b/app/xterm/ctlseqs.txt index 1f8585fed..b57f7b62f 100644 --- a/app/xterm/ctlseqs.txt +++ b/app/xterm/ctlseqs.txt @@ -20,8 +20,8 @@ Thomas Dickey XFree86 Project (1996-2006) - invisible-island.net (2006-2023) - updated for XTerm Patch #378 (2023/01/06) + invisible-island.net (2006-2024) + updated for XTerm Patch #392 (2024/05/25) @@ -315,6 +315,7 @@ ESC ( C Designate G0 Character Set, VT100, ISO 2022. There are a few other 94-character sets: C = 0 -> DEC Special Character and Line Drawing Set, VT100. C = < -> DEC Supplemental, VT200. + C = < -> User Preferred Selection Set, VT300. C = > -> DEC Technical, VT300. These are documented as 94-character sets (like USASCII) without NRCS: @@ -413,6 +414,29 @@ DCS Ps ; Ps | Pt ST key value. The key codes correspond to the DEC function-key codes (e.g., F6=17). +DCS Ps! u Pt ST + Assigning User-Preferred Supplemental Sets (DECAUPSS), VT320, + VT510. XTerm ignores this in UTF-8 mode, and uses the + preferLatin1 resource to choose the default setting. + VT320 provides these: + DCS 0 ! u % 5 ST -> DEC Supplemental Graphic + DCS 1 ! u A ST -> ISO Latin-1 supplemental + VT510 adds these: + DCS 0 ! u " ? ST -> DEC Greek + DCS 0 ! u " 4 ST -> DEC Hebrew + DCS 0 ! u % 0 ST -> DEC Turkish + DCS 0 ! u & 4 ST -> DEC Cyrillic + DCS 1 ! u B ST -> ISO Latin-2 Supplemental + DCS 1 ! u F ST -> ISO Greek Supplemental + DCS 1 ! u H ST -> ISO Hebrew Supplemental + DCS 1 ! u M ST -> ISO Latin-5 Supplemental + DCS 1 ! u L ST -> ISO Latin-Cyrillic + VT520 accepts a few others (undocumented); xterm adds these: + DCS 0 ! u B ST -> United States (USASCII). + DCS 0 ! u 0 ST -> DEC Special Character and Line Drawing + Set. + DCS 0 ! u > ST -> DEC Technical. + DCS $ q Pt ST Request Status String (DECRQSS), VT420 and up. The string following the "q" is one of the following: @@ -426,7 +450,11 @@ DCS $ q Pt ST $ | -> DECSCPP $ } -> DECSASD $ ~ -> DECSSDT + * x -> DECSACE * | -> DECSNLS + , | -> DECAC (VT525 only) + , } -> DECATC (VT525 only) + > Pm m -> XTQMODKEYS (xterm) xterm responds with DCS 1 $ r Pt ST for valid requests, replacing the Pt with the corresponding CSI string, or DCS 0 $ r ST for invalid requests. @@ -615,7 +643,7 @@ CSI ? Pi ; Pa ; Pv S sizes, but disallows modifying those sizes because that is done once, using resource-values. o Graphics geometry is not necessarily the same as "window - size" (see the dtterm window manipulation extensions). + size" (see the XTWINOPS window manipulation extensions). XTerm limits the maximum graphics geometry according to the maxGraphicSize resource. The maxGraphicSize resource can be either an explicit @@ -655,6 +683,9 @@ CSI > Pm T (See discussion of Title Modes). +CSI ? 5 W Reset tab stops to start with column 9, every 8 columns + (DECST8C), VT510. + CSI Ps X Erase Ps Character(s) (default = 1) (ECH). CSI Ps Z Cursor Backward Tabulation Ps tab stops (default = 1) (CBT). @@ -683,6 +714,7 @@ CSI Ps c Send Device Attributes (Primary DA). -> CSI ? 6 2 ; Ps c ("VT220") -> CSI ? 6 3 ; Ps c ("VT320") -> CSI ? 6 4 ; Ps c ("VT420") + -> CSI ? 6 5 ; Ps c ("VT510" to ("VT525") The VT100-style response parameters do not mean anything by themselves. VT220 (and higher) parameters do, telling the @@ -793,16 +825,21 @@ CSI ? Pm h Ps = 4 1 -> more(1) fix (see curses resource). Ps = 4 2 -> Enable National Replacement Character sets (DECNRCM), VT220. - Ps = 4 3 -> Enable Graphics Expanded Print Mode (DECGEPM). + Ps = 4 3 -> Enable Graphic Expanded Print Mode (DECGEPM), + VT340. Ps = 4 4 -> Turn on margin bell, xterm. - Ps = 4 4 -> Enable Graphics Print Color Mode (DECGPCM). - Ps = 4 5 -> Reverse-wraparound mode, xterm. - Ps = 4 5 -> Enable Graphics Print ColorSpace (DECGPCS). - Ps = 4 6 -> Start logging, xterm. This is normally - disabled by a compile-time option. + Ps = 4 4 -> Enable Graphic Print Color Mode (DECGPCM), + VT340. + Ps = 4 5 -> Reverse-wraparound mode (XTREVWRAP), xterm. + Ps = 4 5 -> Enable Graphic Print Color Syntax (DECGPCS), + VT340. + Ps = 4 6 -> Start logging (XTLOGGING), xterm. This is + normally disabled by a compile-time option. + Ps = 4 6 -> Graphic Print Background Mode, VT340. Ps = 4 7 -> Use Alternate Screen Buffer, xterm. This may be disabled by the titeInhibit resource. - Ps = 4 7 -> Enable Graphics Rotated Print Mode (DECGRPM). + Ps = 4 7 -> Enable Graphic Rotated Print Mode (DECGRPM), + VT340. Ps = 6 6 -> Application keypad mode (DECNKM), VT320. Ps = 6 7 -> Backarrow key sends backspace (DECBKM), VT340, VT420. This sets the backarrowKey resource to "true". @@ -829,6 +866,7 @@ CSI ? Pm h This sets the scrollTtyOutput resource to "true". Ps = 1 0 1 1 -> Scroll to bottom on key press (rxvt). This sets the scrollKey resource to "true". + Ps = 1 0 1 4 -> Enable fastScroll resource, xterm. Ps = 1 0 1 5 -> Enable urxvt Mouse Mode. Ps = 1 0 1 6 -> Enable SGR Mouse PixelMode, xterm. Ps = 1 0 3 4 -> Interpret "meta" key, xterm. This sets the @@ -853,6 +891,8 @@ CSI ? Pm h is received, xterm. This enables the popOnBell resource. Ps = 1 0 4 4 -> Reuse the most recent data copied to CLIPBOARD, xterm. This enables the keepClipboard resource. + Ps = 1 0 4 5 -> Extended Reverse-wraparound mode + (XTREVWRAP2), xterm. Ps = 1 0 4 6 -> Enable switching to/from Alternate Screen Buffer, xterm. This works for terminfo-based systems, updating the titeInhibit resource. @@ -874,7 +914,12 @@ CSI ? Pm h Ps = 1 0 6 0 -> Set legacy keyboard emulation, i.e, X11R6, xterm. Ps = 1 0 6 1 -> Set VT220 keyboard emulation, xterm. + Ps = 2 0 0 1 -> Enable readline mouse button-1, xterm. + Ps = 2 0 0 2 -> Enable readline mouse button-2, xterm. + Ps = 2 0 0 3 -> Enable readline mouse button-3, xterm. Ps = 2 0 0 4 -> Set bracketed paste mode, xterm. + Ps = 2 0 0 5 -> Enable readline character-quoting, xterm. + Ps = 2 0 0 6 -> Enable readline newline pasting, xterm. CSI Ps i Media Copy (MC). Ps = 0 -> Print screen (default). @@ -924,15 +969,19 @@ CSI ? Pm l Ps = 4 1 -> No more(1) fix (see curses resource). Ps = 4 2 -> Disable National Replacement Character sets (DECNRCM), VT220. - Ps = 4 3 -> Disable Graphics Expanded Print Mode (DECGEPM). + Ps = 4 3 -> Disable Graphic Expanded Print Mode (DECGEPM), + VT340. Ps = 4 4 -> Turn off margin bell, xterm. - Ps = 4 4 -> Disable Graphics Print Color Mode (DECGPCM). - Ps = 4 5 -> No Reverse-wraparound mode, xterm. - Ps = 4 5 -> Disable Graphics Print ColorSpace (DECGPCS). - Ps = 4 6 -> Stop logging, xterm. This is normally disabled - by a compile-time option. + Ps = 4 4 -> Disable Graphic Print Color Mode (DECGPCM), + VT340. + Ps = 4 5 -> No Reverse-wraparound mode (XTREVWRAP), xterm. + Ps = 4 5 -> Disable Graphic Print Color Syntax (DECGPCS), + VT340. + Ps = 4 6 -> Stop logging (XTLOGGING), xterm. This is + normally disabled by a compile-time option. Ps = 4 7 -> Use Normal Screen Buffer, xterm. - Ps = 4 7 -> Disable Graphics Rotated Print Mode (DECGRPM). + Ps = 4 7 -> Disable Graphic Rotated Print Mode (DECGRPM), + VT340. Ps = 6 6 -> Numeric keypad mode (DECNKM), VT320. Ps = 6 7 -> Backarrow key sends delete (DECBKM), VT340, VT420. This sets the backarrowKey resource to "false". @@ -959,6 +1008,7 @@ CSI ? Pm l (rxvt). This sets the scrollTtyOutput resource to "false". Ps = 1 0 1 1 -> Don't scroll to bottom on key press (rxvt). This sets the scrollKey resource to "false". + Ps = 1 0 1 4 -> Disable fastScroll resource, xterm. Ps = 1 0 1 5 -> Disable urxvt Mouse Mode. Ps = 1 0 1 6 -> Disable SGR Mouse Pixel-Mode, xterm. Ps = 1 0 3 4 -> Don't interpret "meta" key, xterm. This @@ -980,6 +1030,8 @@ CSI ? Pm l resource. Ps = 1 0 4 3 -> Disable raising of the window when Control- G is received, xterm. This disables the popOnBell resource. + Ps = 1 0 4 5 -> No Extended Reverse-wraparound mode + (XTREVWRAP2), xterm. Ps = 1 0 4 6 -> Disable switching to/from Alternate Screen Buffer, xterm. This works for terminfo-based systems, updating the titeInhibit resource. If currently using the @@ -1004,7 +1056,12 @@ CSI ? Pm l X11R6, xterm. Ps = 1 0 6 1 -> Reset keyboard emulation to Sun/PC style, xterm. + Ps = 2 0 0 1 -> Disable readline mouse button-1, xterm. + Ps = 2 0 0 2 -> Disable readline mouse button-2, xterm. + Ps = 2 0 0 3 -> Disable readline mouse button-3, xterm. Ps = 2 0 0 4 -> Reset bracketed paste mode, xterm. + Ps = 2 0 0 5 -> Disable readline character-quoting, xterm. + Ps = 2 0 0 6 -> Disable readline newline pasting, xterm. CSI Pm m Character Attributes (SGR). Ps = 0 -> Normal (default), VT100. @@ -1250,11 +1307,8 @@ CSI ? Ps n The last two parameters apply to VT300 & up (keyboard ready) and VT400 & up (LK01) respectively. - Ps = 5 3 -> Report Locator status. The response is CSI ? 5 - 3 n Locator available, if compiled-in, or CSI ? 5 0 n No - Locator, if not. Ps = 5 5 -> Report Locator status. The response is CSI ? 5 - 3 n Locator available, if compiled-in, or CSI ? 5 0 n No + 0 n Locator available, if compiled-in, or CSI ? 5 3 n No Locator, if not. Ps = 5 6 -> Report Locator type. The response is CSI ? 5 7 ; 1 n Mouse, if compiled-in, or CSI ? 5 7 ; 0 n Cannot @@ -1338,9 +1392,9 @@ CSI Pm # p limitations of C#. CSI > Ps q - Ps = 0 -> Report xterm name and version (XTVERSION). The - response is a DSR sequence identifying the version: DCS > | - text ST + Ps = 0 -> Report xterm name and version (XTVERSION). + The response is a DSR sequence identifying the version: + DCS > | text ST CSI Ps q Load LEDs (DECLL), VT100. Ps = 0 -> Clear all LEDS (default). @@ -1500,6 +1554,12 @@ CSI Ps ; Ps ; Ps t Ps >= 2 4 -> Resize to Ps lines (DECSLPP), VT340 and VT420. xterm adapts this by resizing its window. + XTWINOPS 2 2 (save/push title) and 2 3 (restore/pop title) + accept an optional third parameter for direct access to the + stack. Parameters in the range 1 through 10, may be used to + store the title into the stack or retrieve the title from the + stack without pushing/popping. + CSI > Pm t This xterm control sets one or more features of the title modes (XTSMTITLE), xterm. Each parameter enables a single @@ -1524,12 +1584,25 @@ CSI Pt ; Pl ; Pb ; Pr ; Pm $ t CSI u Restore cursor (SCORC, also ANSI.SYS). +CSI & u User-Preferred Supplemental Set (DECRQUPSS), VT320, VT510. + Response is DECAUPSS. + CSI Ps SP u Set margin-bell volume (DECSMBV), VT520. Ps = 0 , 5 , 6 , 7 , or 8 -> high. Ps = 1 -> off. Ps = 2 , 3 or 4 -> low. +CSI " v Request Displayed Extent (DECRQDE), VT340, VT420. + Response is + CSI Ph; Pw; Pc; Pr; Pp " w + where + Ph is the number of lines of the current page + Pw is the number of columns of the current page + Pc is the column number at the top-left of the window + Pr is the row number at the top-left of the window + Pp is the current page number + CSI Pt ; Pl ; Pb ; Pr ; Pp ; Pt ; Pl ; Pp $ v Copy Rectangular Area (DECCRA), VT400 and up. Pt ; Pl ; Pb ; Pr denotes the rectangle. @@ -1595,7 +1668,6 @@ CSI Ps # y 3 -> omit checksum for cells not explicitly initialized. 4 -> do not mask cell value to 8 bits or ignore combining characters. - 5 -> do not mask cell value to 7 bits. CSI Pi ; Pg ; Pt ; Pl ; Pb ; Pr * y Request Checksum of Rectangular Area (DECRQCRA), VT420 and up. @@ -1718,6 +1790,42 @@ CSI # } Pop video attributes from stack (XTPOPSGR), xterm. Popping restores the video-attributes which were saved using XTPUSHSGR to their previous state. +CSI Ps; Pf; Pb, | + Assign Color (DECAC), VT525 only. + Ps selects the color item + Pf is the foreground color index 0..15 + Pb is the background color index 0..15 + Color items: + Ps = 1 -> normal text + Ps = 2 -> window frame + xterm uses the SGR color palette with DECAC color item 1 to + update the VT100 window colors, like OSC 1 0 and 1 1 . + +CSI Ps; Pf; Pb, } + Alternate Text Color (DECATC), VT525 only. This feature + specifies the colors to use when DECSTGLT is selected to 1 or + 2. + Ps selects attribute combinations + Pf is the foreground color index 0..15 + Pb is the background color index 0..15 + Attribute combinations: + Ps = 0 -> normal text + Ps = 1 -> bold + Ps = 2 -> reverse + Ps = 3 -> underline + Ps = 4 -> blink + Ps = 5 -> bold reverse + Ps = 6 -> bold underline + Ps = 7 -> bold blink + Ps = 8 -> reverse underline + Ps = 9 -> reverse blink + Ps = 1 0 -> underline blink + Ps = 1 1 -> bold reverse underline + Ps = 1 2 -> bold reverse blink + Ps = 1 3 -> bold underline blink + Ps = 1 4 -> reverse underline blink + Ps = 1 5 -> bold reverse underline blink + CSI Ps ' } Insert Ps Column(s) (default = 1) (DECIC), VT420 and up. @@ -1741,13 +1849,15 @@ Operating System Commands OSC Ps ; Pt BEL OSC Ps ; Pt ST - Set Text Parameters. Some control sequences return + Set Text Parameters, xterm. Some control sequences return information: o For colors and font, if Pt is a "?", the control sequence elicits a response which consists of the control sequence which would set the corresponding value. - o The dtterm control sequences allow you to determine the - icon name and window title. + o A few of these control sequences began with dtterm (codes + 0 , 1 , and 2 ). Code 3 in dtterm sets the working + directory for the next session. XTerm does that with the + spawn-new-terminal action. XTerm accepts either BEL or ST for terminating OSC sequences, and when returning information, uses the same @@ -1816,6 +1926,25 @@ OSC Ps ; Pt ST list. The colors are specified by name or RGB specification as per XParseColor. + Resource Description + -----------------------+----------------------------- + foreground | VT100 text foreground color + background | VT100 text background color + cursorColor | text cursor color + pointerColor | pointer foreground color + pointerColorBackground | pointer background + (foreground) | Tektronix foreground color + (background) | Tektronix background color + highlightColor | highlight background color + (cursorColor) | Tektronix cursor color + highlightTextColor | highlight foreground color + -----------------------+----------------------------- + + + The Tektronix colors are initially set from the VT100 colors, + but after that can be set independently using these control + sequences. + If a "?" is given rather than a name or RGB specification, xterm replies with a control sequence of the same form which can be used to set the corresponding dynamic color. Because @@ -1834,10 +1963,14 @@ OSC Ps ; Pt ST Ps = 1 8 -> Change Tektronix cursor color to Pt. Ps = 1 9 -> Change highlight foreground color to Pt. - Ps = 2 2 -> Change pointer cursor to Pt. + Ps = 2 2 -> Change pointer cursor shape to Pt. The + parameter Pt sets the pointerShape resource. If Pt is empty, + or does not match any of the standard names, n uses the + resource's default "xterm" shape. - Ps = 4 6 -> Change Log File to Pt. This is normally - disabled by a compile-time option. + Ps = 4 6 -> Change Log File to Pt. The parameter Pt sets + the logFile resource. Logging is normally disabled by a + compile-time option. Ps = 5 0 -> Set Font to Pt. These controls may be disabled using the allowFontOps resource. If Pt begins with a "#", @@ -1981,8 +2114,8 @@ XTerm detects all of these keys via X key-press and key-release events. It uses the translations resource to decide what to do with these events. -o Ordinary keys are handled with the insert-seven-bit or insert-eight- - bit action. +o Ordinary keys are handled with the insert-seven-bit action, or the + insert-eight-bit action. o Special keys may be handled with other resources. However, xterm also has built-in logic to map commonly-used special keys into @@ -2459,6 +2592,50 @@ For background and discussion, see the FAQ: +Readline Modes + +Several modes provide support for mouse button events in readline. +Bracketed paste is one of these readline modes, but is used more widely. + +Some assumptions (particular mouse buttons) and limitations (the mouse +is clicked on the current row on the screen) apply: + +2 0 0 1 If mouse button 1 is used to end or extend a selection (the + select-end action), and if the cursor position is on the same + row as the mouse-click, send left/right cursor control + sequences to the host to adjust the cursor position to match + the mouse click. + +2 0 0 2 When pasting text (the insert-selection action which is + normally bound to mouse button 2), if mouse protocol is not + enabled, and if the cursor position is on the same row as the + mouse-click, send left/right cursor control sequences to the + host to adjust the cursor position to match the mouse click. + +2 0 0 3 If mouse button 3 is double-clicked when ending or extending a + selection, (the select-end action), and if the cursor position + is on the same line as the mouse-click: + + o Send left/right cursor control sequences to the host to + adjust the cursor position to match the mouse click. + + o In addition to the same row, the selection may be part of + a wrapped line as in other xterm selections (see the + Selection Functions section in the manual page). + + o After adjusting the cursor position, xterm sends erase- + characters (one for each character in the selection) to + tell the host to delete the selected text. + +2 0 0 5 When writing a selection to the host (i.e., pasting text), + escape each character with the literal-next (Ctrl-V) + character. + +2 0 0 6 Normally when xterm writes selections to the host, it + translates newlines to carriage returns. This mode disables + the translation, passing newlines literally. + + Title Modes The window- and icon-labels can be set or queried using control @@ -2858,6 +3035,13 @@ DCS Pm p Pr..Pr ST Pm = 2 -> resume command, use command display mode. Pm = 3 -> start new command, use command display mode. +A few of the VT330/VT340 private modes conflict with xterm. Codes 4 0 +to 4 7 were first used by xterm in X10R4 (December 1986). While X11R1 +xterm dropped codes 4 1 and 4 2 , the remaining ones are still used. +The VT330/VT340 introduced in April 1987 uses 4 4 to 4 7 for color +graphics printing controls. When configured for ReGIS, xterm uses the +VT330/VT340 interpretation of these private modes. + Non-VT100 Modes @@ -3019,10 +3203,11 @@ However long, the technical manuals have problems: o DEC's manuals did not provide a comprehensive comparison of the features in different model. - Peter Sichel's Host Interface Functions Checklist spreadsheet is - useful for noting which model introduced a given feature (although - there are a few apparent errors such as the DECRQSS feature cited - for VT320 whereas the technical manual omits it). + Host Interface Functions Checklist by Peter Sichel (January 12, + 1994) is helpful. This spreadsheet is useful for noting which model + introduced a given feature (although there are a few apparent errors + such as the DECRQSS feature cited for VT320 whereas the technical + manual omits it). o Sometimes the manuals disagree. For example, DEC's standard document (DEC STD 070) for terminals says that DECSCL performs a @@ -3159,7 +3344,7 @@ Standards The DEC terminal family (VT100 through VT525) is upward-compatible, using standards plus extensions, e.g., "private modes". Not all commonly-used features are standard. For example, scrolling regions are -not found in ECMA-48. On the other hand, ECMA-48 was not intended to +not found in ECMA-48. On the other hand, ECMA-48 was not intended to be all-encompassing. Quoting from the second edition: Full conformance to a standard means that all its requirements are @@ -3173,7 +3358,7 @@ all-encompassing. Quoting from the second edition: This Standard addresses a whole class of devices which can vary greatly from each other depending on the application for which a - device has been specifically designed. Obviously, a product which + device has been specifically designed. Obviously, a product which implements all facilities described in this standard - thus being in "full conformance" with it - whilst theoretically possible, would be technically and economically unthinkable. @@ -3215,7 +3400,7 @@ o ANSI X3.64-1979 does not list color as a feature of the SGR sequence ANSI X3.64-1979, and ECMA-48, Additional Controls for Character- Imaging I/O Devices, were developed in parallel, with close liaison. ISO DP 6429, Additional Control Functions for - Character-Imaging Devices, was developed as a synthesis of X3.04 + Character-Imaging Devices, was developed as a synthesis of X3.64 and ECMA-48. During this process, some control functions as well as additional selective parameters were added. Except for point 1 below, X3.64 is a subset of ISO 6429. Although the two @@ -3352,47 +3537,47 @@ o The SCOSC/SCORC control sequences for saving/restoring the cursor Most Dec Private mode settings can be saved away internally using \E[?ns, where n is the same number to set or reset the Dec Private mode. The mode can be restored using \E[?nr. This can - be used in termcap for vi, for example, to turn off saving of + be used in termcap for vi(1), for example, to turn off saving of lines, but restore whatever the original state was on exit. - while the SCOSC/SCORC pair was added in 1995 by XFree86 (and + while the SCOSC/SCORC pair was added in 1995 by XFree86 (and documented long afterwards). - The SCO ANSI console terminal descriptions did not use these - controls (they used the VT100-compatible SC/RC pair). SCOSC/SCORC - were an artifact of DOS 2.00 (January 1983), by Microsoft and later + The SCO ANSI console terminal descriptions did not use these + controls (they used the VT100-compatible SC/RC pair). SCOSC/SCORC + were an artifact of DOS 2.00 (January 1983), by Microsoft and later supported by SCO and other vendors. - The SCOSC/SCORC pair is considered a private mode because the final + The SCOSC/SCORC pair is considered a private mode because the final characters (s and u ) fall in the range from "`" to "~" (octal 0140 - to octal 0176). Other private control sequences can be constructed + to octal 0176). Other private control sequences can be constructed by using octets 074 to 077 (characters "<", "=", ">", or "?") at the beginning of the parameter string. The XTSAVE and XTRESTORE controls use "?") in this manner. Because the XTSAVE and XTRESTORE controls are private, other - terminals may behave differently. For example, DEC (a contributor - to the early xterm as well as a manufacturer of terminals) used an - incompatible private control in one of its terminals more than five + terminals may behave differently. For example, DEC (a contributor + to the early xterm as well as a manufacturer of terminals) used an + incompatible private control in one of its terminals more than five years later (for the VT420 PCTerm, announced in February 1992). - In that model of the VT420, CSI ? Pm; Pc r selects the PC TERM - emulation mode. When this mode is enabled, the keyboard sends scan - codes rather than characters (analogous to X keyboard events). The - first parameter of this private control enables or disables PC TERM + In that model of the VT420, CSI ? Pm; Pc r selects the PC TERM + emulation mode. When this mode is enabled, the keyboard sends scan + codes rather than characters (analogous to X keyboard events). The + first parameter of this private control enables or disables PC TERM mode, while the second selects a character set. An ambiguity arises if an application omits the second parameter. In that special case, - it cannot be distinguished from XTRESTORE. DEC did not take this + it cannot be distinguished from XTRESTORE. DEC did not take this into account when designing the feature. - If there were potential users, xterm could accommodate this by a - resource setting. In retrospect (thirty years later), there have - been no uses of PC TERM, while the XTRESTORE feature is still in + If there were potential users, xterm could accommodate this by a + resource setting. In retrospect (thirty years later), there have + been no uses of PC TERM, while the XTRESTORE feature is still in use. o The aixterm manual page gives the format of the control sequence for - foreground and background colors 8-15, but does not specify what - those colors are. That is implied by the description's mention of + foreground and background colors 8-15, but does not specify what + those colors are. That is implied by the description's mention of HFT: The aixterm command provides a standard terminal type for @@ -3402,7 +3587,7 @@ o The aixterm manual page gives the format of the control sequence for the -v flag. Unlike xterm, there are no resource names for the 16 colors, leaving - the reader to assume that the mapping is hard-coded. The control - sequences for colors 8-15 are not specified by ECMA-48, but rather - (as done in other instances by xterm) chosen to not conflict with + the reader to assume that the mapping is hard-coded. The control + sequences for colors 8-15 are not specified by ECMA-48, but rather + (as done in other instances by xterm) chosen to not conflict with current or future standards. diff --git a/app/xterm/cursor.c b/app/xterm/cursor.c index 6e22c0d6f..2663e258e 100644 --- a/app/xterm/cursor.c +++ b/app/xterm/cursor.c @@ -1,7 +1,7 @@ -/* $XTermId: cursor.c,v 1.83 2022/09/23 08:13:43 tom Exp $ */ +/* $XTermId: cursor.c,v 1.93 2023/09/21 08:17:56 tom Exp $ */ /* - * Copyright 2002-2021,2022 by Thomas E. Dickey + * Copyright 2002-2022,2023 by Thomas E. Dickey * * All Rights Reserved * @@ -100,46 +100,101 @@ CursorSet(TScreen *screen, int row, int col, unsigned flags) } /* - * moves the cursor left n, no wrap around + * Unlike VT100, xterm allows reverse wrapping of the cursor. This feature was + * introduced in X10R4 (December 1986), but did not modify the comment which + * said "moves the cursor left n, no wrap around". However, this reverse + * wrapping allowed the cursor to wrap around to the end of the screen. + * + * xterm added VT420-compatible left/right margin support in 2012. If the + * cursor starts off within the margins, the reverse wrapping result will be + * within the margins. + * + * Wrapping to the end of the screen did not appear to be the original intent. + * That was revised in 2023, using private mode 45 for movement within the + * current (wrapped) line, and 1045 for movement to "any" line. */ void CursorBack(XtermWidget xw, int n) { #define WRAP_MASK (REVERSEWRAP | WRAPAROUND) +#define WRAP_MASK2 (REVERSEWRAP2 | WRAPAROUND) TScreen *screen = TScreenOf(xw); - int rev; - int left = ScrnLeftMargin(xw); + /* *INDENT-EQLS* */ + int rev = (((xw->flags & WRAP_MASK) == WRAP_MASK) != 0); + int rev2 = (((xw->flags & WRAP_MASK2) == WRAP_MASK2) != 0); + int left = ScrnLeftMargin(xw); + int right = ScrnRightMargin(xw); int before = screen->cur_col; + int top = ScrnTopMargin(xw); + int bottom = ScrnBottomMargin(xw); + int col = screen->cur_col; + int row = screen->cur_row; - if ((rev = ((xw->flags & WRAP_MASK) == WRAP_MASK)) != 0 - && screen->do_wrap) { - n--; - } + int count; + CLineData *ld; + + TRACE(("CursorBack(%d) current %d,%d rev=%d/%d margins H[%d..%d] V[%d..%d]\n", + n, + screen->cur_row, screen->cur_col, + rev, rev2, + left, right, + top, bottom)); /* if the cursor is already before the left-margin, we have to let it go */ if (before < left) left = 0; - if ((screen->cur_col -= n) < left) { - if (rev) { - int in_row = ScrnRightMargin(xw) - left + 1; - int offset = (in_row * screen->cur_row) + screen->cur_col - left; - if ((before == left) && - ScrnIsColInMargins(screen, before) && - ScrnIsRowInMargins(screen, screen->cur_row) && - screen->cur_row == screen->top_marg) { - offset = (screen->bot_marg + 1) * in_row - 1; - } else if (offset < 0) { - int length = in_row * MaxRows(screen); - offset += ((-offset) / length + 1) * length; - } - set_cur_row(screen, (offset / in_row)); - set_cur_col(screen, (offset % in_row) + left); - do_xevents(xw); + ld = NULL; + if ((count = n) > 0) { + if ((rev || rev2) && screen->do_wrap) { + --count; } else { - set_cur_col(screen, left); + --col; } } + + for (;;) { + if (col < left) { + if (rev2) { + col = right; + if (row == top) + row = bottom + 1; + } else { + if (!rev) { + col = left; + break; + } + if (row <= top) { + col = left; + row = top; + break; + } + } + ld = NULL; /* try a reverse-wrap */ + --row; + } + if (ld == NULL) { + ld = getLineData(screen, ROW2INX(screen, row)); + if (ld == NULL) + break; /* should not happen */ + if (row != screen->cur_row) { + if (!rev2 && !LineTstWrapped(ld)) { + ++row; /* reverse-wrap failed */ + col = left; + break; + } + col = right; + } + } + + if (--count <= 0) + break; + --col; + } + set_cur_row(screen, row); + set_cur_col(screen, col); + do_xevents(xw); + ResetWrap(screen); } @@ -289,7 +344,8 @@ CarriageReturn(XtermWidget xw) set_cur_col(screen, col); ResetWrap(screen); - do_xevents(xw); + if (screen->jumpscroll && !screen->fastscroll) + do_xevents(xw); } /* @@ -451,7 +507,6 @@ CursorNextLine(XtermWidget xw, int count) CursorDown(screen, count < 1 ? 1 : count); CarriageReturn(xw); - do_xevents(xw); } /* @@ -464,7 +519,6 @@ CursorPrevLine(XtermWidget xw, int count) CursorUp(screen, count < 1 ? 1 : count); CarriageReturn(xw); - do_xevents(xw); } /* diff --git a/app/xterm/error.h b/app/xterm/error.h index d2aabd727..88093d9cb 100644 --- a/app/xterm/error.h +++ b/app/xterm/error.h @@ -1,7 +1,7 @@ -/* $XTermId: error.h,v 1.26 2012/10/05 00:17:51 tom Exp $ */ +/* $XTermId: error.h,v 1.28 2023/11/24 00:56:16 tom Exp $ */ /* - * Copyright 1997-2011,2012 by Thomas E. Dickey + * Copyright 1997-2012,2023 by Thomas E. Dickey * * All Rights Reserved * @@ -53,6 +53,8 @@ /* @(#)error.h X10/6.6 11/6/86 */ +#define ERROR_MISC 1 /* miscellaneous errors */ + /* main.c */ #define ERROR_FIONBIO 11 /* main: ioctl() failed on FIONBIO */ #define ERROR_F_GETFL 12 /* main: ioctl() failed on F_GETFL */ @@ -73,6 +75,7 @@ #define ERROR_INIGROUPS 28 /* spawn: initgroups() failed */ #define ERROR_FORK 29 /* spawn: fork() failed */ #define ERROR_EXEC 30 /* spawn: exec() failed */ +#define ERROR_GET_ATOM 31 /* intern_atom() failed */ #define ERROR_PTYS 32 /* get_pty: not enough ptys */ #define ERROR_PTY_EXEC 34 /* waiting for initial map */ #define ERROR_SETUID 35 /* spawn: setuid() failed */ diff --git a/app/xterm/fontutils.c b/app/xterm/fontutils.c index a487d9301..61467177e 100644 --- a/app/xterm/fontutils.c +++ b/app/xterm/fontutils.c @@ -1,7 +1,7 @@ -/* $XTermId: fontutils.c,v 1.760 2023/01/08 23:42:23 tom Exp $ */ +/* $XTermId: fontutils.c,v 1.783 2024/07/10 15:48:26 tom Exp $ */ /* - * Copyright 1998-2022,2023 by Thomas E. Dickey + * Copyright 1998-2023,2024 by Thomas E. Dickey * * All Rights Reserved * @@ -44,6 +44,7 @@ #include <main.h> #include <data.h> +#include <error.h> #include <menu.h> #include <xstrings.h> #include <xterm.h> @@ -393,7 +394,7 @@ get_font_name_props(Display *dpy, XFontStruct *fs, char **result) * first get the full font name */ name = 0; - fontatom = XInternAtom(dpy, "FONT", False); + fontatom = CachedInternAtom(dpy, "FONT"); if (fontatom != 0) { XFontProp *fp; int i; @@ -1202,6 +1203,81 @@ reportXCharStruct(const char *tag, XCharStruct * cs) } static void +fillXCharStruct(XCharStruct * cs, short value) +{ + cs->lbearing = value; + cs->rbearing = value; + cs->width = value; + cs->ascent = value; + cs->descent = value; +} + +/* if the per-character data differs from the summary, that is a problem */ +static void +compareXCharStruct(const char *tag, XCharStruct * actual, XCharStruct * expect) +{ +#define CompareXCharStruct(field) \ + if (actual->field != expect->field) \ + ReportFonts("\t\t%s %s differs: %d\n", tag, #field, actual->field) + CompareXCharStruct(lbearing); + CompareXCharStruct(rbearing); + CompareXCharStruct(width); + CompareXCharStruct(ascent); + CompareXCharStruct(descent); +} + +static void +reportXPerChar(XFontStruct *fs) +{ + XCharStruct *cs = fs->per_char; + + if (cs != NULL) { + XCharStruct min_bounds; + XCharStruct max_bounds; + int valid = 0; + int total = 0; + unsigned first_char = 0; + unsigned last_char = 0; + unsigned ch; + + if (fs->max_byte1 == 0) { + first_char = fs->min_char_or_byte2; + last_char = fs->max_char_or_byte2; + } else { + first_char = (fs->min_byte1 * 256) + fs->min_char_or_byte2; + last_char = (fs->max_byte1 * 256) + fs->max_char_or_byte2; + } + + fillXCharStruct(&max_bounds, -32768); + fillXCharStruct(&min_bounds, 32767); + for (ch = first_char; ch < last_char; ++ch) { + XCharStruct *item = cs + ch; + ++total; + if (!CI_NONEXISTCHAR(item)) { + ++valid; +#define MIN_BOUNDS(field) min_bounds.field = Min(min_bounds.field, item->field) + MIN_BOUNDS(lbearing); + MIN_BOUNDS(rbearing); + MIN_BOUNDS(width); + MIN_BOUNDS(ascent); + MIN_BOUNDS(descent); +#define MAX_BOUNDS(field) max_bounds.field = Max(max_bounds.field, item->field) + MAX_BOUNDS(lbearing); + MAX_BOUNDS(rbearing); + MAX_BOUNDS(width); + MAX_BOUNDS(ascent); + MAX_BOUNDS(descent); + } + } + ReportFonts("\t\tPer-character: %d/%d\n", valid, total); + compareXCharStruct("Max", &max_bounds, &(fs->max_bounds)); + compareXCharStruct("Min", &min_bounds, &(fs->min_bounds)); + } else { + ReportFonts("\t\tPer-character: none\n"); + } +} + +static void reportOneVTFont(const char *tag, XTermFonts * fnt) { @@ -1222,8 +1298,8 @@ reportOneVTFont(const char *tag, ReportFonts("\t\tall chars: %s\n", (fs->all_chars_exist ? "yes" : "no")); - ReportFonts("\t\tdefault char: %d\n", fs->default_char); - ReportFonts("\t\tdirection: %d\n", fs->direction); + ReportFonts("\t\tdefault char: %u\n", fs->default_char); + ReportFonts("\t\tdirection: %u\n", fs->direction); ReportFonts("\t\tascent: %d\n", fs->ascent); ReportFonts("\t\tdescent: %d\n", fs->descent); ReportFonts("\t\tfirst char: %u\n", first_char); @@ -1243,12 +1319,13 @@ reportOneVTFont(const char *tag, ReportFonts("\t\tmissing-chars: %u\n", missing); ReportFonts("\t\tpresent-chars: %u\n", countGlyphs(fs) - missing); } - ReportFonts("\t\tmin_byte1: %d\n", fs->min_byte1); - ReportFonts("\t\tmax_byte1: %d\n", fs->max_byte1); + ReportFonts("\t\tmin_byte1: %u\n", fs->min_byte1); + ReportFonts("\t\tmax_byte1: %u\n", fs->max_byte1); ReportFonts("\t\tproperties: %d\n", fs->n_properties); reportXCharStruct("min_bounds", &(fs->min_bounds)); reportXCharStruct("max_bounds", &(fs->max_bounds)); - /* TODO: report fs->properties and fs->per_char */ + reportXPerChar(fs); + /* TODO: report fs->properties */ } } @@ -1264,11 +1341,12 @@ reportVTFontInfo(XtermWidget xw, int fontnum) ReportFonts("Loaded VTFonts(default)\n"); } - reportOneVTFont("fNorm", GetNormalFont(screen, fNorm)); - reportOneVTFont("fBold", GetNormalFont(screen, fBold)); +#define ReportOneVTFont(name) reportOneVTFont(#name, screen->fnts + name) + ReportOneVTFont(fNorm); + ReportOneVTFont(fBold); #if OPT_WIDE_CHARS - reportOneVTFont("fWide", GetNormalFont(screen, fWide)); - reportOneVTFont("fWBold", GetNormalFont(screen, fWBold)); + ReportOneVTFont(fWide); + ReportOneVTFont(fWBold); #endif } } @@ -1775,7 +1853,7 @@ xtermLoadFont(XtermWidget xw, UIntSet(screen->fnt_boxes, 2); for (ch = 1; ch < 32; ch++) { unsigned n = dec2ucs(screen, ch); - if ((n != UCS_REPL) + if (!is_UCS_SPECIAL(n) && (n != ch) && (screen->fnt_boxes & 2)) { if (xtermMissingChar(n, &new_fonts[fNorm]) || @@ -2188,7 +2266,7 @@ xtermLoadVTFonts(XtermWidget xw, String myName, String myClass) #define ALLOC_SUBLIST(which,field) \ if (subresourceRec.default_font.field != NULL) { \ char *blob = x_strdup(subresourceRec.default_font.field); \ - char *base = blob; \ + char *base; \ for (base = blob; ; base = NULL) { \ char *item = strtok(base, ","); \ if (item == NULL) \ @@ -2398,8 +2476,12 @@ xtermSetCursorBox(TScreen *screen) XPoint *vp; int fw = FontWidth(screen) - 1; int fh = FontHeight(screen) - 1; - int ww = isCursorBar(screen) ? 1 : fw; - int hh = isCursorUnderline(screen) ? 1 : fh; + int ww = isCursorBar(screen) ? fw / 8 : fw; + int hh = isCursorUnderline(screen) ? fh / 8 : fh; + if (ww < 2) + ww = 2; + if (hh < 2) + hh = 2; vp = &VTbox[1]; (vp++)->x = (short) ww; @@ -3268,7 +3350,7 @@ checkFontInfo(int value, const char *tag, int failed) if (value == 0 || failed) { if (value == 0) { xtermWarning("Selected font has no non-zero %s for ISO-8859-1 encoding\n", tag); - exit(1); + exit(ERROR_MISC); } else { xtermWarning("Selected font has no valid %s for ISO-8859-1 encoding\n", tag); } @@ -3512,8 +3594,7 @@ xtermComputeFontInfo(XtermWidget xw, */ if (screen->fnt_boxes) { screen->fnt_boxes = 0; - TRACE(("Xft opened - will %suse internal line-drawing characters\n", - screen->fnt_boxes ? "not " : "")); + TRACE(("Xft opened - will not use internal line-drawing characters\n")); } } @@ -3813,7 +3894,7 @@ xtermMissingChar(unsigned ch, XTermFonts * font) } #endif -#if OPT_BOX_CHARS +#if OPT_BOX_CHARS || OPT_WIDE_CHARS /* * The grid is arbitrary, enough resolution that nothing's lost in * initialization. @@ -3987,6 +4068,39 @@ xtermDrawBoxChar(XTermDraw * params, SEG( 0, 2*BOX_HIGH/3, CHR_WIDE, 2*BOX_HIGH/3), SEG( 0, MID_HIGH, CHR_WIDE, MID_HIGH), -1 + }, sigma_1[] = + { + SEG(BOX_WIDE, MID_HIGH, BOX_WIDE/2, MID_HIGH), + SEG(BOX_WIDE/2, MID_HIGH, BOX_WIDE, BOX_HIGH), + -1 + }, sigma_2[] = + { + SEG(BOX_WIDE, MID_HIGH, BOX_WIDE/2, MID_HIGH), + SEG(BOX_WIDE/2, MID_HIGH, BOX_WIDE, 0), + -1 + }, sigma_3[] = + { + SEG( 0, 0, BOX_WIDE, BOX_HIGH), + -1 + }, sigma_4[] = + { + SEG( 0, BOX_HIGH, BOX_WIDE, 0), + -1 + }, sigma_5[] = + { + SEG( 0, MID_HIGH, MID_WIDE, MID_HIGH), + SEG(MID_WIDE, MID_HIGH, MID_WIDE, BOX_HIGH), + -1 + }, sigma_6[] = + { + SEG( 0, MID_HIGH, MID_WIDE, MID_HIGH), + SEG(MID_WIDE, MID_HIGH, MID_WIDE, 0), + -1 + }, sigma_7[] = + { + SEG( 0, 0, MID_WIDE, MID_HIGH), + SEG( 0, BOX_HIGH, MID_WIDE, MID_HIGH), + -1 }; static const struct { @@ -4026,6 +4140,14 @@ xtermDrawBoxChar(XTermDraw * params, { 0, not_equal_to }, /* 1D */ { 0, 0 }, /* 1E LB */ { 0, 0 }, /* 1F bullet */ + { 0, 0 }, /* 20 space */ + { 3, sigma_1 }, /* PUA(0) */ + { 3, sigma_2 }, /* PUA(1) */ + { 3, sigma_3 }, /* PUA(2) */ + { 3, sigma_4 }, /* PUA(3) */ + { 3, sigma_5 }, /* PUA(4) */ + { 3, sigma_6 }, /* PUA(5) */ + { 3, sigma_7 }, /* PUA(6) */ }; /* *INDENT-ON* */ @@ -4037,6 +4159,7 @@ xtermDrawBoxChar(XTermDraw * params, * screen->fnt_wide); unsigned font_height = (((params->draw_flags & DOUBLEHFONT) ? 2U : 1U) * screen->fnt_high); + unsigned thick; if (cells > 1) font_width *= (unsigned) cells; @@ -4051,11 +4174,11 @@ xtermDrawBoxChar(XTermDraw * params, && !UsingRenderFont(params->xw) #endif && (ch > 127) - && (ch != UCS_REPL)) { + && !is_UCS_SPECIAL(ch)) { int which = (params->attr_flags & BOLD) ? fBold : fNorm; unsigned n; for (n = 1; n < 32; n++) { - if (xtermMissingChar(n, getNormalFont(screen, which))) + if (xtermMissingChar(n, XTermFontsRef(screen->fnts, which))) continue; if (dec2ucs(screen, n) != ch) continue; @@ -4080,7 +4203,7 @@ xtermDrawBoxChar(XTermDraw * params, #endif /* - * Line-drawing characters show use the full (scaled) cellsize, while + * Line-drawing characters display using the full (scaled) cellsize, while * other characters should be shifted to center them vertically. */ if (!xftords) { @@ -4091,6 +4214,11 @@ xtermDrawBoxChar(XTermDraw * params, } } + if (xtermIsDecTechnical(ch)) { + ch -= XTERM_PUA; + ch += 33; + } + TRACE(("DRAW_BOX(%02X) cell %dx%d at %d,%d%s\n", ch, font_height, font_width, y, x, ((ch >= XtNumber(lines)) @@ -4119,19 +4247,18 @@ xtermDrawBoxChar(XTermDraw * params, setCgsBack(params->xw, cgsWin, cgsId, getCgsBack(params->xw, cgsWin, gc)); gc2 = getCgsGC(params->xw, cgsWin, cgsId); - XSetLineAttributes(screen->display, gc2, - (params->attr_flags & BOLD) - ? ((font_height > 12) - ? font_height / 12 - : 1) - : ((font_height > 16) - ? font_height / 16 - : 1), - LineSolid, - CapProjecting, - JoinMiter); - - if (ch == 1) { /* diamond */ + thick = ((params->attr_flags & BOLD) + ? (Max((unsigned) screen->fnt_high / 12, 1)) + : (Max((unsigned) screen->fnt_high / 16, 1))); + setXtermLineAttributes(screen->display, gc2, + thick, + ((ch < XtNumber(lines)) + ? LineSolid + : LineOnOffDash)); + + if (ch == 32) { /* space! */ + ; /* boxing a missing space is pointless */ + } else if (ch == 1) { /* diamond */ XPoint points[5]; int npoints = 5, n; @@ -4209,12 +4336,37 @@ xtermDrawBoxChar(XTermDraw * params, } } else if (screen->force_all_chars) { /* bounding rectangle, for debugging */ - XDrawRectangle(screen->display, VDrawable(screen), gc2, x, y, - font_width - 1, - font_height - 1); + if ((params->draw_flags & DOUBLEHFONT)) { + XRectangle clip; + + clip.x = 0; + clip.y = 0; + clip.width = (unsigned short) ((font_width - 1) + (unsigned) thick); + clip.height = (unsigned short) ((unsigned) FontHeight(screen) + thick); + + if ((params->draw_flags & DOUBLEFIRST)) { + y -= (2 * FontDescent(screen)); + clip.height = + (unsigned short) (clip.height + - ((unsigned short) FontDescent(screen))); + } else { + y -= FontHeight(screen); + y += FontDescent(screen); + clip.y = (short) FontHeight(screen); + } + XSetClipRectangles(screen->display, gc2, x, y, &clip, 1, Unsorted); + } + XDrawRectangle(screen->display, VDrawable(screen), gc2, + x + (int) thick, y + (int) thick, + font_width - (2 * thick), + font_height - (2 * thick)); + if ((params->draw_flags & DOUBLEHFONT)) { + XSetClipMask(screen->display, gc2, None); + } } + resetXtermLineAttributes(screen->display, gc2); } -#endif /* OPT_BOX_CHARS */ +#endif /* OPT_BOX_CHARS || OPT_WIDE_CHARS */ #if OPT_RENDERFONT static int @@ -4401,7 +4553,7 @@ findXftGlyph(XtermWidget xw, XTermXftFonts *fontData, unsigned wc) } /* initialize on the first call */ - if (fontData->fontset == NULL) { + if (fontData->fontset == NULL && fontData->pattern != NULL) { FcFontSet *sortedFonts; FcPattern *myPattern; int j; @@ -4462,7 +4614,8 @@ findXftGlyph(XtermWidget xw, XTermXftFonts *fontData, unsigned wc) FcPatternDestroy(myPattern); fontData->fs_size = Min(MaxXftCache, fontData->fontset->nfont); - } { + } + if (fontData->fontset != NULL && fontData->fs_size > 0) { XftFont *check; int empty = fontData->fs_size; @@ -4542,9 +4695,8 @@ findXftGlyph(XtermWidget xw, XTermXftFonts *fontData, unsigned wc) TRACE_FALLBACK(xw, "new", wc, result, actual); break; } else { - Bool ok; if (defer >= 0 - && (ok = !slowXftMissing(xw, check, wc)) + && !slowXftMissing(xw, check, wc) && checkXftGlyph(xw, check, wc)) { XTermFontMap *font_map = &(fontData->font_map); TRACE(("checkrecover2 %d\n", n)); @@ -4660,7 +4812,7 @@ ucs2dec(TScreen *screen, unsigned ch) (void) screen; if ((ch > 127) - && (ch != UCS_REPL)) { + && !is_UCS_SPECIAL(ch)) { #if OPT_VT52_MODE if (screen != 0 && !(screen->vtXX_level)) { /* @@ -5776,6 +5928,7 @@ getDoubleXftFont(XTermDraw * params, XTermXftFonts *data, unsigned chrset, unsig (void *) 0); } xtermOpenXft(xw, data, 0, face_name, sub_pattern, category); + data->pattern = sub_pattern; } } #endif diff --git a/app/xterm/fontutils.h b/app/xterm/fontutils.h index 68326bc2b..24b4c7079 100644 --- a/app/xterm/fontutils.h +++ b/app/xterm/fontutils.h @@ -1,7 +1,7 @@ -/* $XTermId: fontutils.h,v 1.142 2022/10/23 14:47:45 tom Exp $ */ +/* $XTermId: fontutils.h,v 1.147 2024/07/11 08:16:39 tom Exp $ */ /* - * Copyright 1998-2021,2022 by Thomas E. Dickey + * Copyright 1998-2022,2024 by Thomas E. Dickey * * All Rights Reserved * @@ -123,13 +123,21 @@ extern char *xtermSpecialFont (XTermDraw * /* params */); ? ((font)->known_missing[(Char)(ch)] > 1) \ : ((FontIsIncomplete(font) && xtermMissingChar(ch, font)) \ || ForceBoxChars(screen, ch))) - -extern void xtermDrawBoxChar (XTermDraw * /* params */, unsigned /* ch */, GC /* gc */, int /* x */, int /* y */, int /* cols */, Bool /* xftords */); #else #define IsXtermMissingChar(screen, ch, font) False #endif +extern void xtermDrawBoxChar (XTermDraw * /* params */, unsigned /* ch */, GC /* gc */, int /* x */, int /* y */, int /* cols */, Bool /* xftords */); + #if OPT_BOX_CHARS || OPT_REPORT_FONTS +#define XTermFontsRef(fontList, which) \ + (((which) != fNorm && \ + ((fontList)[(which)].fs == NULL || \ + (fontList)[(which)].fs->per_char == NULL) && \ + ((fontList)[fNorm].fs != NULL && \ + (fontList)[fNorm].fs->per_char != NULL)) \ + ? &((fontList)[fNorm]) \ + : &((fontList)[(which)])) extern Bool xtermMissingChar (unsigned /* ch */, XTermFonts */* font */); #endif @@ -142,7 +150,10 @@ extern Bool xtermLoadWideFonts (XtermWidget /* w */, Bool /* nullOk */); extern void xtermSaveVTFonts (XtermWidget /* xw */); #endif +/* checks for internal charset codes */ +#define xtermIsDecTechnical(ch) ((ch) >= XTERM_PUA && (ch) <= XTERM_PUA + 6) #define xtermIsDecGraphic(ch) ((ch) > 0 && (ch) < 32) +#define xtermIsInternalCs(ch) (xtermIsDecGraphic(ch) || xtermIsDecTechnical(ch)) #if OPT_RENDERFONT extern Boolean maybeXftCache(XtermWidget /* xw */, XftFont * /* font */); diff --git a/app/xterm/gen-charsets.pl b/app/xterm/gen-charsets.pl index 2456a748c..11c6b0e4f 100644 --- a/app/xterm/gen-charsets.pl +++ b/app/xterm/gen-charsets.pl @@ -1,9 +1,9 @@ -#! /usr/bin/perl -w -# $XTermId: gen-charsets.pl,v 1.2 2018/08/22 22:59:15 tom Exp $ +#! /usr/bin/env perl +# $XTermId: gen-charsets.pl,v 1.37 2024/02/09 01:11:52 tom Exp $ # ----------------------------------------------------------------------------- # this file is part of xterm # -# Copyright 2018 by Thomas E. Dickey +# Copyright 2018-2023,2024 by Thomas E. Dickey # # All Rights Reserved # @@ -31,32 +31,88 @@ # sale, use or other dealings in this Software without prior written # authorization. # ----------------------------------------------------------------------------- -# -# Translate a Unicode mapping, e.g., for one of the ISO-8859-x codepages, -# into the form used in charsets.c for converting characters. +# Format/maintain xterm's charsets.h header. + use strict; +use warnings; + +use Getopt::Std; $| = 1; -sub do_file($) { - my $file = shift; - my $undef = hex(0x2426); +our ( $opt_d, $opt_i, $opt_v, $opt_x ); +our $undef = hex(0x2426); +our $head_file = "charsets.h"; +our $data_file = "charsets.dat"; +our @import; + +our %wide_chars = qw( + map_DEC_Cyrillic 1 + map_DEC_Greek_Supp 1 + map_DEC_Hebrew_Supp 1 + map_DEC_Technical 1 + map_DEC_Turkish_Supp 1 + map_ISO_Greek_Supp 1 + map_ISO_Hebrew 1 + map_ISO_Latin_2 1 + map_ISO_Latin_5 1 + map_ISO_Latin_Cyrillic 1 + map_NRCS_Greek 1 + map_NRCS_Hebrew 1 + map_NRCS_Turkish 1 +); + +our $note_1 = "\ +#ifndef included_charsets_h +#define included_charsets_h 1"; + +our $note_2 = "\ +#ifndef PUA +#define PUA(n) (0xEEEE + (n)) +#endif +#define UNDEF 0x2426\t\t/* rendered as a backwards \"?\" */"; + +our $note_3 = "\ +#if OPT_WIDE_CHARS +#define begin_CODEPAGE(size) \\ +\tif (!(xw->flags & NATIONAL)) { \\ +\t screen->utf8_nrc_mode++; \\ +\t} +#define end_CODEPAGE() \\ +\tif (!(xw->flags & NATIONAL)) { \\ +\t screen->utf8_nrc_mode--; \\ +\t} +#else +#define begin_CODEPAGE(size)\t/* nothing */ +#define end_CODEPAGE()\t\t/* nothing */ +#endif"; + +sub read_file($) { + my $file = shift; open( FP, $file ) || do { print STDERR "Can't open $file: $!\n"; return; }; my @data = <FP>; close(FP); + chomp @data; + return @data; +} + +# Translate a Unicode mapping, e.g., for one of the ISO-8859-x codepages, +# into the form used in charsets.c for converting characters. +sub do_import($) { + my $file = shift; + my @data = &read_file($file); my $name = $file; $name =~ s,^.*/,,; $name =~ s/\..*$//; $name =~ s/^(8859)/ISO-$1/; $name =~ s/-/_/g; - printf "#define map_%s(code) \\\n", $name; - printf "\tswitch (code) { \\\n"; my @target; my @noteof; + $import[ $#import + 1 ] = sprintf "map_%s", $name; for my $n ( 0 .. $#data ) { chomp $data[$n]; $data[$n] =~ s/^\s*//; @@ -88,18 +144,278 @@ sub do_file($) { my $hi = $target[127] ? 127 : 126; for my $n ( $lo .. $hi ) { if ( defined $target[$n] ) { - printf "\t UNI(0x%02x, 0x%04x);\t/* %s */ \\\n", $n, + $import[ $#import + 1 ] = sprintf "\t0x%02x\t0x%04x\t\t# %s", $n, $target[$n], $noteof[$n]; } else { - printf "\t XXX(0x%02x, UNDEF);\t/* undefined */ \\\n", $n; + $import[ $#import + 1 ] = sprintf "\t0x%02x\tUNDEF\t\t# undefined", + $n; + } + } + if ($opt_v) { + for my $n ( 0 .. $#import ) { + printf "%s\n", $import[$n]; } } - printf "\t}\n"; } -while ( $#ARGV >= 0 ) { - &do_file( shift @ARGV ); +sub add_text($$) { + my @head = @{ $_[0] }; + my @note = split /\n/, $_[1]; + for my $n ( 0 .. $#note ) { + $head[ $#head + 1 ] = $note[$n]; + } + return @head; +} + +sub end_note($$) { + my @head = @{ $_[0] }; + my $note = $_[1]; + $head[ $#head + 1 ] = " */"; + my $notes; + if ( $note == 1 ) { + $notes = $note_1; + } + elsif ( $note == 2 ) { + $notes = $note_2; + } + elsif ( $note == 3 ) { + $notes = $note_3; + } + else { + $notes = ""; + } + return &add_text( \@head, $notes ); +} + +sub hex_of($) { + my $text = shift; + if ($text) { + $text =~ s/^(0x|u\+)//i; + $text = "0x" . $text if ( $text =~ /^[[:xdigit:]]+$/ ); + } + return $text; } +sub add($$) { + my @data = @{ $_[0] }; + my $text = $_[1]; + $data[ $#data + 1 ] = $text; + return @data; +} + +sub add_unmap($$) { + my @head = @{ $_[0] }; + my %unmap = %{ $_[1] }; + my %noted = %{ $_[2] }; + my $title = $_[3]; + my $macro = "un$title"; + $macro .= "(code,dft)" unless ( $macro =~ /\(code/ ); + $macro =~ s/code\)/code,dft\)/; + @head = &add( \@head, "" ); + + if (%unmap) { + my @codes = sort keys %unmap; + + if ( $#codes > 0 ) { + @head = &add( \@head, "#define $macro \\" ); + @head = &add( \@head, "\tswitch (code) { \\" ); + for my $code ( sort keys %unmap ) { + my $note = $noted{$code}; + my $pads = " "; + if ( $title =~ /_NRCS_/ ) { + $pads = sprintf( "%*s", 17 - length($code), " " ); + $note =~ s/\t/ /; + } + @head = &add( + \@head, + sprintf( + "\t MAP(%s,%s%s)%s \\", + $code, $pads, $unmap{$code}, $note + ) + ); + } + @head = &add( \@head, "\t default: dft; break; \\" ); + @head = &add( \@head, "\t}" ); + } + else { + @head = &add( \@head, "#define $macro /* nothing? */" ); + } + } + else { + @head = &add( \@head, "#define $macro /* nothing */" ); + } + return @head; +} + +# Read the current charsets data file, and format a new charsets.h file. +sub do_update($) { + my $file = shift; + my @data = &read_file($file); + return unless ( $#data >= 0 ); + my @head; + my %noted; + my %unmap; + my $title = ""; + my $state = 0; + my $ended = ""; + my $extra = ""; + my $notes = 0; + my $codep = 0; + + for my $n ( 0 .. $#data ) { + my $data = $data[$n]; + if ( $data =~ /^\s*#/ ) { + @head = &add( \@head, "/*" ) unless ( $state == 1 ); + $data =~ s/#/ */; + @head = &add( \@head, $data ); + $state = 1; + } + elsif ( $data =~ /^\s*$/ ) { + @head = &end_note( \@head, $notes++ ) if ( $state == 1 ); + + if ( $state >= 2 ) { + @head = &add( \@head, $ended ); + @head = &add_unmap( \@head, \%unmap, \%noted, $title ); + @head = &add( \@head, $extra ) if ( $extra ne "" ); + } + @head = &add( \@head, "" ); + + $title = ""; + %unmap = (); + $state = 0; + $ended = ""; + $extra = ""; + } + elsif ( $data =~ /^map_/ ) { + $title = $data; + @head = &end_note( \@head, $notes++ ) if ( $state == 1 ); + $state = 2; + $codep = 0; + $codep = 94 if ( $data =~ /_DEC_/ ); + $codep = 96 if ( $data =~ /_ISO_/ ); + + $data .= "(code)" unless ( $data =~ /\(code/ ); + + @head = &add( \@head, sprintf( "#define %s \\", $data ) ); + @head = &add( \@head, sprintf( "\tbegin_CODEPAGE(%d) \\", $codep ) ) + if ($codep); + @head = &add( \@head, "\tswitch (code) { \\" ); + + $ended = $codep ? "\t} \\\n\tend_CODEPAGE()" : "\t}"; + + # special case for map_DEC_Supp_Graphic + if ( $data =~ /\(code,dft\)/ ) { + $ended = "\t default: dft; break; \\\n" . $ended; + $extra = "\n#if OPT_WIDE_CHARS"; + } + } + elsif ( + $data =~ /^\s+(0x)?[[:xdigit:]]{2} + \s+(BLANK + |PUA\(\d\) + |UNDEF + |XK_\w+ + |(0x|U\+)?[[:xdigit:]]{1,4})\s*/x + ) + { + @head = &add( \@head, " */" ) if ( $state == 1 ); + $state = 3; + my $note = ""; + if ( $data =~ /#/ ) { + $note = $data; + $note =~ s/[^#]*#\s*//; + $note = "\t/* $note */" if ( $note ne "" ); + $data =~ s/\s*#.*//; + } + $data =~ s/\s+/ /g; + $data =~ s/^ //; + $data =~ s/ $//; + my @fields = split /\s/, $data; + my $source = &hex_of( $fields[0] ); + my $target = &hex_of( $fields[1] ); + my $intern = &hex_of( $fields[2] ); + my $macros = "UNI"; + $macros = "MAP" if ( $target =~ /^XK_/ ); + $macros = "XXX" if ( $target eq "UNDEF" ); + $macros = "XXX" if ( $target =~ /PUA\(\d\)/ ); + + if ( $target ne $source ) { + $intern = $source unless ($intern); + } + my $item = sprintf( " %s(%s, %s)", $macros, $source, $target ); + + # fix formatting for the XK_-based VT220 definitions + if ( $codep == 0 + and $title !~ /(Greek|Hebrew|Turkish)/ + and index( $note, "\t/*" ) == 0 ) + { + my $pads = 24 - length($item); + $item .= "\t" if ( $pads > 0 ); + } + @head = &add( \@head, sprintf( "\t%s%s \\", $item, $note ) ); + + if ( defined $intern ) { + if ( $source ne $intern ) { + $unmap{$source} = $intern; + $noted{$source} = $note; + } + } + } + else { + printf STDERR "? unexpected data:\n\t%s\n", $data; + } + } + if ( $state >= 2 ) { + @head = &add( \@head, $ended ); + @head = &add_unmap( \@head, \%unmap, \%noted, $title ); + @head = &add( \@head, $extra ) if ( $extra ne "" ); + } + @head = &add( \@head, "#else" ); + foreach my $key ( sort keys %wide_chars ) { + @head = + &add( \@head, sprintf( "#define %s(code)\t/* nothing */", $key ) ); + @head = &add( \@head, sprintf( "#define un%s(code,dft) dft", $key ) ); + } + @head = &add( \@head, "#endif /* OPT_WIDE_CHARS */" ); + @head = &add( \@head, "" ); + @head = &add( \@head, "#endif /* included_charsets_h */" ); + + my $origin = $file; + $origin =~ s/\.dat\b/.h/; + my $update = $origin . ".new"; + unlink $update; + open( my $fh, ">", $update ) + or die "Can't open > $update.txt: $!"; + for my $n ( 0 .. $#head ) { + printf $fh "%s\n", $head[$n]; + } + close $fh; + + system("diff -u $origin $update") if $opt_v; + rename $update, $origin if $opt_x; + unlink $update; +} + +sub main::HELP_MESSAGE() { + printf STDERR <<EOF +Usage: $0 [options] + +Options: + -d debug + -i import charset data from Unicode file + -v verbose + -x update charsets.h from $data_file +EOF + ; + exit 1; +} + +$Getopt::Std::STANDARD_HELP_VERSION = 1; +&getopts('i:vx') || &main::HELP_MESSAGE; +$#ARGV >= 0 && &main::HELP_MESSAGE; + +&do_import($opt_i) if ($opt_i); +&do_update($data_file); + 1; diff --git a/app/xterm/graphics.c b/app/xterm/graphics.c index 9d7d6a4f4..945b65e2d 100644 --- a/app/xterm/graphics.c +++ b/app/xterm/graphics.c @@ -1,8 +1,8 @@ -/* $XTermId: graphics.c,v 1.118 2022/05/16 23:35:50 tom Exp $ */ +/* $XTermId: graphics.c,v 1.135 2024/05/11 09:49:08 tom Exp $ */ /* - * Copyright 2013-2021,2022 by Ross Combs - * Copyright 2013-2021,2022 by Thomas E. Dickey + * Copyright 2013-2023,2024 by Thomas E. Dickey + * Copyright 2013-2022,2023 by Ross Combs * * All Rights Reserved * @@ -43,6 +43,12 @@ #include <assert.h> #include <graphics.h> +#define OPT_INHERIT_COLORS 0 + +#if OPT_REGIS_GRAPHICS +#include <graphics_regis.h> +#endif + #undef DUMP_BITMAP #undef DUMP_COLORS #undef DEBUG_PALETTE @@ -278,7 +284,7 @@ draw_solid_pixel(Graphic *graphic, int x, int y, unsigned color) y >= 0 && y < graphic->actual_height) { _draw_pixel(graphic, x, y, color); if (color < MAX_COLOR_REGISTERS) - graphic->color_registers_used[color] = 1; + graphic->color_registers_used[color] = True; } } @@ -311,7 +317,7 @@ draw_solid_rectangle(Graphic *graphic, int x1, int y1, int x2, int y2, unsigned y2 = graphic->actual_height - 1; if (color < MAX_COLOR_REGISTERS) - graphic->color_registers_used[color] = 1; + graphic->color_registers_used[color] = True; for (y = y1; y <= y2; y++) for (x = x1; x <= x2; x++) _draw_pixel(graphic, x, y, color); @@ -377,10 +383,13 @@ copy_overlapping_area(Graphic *graphic, int src_ul_x, int src_ul_y, #define set_color_register(color_registers, color, pr, pg, pb) \ do { \ + assert(color <= MAX_COLOR_REGISTERS); \ + { \ ColorRegister *reg = &color_registers[color]; \ reg->r = (short) pr; \ reg->g = (short) pg; \ reg->b = (short) pb; \ + } \ } while (0) /* Graphics which don't use private colors will act as if they are using a @@ -413,6 +422,26 @@ set_shared_color_register(unsigned color, int r, int g, int b) } void +fetch_color_register(Graphic *graphic, + unsigned color, + ColorRegister *reg) +{ + assert(color < MAX_COLOR_REGISTERS); + + reg->r = -1; + reg->g = -1; + reg->b = -1; + + if (graphic->color_registers_used[color]) { + if (graphic->private_colors) { + *reg = graphic->private_color_registers[color]; + } else { + *reg = getSharedRegisters()[color]; + } + } +} + +void update_color_register(Graphic *graphic, unsigned color, int r, @@ -427,7 +456,7 @@ update_color_register(Graphic *graphic, if (graphic->color_registers_used[color]) { graphic->dirty = True; } - graphic->color_registers_used[color] = 1; + graphic->color_registers_used[color] = True; } else { set_shared_color_register(color, r, g, b); } @@ -470,17 +499,29 @@ find_color_register(ColorRegister const *color_registers, int r, int g, int b) return (RegisterNum) closest_index; } +#if OPT_INHERIT_COLORS static void -init_color_registers(ColorRegister *color_registers, int graphics_termid) +copy_color_registers(Graphic *target, Graphic *source) { - TRACE(("setting initial colors for terminal %d\n", graphics_termid)); - { - unsigned i; + memcpy(target->color_registers_used, + source->color_registers_used, + sizeof(Boolean) * MAX_COLOR_REGISTERS); - for (i = 0U; i < MAX_COLOR_REGISTERS; i++) { - set_color_register(color_registers, (RegisterNum) i, 0, 0, 0); - } - } + memcpy(target->private_color_registers, + source->color_registers, + sizeof(ColorRegister) * MAX_COLOR_REGISTERS); +} +#endif + +static void +init_color_registers(TScreen const *screen, ColorRegister *color_registers) +{ + const int graphics_termid = GraphicsTermId(screen); + + TRACE(("setting initial colors for terminal %d\n", graphics_termid)); + memset(color_registers, + 0, + sizeof(ColorRegister) * MAX_COLOR_REGISTERS); /* * default color registers: @@ -631,14 +672,14 @@ get_color_register_count(TScreen const *screen) } static void -init_graphic(Graphic *graphic, +init_graphic(TScreen *screen, + Graphic *graphic, unsigned type, - int graphics_termid, int charrow, int charcol, - unsigned num_color_registers, - int private_colors) + unsigned num_color_registers) { + int private_colors = screen->privatecolorregisters; const unsigned max_pixels = (unsigned) (graphic->max_width * graphic->max_height); @@ -647,7 +688,7 @@ init_graphic(Graphic *graphic, graphic->hidden = False; graphic->dirty = True; memset(graphic->pixels, COLOR_HOLE & 0xff, max_pixels * sizeof(RegisterNum)); - memset(graphic->color_registers_used, 0, sizeof(graphic->color_registers_used)); + memset(graphic->color_registers_used, False, sizeof(graphic->color_registers_used)); /* * text and graphics interactions: @@ -680,8 +721,33 @@ init_graphic(Graphic *graphic, graphic->private_colors = private_colors; if (graphic->private_colors) { +#if OPT_INHERIT_COLORS + unsigned ii; + int max_charrow = -1; + Graphic *newest = NULL; +#endif + TRACE(("using private color registers\n")); - init_color_registers(graphic->private_color_registers, graphics_termid); + +#if OPT_INHERIT_COLORS + FOR_EACH_SLOT(ii) { + Graphic *check; + if (!(check = getActiveSlot(ii))) + continue; + if (!newest || check->charrow >= max_charrow) { + max_charrow = check->charrow; + newest = check; + } + } + + if (newest != NULL && newest != graphic) { + copy_color_registers(graphic, newest); + } else { + init_color_registers(screen, graphic->private_color_registers); + } +#else + init_color_registers(screen, graphic->private_color_registers); +#endif graphic->color_registers = graphic->private_color_registers; } else { TRACE(("using shared color registers\n")); @@ -697,15 +763,17 @@ init_graphic(Graphic *graphic, Graphic * get_new_graphic(XtermWidget xw, int charrow, int charcol, unsigned type) { - TScreen const *screen = TScreenOf(xw); + TScreen *screen = TScreenOf(xw); const int bufferid = screen->whichBuf; - const int graphics_termid = GraphicsTermId(screen); Graphic *graphic = NULL; unsigned ii; + TRACE(("get_new_graphic %d,%d type %d\n", charrow, charcol, type)); + FOR_EACH_SLOT(ii) { if ((graphic = getInactiveSlot(screen, ii))) { - TRACE(("using fresh graphic index=%u id=%u\n", ii, next_graphic_id)); + TRACE(("using fresh graphic index %u as id %u\n", + ii, next_graphic_id)); break; } } @@ -714,16 +782,19 @@ get_new_graphic(XtermWidget xw, int charrow, int charcol, unsigned type) if (!graphic) { int min_charrow = 0; Graphic *min_graphic = NULL; + if_TRACE(unsigned best_ii = (1 + MAX_GRAPHICS)); FOR_EACH_SLOT(ii) { if (!(graphic = getActiveSlot(ii))) continue; if (!min_graphic || graphic->charrow < min_charrow) { + if_TRACE(best_ii = ii); min_charrow = graphic->charrow; min_graphic = graphic; } } - TRACE(("recycling old graphic index=%u id=%u\n", ii, next_graphic_id)); + TRACE(("recycling old graphic index %u as id %u\n", + best_ii, next_graphic_id)); graphic = min_graphic; } @@ -733,13 +804,12 @@ get_new_graphic(XtermWidget xw, int charrow, int charcol, unsigned type) graphic->xw = xw; graphic->bufferid = bufferid; graphic->id = next_graphic_id++; - init_graphic(graphic, + init_graphic(screen, + graphic, type, - graphics_termid, charrow, charcol, - num_color_registers, - screen->privatecolorregisters); + num_color_registers); } return graphic; } @@ -944,7 +1014,11 @@ refresh_graphic(TScreen const *screen, holes, total, out_of_range)); } +#define MAX_PCT 100. /* HLS uses this for L, S percentages */ +#define MAX_RGB 100. /* use this rather than 255 */ + /* + * In HLS, H is an angle, in degrees, and L, S are percentages. * Primary color hues: * blue: 0 degrees * red: 120 degrees @@ -953,12 +1027,19 @@ refresh_graphic(TScreen const *screen, void hls2rgb(int h, int l, int s, short *r, short *g, short *b) { - const int hs = ((h + 240) / 60) % 6; - const double lv = l / 100.0; - const double sv = s / 100.0; + int hs; + const double lv = l / MAX_PCT; + const double sv = s / MAX_PCT; double c, x, m, c2; double r1, g1, b1; + h = h - 120; /* Rotate so that blue is at 0 degrees */ + while (h < 0) + h += 360; /* Normalize to 0 to 360, */ + while (h >= 360) + h -= 360; + hs = ((h + 59) / 60) % 6; + if (s == 0) { *r = *g = *b = (short) l; return; @@ -1004,15 +1085,15 @@ hls2rgb(int h, int l, int s, short *r, short *g, short *b) break; default: TRACE(("Bad HLS input: [%d,%d,%d], returning white\n", h, l, s)); - *r = (short) 100; - *g = (short) 100; - *b = (short) 100; + *r = (short) 360; + *g = (short) MAX_PCT; + *b = (short) MAX_PCT; return; } - *r = (short) ((r1 + m) * 100.0 + 0.5); - *g = (short) ((g1 + m) * 100.0 + 0.5); - *b = (short) ((b1 + m) * 100.0 + 0.5); + *r = (short) ((r1 + m) * MAX_PCT + 0.5); + *g = (short) ((g1 + m) * MAX_PCT + 0.5); + *b = (short) ((b1 + m) * MAX_PCT + 0.5); if (*r < 0) *r = 0; @@ -1029,6 +1110,49 @@ hls2rgb(int h, int l, int s, short *r, short *g, short *b) } void +rgb2hls(int r, int g, int b, short *h, short *l, short *s) +{ + const double scaled_r = (r / MAX_RGB); + const double scaled_g = (g / MAX_RGB); + const double scaled_b = (b / MAX_RGB); + + const double min_scale = Min(Min(scaled_r, scaled_g), scaled_b); + const double max_scale = Max(Max(scaled_r, scaled_g), scaled_b); + const double dif_scale = max_scale - min_scale; + + double h_work = 0.; + double s_work = 0.; + double l_work = ((max_scale + min_scale) / 2.); + + if (dif_scale != 0.) { + if (l_work < 0.5f) { + s_work = (dif_scale / (max_scale + min_scale)); + } else { + s_work = (dif_scale / (2. - max_scale - min_scale)); + } + + if (scaled_r == max_scale) { + h_work = (scaled_g - scaled_b) / dif_scale; + } else if (scaled_g == max_scale) { + h_work = 2. + (scaled_b - scaled_r) / dif_scale; + } else if (scaled_b == max_scale) { + h_work = 4. + (scaled_r - scaled_g) / dif_scale; + } + } + + h_work *= 60.; + if (h_work < 0) + h_work += 360.; + + s_work *= MAX_RGB; + l_work *= MAX_RGB; + + *h = (short) h_work; + *s = (short) s_work; + *l = (short) l_work; +} + +void dump_graphic(Graphic const *graphic) { #if defined(DUMP_COLORS) || defined(DUMP_BITMAP) @@ -1745,7 +1869,7 @@ chararea_clear_displayed_graphics(TScreen const *screen, void reset_displayed_graphics(TScreen const *screen) { - init_color_registers(getSharedRegisters(), GraphicsTermId(screen)); + init_color_registers(screen, getSharedRegisters()); if (used_graphics) { unsigned ii; @@ -1754,6 +1878,9 @@ reset_displayed_graphics(TScreen const *screen) FOR_EACH_SLOT(ii) { deactivateSlot(ii); } +#if OPT_REGIS_GRAPHICS + reset_regis(); +#endif } } diff --git a/app/xterm/graphics.h b/app/xterm/graphics.h index 7131e1603..19dab5082 100644 --- a/app/xterm/graphics.h +++ b/app/xterm/graphics.h @@ -1,8 +1,8 @@ -/* $XTermId: graphics.h,v 1.29 2022/02/22 23:36:19 tom Exp $ */ +/* $XTermId: graphics.h,v 1.32 2023/09/28 00:24:13 tom Exp $ */ /* - * Copyright 2013-2016,2022 by Ross Combs - * Copyright 2013-2016,2022 by Thomas E. Dickey + * Copyright 2013-2022,2023 by Ross Combs + * Copyright 2013-2022,2023 by Thomas E. Dickey * * All Rights Reserved * @@ -66,7 +66,7 @@ typedef struct { RegisterNum *pixels; ColorRegister *private_color_registers; ColorRegister *color_registers; - char color_registers_used[MAX_COLOR_REGISTERS]; + Boolean color_registers_used[MAX_COLOR_REGISTERS]; XtermWidget xw; int max_width; /* largest image which can be stored */ int max_height; /* largest image which can be stored */ @@ -93,8 +93,10 @@ extern void draw_solid_pixel(Graphic */* graphic */, int /* x */, int /* y */, u extern void draw_solid_rectangle(Graphic */* graphic */, int /* x1 */, int /* y1 */, int /* x2 */, int /* y2 */, unsigned /* color */); extern void copy_overlapping_area(Graphic */* graphic */, int /* src_x */, int /* src_y */, int /* dst_x */, int /* dst_y */, unsigned /* w */, unsigned /* h */, unsigned /* default_color */); extern void hls2rgb(int /* h */, int /* l */, int /* s */, short */* r */, short */* g */, short */* b */); +extern void rgb2hls(int /* r */, int /* g */, int /* b */, short */* h */, short */* l */, short */* s */); extern void dump_graphic(Graphic const */* graphic */); extern unsigned get_color_register_count(TScreen const */* screen */); +extern void fetch_color_register(Graphic */* graphic */, unsigned /* color */, ColorRegister* /* reg */); extern void update_color_register(Graphic */* graphic */, unsigned /* color */, int /* r */, int /* g */, int /* b */); extern RegisterNum find_color_register(ColorRegister const */* color_registers */, int /* r */, int /* g */, int /* b */); extern void chararea_clear_displayed_graphics(TScreen const */* screen */, int /* leftcol */, int /* toprow */, int /* ncols */, int /* nrows */); @@ -117,6 +119,7 @@ extern void noleaks_graphics(Display */* dpy */); #define draw_solid_rectangle(graphic, x1, y1, x2, y2, color) /* nothing */ #define copy_overlapping_area(graphic, src_x, src_y, dst_x, dst_y, w, h, default_color) /* nothing */ #define hls2rgb(h, l, s, r, g, b) /* nothing */ +#define rgb2hls(r, g, b, h, l, s) /* nothing */ #define dump_graphic(graphic) /* nothing */ #define get_color_register_count(screen) /* nothing */ #define update_color_register(graphic, color, r, g, b) /* nothing */ diff --git a/app/xterm/graphics_regis.c b/app/xterm/graphics_regis.c index c532e4e29..d1d00b6ee 100644 --- a/app/xterm/graphics_regis.c +++ b/app/xterm/graphics_regis.c @@ -1,8 +1,8 @@ -/* $XTermId: graphics_regis.c,v 1.130 2022/05/16 23:31:18 tom Exp $ */ +/* $XTermId: graphics_regis.c,v 1.149 2023/10/08 23:11:35 tom Exp $ */ /* - * Copyright 2014-2021,2022 by Ross Combs - * Copyright 2014-2021,2022 by Thomas E. Dickey + * Copyright 2014-2022,2023 by Ross Combs + * Copyright 2014-2022,2023 by Thomas E. Dickey * * All Rights Reserved * @@ -68,7 +68,7 @@ #undef DEBUG_COMPUTED_FONT_METRICS #undef DEBUG_FONT_NAME #undef DEBUG_FONT_SIZE_SEARCH -#undef DEBUG_XFT_GLYPH +#undef DEBUG_XFT_GLYPH_COPY #undef DEBUG_GLYPH_RETRIEVAL #undef DEBUG_XFT_GLYPH_LOADING #undef DEBUG_LOAD @@ -119,6 +119,14 @@ typedef struct RegisTextControls { int slant; /* for italic/oblique */ } RegisTextControls; +#define S_QUOTE '\'' +#define D_QUOTE '"' + +#define isQuote(ch) ((ch) == S_QUOTE || (ch) == D_QUOTE) +#define PickQuote(ch) ((ch) == S_QUOTE ? D_QUOTE : S_QUOTE) + +#define isName(c) ((c) == '_' || isalnum(CharOf(c))) + #define FixedCopy(dst, src, len) strncpy(dst, src, len - 1)[len - 1] = '\0' #define CopyFontname(dst, src) FixedCopy(dst, src, (size_t) REGIS_FONTNAME_LEN) @@ -538,8 +546,8 @@ draw_or_save_patterned_pixel(RegisGraphicsContext *context, int x, int y) static int sort_points(void const *l, void const *r) { - RegisPoint const *const lp = (RegisPoint const *)l; - RegisPoint const *const rp = (RegisPoint const *)r; + RegisPoint const *const lp = (RegisPoint const *) l; + RegisPoint const *const rp = (RegisPoint const *) r; if (lp->y < rp->y) return -1; @@ -580,9 +588,6 @@ draw_shaded_polygon(RegisGraphicsContext *context) for (p = 0U; p < context->fill_point_count; p++) { int new_x = context->fill_points[p].x; int new_y = context->fill_points[p].y; -#if 0 - printf("got %d,%d (%d,%d) inside=%d\n", new_x, new_y, old_x, old_y, inside); -#endif /* * FIXME: This is using pixels to represent lines which loses @@ -642,9 +647,6 @@ draw_filled_polygon(RegisGraphicsContext *context) for (p = 0U; p < context->fill_point_count; p++) { int new_x = context->fill_points[p].x; int new_y = context->fill_points[p].y; -#if 0 - printf("got %d,%d (%d,%d) inside=%d\n", new_x, new_y, old_x, old_y, inside); -#endif /* * FIXME: This is using pixels to represent lines which loses @@ -1826,32 +1828,54 @@ get_xft_glyph_dimensions(XtermWidget xw, XftFont *font, unsigned *w, #define FONT_SIZE_CACHE_SIZE 32U +typedef struct { + XftFont *font_data; + char fontname[REGIS_FONTNAME_LEN]; + unsigned maxw, maxh, max_pixels; + unsigned targeth; + unsigned w, h; + unsigned xmin; + unsigned ymin; +} FONT_CACHE; + +static FONT_CACHE font_cache[FONT_SIZE_CACHE_SIZE]; + +static void +close_xft_font(XtermWidget xw, XftFont *font) +{ + if (font != NULL) { + Display *display = XtDisplay(xw); + unsigned ii; + for (ii = 0; ii < FONT_SIZE_CACHE_SIZE; ++ii) { + if (font == font_cache[ii].font_data) { + font_cache[ii].font_data = NULL; + break; + } + } + XftFontClose(display, font); + } +} + /* Find the font pixel size which returns the font which is closest to the given * maxw and maxh without overstepping either dimension. */ static XftFont * find_best_xft_font_size(XtermWidget xw, char const *fontname, - unsigned maxw, unsigned maxh, unsigned max_pixels, - unsigned *w, unsigned *h, - unsigned *xmin, unsigned *ymin) + unsigned maxw, + unsigned maxh, + unsigned max_pixels, + unsigned *w, + unsigned *h, + unsigned *xmin, + unsigned *ymin) { Display *display = XtDisplay(xw); Screen *screen = XtScreen(xw); XftFont *font; unsigned targeth; - unsigned ii, cacheindex; - /* FIXME: change cache to just cache the final result and put it in a - * wrapper function - */ - static struct { - char fontname[REGIS_FONTNAME_LEN]; - unsigned maxw, maxh, max_pixels; - unsigned targeth; - unsigned w, h; - unsigned xmin; - unsigned ymin; - } cache[FONT_SIZE_CACHE_SIZE]; + unsigned ii; + FONT_CACHE *cp = NULL; assert(display); assert(screen); @@ -1862,24 +1886,36 @@ find_best_xft_font_size(XtermWidget xw, assert(ymin); #ifdef DEBUG_FONT_SIZE_SEARCH - TRACE(("determining best size of font '%s' for %ux%u glyph with max_pixels=%u\n", + TRACE(("determining best size of font \"%s\" for %ux%u glyph with max_pixels=%u\n", fontname, maxw, maxh, max_pixels)); #endif - cacheindex = FONT_SIZE_CACHE_SIZE; for (ii = 0U; ii < FONT_SIZE_CACHE_SIZE; ii++) { - if (cache[ii].maxw == maxw && cache[ii].maxh == maxh && - cache[ii].max_pixels == max_pixels && - strcmp(cache[ii].fontname, fontname) == 0) { - cacheindex = ii; + if (font_cache[ii].maxw == maxw && + font_cache[ii].maxh == maxh && + font_cache[ii].max_pixels == max_pixels && + strcmp(font_cache[ii].fontname, fontname) == 0) { + cp = &font_cache[ii]; + if (cp->font_data) { + *w = cp->w; + *h = cp->h; + *xmin = cp->xmin; + *ymin = cp->ymin; + return cp->font_data; + } break; } } - if (cacheindex < FONT_SIZE_CACHE_SIZE) { - targeth = cache[cacheindex].targeth; + if (cp != NULL) { + targeth = cp->targeth; } else { - targeth = maxh * 10U + 5U; + targeth = maxh * 8U + 5U; } + +#define MAX_TARGETH 720U /* above this level, fontconfig chokes */ + if (targeth > MAX_TARGETH) + targeth = MAX_TARGETH; + for (;;) { if (targeth <= 5U) { TRACE(("Giving up finding suitable Xft font size for \"%s\" at %ux%u.\n", @@ -1917,17 +1953,8 @@ find_best_xft_font_size(XtermWidget xw, TRACE(("trying targeth=%g\n", targeth / 10.0)); #endif XftPatternBuild(pat, -#if 0 - /* arbitrary value */ - XFT_SIZE, XftTypeDouble, 12.0, -#endif XFT_PIXEL_SIZE, XftTypeDouble, (double) targeth / 10.0, -#if 0 - XFT_CHAR_WIDTH, XftTypeInteger, (int) maxw, - XFT_CHAR_HEIGHT, XftTypeInteger, (int) - (targeth / 10U), -#endif XFT_SPACING, XftTypeInteger, XFT_MONO, XFT_SLANT, XftTypeInteger, 0, XFT_ANTIALIAS, XftTypeBool, False, @@ -1942,15 +1969,7 @@ find_best_xft_font_size(XtermWidget xw, } } if (!font) { -#ifdef DEBUG_FONT_SIZE_SEARCH - { - char buffer[1024]; - - if (XftNameUnparse(font->pattern, buffer, (int) sizeof(buffer))) - printf("font name unparsed: \"%s\"\n", buffer); - } -#endif - TRACE(("unable to open a monospaced Xft font matching '%s' with pixelsize %g\n", + TRACE(("unable to open a monospaced Xft font matching \"%s\" with pixelsize %g\n", fontname, targeth / 10.0)); return NULL; } @@ -1966,12 +1985,12 @@ find_best_xft_font_size(XtermWidget xw, } #endif - if (cacheindex < FONT_SIZE_CACHE_SIZE && - targeth == cache[cacheindex].targeth) { - *w = cache[cacheindex].w; - *h = cache[cacheindex].h; - *xmin = cache[cacheindex].xmin; - *ymin = cache[cacheindex].ymin; + if (cp != NULL && + targeth == cp->targeth) { + *w = cp->w; + *h = cp->h; + *xmin = cp->xmin; + *ymin = cp->ymin; } else { get_xft_glyph_dimensions(xw, font, w, h, xmin, ymin); @@ -1990,28 +2009,26 @@ find_best_xft_font_size(XtermWidget xw, #endif if (*h > maxh) { + float ratio = (float) (*h) / (float) maxh; XftFontClose(display, font); #ifdef DEBUG_FONT_SIZE_SEARCH TRACE(("got %ux%u glyph; too tall; reducing target size\n", *w, *h)); #endif - if (*h > 2U * maxh) { - targeth /= (*h / maxh); - } else if (targeth > 10U && *h > maxh + 1U) { - targeth -= 10U; + if (targeth >= 10U && ratio > 1.1) { + targeth = (unsigned) ((float) targeth / ratio); } else { targeth--; } continue; } if (*w > maxw) { + float ratio = (float) (*w) / (float) maxw; XftFontClose(display, font); #ifdef DEBUG_FONT_SIZE_SEARCH TRACE(("got %ux%u glyph; too wide; reducing target size\n", *w, *h)); #endif - if (*w > 2U * maxw) { - targeth /= (*w / maxw); - } else if (targeth > 10U && *w > maxw + 1U) { - targeth -= 10U; + if (targeth >= 10U && ratio > 1.1) { + targeth = (unsigned) ((float) targeth / ratio); } else { targeth--; } @@ -2052,34 +2069,32 @@ find_best_xft_font_size(XtermWidget xw, } #endif - if (cacheindex == FONT_SIZE_CACHE_SIZE) { + if (cp == NULL) { for (ii = 0U; ii < FONT_SIZE_CACHE_SIZE; ii++) { - if (cache[ii].maxw == 0U || cache[ii].maxh == 0U || - cache[ii].max_pixels == 0U) { - CopyFontname(cache[ii].fontname, fontname); - cache[ii].maxw = maxw; - cache[ii].maxh = maxh; - cache[ii].max_pixels = max_pixels; - cache[ii].targeth = targeth; - cache[ii].w = *w; - cache[ii].h = *h; - cache[ii].xmin = *xmin; - cache[ii].ymin = *ymin; + if (font_cache[ii].maxw == 0U || + font_cache[ii].maxh == 0U || + font_cache[ii].max_pixels == 0U) { + cp = &font_cache[ii]; break; } } - if (ii == FONT_SIZE_CACHE_SIZE) { + if (cp == NULL) { ii = targeth % FONT_SIZE_CACHE_SIZE; - CopyFontname(cache[ii].fontname, fontname); - cache[ii].maxw = maxw; - cache[ii].maxh = maxh; - cache[ii].max_pixels = max_pixels; - cache[ii].targeth = targeth; - cache[ii].w = *w; - cache[ii].h = *h; - cache[ii].xmin = *xmin; - cache[ii].ymin = *ymin; + cp = &font_cache[ii]; + close_xft_font(xw, cp->font_data); } + CopyFontname(cp->fontname, fontname); + cp->maxw = maxw; + cp->maxh = maxh; + cp->max_pixels = max_pixels; + cp->targeth = targeth; + cp->w = *w; + cp->h = *h; + cp->xmin = *xmin; + cp->ymin = *ymin; + } + if (cp != NULL) { + cp->font_data = font; } return font; } @@ -2102,7 +2117,6 @@ get_xft_bitmap_of_character(RegisGraphicsContext const *context, */ #ifdef XRENDERFONT XtermWidget xw = context->destination_graphic->xw; - Display *display = XtDisplay(xw); XftFont *font; unsigned xmin = 0U, ymin = 0U; @@ -2117,17 +2131,16 @@ get_xft_bitmap_of_character(RegisGraphicsContext const *context, if (*w == 0U || *h == 0U) { TRACE(("empty glyph found for '%c'\n", ch)); - XftFontClose(display, font); + close_xft_font(xw, font); return 1; } if (!copy_bitmap_from_xft_font(xw, font, CharOf(ch), pixels, *w, *h, xmin, ymin)) { TRACE(("Unable to create bitmap for '%c'\n", ch)); - XftFontClose(display, font); + close_xft_font(xw, font); return 0; } - XftFontClose(display, font); # ifdef DEBUG_XFT_GLYPH_LOADING TRACE(("loaded glyph '%c' at max size %dx%d\n", ch, maxw, maxh)); # endif @@ -2365,7 +2378,7 @@ get_bitmap_of_character(RegisGraphicsContext const *context, int ch, if (fontname) { #ifdef DEBUG_GLYPH_RETRIEVAL - TRACE(("using xft font %s\n", fontname)); + TRACE(("using xft font \"%s\"\n", fontname)); #endif if (get_xft_bitmap_of_character(context, fontname, ch, maxw, maxh, pixels, @@ -3151,6 +3164,37 @@ extract_regis_command(RegisDataFragment *input, char *command) return 1; } +/* + * Check a ReGIS alphabet name before reporting it, to pick an appropriate + * delimiter. If the string is empty, or contains nonreportable characters, + * just return NUL. + */ +static int +pick_quote(const char *value) +{ + Bool s_quote = False; + Bool d_quote = False; + + if (*value != '\0') { + while (*value != '\0') { + int ch = CharOf(*value++); + if (ch == D_QUOTE) + d_quote = True; + else if (ch == S_QUOTE) + s_quote = True; + else if (!isName(ch)) + s_quote = d_quote = True; + } + } else { + s_quote = d_quote = True; + } + return ((s_quote && d_quote) + ? 0 + : (s_quote + ? D_QUOTE + : S_QUOTE)); +} + static int extract_regis_string(RegisDataFragment *input, char *out, unsigned maxlen) { @@ -3166,7 +3210,7 @@ extract_regis_string(RegisDataFragment *input, char *out, unsigned maxlen) return 0; ch = peek_fragment(input); - if (ch != '\'' && ch != '"') + if (!isQuote(ch)) return 0; open_quote_ch = ch; outlen = 0U; @@ -3246,7 +3290,7 @@ extract_regis_parenthesized_data(RegisDataFragment *input, for (; input->pos < input->len; input->pos++, output->len++) { char prev_ch = ch; ch = input->start[input->pos]; - if (ch == '\'' || ch == '"') { + if (isQuote(ch)) { if (open_quote_ch == '\0') { open_quote_ch = ch; } else { @@ -3314,7 +3358,7 @@ extract_regis_option(RegisDataFragment *input, if (ch == ';' || ch == ',' || ch == '(' || ch == ')' || ch == '[' || ch == ']' || - ch == '"' || ch == '\'' || + isQuote(ch) || isdigit(CharOf(ch))) { return 0; } @@ -3330,7 +3374,7 @@ extract_regis_option(RegisDataFragment *input, TRACE(("looking at char '%c' in option '%c'\n", ch, *option)); /* FIXME: any special rules for commas? */ /* FIXME: handle escaped quotes */ - if (ch == '\'' || ch == '"') { + if (isQuote(ch)) { if (open_quote_ch == ch) { open_quote_ch = '\0'; } else { @@ -3421,33 +3465,56 @@ regis_num_to_int(RegisDataFragment const *input, int *out) return 1; } +#define spec_H xBIT(0) +#define spec_L xBIT(1) +#define spec_S xBIT(2) + +#define spec_HLS (spec_H | spec_L | spec_S) + +#define spec_R xBIT(3) +#define spec_G xBIT(4) +#define spec_B xBIT(5) + +#define spec_RGB (spec_R | spec_G | spec_B) + static int load_regis_colorspec(RegisGraphicsContext const *context, RegisDataFragment const *input, - short *r_out, short *g_out, short *b_out) + ColorRegister *colors) { RegisDataFragment colorspec; - short r = -1, g = -1, b = -1; + short r = colors->r; + short g = colors->g; + short b = colors->b; short l = -1; int simple; + unsigned len; + unsigned spec = 0; assert(context); assert(input); - assert(r_out); - assert(g_out); - assert(b_out); + assert(colors); copy_fragment(&colorspec, input); TRACE(("colorspec option: \"%s\"\n", fragment_to_tempstr(&colorspec))); skip_regis_whitespace(&colorspec); simple = 0; - if (fragment_remaining(&colorspec) == 1U) { + if ((len = fragment_remaining(&colorspec)) == 1U) { simple = 1; - } else if (fragment_remaining(&colorspec) > 1U) { - char after = get_fragment(&colorspec, 1U); - if (IsSpace(after)) - simple = 1; + } else if (len > 1U) { + unsigned n; + for (n = 1; n < len; ++n) { + char after = get_fragment(&colorspec, n); + /* if no parameters, we might see a right-parenthesis, but on error + * we can anything */ + if (strchr("[(,)]", after) != NULL) { + simple = 1; + break; + } else if (!IsSpace(after)) { + break; + } + } } if (simple) { char ch = pop_fragment(&colorspec); @@ -3576,7 +3643,7 @@ load_regis_colorspec(RegisGraphicsContext const *context, return 0; } if (!regis_num_to_int(&num, &val)) { - TRACE(("DATA_ERROR: component value %s is not a number\n", + TRACE(("DATA_ERROR: component value \"%s\" is not a number\n", fragment_to_tempstr(&num))); return 0; } @@ -3589,38 +3656,56 @@ load_regis_colorspec(RegisGraphicsContext const *context, switch (comp) { case 'H': h = (short) val; + spec |= spec_H; break; case 'L': l = (short) val; + spec |= spec_L; break; case 'S': s = (short) val; + spec |= spec_S; break; case 'R': r = (short) val; + spec |= spec_R; break; case 'G': g = (short) val; + spec |= spec_G; break; case 'B': b = (short) val; + spec |= spec_B; break; } } - if (h >= 0 && l >= 0 && s >= 0 && r < 0 && g < 0 && b < 0) { + if ((spec & spec_HLS) && (spec & spec_RGB)) { + TRACE(("DATA_ERROR: conflicting colorspec format\n")); + return 0; + } else if (spec == spec_HLS) { TRACE(("found HLS colorspec to be converted: %hd,%hd,%hd\n", h, l, s)); hls2rgb(h, l, s, &r, &g, &b); TRACE(("converted to RGB: %hd,%hd,%hd\n", r, g, b)); - } else if (h < 0 && l < 0 && s < 0 && r >= 0 && g >= 0 && b >= 0) { + } else if (spec == spec_RGB) { TRACE(("found RGB colorspec: %hd,%hd,%hd\n", r, g, b)); l = (short) ((MIN3(r, g, b) + MAX3(r, g, b)) / 2); TRACE(("calculated L: %d\n", l)); - } else if (h < 0 && l >= 0 && s < 0 && r < 0 && g < 0 && b < 0) { - TRACE(("found L colorspec to be converted: %hd,%hd,%hd\n", + } else if ((spec & spec_HLS)) { + short old_h, old_l, old_s; + TRACE(("using partial HLS %hd,%hd,%hd\n", h, l, s)); + rgb2hls(r, g, b, &old_h, &old_l, &old_s); + if (h < 0) + h = old_h; + if (l < 0) + l = old_l; + if (s < 0) + s = old_s; + TRACE(("resulting HLS colorspec to convert: %hd,%hd,%hd\n", h, l, s)); - hls2rgb(0, l, 0, &r, &g, &b); + hls2rgb(h, l, s, &r, &g, &b); TRACE(("converted to RGB: %hd,%hd,%hd\n", r, g, b)); } else { TRACE(("DATA_ERROR: unrecognized colorspec format\n")); @@ -3636,9 +3721,9 @@ load_regis_colorspec(RegisGraphicsContext const *context, TRACE(("converted to grayscale: %hd,%hd,%hd\n", r, g, b)); } - *r_out = r; - *g_out = g; - *b_out = b; + colors->r = r; + colors->g = g; + colors->b = b; skip_regis_whitespace(&colorspec); if (!fragment_consumed(&colorspec)) { @@ -3671,7 +3756,7 @@ load_regis_regnum_or_colorspec(RegisGraphicsContext const *context, if (extract_regis_num(&colorspec, &num)) { if (!regis_num_to_int(&num, &val)) { - TRACE(("DATA_ERROR: colorspec value %s is not a valid register\n", + TRACE(("DATA_ERROR: colorspec value \"%s\" is not a valid register\n", fragment_to_tempstr(&num))); return 0; } @@ -3705,15 +3790,16 @@ load_regis_regnum_or_colorspec(RegisGraphicsContext const *context, } if (extract_regis_parenthesized_data(&colorspec, &coloroption)) { - short r, g, b; + ColorRegister find_reg = + {-1, -1, -1}; - if (!load_regis_colorspec(context, &coloroption, &r, &g, &b)) { + if (!load_regis_colorspec(context, &coloroption, &find_reg)) { TRACE(("unable to parse colorspec\n")); return 0; } *out = find_color_register(context->destination_graphic->color_registers, - r, g, b); + find_reg.r, find_reg.g, find_reg.b); TRACE(("colorspec maps to closest register %u\n", *out)); return 1; @@ -3847,11 +3933,11 @@ load_regis_mult_extent(char const *extent, int *w, int *h) int px, py; if (!load_regis_raw_extent(extent, &relx, &rely, &px, &py, 1)) { - TRACE(("invalid coordinates in extent %s\n", extent)); + TRACE(("invalid coordinates in extent \"%s\"\n", extent)); return 0; } if (relx | rely) { - TRACE(("invalid relative value in multiplier extent %s\n", extent)); + TRACE(("invalid relative value in multiplier extent \"%s\"\n", extent)); return 0; } @@ -3869,7 +3955,7 @@ load_regis_pixel_extent(char const *extent, int origx, int origy, int px, py; if (!load_regis_raw_extent(extent, &relx, &rely, &px, &py, 1)) { - TRACE(("invalid coordinates in extent %s\n", extent)); + TRACE(("invalid coordinates in extent \"%s\"\n", extent)); return 0; } @@ -3894,7 +3980,7 @@ load_regis_coord_extent(RegisGraphicsContext const *context, char const *extent, int ux, uy; if (!load_regis_raw_extent(extent, &relx, &rely, &ux, &uy, COORD_SCALE)) { - TRACE(("invalid coordinates in extent %s\n", extent)); + TRACE(("invalid coordinates in extent \"%s\"\n", extent)); return 0; } @@ -5008,6 +5094,7 @@ parse_regis_command(RegisParseState *state) static int parse_regis_option(RegisParseState *state, RegisGraphicsContext *context) { + XtermWidget xw = context->display_graphic->xw; RegisDataFragment optionarg; if (!extract_regis_option(&state->input, &state->option, &optionarg)) @@ -5586,13 +5673,18 @@ parse_regis_option(RegisParseState *state, RegisGraphicsContext *context) state->option, fragment_to_tempstr(&optionarg))); break; } { - char reply[64]; + unsigned err_code = 0U; + unsigned err_char = 0U; TRACE(("got report last error condition\n")); /* FIXME: implement after adding error tracking */ - sprintf(reply, "\"%u,%u\"\r", 0U, 0U); - unparseputs(context->display_graphic->xw, reply); - unparse_end(context->display_graphic->xw); + unparseputc(xw, D_QUOTE); + unparseputn(xw, err_code); + unparseputc(xw, ','); + unparseputn(xw, err_char); + unparseputc(xw, D_QUOTE); + unparseputc(xw, '\r'); + unparse_end(xw); } break; case 'I': @@ -5639,8 +5731,8 @@ parse_regis_option(RegisParseState *state, RegisGraphicsContext *context) /* FIXME: implement arrow key movement */ /* FIXME: implement button/key collection */ - unparseputs(context->display_graphic->xw, "\r"); - unparse_end(context->display_graphic->xw); + unparseputc(xw, '\r'); + unparse_end(xw); skip_regis_whitespace(&optionarg); if (!fragment_consumed(&optionarg)) { @@ -5657,25 +5749,22 @@ parse_regis_option(RegisParseState *state, RegisGraphicsContext *context) if (!fragment_consumed(&optionarg)) { TRACE(("DATA_ERROR: unexpected arguments to ReGIS report command option '%c' arg \"%s\"\n", state->option, fragment_to_tempstr(&optionarg))); - break; - } { - char buffer[32]; - - if (state->load_index == MAX_REGIS_ALPHABETS) { - /* If this happens something went wrong elsewhere. */ - TRACE(("DATA_ERROR: unable to report current load alphabet\n")); - unparseputs(context->display_graphic->xw, "A0\"\"\r"); - unparse_end(context->display_graphic->xw); - break; + } else if (state->load_index == MAX_REGIS_ALPHABETS) { + /* If this happens something went wrong elsewhere. */ + TRACE(("DATA_ERROR: unable to report current load alphabet\n")); + unparseputs(xw, "A0\"\"\r"); + unparse_end(xw); + } else { + int delim = pick_quote(state->load_name); + if (delim != '\0') { + unparseputs(xw, "A"); + unparseputn(xw, state->load_alphabet); + unparseputc(xw, delim); + unparseputs(xw, state->load_name); + unparseputc(xw, delim); } - - unparseputs(context->display_graphic->xw, "A"); - sprintf(buffer, "%u", state->load_alphabet); - unparseputs(context->display_graphic->xw, buffer); - unparseputs(context->display_graphic->xw, "\""); - unparseputs(context->display_graphic->xw, state->load_name); - unparseputs(context->display_graphic->xw, "\"\r"); - unparse_end(context->display_graphic->xw); + unparseputc(xw, '\r'); + unparse_end(xw); } break; case 'M': @@ -5717,27 +5806,31 @@ parse_regis_option(RegisParseState *state, RegisGraphicsContext *context) } if (name == '=') { - char reply[64]; + unsigned max_available = 1000U; + unsigned cur_available = max_available; TRACE(("got report macrograph storage request\n")); /* FIXME: Implement when macrographs are supported. */ - sprintf(reply, "\"%u,%u\"\r", 1000U, 1000U); - unparseputs(context->display_graphic->xw, reply); - unparse_end(context->display_graphic->xw); + unparseputc(xw, D_QUOTE); + unparseputn(xw, cur_available); + unparseputc(xw, ','); + unparseputn(xw, max_available); + unparseputc(xw, D_QUOTE); + unparseputc(xw, '\r'); + unparse_end(xw); } else if (name < 'A' || name > 'Z') { TRACE(("DATA_ERROR: invalid macrograph name: \"%c\"\n", name)); /* FIXME: what should happen? */ break; } else { - char temp[8]; - TRACE(("got report macrograph request for name '%c'\n", name)); - sprintf(temp, "@=%c", name); - unparseputs(context->display_graphic->xw, temp); + unparseputs(xw, "@="); + unparseputc(xw, name); /* FIXME: Allow this to be disabled for security reasons. */ /* FIXME: implement when macrographs are supported. */ - unparseputs(context->display_graphic->xw, "@;\r"); - unparse_end(context->display_graphic->xw); + unparseputs(xw, "@;"); + unparseputc(xw, '\r'); + unparse_end(xw); } } break; @@ -5785,78 +5878,59 @@ parse_regis_option(RegisParseState *state, RegisGraphicsContext *context) TRACE(("got report cursor position (output=%d)\n", output)); /* FIXME: look into supporting ANSI locator reports (DECLRP) */ + unparseputc(xw, L_BLOK); if (output == 1) { - char reply[64]; + /* FIXME: verify in absolute, not user, coordinates */ + unparseputn(xw, (unsigned) context->graphics_output_cursor_x); + unparseputc(xw, ','); + unparseputn(xw, (unsigned) context->graphics_output_cursor_y); + } else if (context->multi_input_mode) { + /* FIXME: track input coordinates */ + unsigned x = 0, y = 0; /* placeholders */ + /* send CSI240~[x,y]\r with current input cursor location */ + + /* FIXME: verify no leading char or button sequence */ + /* FIXME: should we ever send an eight-bit CSI? */ /* FIXME: verify in absolute, not user, coordinates */ - sprintf(reply, "[%d,%d]\r", - context->graphics_output_cursor_x, - context->graphics_output_cursor_y); - unparseputs(context->display_graphic->xw, reply); - unparse_end(context->display_graphic->xw); + TRACE(("sending multi-mode input report at %u,%u\n", x, y)); + unparseputn(xw, x); + unparseputc(xw, ','); + unparseputn(xw, y); } else { - char reply[64]; - int x, y; - - if (context->multi_input_mode) { - /* FIXME: track input coordinates */ - x = y = 0; /* placeholders */ - - /* send CSI240~[x,y]\r with current input cursor location */ - - /* FIXME: verify no leading char or button sequence */ - /* FIXME: should we ever send an eight-bit CSI? */ - /* FIXME: verify in absolute, not user, coordinates */ - TRACE(("sending multi-mode input report at %d,%d\n", - x, y)); - sprintf(reply, "[%d,%d]\r", x, y); - unparseputs(context->display_graphic->xw, reply); - unparse_end(context->display_graphic->xw); - break; - } else { - char ch; - - /* FIXME: wait for first non-arrow keypress or mouse click, and don't update graphics while waiting */ - ch = ' '; /* placeholder */ - x = y = 0; /* placeholders */ - - /* send <key or button>[x,y]\r to report input cursor location */ - - /* null button: CSI240~ */ - /* left button: CSI241~ */ - /* middle button: CSI243~ */ - /* right button: CSI245~ */ - /* extra button: CSI247~ */ - /* FIXME: support DECLBD to change button assignments */ - /* FIXME: verify no leading char or button sequence */ - TRACE(("sending one-shot input report with %c at %d,%d\n", - ch, x, y)); -#if 0 /* FIXME - dead code */ - if (ch == '\r') { - /* Return only reports the location. */ - sprintf(reply, "[%d,%d]\r", x, y); - } else if (ch == '\177') { - /* DEL exits locator mode reporting nothing. */ - sprintf(reply, "\r"); - } else -#endif - { - sprintf(reply, "%c[%d,%d]\r", ch, x, y); - } - unparseputs(context->display_graphic->xw, reply); - unparse_end(context->display_graphic->xw); - /* FIXME: exit one-shot mode and disable input cursor */ - break; + char ch = ' '; /* placeholder */ + unsigned x = 0, y = 0; /* placeholders */ + + /* FIXME: wait for first non-arrow keypress or mouse click, and don't update graphics while waiting */ + /* send <key or button>[x,y]\r to report input cursor location */ + + /* null button: CSI240~ */ + /* left button: CSI241~ */ + /* middle button: CSI243~ */ + /* right button: CSI245~ */ + /* extra button: CSI247~ */ + /* FIXME: support DECLBD to change button assignments */ + /* FIXME: verify no leading char or button sequence */ + TRACE(("sending one-shot input report with %c at %u,%u\n", + ch, x, y)); + if (ch != '\177') { + unparseputn(xw, x); + unparseputc(xw, ','); + unparseputn(xw, y); } + /* FIXME: exit one-shot mode and disable input cursor */ } + unparseputc(xw, R_BLOK); + unparseputc(xw, '\r'); + unparse_end(xw); } break; default: TRACE(("DATA_ERROR: sending empty report for unknown ReGIS report command option '%c' arg \"%s\"\n", state->option, fragment_to_tempstr(&optionarg))); /* Unknown report request types must receive empty reports. */ - unparseputs(context->display_graphic->xw, "\r"); - unparse_end(context->display_graphic->xw); + unparseputs(xw, "\r"); + unparse_end(xw); break; } break; @@ -6060,7 +6134,7 @@ parse_regis_option(RegisParseState *state, RegisGraphicsContext *context) if (extract_regis_num(&optionarg, ®num)) { int register_num; int color_only; - short r, g, b; + ColorRegister my_reg; if (!regis_num_to_int(®num, ®ister_num)) { TRACE(("DATA_ERROR: unable to parse int in screen color register mapping option: \"%s\"\n", @@ -6093,10 +6167,17 @@ parse_regis_option(RegisParseState *state, RegisGraphicsContext *context) break; } - TRACE(("mapping register %d to color spec: \"%s\"\n", - register_num, fragment_to_tempstr(&colorspec))); - if (!load_regis_colorspec(context, &colorspec, - &r, &g, &b)) { + fetch_color_register(context->destination_graphic, + (RegisterNum) register_num, + &my_reg); + + TRACE(("mapping register %d %d,%d,%d to color spec: \"%s\"\n", + register_num, + my_reg.r, + my_reg.g, + my_reg.b, + fragment_to_tempstr(&colorspec))); + if (!load_regis_colorspec(context, &colorspec, &my_reg)) { TRACE(("DATA_ERROR: unable to use colorspec for mapping of register %d\n", register_num)); return 1; @@ -6106,13 +6187,13 @@ parse_regis_option(RegisParseState *state, RegisGraphicsContext *context) (context->graphics_termid == 240 || context->graphics_termid == 330)) { TRACE(("NOT setting color register %d to %hd,%hd,%hd\n", - register_num, r, g, b)); + register_num, my_reg.r, my_reg.g, my_reg.b)); } else { TRACE(("setting color register %d to %hd,%hd,%hd\n", - register_num, r, g, b)); + register_num, my_reg.r, my_reg.g, my_reg.b)); update_color_register(context->destination_graphic, (RegisterNum) register_num, - r, g, b); + my_reg.r, my_reg.g, my_reg.b); } continue; } { @@ -6154,7 +6235,7 @@ parse_regis_option(RegisParseState *state, RegisGraphicsContext *context) TRACE(("using display page number: %d\n", page)); context->display_page = (unsigned) page; - map_regis_graphics_pages(context->display_graphic->xw, context); + map_regis_graphics_pages(xw, context); } break; case 'T': @@ -7433,12 +7514,6 @@ parse_regis_toplevel(RegisParseState *state, RegisGraphicsContext *context) { RegisDataFragment parenthesized; char ch; -#if 0 - TRACE(("reference line: shading=%d ref=%u loc=%d\n", - context->temporary_write_controls.shading_enabled, - context->temporary_write_controls.shading_reference_dim, - context->temporary_write_controls.shading_reference)); -#endif #ifdef DEBUG_PARSING TRACE(("parsing top level: char %u of %u (next char '%c')\n", @@ -7582,6 +7657,13 @@ parse_regis_toplevel(RegisParseState *state, RegisGraphicsContext *context) } void +reset_regis(void) +{ + persistent_context.width = 0; + persistent_context.height = 0; +} + +void parse_regis(XtermWidget xw, ANSI *params, char const *string) { TScreen *screen = TScreenOf(xw); diff --git a/app/xterm/graphics_regis.h b/app/xterm/graphics_regis.h index d9a861ef3..196db6778 100644 --- a/app/xterm/graphics_regis.h +++ b/app/xterm/graphics_regis.h @@ -1,8 +1,8 @@ -/* $XTermId: graphics_regis.h,v 1.2 2016/05/29 16:34:47 tom Exp $ */ +/* $XTermId: graphics_regis.h,v 1.3 2023/07/07 20:10:32 tom Exp $ */ /* - * Copyright 2014,2016 by Ross Combs - * Copyright 2014,2016 by Thomas E. Dickey + * Copyright 2014-2016,2023 by Ross Combs + * Copyright 2014-2016,2023 by Thomas E. Dickey * * All Rights Reserved * @@ -38,8 +38,10 @@ #include <ptyx.h> #if OPT_REGIS_GRAPHICS +extern void reset_regis(void); extern void parse_regis(XtermWidget /* xw */, ANSI */* params */, char const */* string */); #else +#define reset_regis() /* nothing */ #define parse_regis(xw, params, string) /* nothing */ #endif diff --git a/app/xterm/graphics_sixel.c b/app/xterm/graphics_sixel.c index 876642289..4cb32ce90 100644 --- a/app/xterm/graphics_sixel.c +++ b/app/xterm/graphics_sixel.c @@ -1,8 +1,9 @@ -/* $XTermId: graphics_sixel.c,v 1.38 2022/10/10 15:09:41 tom Exp $ */ +/* $XTermId: graphics_sixel.c,v 1.62 2024/07/01 21:19:30 tom Exp $ */ /* - * Copyright 2014-2021,2022 by Ross Combs - * Copyright 2014-2021,2022 by Thomas E. Dickey + * Copyright 2014-2023,2024 by Thomas E. Dickey + * Copyright 2024 by Benjamin A. Wong + * Copyright 2014-2022,2023 by Ross Combs * * All Rights Reserved * @@ -46,57 +47,6 @@ #include <graphics_sixel.h> /***====================================================================***/ -/* - * Parse numeric parameters which have the operator as a prefix rather than a - * suffix as in ANSI format. - * - * # 0 - * #1 1 - * #1; 1 - * "1;2;640;480 4 - * #1;2;0;0;0 5 - */ -static void -parse_prefixedtype_params(ANSI *params, const char **string) -{ - const char *cp = *string; - ParmType nparam = 0; - int last_empty = 1; - - memset(params, 0, sizeof(*params)); - params->a_final = CharOf(*cp); - if (*cp != '\0') - cp++; - - while (*cp != '\0') { - Char ch = CharOf(*cp); - - if (isdigit(ch)) { - last_empty = 0; - if (nparam < NPARAM) { - params->a_param[nparam] = - (ParmType) ((params->a_param[nparam] * 10) - + (ch - '0')); - } - } else if (ch == ';') { - last_empty = 1; - nparam++; - } else if (ch == ' ' || ch == '\r' || ch == '\n') { - /* EMPTY */ ; - } else { - break; - } - cp++; - } - - *string = cp; - if (!last_empty) - nparam++; - if (nparam > NPARAM) - params->a_nparam = NPARAM; - else - params->a_nparam = nparam; -} typedef struct { RegisterNum current_register; @@ -109,6 +59,46 @@ typedef struct { int col; /* context used during parsing */ } SixelContext; +/* Saved state for the parse_sixel_char() state machine */ +static XtermWidget s_xw; +static TScreen *s_screen; +static Graphic *s_graphic; +static SixelContext s_context; +static int s_prev_row; /* Dirty graphic cursor last location for screen updating */ +static int s_prev_col; +static int s_accumulator; /* Accumulation of decimal digits. (-1 for no digits, use default) */ +static Boolean s_repeating; /* true if gathering digits for '!' (repeat) */ + +/* + * States for gathering params for '#' (color) + */ +static enum { + s_NOTCOLORING + ,s_GETTINGREGISTER + ,s_GETTINGCOLORSPACE + ,s_GETTINGPC1 + ,s_GETTINGPC2 + ,s_GETTINGPC3 + ,s_COLORINGDONE +} s_color_state; + +static int s_color_params[s_COLORINGDONE + 1]; +static RegisterNum s_Pregister; + +/* + * States for gathering params from DECGRA ('"' set raster attributes) + * Refer to EK-PPLV2-PM, page 5-24. + */ +static enum { + s_NOTRASTER + ,s_GETTINGPAN /* Pixel aspect ratio numerator */ + ,s_GETTINGPAD /* Pixel aspect ratio denominator */ + ,s_GETTINGV /* Pixel vertical extent */ + ,s_GETTINGH /* Pixel horizontal extent */ + ,s_RASTERDONE +} s_raster_state; +static int s_raster_params[s_RASTERDONE + 1]; + /* SIXEL SCROLLING, which is on by default in VT3xx terminals, can be * turned off to better emulate VT2xx terminals by setting Sixel * Display Mode (DECSDM) @@ -155,7 +145,7 @@ init_sixel_background(Graphic *graphic, SixelContext const *context) target += graphic->max_width; memcpy(target, source, length); } - graphic->color_registers_used[context->background] = 1; + graphic->color_registers_used[context->background] = True; } #define ValidColumn(graphic, context) \ @@ -204,80 +194,118 @@ set_sixel(Graphic *graphic, SixelContext const *context, int sixel) } static void -update_sixel_aspect(SixelContext const *context, Graphic *graphic) +update_sixel_aspect(SixelContext * context, Graphic *graphic) { + int limit; + int best; + int gcd; + /* We want to keep the ratio accurate but would like every pixel to have * the same size so keep these as whole numbers. */ - /* FIXME: DEC terminals had pixels about twice as tall as they were wide, - * and it seems the VT125 and VT24x only used data from odd graphic rows. - * This means it basically cancels out if we ignore both, except that - * the even rows of pixels may not be written by the application such that - * they are suitable for display. In practice this doesn't seem to be - * an issue but I have very few test files/programs. + + /* FIXME: The VT340 repeats pixels instead of spreading them out. */ + + /* FIXME: A single sixel DCS string can have multiple aspect ratios on + the VT340, but PPLv2 does not allow it. We currently neither implement + it nor explicitly ignore DECGRA after sixels have started. We probably + should allow for it as that is how genuine DEC hardware behaved. */ + + TRACE(("sixel updating pixel aspect (v:h): %d:%d\n", + context->aspect_vertical, context->aspect_horizontal)); + + /* + * Reduce to the lowest possible format, + * to handle ratios such as 2:3 and 16:9 */ - if (context->aspect_vertical < context->aspect_horizontal) { - graphic->pixw = 1; - graphic->pixh = ((context->aspect_vertical - + context->aspect_horizontal - 1) - / context->aspect_horizontal); - } else { - graphic->pixw = ((context->aspect_horizontal - + context->aspect_vertical - 1) - / context->aspect_vertical); - graphic->pixh = 1; + limit = Min(context->aspect_vertical, context->aspect_horizontal); + TRACE(("sixel aspect limit: %d\n", limit)); + best = 1; + for (gcd = 2; gcd <= limit; ++gcd) { + if ((context->aspect_vertical % gcd) == 0 + && (context->aspect_horizontal % gcd) == 0) { + best = gcd; + } } + TRACE(("sixel aspect gcd: %d\n", best)); + context->aspect_vertical /= best; + context->aspect_horizontal /= best; + + /* EK-PPLV2-PM-B01 says the range along either axis is no more than 10, + * which is good advice for programs creating images for generic "Level 2 + * Sixel" devices. + * + * FIXME: The converse is true when implementing a sixel rendering + * engine. As a *minimum* requirement, xterm must allow either axis to + * range from 1 to 10, but, just like the hardware it emulates, it may + * exceed specifications. + * + * The VT340 appears to have no practical limit. Even ratios over 480:1 + * -- where each pixel would exceed the screen height -- are allowed. + */ + if (context->aspect_vertical > (10 * context->aspect_horizontal)) + context->aspect_vertical = (10 * context->aspect_horizontal); + + if (context->aspect_horizontal > (10 * context->aspect_vertical)) + context->aspect_horizontal = (10 * context->aspect_vertical); + + /* in any case, limit "pixel" size if both are large */ +#define by10(n) n = (n + 5) / 10 + while (context->aspect_vertical >= 10 + && context->aspect_horizontal >= 10) { + by10(context->aspect_vertical); + by10(context->aspect_horizontal); + } + + graphic->pixw = context->aspect_horizontal; + graphic->pixh = context->aspect_vertical; + TRACE(("sixel aspect ratio: an=%d ad=%d -> pixw=%d pixh=%d\n", context->aspect_vertical, context->aspect_horizontal, graphic->pixw, graphic->pixh)); +#if 1 + /* FIXME: Aspect Ratio is buggy, so we'll just force it off */ + graphic->pixw = 1; + graphic->pixh = 1; +#endif } -static int -finished_parsing(XtermWidget xw, Graphic *graphic) +static void +finished_parsing(Graphic *graphic) { - TScreen *screen = TScreenOf(xw); + TScreen *screen = TScreenOf(s_xw); /* Update the screen scrolling and do a refresh. * The refresh may not cover the whole graphic. */ if (screen->scroll_amt) - FlushScroll(xw); + FlushScroll(s_xw); - if (SixelScrolling(xw)) { + if (SixelScrolling(s_xw)) { int new_row, new_col; + /* Note: XTerm follows the VT340 behavior in text cursor placement + * for nearly all sixel images. It differs in the few places where + * TWO newlines would have been necessary for subsequent text to not + * overwrite an image. XTerm always requires only a single newline. + * + * Emulating the VT340's quirky and undocumented behavior is of + * dubious value. The heuristic DEC used has nice properties, but + * only applies if the font is exactly 20 pixels high. + */ + new_row = (graphic->charrow - 1 + + (((graphic->actual_height * graphic->pixh) + + FontHeight(screen) - 1) + / FontHeight(screen))); + if (screen->sixel_scrolls_right) { - new_row = (graphic->charrow - + (((graphic->actual_height * graphic->pixh) - + FontHeight(screen) - 1) - / FontHeight(screen)) - - 1); new_col = (graphic->charcol + (((graphic->actual_width * graphic->pixw) + FontWidth(screen) - 1) / FontWidth(screen))); } else { - /* NOTE: XTerm follows the VT382 behavior in text cursor - * placement. The VT382's vertical position appears to be - * truncated (rounded toward zero) after converting to character - * row. While rounding up is more often what is desired, so as to - * not overwrite the image, doing so automatically would cause text - * or graphics to scroll off the top of the screen. Therefore, - * applications must add their own newline character, if desired, - * after a sixel image. - * - * FIXME: The VT340 also rounds down, but it seems to have a - * strange behavior where, on rare occasions, two newlines are - * required to advance beyond the end of the image. This appears - * to be a firmware bug, but it should be added as an option for - * compatibility. - */ - new_row = (graphic->charrow - 1 - + (((graphic->actual_height * graphic->pixh) - + FontHeight(screen) - 1) - / FontHeight(screen))); new_col = graphic->charcol; } @@ -299,7 +327,7 @@ finished_parsing(XtermWidget xw, Graphic *graphic) } while (new_row > screen->bot_marg) { - xtermScroll(xw, 1); + xtermScroll(s_xw, 1); new_row--; TRACE(("bottom row was past screen. new start row=%d, cursor row=%d\n", graphic->charrow, new_row)); @@ -316,292 +344,444 @@ finished_parsing(XtermWidget xw, Graphic *graphic) } graphic->dirty = True; - refresh_modified_displayed_graphics(xw); - - TRACE(("DONE parsed sixel data\n")); + refresh_modified_displayed_graphics(s_xw); dump_graphic(graphic); - return 0; } /* - * Interpret sixel graphics sequences. - * - * Resources: - * http://vt100.net/docs/vt3xx-gp/chapter14.html - * ftp://ftp.cs.utk.edu/pub/shuford/terminal/sixel_graphics_news.txt - * ftp://ftp.cs.utk.edu/pub/shuford/terminal/all_about_sixels.txt + * Handle Sixel protocol selector: Ps1 ; Ps2 ; Ps3 q + * Refer to EK-PPLV2-PM, Table 5-1 "Macro Parameter Selections" */ -int -parse_sixel(XtermWidget xw, ANSI *params, char const *string) +void +parse_sixel_init(XtermWidget xw, ANSI *params) { - TScreen *screen = TScreenOf(xw); - Graphic *graphic; - SixelContext context; - - switch (screen->terminal_id) { + s_xw = xw; + s_screen = TScreenOf(xw); + s_repeating = False; + s_accumulator = -1; /* No digits accumulated */ + s_context.aspect_horizontal = 1; + s_context.aspect_vertical = 2; + + switch (s_screen->terminal_id) { case 240: case 241: case 330: case 340: - context.aspect_vertical = 2; - context.aspect_horizontal = 1; + s_context.aspect_vertical = 2; + s_context.aspect_horizontal = 1; break; case 382: - context.aspect_vertical = 1; - context.aspect_horizontal = 1; + s_context.aspect_vertical = 1; + s_context.aspect_horizontal = 1; break; default: - context.aspect_vertical = 2; - context.aspect_horizontal = 1; + s_context.aspect_vertical = 2; + s_context.aspect_horizontal = 1; break; } - context.declared_width = 0; - context.declared_height = 0; + s_context.declared_width = 0; + s_context.declared_height = 0; + + s_context.row = 0; + s_context.col = 0; - context.row = 0; - context.col = 0; + s_prev_row = 0; + s_prev_col = 0; /* default isn't white on the VT240, but not sure what it is */ - context.current_register = 3; /* FIXME: using green, but not sure what it should be */ + s_context.current_register = 3; /* FIXME: using green, but not sure what it should be */ - if (SixelScrolling(xw)) { + /* allocate s_graphic if needs be */ + if (SixelScrolling(s_xw)) { TRACE(("sixel scrolling enabled: inline positioning for graphic at %d,%d\n", - screen->cur_row, screen->cur_col)); - graphic = get_new_graphic(xw, screen->cur_row, screen->cur_col, 0U); + s_screen->cur_row, s_screen->cur_col)); + s_graphic = get_new_graphic(s_xw, + s_screen->cur_row, + s_screen->cur_col, 0U); } else { TRACE(("sixel scrolling disabled: inline positioning for graphic at %d,%d\n", 0, 0)); - graphic = get_new_graphic(xw, 0, 0, 0U); + s_graphic = get_new_graphic(s_xw, 0, 0, 0U); } { - int Pmacro = params->a_param[0]; - int Pbgmode = params->a_param[1]; - int Phgrid = params->a_param[2]; - int Pan = params->a_param[3]; - int Pad = params->a_param[4]; - int Ph = params->a_param[5]; - int Pv = params->a_param[6]; - - (void) Phgrid; + static const int vertical[] = + { + /* 0 1 2 3 4 5 6 7 8 9 */ + 200, 200, 450, 300, 250, 183, 150, 130, 112, 100 + }; + int Pmacro = UParmOf(params->a_param[0]); + int Pbgmode = UParmOf(params->a_param[1]); + int Phgrid = UParmOf(params->a_param[2]); TRACE(("sixel bitmap graphics sequence: params=%d (Pmacro=%d Pbgmode=%d Phgrid=%d) scroll_amt=%d\n", params->a_nparam, Pmacro, Pbgmode, Phgrid, - screen->scroll_amt)); - - switch (params->a_nparam) { - case 7: - if (Pan == 0 || Pad == 0) { - TRACE(("DATA_ERROR: invalid raster ratio %d/%d\n", Pan, Pad)); - return -1; - } - context.aspect_vertical = Pan; - context.aspect_horizontal = Pad; + s_screen->scroll_amt)); - if (Ph <= 0 || Pv <= 0) { - TRACE(("DATA_ERROR: raster image dimensions are invalid %dx%d\n", - Ph, Pv)); - return -1; - } - if (Ph > graphic->max_width || Pv > graphic->max_height) { - TRACE(("DATA_ERROR: raster image dimensions are too large %dx%d\n", - Ph, Pv)); - return -1; - } - context.declared_width = Ph; - context.declared_height = Pv; - if (context.declared_width > graphic->actual_width) { - graphic->actual_width = context.declared_width; - } - if (context.declared_height > graphic->actual_height) { - graphic->actual_height = context.declared_height; - } - break; - case 3: - case 2: - case 1: - switch (Pmacro) { - case 0: - /* keep default aspect settings */ - break; - case 1: - case 5: - case 6: - context.aspect_vertical = 2; - context.aspect_horizontal = 1; - break; - case 2: - context.aspect_vertical = 5; - context.aspect_horizontal = 1; - break; - case 3: - case 4: - context.aspect_vertical = 3; - context.aspect_horizontal = 1; - break; - case 7: - case 8: - case 9: - context.aspect_vertical = 1; - context.aspect_horizontal = 1; - break; - default: - TRACE(("DATA_ERROR: unknown sixel macro mode parameter\n")); - return -1; - } - break; - case 0: - break; - default: - TRACE(("DATA_ERROR: unexpected parameter count (found %d)\n", params->a_nparam)); - return -1; + /* Ps1: "Macro" Aspect ratio and default grid size */ + /* + * Note: Macro is often left at 0 since its horizontal grid size can be + * overridden by Ps3 and its aspect ratio can be overridden by DECGRA. + */ + if (Pmacro > 9 || Pmacro < 0) { + Pmacro = 0; } + s_context.aspect_vertical = vertical[Pmacro]; + s_context.aspect_horizontal = 100; + /* Ps2: Background 0 or 2 = opaque, 1 = transparent */ if (Pbgmode == 1) { - context.background = COLOR_HOLE; + s_context.background = COLOR_HOLE; } else { - /* FIXME: is the default background register always zero? what about in light background mode? */ - context.background = 0; + /* The default background register is always zero (including in + * light background mode) on the VT340. + */ + s_context.background = 0; } - /* Ignore the grid parameter because it seems only printers paid attention to it. - * The VT3xx was always 0.0195 cm. + /* Ps3: horizontal grid size in decipoints (1/720 inch) */ + /* + * Note: The CRT of the VT340 had a grid (distance between pixels) + * of 10/720th of an inch (0.0195 cm). */ + if (Phgrid <= 0) { + Phgrid = 50; /* Default is 50 decipoints (144dpi) */ + } } - update_sixel_aspect(&context, graphic); + update_sixel_aspect(&s_context, s_graphic); +} - for (;;) { - Char ch = CharOf(*string); - if (ch == '\0') - break; +#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) +#define TS_NANOSEC 1L +#define TS_MICROSEC 1000L * TS_NANOSEC +#define TS_MILLISEC 1000L * TS_MICROSEC +#define TS_SEC 1000L * TS_MILLISEC - if (ch >= 0x3f && ch <= 0x7e) { - int sixel = ch - 0x3f; - TRACE(("sixel=%x (%c)\n", sixel, (char) ch)); - if (!graphic->valid) { - init_sixel_background(graphic, &context); - graphic->valid = True; - } - if (sixel) { - if (!ValidColumn(graphic, &context) || - !set_sixel(graphic, &context, sixel)) { - context.col = 0; - break; - } - } - context.col++; - } else if (ch == '$') { /* DECGCR */ - /* ignore DECCRNLM in sixel mode */ - TRACE(("sixel CR\n")); - context.col = 0; - } else if (ch == '-') { /* DECGNL */ - int scroll_lines; - TRACE(("sixel NL\n")); - scroll_lines = 0; - while (graphic->charrow - scroll_lines + - (((context.row + Min(6, graphic->actual_height - context.row)) - * graphic->pixh - + FontHeight(screen) - 1) - / FontHeight(screen)) > screen->bot_marg) { - scroll_lines++; - } - context.col = 0; - context.row += 6; - /* If we hit the bottom margin on the graphics page (well, we just use the - * text margin for now), the behavior is to either scroll or to discard - * the remainder of the graphic depending on this setting. - */ - if (scroll_lines > 0) { - if (SixelScrolling(xw)) { - Display *display = screen->display; - xtermScroll(xw, scroll_lines); - XSync(display, False); - TRACE(("graphic scrolled the screen %d lines. screen->scroll_amt=%d screen->topline=%d, now starting row is %d\n", - scroll_lines, - screen->scroll_amt, - screen->topline, - graphic->charrow)); - } else { - break; - } - } - } else if (ch == '!') { /* DECGRI */ - int Pcount; - const char *start; - int sixel; - - start = ++string; - for (;;) { - ch = CharOf(*string); - if (!(isdigit(ch) || isspace(ch))) - break; - string++; - } - if (ch == '\0') { - TRACE(("DATA_ERROR: sixel data string terminated in the middle of a repeat operator\n")); - return finished_parsing(xw, graphic); - } - if (string == start) { - TRACE(("DATA_ERROR: sixel data string contains a repeat operator with empty count\n")); - return finished_parsing(xw, graphic); - } - Pcount = atoi(start); - sixel = ch - 0x3f; +/* Returns True if the system's monotonic clock has reached or exceeded _when_. + * If _increment_ is not NULL, _when_ will be set to now + _increment_. + */ +static Boolean +times_up(struct timespec *when, struct timespec *increment) +{ + struct timespec now; + + clock_gettime(CLOCK_MONOTONIC, &now); + if (when->tv_sec < now.tv_sec + || (when->tv_sec == now.tv_sec + && when->tv_nsec < now.tv_nsec)) { + return False; + } + if (increment) { + when->tv_sec += now.tv_sec + increment->tv_sec; + when->tv_nsec += now.tv_nsec + increment->tv_nsec; + while (when->tv_nsec >= TS_SEC) { + when->tv_sec += 1; + when->tv_nsec -= TS_SEC; + } + } + return True; +} + +#endif + +static void +parse_sixel_incremental_display(void) +{ + /* Watch sixels appear just like a VT340! */ + int dirty_row = ((s_context.row * s_graphic->pixh) + + (s_graphic->charrow * FontHeight(s_screen))); + + int dirty_col = ((s_context.col * s_graphic->pixw) + + (s_graphic->charcol * FontWidth(s_screen))); + +#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) + static struct timespec next_refresh = + { + 0, 0 + }; + static struct timespec refresh_delay = + { + 0, TS_MILLISEC + }; + + /* Bundle up incremental refreshes that happen faster than visually + * perceptible. + */ + if (!times_up(&next_refresh, &refresh_delay)) { + return; + } +#endif + + if (dirty_row != s_prev_row) { + s_prev_row = dirty_row; + s_prev_col = 0; + } + + /* FIXME: Image should be cropped to the text cells when xtermmargin>0 */ + s_graphic->dirty = True; + refresh_displayed_graphics(s_xw, + s_prev_col / FontWidth(s_screen), + s_prev_row / FontHeight(s_screen), + 1 + 1 + (dirty_col - s_prev_col) / + FontWidth(s_screen), + 1); + s_prev_row = dirty_row; + s_prev_col = dirty_col; +} + +void +parse_sixel_char(char cp) +{ + /* s_* variables are static state, defined above */ + + if (cp == '\0' || isspace(cp)) { + if (s_repeating && cp == '\0') { + TRACE(("DATA_ERROR: sixel data string terminated in the middle of a repeat operator\n")); + s_repeating = False; + finished_parsing(s_graphic); + } + return; + } + + if (isdigit(cp)) { + if (s_accumulator == -1) + s_accumulator = 0; + s_accumulator *= 10; + s_accumulator += cp - '0'; + return; + } + + if (s_repeating) { /* '!' ... */ + /* Not space or digit, so it must be the sixel to show */ + if (cp >= 0x3F && cp <= 0x7E) { + int sixel = cp - 0x3f; TRACE(("sixel repeat operator: sixel=%d (%c), count=%d\n", - sixel, (char) ch, Pcount)); - if (!graphic->valid) { - init_sixel_background(graphic, &context); - graphic->valid = True; + sixel, (char) cp, s_accumulator)); + if (s_accumulator <= 0) { + /* If the repeat count is zero or omitted, it is treated as 1 */ + s_accumulator = 1; + } + if (!s_graphic->valid) { + init_sixel_background(s_graphic, &s_context); + s_graphic->valid = True; } if (sixel) { int i; - for (i = 0; i < Pcount; i++) { - if (ValidColumn(graphic, &context) && - set_sixel(graphic, &context, sixel)) { - context.col++; + for (i = 0; i < s_accumulator; i++) { + if (ValidColumn(s_graphic, &s_context) && + set_sixel(s_graphic, &s_context, sixel)) { + s_context.col++; } else { - context.col = 0; break; } } } else { - context.col += Pcount; + s_context.col += s_accumulator; } - } else if (ch == '#') { /* DECGCI */ - ANSI color_params; - int Pregister; - - parse_prefixedtype_params(&color_params, &string); - Pregister = color_params.a_param[0]; - if (Pregister >= (int) graphic->valid_registers) { - TRACE(("DATA_WARNING: sixel color operator uses out-of-range register %d\n", Pregister)); - /* FIXME: supposedly the DEC terminals wrapped register indices -- verify */ - while (Pregister >= (int) graphic->valid_registers) - Pregister -= (int) graphic->valid_registers; - TRACE(("DATA_WARNING: converted to %d\n", Pregister)); + } else { + TRACE(("DATA_ERROR: sixel data string ignoring repeat operator followed by control: %c (%d)\n", + cp, cp)); + s_repeating = False; + } + s_accumulator = -1; + s_repeating = False; + if (s_screen->incremental_graphics) + parse_sixel_incremental_display(); + return; + } + + /* FIXME: Raster attributes (") can occur repeatedly and at any time. */ + /* Parse the Raster Attributes ( " Pn1 ; Pn2 ; Pn3 ; Pn4 ) */ + if (s_raster_state > s_NOTRASTER) { + TRACE(("sixel DECGRA raster argument found %d, followed by '%c'\n", + s_accumulator, cp)); + + /* cp is not a digit or space, so save the accumulator */ + if (s_accumulator != -1) { + s_raster_params[s_raster_state] = s_accumulator; + } + + switch (s_raster_state) { + +#define GetAspect(state) \ + case state: \ + if (s_raster_params[state] <= 0) { \ + s_raster_params[state] = 1; \ + } else if (s_raster_params[state] > MaxSParm) { \ + s_raster_params[state] = MaxSParm; \ + } \ + break + + GetAspect(s_GETTINGPAN); + GetAspect(s_GETTINGPAD); + +#define GetExtent(state, field) \ + case state: \ + if (s_raster_params[state] <= 0) { \ + s_raster_params[state] = 1; \ + } \ + if (s_raster_params[state] > s_graphic->max_ ## field) { \ + TRACE(("DATA_ERROR: raster " #field " %d > max %d\n", \ + s_raster_params[state], s_graphic->max_ ## field)); \ + s_raster_state = s_NOTRASTER; \ + finished_parsing(s_graphic); \ + return; \ + } \ + s_context.declared_ ## field = s_raster_params[state]; \ + break + + GetExtent(s_GETTINGV, height); + GetExtent(s_GETTINGH, width); + + case s_NOTCOLORING: + case s_RASTERDONE: + /* ignore unreachable states */ + break; + default: + TRACE(("DATA_ERROR: raster operator ('\"') with too many parameters (%d)\n, next char %c (%d)\n", + s_raster_state, cp, cp)); + s_raster_state = s_NOTRASTER; + finished_parsing(s_graphic); + return; + } + + /* Save data from Raster Attributes */ + /* *INDENT-EQLS* */ + s_context.aspect_vertical = s_raster_params[s_GETTINGPAN]; + s_context.aspect_horizontal = s_raster_params[s_GETTINGPAD]; + update_sixel_aspect(&s_context, s_graphic); + s_context.declared_width = s_raster_params[s_GETTINGV]; + s_context.declared_height = s_raster_params[s_GETTINGH]; + + s_accumulator = -1; + s_raster_state++; + + if (cp == ';') { + return; + } + + /* cp (next character to consume) is not digit, space, or semicolon, so finish up with raster */ + s_raster_state = s_NOTRASTER; + + /* FIXME: Declared size should clear & scroll rectangle when no raster attributes */ + if (s_context.declared_width > s_graphic->actual_width) { + s_graphic->actual_width = s_context.declared_width; + } + if (s_context.declared_height > s_graphic->actual_height) { + s_graphic->actual_height = s_context.declared_height; + } + + /* FALLTHRU TO PROCESS cp */ + } + + if (s_color_state > s_NOTCOLORING) { + /* cp is not a digit or space, so process the accumulator */ + if (s_accumulator != -1) { + s_color_params[s_color_state] = s_accumulator; + } + switch (s_color_state) { + case s_GETTINGREGISTER: + if (s_accumulator == -1) { + /* FIXME: What does VT340 do with default register? */ + TRACE(("DATA_ERROR: sixel data string uses default color register, next char %c (%d)\n", + cp, cp)); + finished_parsing(s_graphic); + return; + } + s_Pregister = (RegisterNum) s_color_params[s_GETTINGREGISTER]; + /* The DEC terminals wrapped register indices. */ + s_Pregister %= (RegisterNum) s_graphic->valid_registers; + TRACE(("sixel switch to color register=%u\n", s_Pregister)); + s_context.current_register = s_Pregister; + break; + case s_GETTINGCOLORSPACE: + if (s_accumulator == -1) { + /* FIXME: Default VT340 colorspace is HSL, right? */ + TRACE(("DATA_ERROR: sixel data string uses default colorspace \n")); + s_color_state = s_NOTCOLORING; + finished_parsing(s_graphic); + return; + } + break; + case s_GETTINGPC1: + if (s_accumulator == -1) { + /* FIXME: Does VT340 sixel do the same as ReGIS and use the previous value for unspecified color components? */ + TRACE(("DATA_ERROR: sixel data string uses default color component 1 \n")); + s_color_state = s_NOTCOLORING; + finished_parsing(s_graphic); + return; + } + break; + case s_GETTINGPC2: + if (s_accumulator == -1) { + /* FIXME: unspecified color components? */ + TRACE(("DATA_ERROR: sixel data string uses default color component 2 \n")); + s_color_state = s_NOTCOLORING; + finished_parsing(s_graphic); + return; + } + break; + case s_GETTINGPC3: + if (s_accumulator == -1) { + /* FIXME: unspecified color components? */ + TRACE(("DATA_ERROR: sixel data string uses default color component 3 \n")); + s_color_state = s_NOTCOLORING; + finished_parsing(s_graphic); + return; + } + break; + case s_COLORINGDONE: + case s_NOTCOLORING: + /* ignore unreachable states */ + break; + default: + /* FIXME: Why abort if too many parameters? Doesn't DEC ignore unknown parameters? */ + TRACE(("DATA_ERROR: sixel switch color operator ('#') with too many parameters\n, next char %c (%d)\n", + cp, cp)); + s_color_state = s_NOTCOLORING; + finished_parsing(s_graphic); + return; + } + + s_accumulator = -1; + s_color_state++; + + if (cp == ';') { + return; + } else { + /* cp (next character to consume) is not digit, space, or semicolon, so finish up with color */ + if (s_color_state != s_COLORINGDONE && s_color_state != s_GETTINGCOLORSPACE) { + TRACE(("DATA_ERROR: sixel switch color operator with wrong number of parameters (%d)\n", s_color_state)); + s_color_state = s_NOTCOLORING; + finished_parsing(s_graphic); + return; } - if (color_params.a_nparam > 2 && color_params.a_nparam <= 5) { - int Pspace = color_params.a_param[1]; - int Pc1 = color_params.a_param[2]; - int Pc2 = color_params.a_param[3]; - int Pc3 = color_params.a_param[4]; + if (s_color_state == s_COLORINGDONE) { + /* We've got all components, so set the color register */ + int Pspace = s_color_params[s_GETTINGCOLORSPACE]; + int Pc1 = s_color_params[s_GETTINGPC1]; + int Pc2 = s_color_params[s_GETTINGPC2]; + int Pc3 = s_color_params[s_GETTINGPC3]; short r, g, b; - TRACE(("sixel set color register=%d space=%d color=[%d,%d,%d] (nparams=%d)\n", - Pregister, Pspace, Pc1, Pc2, Pc3, color_params.a_nparam)); + s_color_state = s_NOTCOLORING; + TRACE(("sixel set color register=%u space=%d color=[%d,%d,%d]\n", + s_Pregister, Pspace, Pc1, Pc2, Pc3)); switch (Pspace) { case 1: /* HLS */ if (Pc1 > 360 || Pc2 > 100 || Pc3 > 100) { TRACE(("DATA_ERROR: sixel set color operator uses out-of-range HLS color coordinates %d,%d,%d\n", Pc1, Pc2, Pc3)); - return finished_parsing(xw, graphic); + s_color_state = s_NOTCOLORING; + finished_parsing(s_graphic); + return; } hls2rgb(Pc1, Pc2, Pc3, &r, &g, &b); break; @@ -609,7 +789,9 @@ parse_sixel(XtermWidget xw, ANSI *params, char const *string) if (Pc1 > 100 || Pc2 > 100 || Pc3 > 100) { TRACE(("DATA_ERROR: sixel set color operator uses out-of-range RGB color coordinates %d,%d,%d\n", Pc1, Pc2, Pc3)); - return finished_parsing(xw, graphic); + s_color_state = s_NOTCOLORING; + finished_parsing(s_graphic); + return; } r = (short) Pc1; g = (short) Pc2; @@ -617,75 +799,96 @@ parse_sixel(XtermWidget xw, ANSI *params, char const *string) break; default: /* unknown */ TRACE(("DATA_ERROR: sixel set color operator uses unknown color space %d\n", Pspace)); - return finished_parsing(xw, graphic); + s_color_state = s_NOTCOLORING; + finished_parsing(s_graphic); + return; } - update_color_register(graphic, - (RegisterNum) Pregister, + update_color_register(s_graphic, + s_Pregister, r, g, b); - } else if (color_params.a_nparam == 1) { - TRACE(("sixel switch to color register=%d (nparams=%d)\n", - Pregister, color_params.a_nparam)); - context.current_register = (RegisterNum) Pregister; - } else { - TRACE(("DATA_ERROR: sixel switch color operator with unexpected parameter count (nparams=%d)\n", color_params.a_nparam)); - return finished_parsing(xw, graphic); - } - continue; - } else if (ch == '"') /* DECGRA */ { - ANSI raster_params; - - parse_prefixedtype_params(&raster_params, &string); - if (raster_params.a_nparam < 2) { - TRACE(("DATA_ERROR: sixel raster attribute operator with incomplete parameters (found %d, expected 2 or 4)\n", raster_params.a_nparam)); - return finished_parsing(xw, graphic); - } { - int Pan = raster_params.a_param[0]; - int Pad = raster_params.a_param[1]; - TRACE(("sixel raster attribute with h:w=%d:%d\n", Pan, Pad)); - if (Pan == 0 || Pad == 0) { - TRACE(("DATA_ERROR: invalid raster ratio %d/%d\n", Pan, Pad)); - return finished_parsing(xw, graphic); - } - context.aspect_vertical = Pan; - context.aspect_horizontal = Pad; - update_sixel_aspect(&context, graphic); } - if (raster_params.a_nparam >= 4) { - int Ph = raster_params.a_param[2]; - int Pv = raster_params.a_param[3]; + s_color_state = s_NOTCOLORING; + /* FALLTHRU TO PROCESS cp */ + } + } - TRACE(("sixel raster attribute with h=%d v=%d\n", Ph, Pv)); - if (Ph <= 0 || Pv <= 0) { - TRACE(("DATA_ERROR: raster image dimensions are invalid %dx%d\n", - Ph, Pv)); - return finished_parsing(xw, graphic); - } - if (Ph > graphic->max_width || Pv > graphic->max_height) { - TRACE(("DATA_ERROR: raster image dimensions are too large %dx%d\n", - Ph, Pv)); - return finished_parsing(xw, graphic); - } - context.declared_width = Ph; - context.declared_height = Pv; - if (context.declared_width > graphic->actual_width) { - graphic->actual_width = context.declared_width; - } - if (context.declared_height > graphic->actual_height) { - graphic->actual_height = context.declared_height; + if (cp >= 0x3f && cp <= 0x7e) { + int sixel = cp - 0x3f; + TRACE(("sixel=%x (%c)\n", sixel, (char) cp)); + if (!s_graphic->valid) { + init_sixel_background(s_graphic, &s_context); + s_graphic->valid = True; + } + if (sixel) { + if (!ValidColumn(s_graphic, &s_context) || + !set_sixel(s_graphic, &s_context, sixel)) { + return; + } + } + s_context.col++; + if (s_screen->incremental_graphics) + parse_sixel_incremental_display(); + } else if (cp == '$') { /* DECGCR */ + /* ignore DECCRNLM in sixel mode */ + TRACE(("sixel CR\n")); + s_context.col = 0; + } else if (cp == '-') { /* DECGNL */ + int scroll_lines; + TRACE(("sixel NL: ")); + scroll_lines = 0; + while (s_graphic->charrow - scroll_lines + + (((s_context.row + Min(6, s_graphic->actual_height - s_context.row)) + * s_graphic->pixh + + FontHeight(s_screen) - 1) + / FontHeight(s_screen)) > s_screen->bot_marg) { + scroll_lines++; + } + s_context.col = 0; + s_context.row += 6; + TRACE2(("new row location is %u\n", s_context.row)); + /* If we hit the bottom margin on the graphics page (well, we just use + * the text margin for now), the behavior is to either scroll or to + * discard the remainder of the graphic depending on this setting. + */ + if (scroll_lines > 0) { + if (SixelScrolling(s_xw)) { + xtermScroll(s_xw, scroll_lines); + if (s_screen->incremental_graphics) { + FlushScroll(s_xw); + XSync(s_screen->display, False); + s_graphic->dirty = True; + refresh_modified_displayed_graphics(s_xw); } + TRACE(("graphic scrolled the screen %d lines. s_screen->scroll_amt=%d s_screen->topline=%d, now starting row is %d\n", + scroll_lines, + s_screen->scroll_amt, + s_screen->topline, + s_graphic->charrow)); } - - continue; - } else if (ch == ' ' || ch == '\r' || ch == '\n') { - /* EMPTY */ ; - } else { - TRACE(("DATA_ERROR: skipping unknown sixel command %04x (%c)\n", - (int) ch, ch)); } - - string++; + } else if (cp == '!') { /* DECGRI */ + s_repeating = True; + s_accumulator = -1; + } else if (cp == '#') { /* DECGCI */ + s_color_state = s_GETTINGREGISTER; + s_accumulator = -1; + } else if (cp == '"') { /* DECGRA */ + s_raster_state = s_GETTINGPAN; + s_accumulator = -1; + s_raster_params[s_GETTINGPAN] = 1; /* Default if not specified */ + s_raster_params[s_GETTINGPAD] = 1; /* Default if not specified */ + s_raster_params[s_GETTINGH] = 0; /* Default if not specified */ + s_raster_params[s_GETTINGV] = 0; /* Default if not specified */ + } else { + TRACE(("DATA_ERROR: skipping unknown sixel command %04x (%c)\n", + (int) cp, cp)); } +} - return finished_parsing(xw, graphic); +/* Just like finished_parsing, but called from charproc.c */ +void +parse_sixel_finished(void) +{ + finished_parsing(s_graphic); } diff --git a/app/xterm/graphics_sixel.h b/app/xterm/graphics_sixel.h index 6e2e35dfd..ef590a054 100644 --- a/app/xterm/graphics_sixel.h +++ b/app/xterm/graphics_sixel.h @@ -1,8 +1,8 @@ -/* $XTermId: graphics_sixel.h,v 1.4 2016/05/29 16:35:11 tom Exp $ */ +/* $XTermId: graphics_sixel.h,v 1.9 2024/07/01 21:19:14 tom Exp $ */ /* + * Copyright 2014-2016,2024 by Thomas E. Dickey * Copyright 2014,2016 by Ross Combs - * Copyright 2014,2016 by Thomas E. Dickey * * All Rights Reserved * @@ -38,9 +38,9 @@ #include <ptyx.h> #if OPT_SIXEL_GRAPHICS -extern int parse_sixel(XtermWidget /* xw */, ANSI */* params */, char const */* string */); -#else -#define parse_sixel(xw, params, string) /* nothing */ +extern void parse_sixel_init(XtermWidget /* xw */, ANSI * /* params */); +extern void parse_sixel_char(char /* cp */); +extern void parse_sixel_finished(void); #endif /* *INDENT-ON* */ diff --git a/app/xterm/input.c b/app/xterm/input.c index b7691cf14..a7162aab7 100644 --- a/app/xterm/input.c +++ b/app/xterm/input.c @@ -1,7 +1,7 @@ -/* $XTermId: input.c,v 1.369 2022/11/24 12:48:54 tom Exp $ */ +/* $XTermId: input.c,v 1.370 2023/05/09 08:14:04 tom Exp $ */ /* - * Copyright 1999-2021,2022 by Thomas E. Dickey + * Copyright 1999-2022,2023 by Thomas E. Dickey * * All Rights Reserved * @@ -1204,8 +1204,7 @@ Input(XtermWidget xw, reply.a_param[0] = (ParmType) dec_code; reply.a_final = '~'; } - if (reply.a_final != 0 - && (reply.a_nparam == 0 || reply.a_param[0] >= 0)) + if (reply.a_nparam == 0 || reply.a_param[0] >= 0) unparseseq(xw, &reply); } key = True; diff --git a/app/xterm/koi8rxterm b/app/xterm/koi8rxterm index cbabaed20..d9caf4e32 100644 --- a/app/xterm/koi8rxterm +++ b/app/xterm/koi8rxterm @@ -1,9 +1,9 @@ #!/bin/sh -# $XTermId: koi8rxterm,v 1.6 2021/01/27 01:35:34 tom Exp $ +# $XTermId: koi8rxterm,v 1.7 2023/05/03 23:59:22 tom Exp $ # ----------------------------------------------------------------------------- # this file is part of xterm # -# Copyright 2007,2021 by Thomas E. Dickey +# Copyright 2007-2021,2023 by Thomas E. Dickey # # All Rights Reserved # @@ -112,4 +112,4 @@ fi # for testing: #test -f ./xterm && XTERM_PROGRAM=./xterm -exec "$XTERM_PROGRAM" -class KOI8RXTerm -title "$whoami" -k8 "$@" +exec "$XTERM_PROGRAM" -class KOI8RXTerm -k8 "$@" diff --git a/app/xterm/koi8rxterm.man b/app/xterm/koi8rxterm.man index fb9805af3..2364b4d21 100644 --- a/app/xterm/koi8rxterm.man +++ b/app/xterm/koi8rxterm.man @@ -1,6 +1,6 @@ -.\" $XTermId: koi8rxterm.man,v 1.8 2018/06/23 00:19:53 tom Exp $ +.\" $XTermId: koi8rxterm.man,v 1.9 2024/01/11 21:55:09 tom Exp $ .\" -.\" Copyright 2007-2012, 2018 Thomas E. Dickey +.\" Copyright 2007-2018,2024 Thomas E. Dickey .\" Copyright 2004 Branden Robinson .\" .\" Permission is hereby granted, free of charge, to any person obtaining a @@ -24,16 +24,24 @@ .ds N Koi8rxterm .ds n koi8rxterm .\" -.ie \n(.g .ds AQ \(aq -.el .ds AQ ' -.ie \n(.g .ds `` \(lq -.el .ds `` `` -.ie \n(.g .ds '' \(rq -.el .ds '' '' -.\" .TH KOI8RXTERM 1 "__app_date__" "__app_version__" "X Window System" +.\" +.ie \n(.g \{\ +.ds `` \(lq +.ds '' \(rq +.ds ' \(aq +.\} +.el \{\ +.ie t .ds `` `` +.el .ds `` "" +.ie t .ds '' '' +.el .ds '' "" +.ie t .ds ' \(aq +.el .ds ' ' +.\} .SH NAME -koi8rxterm \- X terminal emulator for KOI8-R environments +koi8rxterm \- +X terminal emulator for KOI8-R environments .SH SYNOPSIS .B \*n [ @@ -95,7 +103,7 @@ is available for Unicode UTF-8 environments. .B LC_ALL\fR, \fBLC_CTYPE\fR, \fBLANG The values of these variables are checked, in order, to determine the character set used by the current locale. -.SH AUTHOR +.SH AUTHORS .B \*n was written by Branden Robinson and is very heavily based on .BR uxterm , diff --git a/app/xterm/linedata.c b/app/xterm/linedata.c index 9b439560f..e9b775214 100644 --- a/app/xterm/linedata.c +++ b/app/xterm/linedata.c @@ -1,7 +1,7 @@ -/* $XTermId: linedata.c,v 1.102 2022/09/18 21:17:43 tom Exp $ */ +/* $XTermId: linedata.c,v 1.106 2023/12/31 20:12:06 tom Exp $ */ /* - * Copyright 2009-2021,2022 by Thomas E. Dickey + * Copyright 2009-2022,2023 by Thomas E. Dickey * * All Rights Reserved * @@ -92,6 +92,10 @@ copyLineData(LineData *dst, CLineData *src) #if OPT_WIDE_CHARS + sizeof(dst->combData[0][0]) * dst->combSize #endif +#if OPT_DEC_RECTOPS + + sizeof(dst->charSeen[0]) + + sizeof(dst->charSets[0]) +#endif ); memcpy(dst->attribs, src->attribs, size * dst->lineSize); @@ -110,6 +114,10 @@ copyLineData(LineData *dst, CLineData *src) dst->color[col] = src->color[col]; #endif dst->charData[col] = src->charData[col]; +#if OPT_DEC_RECTOPS + dst->charSeen[col] = src->charSeen[col]; + dst->charSets[col] = src->charSets[col]; +#endif #if OPT_WIDE_CHARS for (comb = 0; comb < dst->combSize; ++comb) { dst->combData[comb][col] = src->combData[comb][col]; @@ -122,6 +130,10 @@ copyLineData(LineData *dst, CLineData *src) dst->color[col] = initCColor; #endif dst->charData[col] = 0; +#if OPT_DEC_RECTOPS + dst->charSeen[col] = 0; + dst->charSets[col] = 0; +#endif #if OPT_WIDE_CHARS for (comb = 0; comb < dst->combSize; ++comb) { dst->combData[comb][col] = 0; @@ -175,6 +187,10 @@ initLineData(XtermWidget xw) #if OPT_WIDE_CHARS TRACE((" offset(combSize) %lu\n", (unsigned long) offsetof(LineData, combSize))); #endif +#if OPT_DEC_RECTOPS + TRACE((" offset(*charSeen) %lu\n", (unsigned long) offsetof(LineData, charSeen))); + TRACE((" offset(*charSets) %lu\n", (unsigned long) offsetof(LineData, charSets))); +#endif TRACE((" offset(*attribs) %lu\n", (unsigned long) offsetof(LineData, attribs))); #if OPT_ISO_COLORS TRACE((" offset(*color) %lu\n", (unsigned long) offsetof(LineData, color))); @@ -190,6 +206,10 @@ initLineData(XtermWidget xw) #if OPT_WIDE_CHARS TRACE((" offset(combSize) %lu\n", (unsigned long) offsetof(CellData, combSize))); #endif +#if OPT_DEC_RECTOPS + TRACE((" offset(charSeen) %lu\n", (unsigned long) offsetof(CellData, charSeen))); + TRACE((" offset(charSets) %lu\n", (unsigned long) offsetof(CellData, charSets))); +#endif #if OPT_ISO_COLORS TRACE((" offset(color) %lu\n", (unsigned long) offsetof(CellData, color))); #endif @@ -234,7 +254,10 @@ saveCellData(TScreen *screen, if_OPT_ISO_COLORS(screen, { item->color = ld->color[column]; }); - item->charData = ld->charData[column]; + if_OPT_DEC_RECTOPS({ + item->charSeen = ld->charSeen[column]; + item->charData = ld->charData[column]; + }); if_OPT_WIDE_CHARS(screen, { size_t off; Bool blank = (((item->charData == HIDDEN_CHAR) @@ -245,9 +268,13 @@ saveCellData(TScreen *screen, && (limits == NULL || (column + 1) >= limits->right))); if (blank) { + if_OPT_DEC_RECTOPS(item->charSeen = ' '); item->charData = (CharData) ' '; } item->combSize = blank ? 0 : ld->combSize; + if_OPT_DEC_RECTOPS(item->charSets = (blank + ? 0 + : ld->charSets[column])); for_each_combData(off, item) { item->combData[off] = ld->combData[off][column]; } @@ -273,10 +300,15 @@ restoreCellData(TScreen *screen, if_OPT_ISO_COLORS(screen, { ld->color[column] = item->color; }); + if_OPT_DEC_RECTOPS({ + ld->charSeen[column] = item->charSeen; + ld->charSets[column] = item->charSets; + }); ld->charData[column] = item->charData; if_OPT_WIDE_CHARS(screen, { size_t off; ld->combSize = item->combSize; + if_OPT_DEC_RECTOPS(ld->charSets[column] = item->charSets); for_each_combData(off, ld) { ld->combData[off][column] = item->combData[off]; } diff --git a/app/xterm/main.c b/app/xterm/main.c index d101aa357..661a11cb2 100644 --- a/app/xterm/main.c +++ b/app/xterm/main.c @@ -1,7 +1,7 @@ -/* $XTermId: main.c,v 1.892 2023/01/09 00:28:06 tom Exp $ */ +/* $XTermId: main.c,v 1.923 2024/07/09 08:03:49 tom Exp $ */ /* - * Copyright 2002-2022,2023 by Thomas E. Dickey + * Copyright 2002-2023,2024 by Thomas E. Dickey * * All Rights Reserved * @@ -93,6 +93,19 @@ #include <version.h> #include <graphics.h> +/* xterm uses these X Toolkit resource names, which are exported in array */ +#undef XtNborderWidth +#undef XtNiconName +#undef XtNgeometry +#undef XtNreverseVideo +#undef XtNtitle + +#define XtNborderWidth "borderWidth" +#define XtNgeometry "geometry" +#define XtNiconName "iconName" +#define XtNreverseVideo "reverseVideo" +#define XtNtitle "title" + #if OPT_TOOLBAR #if defined(HAVE_LIB_XAW) @@ -145,7 +158,7 @@ static GCC_NORETURN void hungtty(int); static GCC_NORETURN void Syntax(char *); static GCC_NORETURN void HsSysError(int); -#if defined(__SCO__) || defined(SVR4) || defined(_POSIX_SOURCE) || ( defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 1) ) +#if defined(__SCO__) || defined(SVR4) || defined(_POSIX_VERSION) || ( defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 1) ) #define USE_POSIX_SIGNALS #endif @@ -159,16 +172,14 @@ static GCC_NORETURN void HsSysError(int); #define KANJI #endif -#ifdef linux +#ifdef __linux__ #define USE_SYSV_PGRP #define USE_SYSV_SIGNALS #define WTMP -#ifdef __GLIBC__ -#if (__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 1)) +#ifdef HAVE_PTY_H #include <pty.h> #endif #endif -#endif #ifdef __MVS__ #define USE_SYSV_PGRP @@ -185,7 +196,7 @@ static GCC_NORETURN void HsSysError(int); #endif #endif -#if defined(__GLIBC__) && !defined(linux) +#if defined(__GLIBC__) && !defined(__linux__) #define USE_SYSV_PGRP #define WTMP #endif @@ -278,7 +289,7 @@ ttyslot(void) #define setpgrp setpgid #endif -#ifndef linux +#ifndef __linux__ #ifndef VMS #ifndef USE_POSIX_TERMIOS #ifndef USE_ANY_SYSV_TERMIO @@ -291,7 +302,7 @@ ttyslot(void) #include <sys/resource.h> #endif #endif /* !VMS */ -#endif /* !linux */ +#endif /* !__linux__ */ #endif /* __QNX__ */ @@ -311,6 +322,7 @@ ttyslot(void) #endif #include <stdio.h> +#include <math.h> #ifdef __hpux #include <sys/utsname.h> @@ -425,7 +437,7 @@ int utmp_fd = -1; #include <signal.h> -#if defined(__SCO__) || (defined(ISC) && !defined(_POSIX_SOURCE)) +#if defined(__SCO__) || (defined(ISC) && !defined(_POSIX_VERSION)) #undef SIGTSTP /* defined, but not the BSD way */ #endif @@ -504,9 +516,6 @@ static char **command_to_exec_with_luit = NULL; static unsigned command_length_with_luit = 0; #endif -#define TERMCAP_ERASE "kb" -#define VAL_INITIAL_ERASE A2E(8) - /* choose a nice default value for speed - if we make it too low, users who * mistakenly use $TERM set to vt100 will get padding delays. Setting it to a * higher value is not useful since legacy applications (termcap) that care @@ -587,18 +596,6 @@ static unsigned command_length_with_luit = 0; #define CWERASE CONTROL('W') #endif -#ifdef USE_ANY_SYSV_TERMIO -#define TERMIO_STRUCT struct termio -#define ttySetAttr(fd, datap) ioctl(fd, TCSETA, datap) -#define ttyGetAttr(fd, datap) ioctl(fd, TCGETA, datap) -#define ttyFlush(fd) ioctl(fd, TCFLSH, 1) -#elif defined(USE_POSIX_TERMIOS) -#define TERMIO_STRUCT struct termios -#define ttySetAttr(fd, datap) tcsetattr(fd, TCSANOW, datap) -#define ttyGetAttr(fd, datap) tcgetattr(fd, datap) -#define ttyFlush(fd) tcflush(fd, TCOFLUSH) -#endif /* USE_ANY_SYSV_TERMIO */ - #ifndef VMS #ifdef TERMIO_STRUCT /* The following structures are initialized in main() in order @@ -887,82 +884,82 @@ static sigjmp_buf env; static XtResource application_resources[] = { - Sres("iconGeometry", "IconGeometry", icon_geometry, NULL), + Sres(XtNiconGeometry, XtCIconGeometry, icon_geometry, NULL), Sres(XtNtitle, XtCTitle, title, NULL), Sres(XtNiconHint, XtCIconHint, icon_hint, NULL), Sres(XtNiconName, XtCIconName, icon_name, NULL), - Sres("termName", "TermName", term_name, NULL), - Sres("ttyModes", "TtyModes", tty_modes, NULL), - Sres("validShells", "ValidShells", valid_shells, NULL), - Bres("hold", "Hold", hold_screen, False), - Bres("utmpInhibit", "UtmpInhibit", utmpInhibit, False), - Bres("utmpDisplayId", "UtmpDisplayId", utmpDisplayId, True), - Bres("messages", "Messages", messages, True), - Ires("minBufSize", "MinBufSize", minBufSize, 4096), - Ires("maxBufSize", "MaxBufSize", maxBufSize, 32768), - Sres("menuLocale", "MenuLocale", menuLocale, DEF_MENU_LOCALE), - Sres("omitTranslation", "OmitTranslation", omitTranslation, NULL), - Sres("keyboardType", "KeyboardType", keyboardType, "unknown"), + Sres(XtNtermName, XtCTermName, term_name, NULL), + Sres(XtNttyModes, XtCTtyModes, tty_modes, NULL), + Sres(XtNvalidShells, XtCValidShells, valid_shells, NULL), + Bres(XtNhold, XtCHold, hold_screen, False), + Bres(XtNutmpInhibit, XtCUtmpInhibit, utmpInhibit, False), + Bres(XtNutmpDisplayId, XtCUtmpDisplayId, utmpDisplayId, True), + Bres(XtNmessages, XtCMessages, messages, True), + Ires(XtNminBufSize, XtCMinBufSize, minBufSize, 4096), + Ires(XtNmaxBufSize, XtCMaxBufSize, maxBufSize, 32768), + Sres(XtNmenuLocale, XtCMenuLocale, menuLocale, DEF_MENU_LOCALE), + Sres(XtNomitTranslation, XtCOmitTranslation, omitTranslation, NULL), + Sres(XtNkeyboardType, XtCKeyboardType, keyboardType, "unknown"), #ifdef HAVE_LIB_XCURSOR - Sres("cursorTheme", "CursorTheme", cursorTheme, "none"), + Sres(XtNcursorTheme, XtCCursorTheme, cursorTheme, "none"), #endif #if OPT_PRINT_ON_EXIT - Ires("printModeImmediate", "PrintModeImmediate", printModeNow, 0), - Ires("printOptsImmediate", "PrintOptsImmediate", printOptsNow, 9), - Sres("printFileImmediate", "PrintFileImmediate", printFileNow, NULL), - Ires("printModeOnXError", "PrintModeOnXError", printModeOnXError, 0), - Ires("printOptsOnXError", "PrintOptsOnXError", printOptsOnXError, 9), - Sres("printFileOnXError", "PrintFileOnXError", printFileOnXError, NULL), + Ires(XtNprintModeImmediate, XtCPrintModeImmediate, printModeNow, 0), + Ires(XtNprintOptsImmediate, XtCPrintOptsImmediate, printOptsNow, 9), + Sres(XtNprintFileImmediate, XtCPrintFileImmediate, printFileNow, NULL), + Ires(XtNprintModeOnXError, XtCPrintModeOnXError, printModeOnXError, 0), + Ires(XtNprintOptsOnXError, XtCPrintOptsOnXError, printOptsOnXError, 9), + Sres(XtNprintFileOnXError, XtCPrintFileOnXError, printFileOnXError, NULL), #endif #if OPT_SUNPC_KBD - Bres("sunKeyboard", "SunKeyboard", sunKeyboard, False), + Bres(XtNsunKeyboard, XtCSunKeyboard, sunKeyboard, False), #endif #if OPT_HP_FUNC_KEYS - Bres("hpFunctionKeys", "HpFunctionKeys", hpFunctionKeys, False), + Bres(XtNhpFunctionKeys, XtCHpFunctionKeys, hpFunctionKeys, False), #endif #if OPT_SCO_FUNC_KEYS - Bres("scoFunctionKeys", "ScoFunctionKeys", scoFunctionKeys, False), + Bres(XtNscoFunctionKeys, XtCScoFunctionKeys, scoFunctionKeys, False), #endif #if OPT_SUN_FUNC_KEYS - Bres("sunFunctionKeys", "SunFunctionKeys", sunFunctionKeys, False), + Bres(XtNsunFunctionKeys, XtCSunFunctionKeys, sunFunctionKeys, False), #endif #if OPT_TCAP_FKEYS - Bres("tcapFunctionKeys", "TcapFunctionKeys", termcapKeys, False), + Bres(XtNtcapFunctionKeys, XtCTcapFunctionKeys, termcapKeys, False), #endif #if OPT_INITIAL_ERASE - Bres("ptyInitialErase", "PtyInitialErase", ptyInitialErase, DEF_INITIAL_ERASE), - Bres("backarrowKeyIsErase", "BackarrowKeyIsErase", backarrow_is_erase, DEF_BACKARO_ERASE), + Bres(XtNptyInitialErase, XtCPtyInitialErase, ptyInitialErase, DEF_INITIAL_ERASE), + Bres(XtNbackarrowKeyIsErase, XtCBackarrowKeyIsErase, backarrow_is_erase, DEF_BACKARO_ERASE), #endif - Bres("useInsertMode", "UseInsertMode", useInsertMode, False), + Bres(XtNuseInsertMode, XtCUseInsertMode, useInsertMode, False), #if OPT_ZICONBEEP - Ires("zIconBeep", "ZIconBeep", zIconBeep, 0), - Sres("zIconTitleFormat", "ZIconTitleFormat", zIconFormat, "*** %s"), + Ires(XtNzIconBeep, XtCZIconBeep, zIconBeep, 0), + Sres(XtNzIconTitleFormat, XtCZIconTitleFormat, zIconFormat, "*** %s"), #endif #if OPT_PTY_HANDSHAKE - Bres("waitForMap", "WaitForMap", wait_for_map, False), - Bres("ptyHandshake", "PtyHandshake", ptyHandshake, True), - Bres("ptySttySize", "PtySttySize", ptySttySize, DEF_PTY_STTY_SIZE), + Bres(XtNwaitForMap, XtCWaitForMap, wait_for_map, False), + Bres(XtNptyHandshake, XtCPtyHandshake, ptyHandshake, True), + Bres(XtNptySttySize, XtCPtySttySize, ptySttySize, DEF_PTY_STTY_SIZE), #endif #if OPT_REPORT_CCLASS - Bres("reportCClass", "ReportCClass", reportCClass, False), + Bres(XtNreportCClass, XtCReportCClass, reportCClass, False), #endif #if OPT_REPORT_COLORS - Bres("reportColors", "ReportColors", reportColors, False), + Bres(XtNreportColors, XtCReportColors, reportColors, False), #endif #if OPT_REPORT_FONTS - Bres("reportFonts", "ReportFonts", reportFonts, False), + Bres(XtNreportFonts, XtCReportFonts, reportFonts, False), #endif #if OPT_REPORT_ICONS - Bres("reportIcons", "ReportIcons", reportIcons, False), + Bres(XtNreportIcons, XtCReportIcons, reportIcons, False), #endif #if OPT_XRES_QUERY - Bres("reportXRes", "ReportXRes", reportXRes, False), + Bres(XtNreportXRes, XtCReportXRes, reportXRes, False), #endif #if OPT_SAME_NAME - Bres("sameName", "SameName", sameName, True), + Bres(XtNsameName, XtCSameName, sameName, True), #endif #if OPT_SESSION_MGT - Bres("sessionMgt", "SessionMgt", sessionMgt, True), + Bres(XtNsessionMgt, XtCSessionMgt, sessionMgt, True), #endif #if OPT_TOOLBAR Bres(XtNtoolBar, XtCToolBar, toolBar, True), @@ -999,204 +996,213 @@ static String fallback_resources[] = pass over the remaining options after XrmParseCommand is let loose. */ /* *INDENT-OFF* */ #define DATA(option,pattern,type,value) { (char *) option, (char *) pattern, type, (XPointer) value } +#define OPTS(option,pattern_type,value) { (char *) option, (char *) pattern_type, (XPointer) value } +#define UP_ARG(name) "."name, XrmoptionSepArg +#define MY_ARG(name) "*"name, XrmoptionSepArg +#define VT_ARG(name) "*vt100."name, XrmoptionSepArg +#define NO_ARG(name) "*"name, XrmoptionNoArg static XrmOptionDescRec optionDescList[] = { -DATA("-geometry", "*vt100.geometry",XrmoptionSepArg, NULL), -DATA("-132", "*c132", XrmoptionNoArg, "on"), -DATA("+132", "*c132", XrmoptionNoArg, "off"), -DATA("-ah", "*alwaysHighlight", XrmoptionNoArg, "on"), -DATA("+ah", "*alwaysHighlight", XrmoptionNoArg, "off"), -DATA("-aw", "*autoWrap", XrmoptionNoArg, "on"), -DATA("+aw", "*autoWrap", XrmoptionNoArg, "off"), +OPTS("-geometry", VT_ARG(XtNgeometry), NULL), +OPTS("-132", NO_ARG(XtNc132), "on"), +OPTS("+132", NO_ARG(XtNc132), "off"), +OPTS("-ah", NO_ARG(XtNalwaysHighlight), "on"), +OPTS("+ah", NO_ARG(XtNalwaysHighlight), "off"), +OPTS("-aw", NO_ARG(XtNautoWrap), "on"), +OPTS("+aw", NO_ARG(XtNautoWrap), "off"), #ifndef NO_ACTIVE_ICON -DATA("-ai", "*activeIcon", XrmoptionNoArg, "off"), -DATA("+ai", "*activeIcon", XrmoptionNoArg, "on"), +OPTS("-ai", NO_ARG(XtNactiveIcon), "off"), +OPTS("+ai", NO_ARG(XtNactiveIcon), "on"), #endif /* NO_ACTIVE_ICON */ -DATA("-b", "*internalBorder",XrmoptionSepArg, NULL), -DATA("-bc", "*cursorBlink", XrmoptionNoArg, "on"), -DATA("+bc", "*cursorBlink", XrmoptionNoArg, "off"), -DATA("-bcf", "*cursorOffTime",XrmoptionSepArg, NULL), -DATA("-bcn", "*cursorOnTime",XrmoptionSepArg, NULL), -DATA("-bdc", "*colorBDMode", XrmoptionNoArg, "off"), -DATA("+bdc", "*colorBDMode", XrmoptionNoArg, "on"), -DATA("-cb", "*cutToBeginningOfLine", XrmoptionNoArg, "off"), -DATA("+cb", "*cutToBeginningOfLine", XrmoptionNoArg, "on"), -DATA("-cc", "*charClass", XrmoptionSepArg, NULL), -DATA("-cm", "*colorMode", XrmoptionNoArg, "off"), -DATA("+cm", "*colorMode", XrmoptionNoArg, "on"), -DATA("-cn", "*cutNewline", XrmoptionNoArg, "off"), -DATA("+cn", "*cutNewline", XrmoptionNoArg, "on"), -DATA("-cr", "*cursorColor", XrmoptionSepArg, NULL), -DATA("-cu", "*curses", XrmoptionNoArg, "on"), -DATA("+cu", "*curses", XrmoptionNoArg, "off"), -DATA("-dc", "*dynamicColors",XrmoptionNoArg, "off"), -DATA("+dc", "*dynamicColors",XrmoptionNoArg, "on"), -DATA("-fb", "*boldFont", XrmoptionSepArg, NULL), -DATA("-fbb", "*freeBoldBox", XrmoptionNoArg, "off"), -DATA("+fbb", "*freeBoldBox", XrmoptionNoArg, "on"), -DATA("-fbx", "*forceBoxChars", XrmoptionNoArg, "off"), -DATA("+fbx", "*forceBoxChars", XrmoptionNoArg, "on"), -DATA("-fc", "*initialFont", XrmoptionSepArg, NULL), +OPTS("-b", MY_ARG(XtNinternalBorder), NULL), +OPTS("-barc", NO_ARG(XtNcursorBar), "on"), +OPTS("+barc", NO_ARG(XtNcursorBar), "off"), +OPTS("-bc", NO_ARG(XtNcursorBlink), "on"), +OPTS("+bc", NO_ARG(XtNcursorBlink), "off"), +OPTS("-bcf", MY_ARG(XtNcursorOffTime), NULL), +OPTS("-bcn", MY_ARG(XtNcursorOnTime), NULL), +OPTS("-bdc", NO_ARG(XtNcolorBDMode), "off"), +OPTS("+bdc", NO_ARG(XtNcolorBDMode), "on"), +OPTS("-cb", NO_ARG(XtNcutToBeginningOfLine), "off"), +OPTS("+cb", NO_ARG(XtNcutToBeginningOfLine), "on"), +OPTS("-cc", MY_ARG(XtNcharClass), NULL), +OPTS("-cm", NO_ARG(XtNcolorMode), "off"), +OPTS("+cm", NO_ARG(XtNcolorMode), "on"), +OPTS("-cn", NO_ARG(XtNcutNewline), "off"), +OPTS("+cn", NO_ARG(XtNcutNewline), "on"), +OPTS("-cr", MY_ARG(XtNcursorColor), NULL), +OPTS("-cu", NO_ARG(XtNcurses), "on"), +OPTS("+cu", NO_ARG(XtNcurses), "off"), +OPTS("-dc", NO_ARG(XtNdynamicColors), "off"), +OPTS("+dc", NO_ARG(XtNdynamicColors), "on"), +OPTS("-fb", MY_ARG(XtNboldFont), NULL), +OPTS("-fbb", NO_ARG(XtNfreeBoldBox), "off"), +OPTS("+fbb", NO_ARG(XtNfreeBoldBox), "on"), +OPTS("-fbx", NO_ARG(XtNforceBoxChars), "off"), +OPTS("+fbx", NO_ARG(XtNforceBoxChars), "on"), +OPTS("-fc", MY_ARG(XtNinitialFont), NULL), #ifndef NO_ACTIVE_ICON -DATA("-fi", "*iconFont", XrmoptionSepArg, NULL), +OPTS("-fi", MY_ARG(XtNiconFont), NULL), #endif /* NO_ACTIVE_ICON */ #if OPT_RENDERFONT -DATA("-fa", "*faceName", XrmoptionSepArg, NULL), -DATA("-fd", "*faceNameDoublesize", XrmoptionSepArg, NULL), -DATA("-fs", "*faceSize", XrmoptionSepArg, NULL), +OPTS("-fa", MY_ARG(XtNfaceName), NULL), +OPTS("-fd", MY_ARG(XtNfaceNameDoublesize), NULL), +OPTS("-fs", MY_ARG(XtNfaceSize), NULL), #endif #if OPT_WIDE_ATTRS && OPT_ISO_COLORS -DATA("-itc", "*colorITMode", XrmoptionNoArg, "off"), -DATA("+itc", "*colorITMode", XrmoptionNoArg, "on"), +OPTS("-itc", NO_ARG(XtNcolorITMode), "off"), +OPTS("+itc", NO_ARG(XtNcolorITMode), "on"), #endif #if OPT_WIDE_CHARS -DATA("-fw", "*wideFont", XrmoptionSepArg, NULL), -DATA("-fwb", "*wideBoldFont", XrmoptionSepArg, NULL), +OPTS("-fw", MY_ARG(XtNwideFont), NULL), +OPTS("-fwb", MY_ARG(XtNwideBoldFont), NULL), #endif #if OPT_INPUT_METHOD -DATA("-fx", "*ximFont", XrmoptionSepArg, NULL), +OPTS("-fx", MY_ARG(XtNximFont), NULL), #endif #if OPT_HIGHLIGHT_COLOR -DATA("-hc", "*highlightColor", XrmoptionSepArg, NULL), -DATA("-hm", "*highlightColorMode", XrmoptionNoArg, "on"), -DATA("+hm", "*highlightColorMode", XrmoptionNoArg, "off"), -DATA("-selfg", "*highlightTextColor", XrmoptionSepArg, NULL), -DATA("-selbg", "*highlightColor", XrmoptionSepArg, NULL), +OPTS("-hc", MY_ARG(XtNhighlightColor), NULL), +OPTS("-hm", NO_ARG(XtNhighlightColorMode), "on"), +OPTS("+hm", NO_ARG(XtNhighlightColorMode), "off"), +OPTS("-selfg", MY_ARG(XtNhighlightTextColor), NULL), +OPTS("-selbg", MY_ARG(XtNhighlightColor), NULL), #endif #if OPT_HP_FUNC_KEYS -DATA("-hf", "*hpFunctionKeys",XrmoptionNoArg, "on"), -DATA("+hf", "*hpFunctionKeys",XrmoptionNoArg, "off"), +OPTS("-hf", NO_ARG(XtNhpFunctionKeys), "on"), +OPTS("+hf", NO_ARG(XtNhpFunctionKeys), "off"), #endif -DATA("-hold", "*hold", XrmoptionNoArg, "on"), -DATA("+hold", "*hold", XrmoptionNoArg, "off"), +OPTS("-hold", NO_ARG(XtNhold), "on"), +OPTS("+hold", NO_ARG(XtNhold), "off"), #if OPT_INITIAL_ERASE -DATA("-ie", "*ptyInitialErase", XrmoptionNoArg, "on"), -DATA("+ie", "*ptyInitialErase", XrmoptionNoArg, "off"), +OPTS("-ie", NO_ARG(XtNptyInitialErase), "on"), +OPTS("+ie", NO_ARG(XtNptyInitialErase), "off"), #endif -DATA("-j", "*jumpScroll", XrmoptionNoArg, "on"), -DATA("+j", "*jumpScroll", XrmoptionNoArg, "off"), +OPTS("-j", NO_ARG(XtNjumpScroll), "on"), +OPTS("+j", NO_ARG(XtNjumpScroll), "off"), +OPTS("-jf", NO_ARG(XtNfastScroll), "on"), +OPTS("+jf", NO_ARG(XtNfastScroll), "off"), #if OPT_C1_PRINT -DATA("-k8", "*allowC1Printable", XrmoptionNoArg, "on"), -DATA("+k8", "*allowC1Printable", XrmoptionNoArg, "off"), +OPTS("-k8", NO_ARG(XtNallowC1Printable), "on"), +OPTS("+k8", NO_ARG(XtNallowC1Printable), "off"), #endif -DATA("-kt", "*keyboardType", XrmoptionSepArg, NULL), +OPTS("-kt", MY_ARG(XtNkeyboardType), NULL), /* parse logging options anyway for compatibility */ -DATA("-l", "*logging", XrmoptionNoArg, "on"), -DATA("+l", "*logging", XrmoptionNoArg, "off"), -DATA("-lf", "*logFile", XrmoptionSepArg, NULL), -DATA("-ls", "*loginShell", XrmoptionNoArg, "on"), -DATA("+ls", "*loginShell", XrmoptionNoArg, "off"), -DATA("-mb", "*marginBell", XrmoptionNoArg, "on"), -DATA("+mb", "*marginBell", XrmoptionNoArg, "off"), -DATA("-mc", "*multiClickTime", XrmoptionSepArg, NULL), -DATA("-mesg", "*messages", XrmoptionNoArg, "off"), -DATA("+mesg", "*messages", XrmoptionNoArg, "on"), -DATA("-ms", "*pointerColor",XrmoptionSepArg, NULL), -DATA("-nb", "*nMarginBell", XrmoptionSepArg, NULL), -DATA("-nul", "*underLine", XrmoptionNoArg, "off"), -DATA("+nul", "*underLine", XrmoptionNoArg, "on"), -DATA("-pc", "*boldColors", XrmoptionNoArg, "on"), -DATA("+pc", "*boldColors", XrmoptionNoArg, "off"), -DATA("-pf", "*pointerFont", XrmoptionSepArg, NULL), -DATA("-rw", "*reverseWrap", XrmoptionNoArg, "on"), -DATA("+rw", "*reverseWrap", XrmoptionNoArg, "off"), -DATA("-s", "*multiScroll", XrmoptionNoArg, "on"), -DATA("+s", "*multiScroll", XrmoptionNoArg, "off"), -DATA("-sb", "*scrollBar", XrmoptionNoArg, "on"), -DATA("+sb", "*scrollBar", XrmoptionNoArg, "off"), +OPTS("-l", NO_ARG(XtNlogging), "on"), +OPTS("+l", NO_ARG(XtNlogging), "off"), +OPTS("-lf", MY_ARG(XtNlogFile), NULL), +OPTS("-ls", NO_ARG(XtNloginShell), "on"), +OPTS("+ls", NO_ARG(XtNloginShell), "off"), +OPTS("-mb", NO_ARG(XtNmarginBell), "on"), +OPTS("+mb", NO_ARG(XtNmarginBell), "off"), +OPTS("-mc", MY_ARG(XtNmultiClickTime), NULL), +OPTS("-mesg", NO_ARG(XtNmessages), "off"), +OPTS("+mesg", NO_ARG(XtNmessages), "on"), +OPTS("-ms", MY_ARG(XtNpointerColor), NULL), +OPTS("-nb", MY_ARG(XtNnMarginBell), NULL), +OPTS("-nul", NO_ARG(XtNunderLine), "off"), +OPTS("+nul", NO_ARG(XtNunderLine), "on"), +OPTS("-pc", NO_ARG(XtNboldColors), "on"), +OPTS("+pc", NO_ARG(XtNboldColors), "off"), +OPTS("-pf", MY_ARG(XtNpointerFont), NULL), +OPTS("-rw", NO_ARG(XtNreverseWrap), "on"), +OPTS("+rw", NO_ARG(XtNreverseWrap), "off"), +OPTS("-s", NO_ARG(XtNmultiScroll), "on"), +OPTS("+s", NO_ARG(XtNmultiScroll), "off"), +OPTS("-sb", NO_ARG(XtNscrollBar), "on"), +OPTS("+sb", NO_ARG(XtNscrollBar), "off"), #if OPT_REPORT_CCLASS -DATA("-report-charclass","*reportCClass", XrmoptionNoArg, "on"), +OPTS("-report-charclass", NO_ARG(XtNreportCClass), "on"), #endif #if OPT_REPORT_COLORS -DATA("-report-colors", "*reportColors", XrmoptionNoArg, "on"), +OPTS("-report-colors", NO_ARG(XtNreportColors), "on"), #endif #if OPT_REPORT_ICONS -DATA("-report-icons", "*reportIcons", XrmoptionNoArg, "on"), +OPTS("-report-icons", NO_ARG(XtNreportIcons), "on"), #endif #if OPT_REPORT_FONTS -DATA("-report-fonts", "*reportFonts", XrmoptionNoArg, "on"), +OPTS("-report-fonts", NO_ARG(XtNreportFonts), "on"), #endif #if OPT_XRES_QUERY -DATA("-report-xres", "*reportXRes", XrmoptionNoArg, "on"), +OPTS("-report-xres", NO_ARG(XtNreportXRes), "on"), #endif #ifdef SCROLLBAR_RIGHT -DATA("-leftbar", "*rightScrollBar", XrmoptionNoArg, "off"), -DATA("-rightbar", "*rightScrollBar", XrmoptionNoArg, "on"), -#endif -DATA("-rvc", "*colorRVMode", XrmoptionNoArg, "off"), -DATA("+rvc", "*colorRVMode", XrmoptionNoArg, "on"), -DATA("-sf", "*sunFunctionKeys", XrmoptionNoArg, "on"), -DATA("+sf", "*sunFunctionKeys", XrmoptionNoArg, "off"), -DATA("-sh", "*scaleHeight", XrmoptionSepArg, NULL), -DATA("-si", "*scrollTtyOutput", XrmoptionNoArg, "off"), -DATA("+si", "*scrollTtyOutput", XrmoptionNoArg, "on"), -DATA("-sk", "*scrollKey", XrmoptionNoArg, "on"), -DATA("+sk", "*scrollKey", XrmoptionNoArg, "off"), -DATA("-sl", "*saveLines", XrmoptionSepArg, NULL), +OPTS("-leftbar", NO_ARG(XtNrightScrollBar), "off"), +OPTS("-rightbar", NO_ARG(XtNrightScrollBar), "on"), +#endif +OPTS("-rvc", NO_ARG(XtNcolorRVMode), "off"), +OPTS("+rvc", NO_ARG(XtNcolorRVMode), "on"), +OPTS("-sf", NO_ARG(XtNsunFunctionKeys), "on"), +OPTS("+sf", NO_ARG(XtNsunFunctionKeys), "off"), +OPTS("-sh", MY_ARG(XtNscaleHeight), NULL), +OPTS("-si", NO_ARG(XtNscrollTtyOutput), "off"), +OPTS("+si", NO_ARG(XtNscrollTtyOutput), "on"), +OPTS("-sk", NO_ARG(XtNscrollKey), "on"), +OPTS("+sk", NO_ARG(XtNscrollKey), "off"), +OPTS("-sl", MY_ARG(XtNsaveLines), NULL), #if OPT_SUNPC_KBD -DATA("-sp", "*sunKeyboard", XrmoptionNoArg, "on"), -DATA("+sp", "*sunKeyboard", XrmoptionNoArg, "off"), +OPTS("-sp", NO_ARG(XtNsunKeyboard), "on"), +OPTS("+sp", NO_ARG(XtNsunKeyboard), "off"), #endif #if OPT_TEK4014 -DATA("-t", "*tekStartup", XrmoptionNoArg, "on"), -DATA("+t", "*tekStartup", XrmoptionNoArg, "off"), +OPTS("-t", NO_ARG(XtNtekStartup), "on"), +OPTS("+t", NO_ARG(XtNtekStartup), "off"), #endif -DATA("-ti", "*decTerminalID",XrmoptionSepArg, NULL), -DATA("-tm", "*ttyModes", XrmoptionSepArg, NULL), -DATA("-tn", "*termName", XrmoptionSepArg, NULL), +OPTS("-ti", MY_ARG(XtNdecTerminalID), NULL), +OPTS("-tm", MY_ARG(XtNttyModes), NULL), +OPTS("-tn", MY_ARG(XtNtermName), NULL), #if OPT_WIDE_CHARS -DATA("-u8", "*utf8", XrmoptionNoArg, "2"), -DATA("+u8", "*utf8", XrmoptionNoArg, "0"), +OPTS("-u8", NO_ARG(XtNutf8), "2"), +OPTS("+u8", NO_ARG(XtNutf8), "0"), #endif #if OPT_LUIT_PROG -DATA("-lc", "*locale", XrmoptionNoArg, "on"), -DATA("+lc", "*locale", XrmoptionNoArg, "off"), -DATA("-lcc", "*localeFilter",XrmoptionSepArg, NULL), -DATA("-en", "*locale", XrmoptionSepArg, NULL), -#endif -DATA("-uc", "*cursorUnderLine", XrmoptionNoArg, "on"), -DATA("+uc", "*cursorUnderLine", XrmoptionNoArg, "off"), -DATA("-ulc", "*colorULMode", XrmoptionNoArg, "off"), -DATA("+ulc", "*colorULMode", XrmoptionNoArg, "on"), -DATA("-ulit", "*italicULMode", XrmoptionNoArg, "off"), -DATA("+ulit", "*italicULMode", XrmoptionNoArg, "on"), -DATA("-ut", "*utmpInhibit", XrmoptionNoArg, "on"), -DATA("+ut", "*utmpInhibit", XrmoptionNoArg, "off"), -DATA("-im", "*useInsertMode", XrmoptionNoArg, "on"), -DATA("+im", "*useInsertMode", XrmoptionNoArg, "off"), -DATA("-vb", "*visualBell", XrmoptionNoArg, "on"), -DATA("+vb", "*visualBell", XrmoptionNoArg, "off"), -DATA("-pob", "*popOnBell", XrmoptionNoArg, "on"), -DATA("+pob", "*popOnBell", XrmoptionNoArg, "off"), +OPTS("-lc", NO_ARG(XtNlocale), "on"), +OPTS("+lc", NO_ARG(XtNlocale), "off"), +OPTS("-lcc", MY_ARG(XtNlocaleFilter), NULL), +OPTS("-en", MY_ARG(XtNlocale), NULL), +#endif +OPTS("-uc", NO_ARG(XtNcursorUnderLine), "on"), +OPTS("+uc", NO_ARG(XtNcursorUnderLine), "off"), +OPTS("-ulc", NO_ARG(XtNcolorULMode), "off"), +OPTS("+ulc", NO_ARG(XtNcolorULMode), "on"), +OPTS("-ulit", NO_ARG(XtNitalicULMode), "off"), +OPTS("+ulit", NO_ARG(XtNitalicULMode), "on"), +OPTS("-ut", NO_ARG(XtNutmpInhibit), "on"), +OPTS("+ut", NO_ARG(XtNutmpInhibit), "off"), +OPTS("-im", NO_ARG(XtNuseInsertMode), "on"), +OPTS("+im", NO_ARG(XtNuseInsertMode), "off"), +OPTS("-vb", NO_ARG(XtNvisualBell), "on"), +OPTS("+vb", NO_ARG(XtNvisualBell), "off"), +OPTS("-pob", NO_ARG(XtNpopOnBell), "on"), +OPTS("+pob", NO_ARG(XtNpopOnBell), "off"), #if OPT_WIDE_CHARS -DATA("-wc", "*wideChars", XrmoptionNoArg, "on"), -DATA("+wc", "*wideChars", XrmoptionNoArg, "off"), -DATA("-mk_width", "*mkWidth", XrmoptionNoArg, "on"), -DATA("+mk_width", "*mkWidth", XrmoptionNoArg, "off"), -DATA("-cjk_width", "*cjkWidth", XrmoptionNoArg, "on"), -DATA("+cjk_width", "*cjkWidth", XrmoptionNoArg, "off"), -#endif -DATA("-wf", "*waitForMap", XrmoptionNoArg, "on"), -DATA("+wf", "*waitForMap", XrmoptionNoArg, "off"), +OPTS("-wc", NO_ARG(XtNwideChars), "on"), +OPTS("+wc", NO_ARG(XtNwideChars), "off"), +OPTS("-mk_width", NO_ARG(XtNmkWidth), "on"), +OPTS("+mk_width", NO_ARG(XtNmkWidth), "off"), +OPTS("-cjk_width", NO_ARG(XtNcjkWidth), "on"), +OPTS("+cjk_width", NO_ARG(XtNcjkWidth), "off"), +#endif +OPTS("-wf", NO_ARG(XtNwaitForMap), "on"), +OPTS("+wf", NO_ARG(XtNwaitForMap), "off"), #if OPT_ZICONBEEP -DATA("-ziconbeep", "*zIconBeep", XrmoptionSepArg, NULL), +OPTS("-ziconbeep", MY_ARG(XtNzIconBeep), NULL), #endif #if OPT_SAME_NAME -DATA("-samename", "*sameName", XrmoptionNoArg, "on"), -DATA("+samename", "*sameName", XrmoptionNoArg, "off"), +OPTS("-samename", NO_ARG(XtNsameName), "on"), +OPTS("+samename", NO_ARG(XtNsameName), "off"), #endif #if OPT_SESSION_MGT -DATA("-sm", "*sessionMgt", XrmoptionNoArg, "on"), -DATA("+sm", "*sessionMgt", XrmoptionNoArg, "off"), +OPTS("-sm", NO_ARG(XtNsessionMgt), "on"), +OPTS("+sm", NO_ARG(XtNsessionMgt), "off"), #endif #if OPT_TOOLBAR -DATA("-tb", "*" XtNtoolBar, XrmoptionNoArg, "on"), -DATA("+tb", "*" XtNtoolBar, XrmoptionNoArg, "off"), +OPTS("-tb", NO_ARG(XtNtoolBar), "on"), +OPTS("+tb", NO_ARG(XtNtoolBar), "off"), #endif #if OPT_MAXIMIZE -DATA("-maximized", "*maximized", XrmoptionNoArg, "on"), -DATA("+maximized", "*maximized", XrmoptionNoArg, "off"), -DATA("-fullscreen", "*fullscreen", XrmoptionNoArg, "on"), -DATA("+fullscreen", "*fullscreen", XrmoptionNoArg, "off"), +OPTS("-maximized", NO_ARG(XtNmaximized), "on"), +OPTS("+maximized", NO_ARG(XtNmaximized), "off"), +OPTS("-fullscreen", NO_ARG(XtNfullscreen), "on"), +OPTS("+fullscreen", NO_ARG(XtNfullscreen), "off"), #endif /* options that we process ourselves */ DATA("-help", NULL, XrmoptionSkipNArgs, NULL), @@ -1208,14 +1214,14 @@ DATA("-into", NULL, XrmoptionSkipArg, NULL), /* bogus old compatibility stuff for which there are standard XtOpenApplication options now */ DATA("%", "*tekGeometry", XrmoptionStickyArg, NULL), -DATA("#", ".iconGeometry",XrmoptionStickyArg, NULL), -DATA("-T", ".title", XrmoptionSepArg, NULL), -DATA("-n", "*iconName", XrmoptionSepArg, NULL), -DATA("-r", "*reverseVideo",XrmoptionNoArg, "on"), -DATA("+r", "*reverseVideo",XrmoptionNoArg, "off"), -DATA("-rv", "*reverseVideo",XrmoptionNoArg, "on"), -DATA("+rv", "*reverseVideo",XrmoptionNoArg, "off"), -DATA("-w", ".borderWidth", XrmoptionSepArg, NULL), +DATA("#", ".iconGeometry", XrmoptionStickyArg, NULL), +OPTS("-T", UP_ARG(XtNtitle), NULL), +OPTS("-n", MY_ARG(XtNiconName), NULL), +OPTS("-r", NO_ARG(XtNreverseVideo), "on"), +OPTS("+r", NO_ARG(XtNreverseVideo), "off"), +OPTS("-rv", NO_ARG(XtNreverseVideo), "on"), +OPTS("+rv", NO_ARG(XtNreverseVideo), "off"), +OPTS("-w", UP_ARG(XtNborderWidth), NULL), #undef DATA }; @@ -1319,7 +1325,7 @@ static OptionHelp xtermOptions[] = { { "-report-fonts", "report fonts as loaded to stdout" }, #endif #if OPT_REPORT_ICONS -{ "-report-icons", "report title/icon updates" }, +{ "-report-icons", "report title/icon updates" }, #endif #if OPT_XRES_QUERY { "-report-xres", "report X resources for VT100 widget" }, @@ -1403,14 +1409,157 @@ static OptionHelp xtermOptions[] = { { NULL, NULL }}; /* *INDENT-ON* */ -static const char *const message[] = +static const char *const help_message[] = { "Fonts should be fixed width and, if both normal and bold are specified, should", "have the same size. If only a normal font is specified, it will be used for", "both normal and bold text (by doing overstriking). The -e option, if given,", "must appear at the end of the command line, otherwise the user's default shell", "will be started. Options that start with a plus sign (+) restore the default.", - NULL}; + NULL +}; + +int +xtermDisabledChar(void) +{ + int value = -1; +#if defined(_POSIX_VDISABLE) && defined(HAVE_UNISTD_H) + value = _POSIX_VDISABLE; +#endif +#if defined(_PC_VDISABLE) + if (value == -1) { + value = (int) fpathconf(0, _PC_VDISABLE); + if (value == -1) { + if (errno == 0) + value = 0377; + } + } +#elif defined(VDISABLE) + if (value == -1) + value = VDISABLE; +#endif + return value; +} + +/* + * Retrieve (possibly allocating) an atom from the server. Cache the result. + */ +Atom +CachedInternAtom(Display *display, const char *name) +{ + /* + * Aside from a couple of rarely used atoms, the others are all known. + */ + static const char *const known_atoms[] = + { + "FONT", + "WM_CLASS", + "WM_DELETE_WINDOW", + "_NET_ACTIVE_WINDOW", + "_NET_FRAME_EXTENTS", + "_NET_FRAME_EXTENTS", + "_NET_SUPPORTED", + "_NET_SUPPORTING_WM_CHECK", + "_NET_WM_ALLOWED_ACTIONS", + "_NET_WM_ICON_NAME", + "_NET_WM_NAME", + "_NET_WM_PID", + "_NET_WM_STATE", + "_NET_WM_STATE_ADD", + "_NET_WM_STATE_FULLSCREEN", + "_NET_WM_STATE_HIDDEN", + "_NET_WM_STATE_MAXIMIZED_HORZ", + "_NET_WM_STATE_MAXIMIZED_VERT", + "_NET_WM_STATE_REMOVE", + "_WIN_SUPPORTING_WM_CHECK", +#if defined(HAVE_XKB_BELL_EXT) + XkbBN_Info, + XkbBN_MarginBell, + XkbBN_MinorError, + XkbBN_TerminalBell, +#endif +#if defined(HAVE_XKBQUERYEXTENSION) + "Num Lock", + "Caps Lock", + "Scroll Lock", +#endif + }; + +#define NumKnownAtoms XtNumber(known_atoms) + + /* + * The "+1" entry of the array is used for the occasional atom which is not + * predefined. + */ + static struct { + Atom atom; + const char *name; + } AtomCache[NumKnownAtoms + 1]; + + Boolean found = False; + Atom result = None; + Cardinal i; + + TRACE(("intern_atom \"%s\"\n", name)); + + /* + * This should never happen as it implies xterm is aware of multiple + * displays. + */ + if (display != XtDisplay(toplevel)) { + SysError(ERROR_GET_ATOM); + } + + if (AtomCache[0].name == NULL) { + /* pre-load a number of atoms in one request to reduce latency */ + Atom atom_return[NumKnownAtoms]; + int code; + + TRACE(("initialising atom list\n")); + code = XInternAtoms(display, + (char **) known_atoms, + (int) NumKnownAtoms, + False, + atom_return); + /* + * result should be Success, but actually returns BadRequest. + * manpage says XInternAtoms can generate BadAlloc and BadValue errors. + */ + if (code > BadRequest) + SysError(ERROR_GET_ATOM); + + for (i = 0; i < NumKnownAtoms; ++i) { + AtomCache[i].name = known_atoms[i]; + AtomCache[i].atom = atom_return[i]; + } + } + + /* Linear search is probably OK here, due to the small number of atoms */ + for (i = 0; i < NumKnownAtoms; i++) { + if (strcmp(name, AtomCache[i].name) == 0) { + found = True; + result = AtomCache[i].atom; + break; + } + } + + if (!found) { + if (AtomCache[NumKnownAtoms].name == NULL + || strcmp(AtomCache[NumKnownAtoms].name, name)) { + char *actual = x_strdup(name); + free((void *) AtomCache[NumKnownAtoms].name); + result = XInternAtom(display, actual, False); + AtomCache[NumKnownAtoms].atom = result; + AtomCache[NumKnownAtoms].name = actual; + TRACE(("...allocated new atom\n")); + } else { + result = AtomCache[NumKnownAtoms].atom; + TRACE(("...reused cached atom\n")); + } + } + TRACE(("...intern_atom -> %ld\n", result)); + return result; +} /* * Decode a key-definition. This combines the termcap and ttyModes, for @@ -1431,23 +1580,7 @@ decode_keyvalue(char **ptr, int termcap) break; case '-': if (!termcap) { - errno = 0; -#if defined(_POSIX_VDISABLE) && defined(HAVE_UNISTD_H) - value = _POSIX_VDISABLE; -#endif -#if defined(_PC_VDISABLE) - if (value == -1) { - value = (int) fpathconf(0, _PC_VDISABLE); - if (value == -1) { - if (errno != 0) - break; /* skip this (error) */ - value = 0377; - } - } -#elif defined(VDISABLE) - if (value == -1) - value = VDISABLE; -#endif + value = xtermDisabledChar(); break; } /* FALLTHRU */ @@ -1707,7 +1840,7 @@ Syntax(char *badOption) fprintf(stderr, "\r\n\nType %s -help for a full description.\r\n\n", ProgramName); - exit(1); + exit(ERROR_MISC); } static void @@ -1732,7 +1865,7 @@ Help(void) } putchar('\n'); - for (cpp = message; *cpp; cpp++) + for (cpp = help_message; *cpp; cpp++) puts(*cpp); putchar('\n'); fflush(stdout); @@ -1743,7 +1876,7 @@ NeedParam(XrmOptionDescRec * option_ptr, const char *option_val) { if (IsEmpty(option_val)) { xtermWarning("option %s requires a value\n", option_ptr->option); - exit(1); + exit(ERROR_MISC); } } @@ -1825,7 +1958,7 @@ my_pty_name(char *device) if (name) break; len--; - } else if (isalpha(ch)) { + } else if (isalpha(CharOf(ch))) { name = True; len--; } else { @@ -2004,7 +2137,7 @@ disableSetUid(void) TRACE(("process %d disableSetUid\n", (int) getpid())); if (setuid(save_ruid) == -1) { xtermWarning("unable to reset uid\n"); - exit(1); + exit(ERROR_MISC); } TRACE_IDS; } @@ -2019,7 +2152,7 @@ disableSetGid(void) TRACE(("process %d disableSetGid\n", (int) getpid())); if (setegid(save_rgid) == -1) { xtermWarning("unable to reset effective gid\n"); - exit(1); + exit(ERROR_MISC); } TRACE_IDS; } @@ -2199,6 +2332,52 @@ lookup_baudrate(const char *value) } int +get_tty_erase(int fd, int default_erase, const char *tag) +{ + int result = default_erase; + int rc; + +#ifdef TERMIO_STRUCT + TERMIO_STRUCT my_tio; + rc = ttyGetAttr(fd, &my_tio); + if (rc == 0) + result = my_tio.c_cc[VERASE]; +#else /* !TERMIO_STRUCT */ + struct sgttyb my_sg; + rc = ioctl(fd, TIOCGETP, (char *) &my_sg); + if (rc == 0) + result = my_sg.sg_erase; +#endif /* TERMIO_STRUCT */ + TRACE(("%s erase:%d (from %s)\n", (rc == 0) ? "OK" : "FAIL", result, tag)); + (void) tag; + return result; +} + +int +get_tty_lnext(int fd, int default_lnext, const char *tag) +{ + int result = default_lnext; + int rc; + +#ifdef TERMIO_STRUCT + TERMIO_STRUCT my_tio; + rc = ttyGetAttr(fd, &my_tio); + if (rc == 0) + result = my_tio.c_cc[VLNEXT]; +#elif defined(HAS_LTCHARS) + struct ltchars my_ltc; + rc = ioctl(fd, TIOCGLTC, (char *) &my_ltc); + if (rc == 0) + result = my_ltc.t_lnextc; +#else + result = XTERM_LNEXT; +#endif /* TERMIO_STRUCT */ + TRACE(("%s lnext:%d (from %s)\n", (rc == 0) ? "OK" : "FAIL", result, tag)); + (void) tag; + return result; +} + +int main(int argc, char *argv[]ENVP_ARG) { #if OPT_MAXIMIZE @@ -2255,7 +2434,7 @@ main(int argc, char *argv[]ENVP_ARG) #endif { xtermWarning("unable to allocate memory for ttydev or ptydev\n"); - exit(1); + exit(ERROR_MISC); } strcpy(ttydev, TTYDEV); #ifdef USE_PTY_DEVICE @@ -2705,14 +2884,11 @@ main(int argc, char *argv[]ENVP_ARG) if (command_to_exec) { Arg args[2]; - if (!resource.title) { - if (command_to_exec) { - resource.title = x_basename(command_to_exec[0]); - } /* else not reached */ - } - + if (!resource.title) + resource.title = x_basename(command_to_exec[0]); if (!resource.icon_name) resource.icon_name = resource.title; + XtSetArg(args[0], XtNtitle, resource.title); XtSetArg(args[1], XtNiconName, resource.icon_name); @@ -2723,6 +2899,18 @@ main(int argc, char *argv[]ENVP_ARG) *command_to_exec)); XtSetValues(toplevel, args, 2); + } else if (IsEmpty(resource.title) && strcmp(my_class, DEFCLASS)) { + Arg args[2]; + int n; + + resource.title = x_strdup(my_class); + for (n = 0; resource.title[n]; ++n) { + if (isalpha(CharOf(resource.title[n]))) + resource.title[n] = (char) tolower(CharOf(resource.title[n])); + } + TRACE(("setting:\n\ttitle \"%s\"\n", resource.title)); + XtSetArg(args[0], XtNtitle, resource.title); + XtSetValues(toplevel, args, 1); } #if OPT_LUIT_PROG if (term->misc.callfilter) { @@ -3002,7 +3190,7 @@ main(int argc, char *argv[]ENVP_ARG) } } -#if defined(__osf__) || (defined(__GLIBC__) && !defined(USE_USG_PTYS)) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__) +#if defined(__osf__) || (defined(__linux__) && !defined(USE_USG_PTYS)) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__) #define USE_OPENPTY 1 static int opened_tty = -1; #endif @@ -3651,7 +3839,10 @@ findValidShell(const char *haystack, const char *needle) static int ourValidShell(const char *pathname) { - return findValidShell(x_strtrim(resource.valid_shells), pathname); + char *trimmed = x_strtrim(resource.valid_shells); + int result = findValidShell(trimmed, pathname); + free(trimmed); + return result; } #if defined(HAVE_GETUSERSHELL) && defined(HAVE_ENDUSERSHELL) @@ -3777,6 +3968,7 @@ xtermTrimEnv(void) TRIM(0, WINDOW), /* screen */ TRIM(0, XCURSOR_PATH), KEEP(0, MC_XDG_OPEN), + KEEP(0, TERM_INGRES), TRIM(1, COLORFGBG), TRIM(1, COLORTERM), TRIM(1, GIO_LAUNCHED_), @@ -3812,13 +4004,18 @@ xtermTrimEnv(void) my_var[dstlen] = '\0'; xtermUnsetenv(my_var); free(my_var); + /* When removing an entry, check the same slot again. */ + j--; } break; } } else if (dstlen == srclen && !strncmp(environ[j], table[k].name, srclen)) { - if (table[k].trim) + if (table[k].trim) { xtermUnsetenv(table[k].name); + /* When removing an entry, check the same slot again. */ + j--; + } break; } } @@ -3841,7 +4038,7 @@ spawnXTerm(XtermWidget xw, unsigned line_speed) int done; #endif #if OPT_INITIAL_ERASE - int initial_erase = VAL_INITIAL_ERASE; + int initial_erase = XTERM_ERASE; Bool setInitialErase; #endif int rc = 0; @@ -3931,7 +4128,7 @@ spawnXTerm(XtermWidget xw, unsigned line_speed) set_pty_id(ptydev, passedPty); #endif if (xtermResetIds(screen) < 0) - exit(1); + exit(ERROR_MISC); } else { Bool tty_got_hung; @@ -3958,7 +4155,7 @@ spawnXTerm(XtermWidget xw, unsigned line_speed) got_handshake_size = False; #endif /* OPT_PTY_HANDSHAKE */ #if OPT_INITIAL_ERASE - initial_erase = VAL_INITIAL_ERASE; + initial_erase = XTERM_ERASE; #endif signal(SIGALRM, SIG_DFL); @@ -4073,20 +4270,9 @@ spawnXTerm(XtermWidget xw, unsigned line_speed) TRACE_GET_TTYSIZE(screen->respond, "after get_pty"); #if OPT_INITIAL_ERASE if (resource.ptyInitialErase) { -#ifdef TERMIO_STRUCT - TERMIO_STRUCT my_tio; - rc = ttyGetAttr(screen->respond, &my_tio); - if (rc == 0) - initial_erase = my_tio.c_cc[VERASE]; -#else /* !TERMIO_STRUCT */ - struct sgttyb my_sg; - rc = ioctl(screen->respond, TIOCGETP, (char *) &my_sg); - if (rc == 0) - initial_erase = my_sg.sg_erase; -#endif /* TERMIO_STRUCT */ - TRACE(("%s initial_erase:%d (from pty)\n", - (rc == 0) ? "OK" : "FAIL", - initial_erase)); + initial_erase = get_tty_erase(screen->respond, + initial_erase, + "pty"); } #endif /* OPT_INITIAL_ERASE */ } @@ -4094,8 +4280,8 @@ spawnXTerm(XtermWidget xw, unsigned line_speed) /* avoid double MapWindow requests */ XtSetMappedWhenManaged(SHELL_OF(CURRENT_EMU()), False); - wm_delete_window = XInternAtom(XtDisplay(toplevel), "WM_DELETE_WINDOW", - False); + wm_delete_window = CachedInternAtom(XtDisplay(toplevel), + "WM_DELETE_WINDOW"); if (!TEK4014_ACTIVE(xw)) VTInit(xw); /* realize now so know window size for tty driver */ @@ -4106,7 +4292,8 @@ spawnXTerm(XtermWidget xw, unsigned line_speed) * that we are going to steal the console. */ XmuGetHostname(mit_console_name + MIT_CONSOLE_LEN, 255); - mit_console = XInternAtom(screen->display, mit_console_name, False); + TRACE(("getting for console name property \"%s\"\n", mit_console_name)); + mit_console = CachedInternAtom(screen->display, mit_console_name); /* the user told us to be the console, so we can use CurrentTime */ XtOwnSelection(SHELL_OF(CURRENT_EMU()), mit_console, CurrentTime, @@ -4262,18 +4449,18 @@ spawnXTerm(XtermWidget xw, unsigned line_speed) /* * now in child process */ -#if defined(_POSIX_SOURCE) || defined(SVR4) || defined(__convex__) || defined(__SCO__) || defined(__QNX__) +#ifdef HAVE_SETSID int pgrp = setsid(); /* variable may not be used... */ #else int pgrp = getpid(); #endif - TRACE_CHILD + TRACE_CHILD; #ifdef USE_USG_PTYS #ifdef HAVE_SETPGID - setpgid(0, 0); + setpgid(0, 0); #else - setpgrp(); + setpgrp(); #endif unlockpt(screen->respond); TRACE_GET_TTYSIZE(screen->respond, "after unlockpt"); @@ -4439,12 +4626,12 @@ spawnXTerm(XtermWidget xw, unsigned line_speed) sizeof(handshake)); if (i <= 0) { /* parent terminated */ - exit(1); + exit(ERROR_MISC); } if (handshake.status == PTY_NOMORE) { /* No more ptys, let's shutdown. */ - exit(1); + exit(ERROR_MISC); } /* We have a new pty to try */ @@ -4476,7 +4663,7 @@ spawnXTerm(XtermWidget xw, unsigned line_speed) */ { #ifdef TERMIO_STRUCT -#if defined(umips) || defined(CRAY) || defined(linux) +#if defined(umips) || defined(CRAY) || defined(__linux__) /* If the control tty had its modes screwed around with, eg. by lineedit in the shell, or emacs, etc. then tio will have bad values. Let's just get termio from the @@ -4922,7 +5109,7 @@ spawnXTerm(XtermWidget xw, unsigned line_speed) #if defined(WTMPX_FILE) && (defined(SVR4) || defined(__SCO__)) if (xw->misc.login_shell) updwtmpx(WTMPX_FILE, &utmp); -#elif defined(linux) && defined(__GLIBC__) && (__GLIBC__ >= 2) && !(defined(__powerpc__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)) +#elif defined(__linux__) && defined(__GLIBC__) && (__GLIBC__ >= 2) && !(defined(__powerpc__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)) if (xw->misc.login_shell) call_updwtmp(etc_wtmp, &utmp); #else @@ -5136,6 +5323,7 @@ spawnXTerm(XtermWidget xw, unsigned line_speed) } if (*newtc) { #if OPT_INITIAL_ERASE +#define TERMCAP_ERASE "kb" unsigned len; remove_termcap_entry(newtc, TERMCAP_ERASE "="); len = (unsigned) strlen(newtc); @@ -5503,7 +5691,7 @@ Exit(int n) #if defined(WTMPX_FILE) && (defined(SVR4) || defined(__SCO__)) if (xw->misc.login_shell) updwtmpx(WTMPX_FILE, utptr); -#elif defined(linux) && defined(__GLIBC__) && (__GLIBC__ >= 2) && !(defined(__powerpc__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)) +#elif defined(__linux__) && defined(__GLIBC__) && (__GLIBC__ >= 2) && !(defined(__powerpc__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)) copy_filled(utmp.ut_line, utptr->ut_line, sizeof(utmp.ut_line)); if (xw->misc.login_shell) call_updwtmp(etc_wtmp, utptr); @@ -5638,7 +5826,7 @@ resize_termcap(XtermWidget xw) char *newtc = get_tcap_buffer(xw); #ifndef USE_SYSV_ENVVARS - if (!TEK4014_ACTIVE(xw) && *newtc) { + if (!TEK4014_ACTIVE(xw) && newtc != NULL && *newtc) { TScreen *screen = TScreenOf(xw); char *ptr1, *ptr2; size_t i; @@ -5665,6 +5853,10 @@ resize_termcap(XtermWidget xw) ptr1 += 3; ptr2 += 3; strncpy(newtc, oldtc, i = (size_t) (ptr1 - oldtc)); + if (i >= TERMCAP_SIZE - 10) { + TRACE(("...insufficient space: %lu\n", (unsigned long) i)); + return; + } temp = newtc + i; sprintf(temp, "%d", (li_first ? MaxRows(screen) @@ -5863,14 +6055,14 @@ parse_tty_modes(char *s) } } -#ifndef VMS /* don't use pipes on OpenVMS */ +#ifndef GetBytesAvailable int -GetBytesAvailable(int fd) +GetBytesAvailable(Display *dpy) { + int fd = ConnectionNumber(dpy); + int result; #if defined(FIONREAD) - int arg; - ioctl(fd, FIONREAD, (char *) &arg); - return (int) arg; + ioctl(fd, FIONREAD, (char *) &result); #elif defined(__CYGWIN__) fd_set set; struct timeval select_timeout = @@ -5878,19 +6070,15 @@ GetBytesAvailable(int fd) FD_ZERO(&set); FD_SET(fd, &set); - if (Select(fd + 1, &set, NULL, NULL, &select_timeout) > 0) - return 1; - else - return 0; -#elif defined(FIORDCK) - return (ioctl(fd, FIORDCHK, NULL)); -#else /* !FIORDCK */ + result = (Select(fd + 1, &set, NULL, NULL, &select_timeout) > 0) ? 1 : 0; +#else struct pollfd pollfds[1]; pollfds[0].fd = fd; pollfds[0].events = POLLIN; - return poll(pollfds, 1, 0); + result = poll(pollfds, 1, 0); #endif + return result; } #endif /* !VMS */ diff --git a/app/xterm/main.h b/app/xterm/main.h index f1c4d6e9c..3d94776d6 100644 --- a/app/xterm/main.h +++ b/app/xterm/main.h @@ -1,7 +1,7 @@ -/* $XTermId: main.h,v 1.82 2022/11/21 22:28:35 tom Exp $ */ +/* $XTermId: main.h,v 1.85 2023/10/22 10:34:12 tom Exp $ */ /* - * Copyright 2000-2021,2022 by Thomas E. Dickey + * Copyright 2000-2022,2023 by Thomas E. Dickey * * All Rights Reserved * @@ -132,7 +132,7 @@ #endif #ifndef DEF_DISALLOWED_PASTE_CONTROLS -#define DEF_DISALLOWED_PASTE_CONTROLS "BS,DEL,ENQ,EOT,ESC,NUL" +#define DEF_DISALLOWED_PASTE_CONTROLS "BS,DEL,ENQ,EOT,ESC,NUL,STTY" #endif #ifndef DEF_DISALLOWED_TCAP @@ -227,10 +227,26 @@ #define DEF_SCROLL_LINES 1 #endif +#ifndef DEF_SL_CLOCK +#define DEF_SL_CLOCK 1000 +#endif + +#ifndef DEF_SL_COORDS +#define DEF_SL_COORDS 80 +#endif + #ifndef DEF_SL_FORMAT #define DEF_SL_FORMAT "%{version%} %{position%} %{unixtime%}" #endif +#ifndef DEF_STRINGS_MAX +#if OPT_REGIS_GRAPHICS || OPT_SIXEL_GRAPHICS +#define DEF_STRINGS_MAX 600000 +#else +#define DEF_STRINGS_MAX 20000 +#endif +#endif + #ifndef DEF_TITLE_MODES #define DEF_TITLE_MODES 0 #endif diff --git a/app/xterm/menu.c b/app/xterm/menu.c index 4f175972c..50be11be4 100644 --- a/app/xterm/menu.c +++ b/app/xterm/menu.c @@ -1,7 +1,7 @@ -/* $XTermId: menu.c,v 1.370 2022/10/07 08:00:53 Ben.Wong Exp $ */ +/* $XTermId: menu.c,v 1.375 2023/12/01 21:39:31 tom Exp $ */ /* - * Copyright 1999-2021,2022 by Thomas E. Dickey + * Copyright 1999-2022,2023 by Thomas E. Dickey * * All Rights Reserved * @@ -55,6 +55,7 @@ #include <xterm.h> #include <data.h> +#include <error.h> #include <menu.h> #include <fontutils.h> #include <xstrings.h> @@ -696,7 +697,7 @@ create_menu(Widget w, XtermWidget xw, MenuIndex num) toplevel, NULL, 0); TRACE(("created popupShell(%s) widget %p, window %#lx\n", - data->internal_name, list->w, XtWindow(list->w))); + data->internal_name, (void *) list->w, XtWindow(list->w))); #endif if (list->w != 0) { Boolean *unused = unusedEntries(xw, num); @@ -1434,7 +1435,7 @@ do_quit(Widget gw GCC_UNUSED, XtPointer closure GCC_UNUSED, XtPointer data GCC_UNUSED) { - Cleanup(SIGHUP); + Cleanup(ERROR_MISC); } /* @@ -3754,6 +3755,7 @@ update_titeInhibit(void) void update_activeicon(void) { + SetItemSensitivity(vtMenuEntries[vtMenu_activeicon].widget, False); UpdateCheckbox("update_activeicon", vtMenuEntries, vtMenu_activeicon, diff --git a/app/xterm/minstall.in b/app/xterm/minstall.in index fe2c610a3..406dae9bf 100644 --- a/app/xterm/minstall.in +++ b/app/xterm/minstall.in @@ -1,9 +1,9 @@ #!/bin/sh -# $XTermId: minstall.in,v 1.27 2022/10/02 20:13:11 tom Exp $ +# $XTermId: minstall.in,v 1.32 2023/10/08 21:11:07 tom Exp $ # ----------------------------------------------------------------------------- # this file is part of xterm # -# Copyright 2001-2021,2022 by Thomas E. Dickey +# Copyright 2001-2022,2023 by Thomas E. Dickey # # All Rights Reserved # @@ -66,55 +66,23 @@ break fi done +prefix=@prefix@ +exec_prefix=@exec_prefix@ +datarootdir=@datarootdir@ +datadir=@datadir@ + # get parameters MINSTALL="$1" OLD_FILE="$2" END_FILE="$3" -APPS_DIR="$4" -APP_TYPE="$5" -APP_name="$6" -USE_name="$7" -XPMS_DIR="$8" +APP_name="$4" +USE_name="$5" suffix=`echo "$END_FILE" | sed -e 's%^.*\.%%'` NEW_FILE=temp$$ MY_MANSECT=$suffix -# utmp and wtmp have different pathnames on different systems, but there -# are only a few common choices. Note that they may not necessarily appear -# in the same directories. Prefer utmpx/wtmpx to utmp/wtmp, since that's -# the way the configure script is designed. -UTMP_NAME=utmp -UTMP_PATH=/etc -for name in /etc /var/adm /var/run /var/log -do - if test -f $name/utmpx ; then - UTMP_NAME=utmpx - UTMP_PATH=$name - break - elif test -f $name/utmp ; then - UTMP_PATH=$name - break - fi -done -UTMP_PATH=$UTMP_PATH/$UTMP_NAME - -WTMP_NAME=wtmp -WTMP_PATH=/etc -for name in /etc /var/adm /var/run /var/log -do - if test -f $name/wtmpx ; then - WTMP_NAME=wtmpx - WTMP_PATH=$name - break - elif test -f $name/wtmp ; then - WTMP_PATH=$name - break - fi -done -WTMP_PATH=$WTMP_PATH/$WTMP_NAME - lower=abcdefghijklmnopqrstuvwxyz upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ @@ -157,15 +125,16 @@ sed -e 's%__vendorversion__%"X Window System"%' \ -e "s%__delete_is_del__%@delete_is_del@%" \ -e "s%__double_buffer__%@double_buffer@%" \ -e "s%__initial_erase__%@initial_erase@%" \ - -e "s%__default_class__%$APP_TYPE%" \ - -e "s%__apploaddir__%$APPS_DIR%" \ + -e "s%__default_class__%@APP_CLASS@%" \ + -e "s%__apploaddir__%@APPSDIR@%" \ -e "s%__mansuffix__%$MY_MANSECT%g" \ -e "s%__miscmansuffix__%$X_MANSECT%g" \ - -e "s%__pixmapsdir__%$XPMS_DIR%" \ - -e 's%fIutmp\\%fI'$UTMP_NAME'\\%g' \ - -e "s%/etc/utmp%$UTMP_PATH%g" \ - -e 's%fIwtmp\\%fI'$WTMP_NAME'\\%g' \ - -e "s%/etc/wtmp%$WTMP_PATH%g" \ + -e "s%__pixmapsdir__%@PIXMAPDIR@%" \ + -e "s%__strings_max__%@STRINGS_MAX@%" \ + -e "s%__utmp_name__%@UTMP_NAME@%g" \ + -e "s%__utmp_path__%@UTMP_PATH@%g" \ + -e "s%__wtmp_name__%@WTMP_NAME@%g" \ + -e "s%__wtmp_path__%@WTMP_PATH@%g" \ -e 's%/\\(\*\*%/*%g' \ "$OLD_FILE" >$NEW_FILE # diff -u $OLD_FILE $NEW_FILE diff --git a/app/xterm/misc.c b/app/xterm/misc.c index 5d5b0f2cb..e3397261a 100644 --- a/app/xterm/misc.c +++ b/app/xterm/misc.c @@ -1,7 +1,7 @@ -/* $XTermId: misc.c,v 1.1044 2023/01/07 01:11:16 tom Exp $ */ +/* $XTermId: misc.c,v 1.1094 2024/06/26 08:05:39 tom Exp $ */ /* - * Copyright 1999-2022,2023 by Thomas E. Dickey + * Copyright 1999-2023,2024 by Thomas E. Dickey * * All Rights Reserved * @@ -138,8 +138,6 @@ static Boolean xtermAllocColor(XtermWidget, XColor *, const char *); static Cursor make_hidden_cursor(XtermWidget); -static char emptyString[] = ""; - #if OPT_EXEC_XTERM /* Like readlink(2), but returns a malloc()ed buffer, or NULL on error; adapted from libc docs */ @@ -308,14 +306,9 @@ do_xevents(XtermWidget xw) TScreen *screen = TScreenOf(xw); if (xtermAppPending() - || -#if defined(VMS) || defined(__VMS) - screen->display->qlen > 0 -#else - GetBytesAvailable(ConnectionNumber(screen->display)) > 0 -#endif - ) + || GetBytesAvailable(screen->display) > 0) { xevents(xw); + } } void @@ -1346,7 +1339,7 @@ AtomBell(XtermWidget xw, int which) for (n = 0; n < XtNumber(table); ++n) { if (table[n].value == which) { - result = XInternAtom(XtDisplay(xw), table[n].name, False); + result = CachedInternAtom(XtDisplay(xw), table[n].name); break; } } @@ -1780,10 +1773,11 @@ xtermDeiconify(XtermWidget xw) Display *dpy = screen->display; Window target = VShellWindow(xw); XEvent e; - Atom atom_state = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False); + Atom atom_state = CachedInternAtom(dpy, "_NET_ACTIVE_WINDOW"); if (xtermIsIconified(xw)) { TRACE(("...de-iconify window %#lx\n", target)); + ResetHiddenHint(xw); XMapWindow(dpy, target); memset(&e, 0, sizeof(e)); @@ -1833,8 +1827,8 @@ xtermIsIconified(XtermWidget xw) unsigned char *prop_return = 0; long long_length = 1024; Atom requested_type = XA_ATOM; - Atom is_hidden = XInternAtom(dpy, "_NET_WM_STATE_HIDDEN", False); - Atom wm_state = XInternAtom(dpy, "_NET_WM_STATE", False); + Atom is_hidden = CachedInternAtom(dpy, "_NET_WM_STATE_HIDDEN"); + Atom wm_state = CachedInternAtom(dpy, "_NET_WM_STATE"); /* this works with non-EWMH */ result = (win_attrs.map_state != IsViewable) ? True : False; @@ -2484,9 +2478,11 @@ GenerateLogPath(void) } } #else - static const char log_def_name[] = "XtermLog.XXXXXX"; - if ((log_default = x_strdup(log_def_name)) != NULL) { - MakeTemp(log_default); + { + static const char log_def_name[] = "XtermLog.XXXXXX"; + if ((log_default = x_strdup(log_def_name)) != NULL) { + MakeTemp(log_default); + } } #endif @@ -3482,7 +3478,7 @@ xtermIsPrintable(XtermWidget xw, Char **bufp, Char *last) PtyData data; if (decodeUtf8(screen, fakePtyData(&data, cp, last))) { - if (data.utf_data != UCS_REPL + if (!is_UCS_SPECIAL(data.utf_data) && (data.utf_data >= 128 || ansi_table[data.utf_data] == CASE_PRINT)) { next += (data.utf_size - 1); @@ -4462,7 +4458,7 @@ parse_decudk(XtermWidget xw, const char *cp) * Parse numeric parameters. Normally we use a state machine to simplify * interspersing with control characters, but have the string already. */ -static void +void parse_ansi_params(ANSI *params, const char **string) { const char *cp = *string; @@ -4615,7 +4611,6 @@ parse_decdld(ANSI *params, const char *string) #define parse_decdld(p,q) /* nothing */ #endif -#if OPT_DEC_RECTOPS static const char * skip_params(const char *cp) { @@ -4624,9 +4619,11 @@ skip_params(const char *cp) return cp; } +#if OPT_MOD_FKEYS || OPT_DEC_RECTOPS || (OPT_VT525_COLORS && OPT_ISO_COLORS) static int parse_int_param(const char **cp) { + Boolean found = False; int result = 0; const char *s = *cp; while (*s != '\0') { @@ -4635,15 +4632,18 @@ parse_int_param(const char **cp) break; } else if (*s >= '0' && *s <= '9') { result = (result * 10) + (*s++ - '0'); + found = True; } else { s += strlen(s); } } - TRACE(("parse-int %s ->%d, %#x->%s\n", *cp, result, result, s)); + TRACE(("parse-int \"%s\" ->%d, %#x->\"%s\"\n", *cp, result, result, s)); *cp = s; - return result; + return found ? result : -1; } +#endif +#if OPT_DEC_RECTOPS static int parse_chr_param(const char **cp) { @@ -4658,11 +4658,17 @@ parse_chr_param(const char **cp) } } } - TRACE(("parse-chr %s ->%d, %#x->%s\n", *cp, result, result, s)); + TRACE(("parse-chr %s ->%#x, %#x->%s\n", *cp, result, result, s)); *cp = s; return result; } +#if OPT_TRACE +#define done_DECCIR() do { TRACE(("...quit DECCIR @%d\n", __LINE__)); return; } while(0) +#else +#define done_DECCIR() return +#endif + static void restore_DECCIR(XtermWidget xw, const char *cp) { @@ -4671,22 +4677,33 @@ restore_DECCIR(XtermWidget xw, const char *cp) /* row */ if ((value = parse_int_param(&cp)) <= 0 || value > MaxRows(screen)) - return; + done_DECCIR(); screen->cur_row = (value - 1); /* column */ if ((value = parse_int_param(&cp)) <= 0 || value > MaxCols(screen)) - return; + done_DECCIR(); screen->cur_col = (value - 1); /* page */ if (parse_int_param(&cp) != 1) - return; + done_DECCIR(); /* rendition */ - if (((value = parse_chr_param(&cp)) & 0xf0) != 0x40) - return; + if (((value = parse_chr_param(&cp)) & 0xf0) != 0x40) { + if (value & 0x10) { + /* + * VT420 is documented for bit 5 always reset; VT520/VT525 are not + * documented, but do use the bit for setting invisible mode. + */ + if (screen->vtXX_level <= 4) + done_DECCIR(); + } else if (!(value & 0x40)) { + done_DECCIR(); + } + } UIntClr(xw->flags, (INVERSE | BLINK | UNDERLINE | BOLD)); + xw->flags |= (value & 16) ? INVISIBLE : 0; xw->flags |= (value & 8) ? INVERSE : 0; xw->flags |= (value & 4) ? BLINK : 0; xw->flags |= (value & 2) ? UNDERLINE : 0; @@ -4694,38 +4711,39 @@ restore_DECCIR(XtermWidget xw, const char *cp) /* attributes */ if (((value = parse_chr_param(&cp)) & 0xfe) != 0x40) - return; + done_DECCIR(); screen->protected_mode &= ~DEC_PROTECT; screen->protected_mode |= (value & 1) ? DEC_PROTECT : 0; /* flags */ if (((value = parse_chr_param(&cp)) & 0xf0) != 0x40) - return; + done_DECCIR(); screen->do_wrap = (value & 8) ? True : False; screen->curss = (Char) ((value & 4) ? 3 : ((value & 2) ? 2 : 0)); UIntClr(xw->flags, ORIGIN); xw->flags |= (value & 1) ? ORIGIN : 0; if ((value = (parse_chr_param(&cp) - '0')) < 0 || value >= NUM_GSETS) - return; + done_DECCIR(); screen->curgl = (Char) value; if ((value = (parse_chr_param(&cp) - '0')) < 0 || value >= NUM_GSETS) - return; + done_DECCIR(); screen->curgr = (Char) value; /* character-set size */ - if (parse_chr_param(&cp) != 0x4f) /* works for xterm */ - return; + if (parse_chr_param(&cp) == 0xffff) /* FIXME: limit SCS? */ + done_DECCIR(); /* SCS designators */ for (value = 0; value < NUM_GSETS; ++value) { - if (*cp == '%') { - xtermDecodeSCS(xw, value, 0, '%', *++cp); - } else if (*cp != '\0') { - xtermDecodeSCS(xw, value, 0, '\0', *cp); + if (*cp == '\0') { + done_DECCIR(); + } else if (strchr("%&\"", *cp) != NULL) { + int prefix = *cp++; + xtermDecodeSCS(xw, value, 0, prefix, *cp); } else { - return; + xtermDecodeSCS(xw, value, 0, '\0', *cp); } cp++; } @@ -4747,10 +4765,8 @@ restore_DECTABSR(XtermWidget xw, const char *cp) --stop; if (OkTAB(stop)) { TabSet(xw->tabs, stop); - stop = 0; - } else { - fail = True; } + stop = 0; } else { fail = True; } @@ -4762,7 +4778,116 @@ restore_DECTABSR(XtermWidget xw, const char *cp) TRACE(("...done DECTABSR\n")); } -#endif +#endif /* OPT_DEC_RECTOPS */ + +/* + * VT510 and VT520 reference manual have the same explanation for Pn (params), + * but it does not agree with the possible values for Dscs because it refers + * to "ISO Latin-7" (ISO 8859-13 aka "Baltic Rim"), and omits ISO Greek + * (ISO 8859-7): + * + * ------------------------------------------------------------------------ + * Pn Meaning + * ------------------------------------------------------------------------ + * 0 DEC, ISO Latin-1, ISO Latin-2 + * 1 ISO Latin-5, ISO Latin-7, ISO Cyrillic, ISO Hebrew + * ------------------------------------------------------------------------ + * + * versus + * + * ------------------------------------------------------------------------ + * Dscs Character Set + * ------------------------------------------------------------------------ + * %5 DEC Supplemental + * "? DEC Greek + * "4 DEC Hebrew + * %0 DEC Turkish + * &4 DEC Cyrillic + * < User-preferred Supplemental + * A ISO Latin-1 Supplemental + * B ISO Latin-2 Supplemental + * F ISO Greek Supplemental + * H ISO Hebrew Supplemental + * M ISO Latin-5 Supplemental + * L ISO Latin-Cyrillic + * ------------------------------------------------------------------------ + * + * DEC 070, page 5-123 explains that Pn ("Ps" in the text) selects 94 or 96 + * character sets (0 or 1, respectively), and on the next page states that + * the valid combinations are 0 (DEC Supplemental) and 1 (ISO Latin-1 + * supplemental). The document comments in regard to LS0 that (applications) + * should not assume that they can use 96-character sets for G0, but that it + * is possible to do this using UPSS. + * + * The VT510/VT520 reference manuals under SCS Select Character Set show + * a list of 94- and 96-character sets with "DEC" and "NRCS" as 94-characters, + * and the "ISO" as 96-characters. A few 94-character sets are added, based + * on testing VT520/VT525 that shows that DEC Special Graphics also is allowed. + */ +static Bool +decode_upss(XtermWidget xw, const char *cp, char psarg, DECNRCM_codes * upss) +{ + /* *INDENT-OFF* */ + static const struct { + DECNRCM_codes code; + int params; /* 0 for 94-characters, 1 for 96-characters */ + int prefix; + int suffix; + int min_level; + int max_level; + } upss_table[] = { + { DFT_UPSS, 0, '%', '5', 3, 9 }, + { nrc_ASCII, 0, 0, 'A', 1, 9 }, /* undocumented */ + { nrc_DEC_Spec_Graphic, 0, 0, '0', 1, 9 }, /* undocumented */ + { nrc_DEC_Technical, 0, 0, '>', 3, 9 }, /* undocumented */ + { nrc_DEC_Greek_Supp, 0, '"', '?', 5, 9 }, + { nrc_DEC_Hebrew_Supp, 0, '"', '4', 5, 9 }, + { nrc_DEC_Turkish_Supp, 0, '%', '0', 5, 9 }, + { nrc_DEC_Cyrillic, 0, '&', '4', 5, 9 }, + { ALT_UPSS, 1, 0, 'A', 3, 9 }, + { nrc_ISO_Latin_2_Supp, 1, 0, 'B', 5, 9 }, + { nrc_ISO_Greek_Supp, 1, 0, 'F', 5, 9 }, + { nrc_ISO_Hebrew_Supp, 1, 0, 'H', 5, 9 }, + { nrc_ISO_Latin_5_Supp, 1, 0, 'M', 5, 9 }, + { nrc_ISO_Latin_Cyrillic, 1, 0, 'L', 5, 9 }, + }; + /* *INDENT-ON* */ + TScreen *screen = TScreenOf(xw); + Bool result = False; + + *upss = nrc_ASCII; + if (screen->vtXX_level >= 3) { + Cardinal n; + for (n = 0; n < XtNumber(upss_table); ++n) { + if (((int) psarg - '0') != upss_table[n].params) + continue; + + if (cp[1] == '\0') { + if (upss_table[n].suffix != cp[0]) + continue; + } else if (cp[2] == '\0') { + if (upss_table[n].prefix != cp[0]) + continue; + if (upss_table[n].suffix != cp[1]) + continue; + } else { + continue; + } + + result = True; + *upss = upss_table[n].code; + if (*upss == DFT_UPSS) { + TRACE(("DECAUPSS (default)\n")); + } else if (*upss == ALT_UPSS) { + TRACE(("DECAUPSS (alternate)\n")); + } + break; + } + TRACE(("DECAUPSS %ssuccessful %s\n", + result ? "" : "not ", visibleScsCode(*upss))); + } + return result; +} void do_dcs(XtermWidget xw, Char *dcsbuf, size_t dcslen) @@ -4772,8 +4897,12 @@ do_dcs(XtermWidget xw, Char *dcsbuf, size_t dcslen) const char *cp = (const char *) dcsbuf; Bool okay; ANSI params; -#if OPT_DEC_RECTOPS char psarg = '0'; +#if OPT_VT525_COLORS && OPT_ISO_COLORS + const char *cp2; +#endif +#if (OPT_VT525_COLORS && OPT_ISO_COLORS) || OPT_MOD_FKEYS + int ival; #endif TRACE(("do_dcs(%s:%lu)\n", (char *) dcsbuf, (unsigned long) dcslen)); @@ -4864,12 +4993,79 @@ do_dcs(XtermWidget xw, Char *dcsbuf, size_t dcslen) cp); } else #endif +#if OPT_DEC_RECTOPS + if (!strcmp(cp, "*x")) { /* DECSACE */ + TRACE(("reply DECSACE\n")); + sprintf(reply, "%d%s", + screen->cur_decsace, + cp); + } else +#endif if (!strcmp(cp, "*|")) { /* DECSNLS */ TRACE(("reply DECSNLS\n")); sprintf(reply, "%d%s", screen->max_row + 1, cp); - } else { + } else +#if OPT_VT525_COLORS && OPT_ISO_COLORS + if (screen->terminal_id == 525 + && !strcmp((cp2 = skip_params(cp)), ",}")) { /* DECATC */ + ival = parse_int_param(&cp); + TRACE(("reply DECATC:%s\n", cp)); + if (ival >= 0 && ival < 16 && *cp2 == ',') { + sprintf(reply, "%d;%d;%d%s", ival, + screen->alt_colors[ival].fg, + screen->alt_colors[ival].bg, + cp2); + } else { + okay = False; + } + } else if (screen->terminal_id == 525 + && !strcmp((cp2 = skip_params(cp)), ",|")) { /* DECAC */ + ival = parse_int_param(&cp); + TRACE(("reply DECAC\n")); + switch (ival) { + case 1: /* normal text */ + sprintf(reply, "%d,%d%s", + screen->assigned_fg, + screen->assigned_bg, + cp2); + break; + case 2: /* window frame (not implemented) */ + /* FALLTHRU */ + default: + okay = False; + break; + } + } else +#endif +#if OPT_MOD_FKEYS + if (*cp == '>' && !strcmp(skip_params(1 + cp), "m")) { /* XTQMODKEYS */ + ++cp; + okay = True; + ival = parse_int_param(&cp); +#define GET_MOD_FKEYS(field) xw->keyboard.modify_now.field +#define FMT_MOD_FKEYS(field) sprintf(reply, ">%d;%dm", ival, GET_MOD_FKEYS(field)) + switch (ival) { + case 0: + FMT_MOD_FKEYS(allow_keys); + break; + case 1: + FMT_MOD_FKEYS(cursor_keys); + break; + case 2: + FMT_MOD_FKEYS(function_keys); + break; + case 4: + FMT_MOD_FKEYS(other_keys); + break; + default: + okay = False; + break; + } + } else +#endif + { okay = False; } @@ -4935,7 +5131,7 @@ do_dcs(XtermWidget xw, Char *dcsbuf, size_t dcslen) unparseputn(xw, xw->rgb_widths[0]); } else { char temp[1024]; - sprintf(temp, "%d/%d/%d", + sprintf(temp, "%u/%u/%u", xw->rgb_widths[0], xw->rgb_widths[1], xw->rgb_widths[2]); @@ -4988,6 +5184,7 @@ do_dcs(XtermWidget xw, Char *dcsbuf, size_t dcslen) break; /* no data found, error */ } if ((cp - parsed) > 1024) { + free(name); break; /* ignore improbable resource */ } TRACE(("query-feature '%s'\n", name)); @@ -5032,8 +5229,25 @@ do_dcs(XtermWidget xw, Char *dcsbuf, size_t dcslen) #endif } break; -#if OPT_DEC_RECTOPS + case '0': + /* FALLTHRU */ case '1': + if (screen->vtXX_level >= 3 && *skip_params(cp) == '!') { + DECNRCM_codes upss; + psarg = *cp++; + if (*cp++ == '!' && *cp++ == 'u') { +#if OPT_WIDE_CHARS + if (screen->wide_chars && screen->utf8_mode) { + ; /* EMPTY */ + } else +#endif + if (decode_upss(xw, cp, psarg, &upss)) { + screen->gsets_upss = upss; + } + } + break; + } +#if OPT_DEC_RECTOPS /* FALLTHRU */ case '2': if (*skip_params(cp) == '$') { @@ -5058,7 +5272,6 @@ do_dcs(XtermWidget xw, Char *dcsbuf, size_t dcslen) /* FALLTHRU */ default: if (optRegisGraphics(screen) || - optSixelGraphics(screen) || screen->vtXX_level >= 2) { /* VT220 */ parse_ansi_params(¶ms, &cp); switch (params.a_final) { @@ -5071,14 +5284,7 @@ do_dcs(XtermWidget xw, Char *dcsbuf, size_t dcslen) TRACE(("ignoring ReGIS graphic (compilation flag not enabled)\n")); #endif break; - case 'q': /* sixel */ -#if OPT_SIXEL_GRAPHICS - if (optSixelGraphics(screen)) { - (void) parse_sixel(xw, ¶ms, cp); - } -#else - TRACE(("ignoring sixel graphic (compilation flag not enabled)\n")); -#endif + case 'q': /* sixel is done in charproc.c */ break; case '|': /* DECUDK */ if (screen->vtXX_level >= 2) { /* VT220 */ @@ -5304,6 +5510,9 @@ do_dec_rqm(XtermWidget xw, int nparams, int *params) if_PRINT_GRAPHICS2(result = MdBool(screen->graphics_print_color_syntax)) result = MdFlag(xw->flags, REVERSEWRAP); break; + case srm_REVERSEWRAP2: /* extended reverse wraparound */ + result = MdFlag(xw->flags, REVERSEWRAP2); + break; #if defined(ALLOWLOGGING) case srm_ALLOWLOGGING: /* logging */ if_PRINT_GRAPHICS2(result = MdBool(screen->graphics_print_background_mode)) @@ -5429,6 +5638,9 @@ do_dec_rqm(XtermWidget xw, int nparams, int *params) case srm_SAVE_CURSOR: result = MdBool(screen->sc[screen->whichBuf].saved); break; + case srm_FAST_SCROLL: + result = MdBool(screen->fastscroll); + break; #if OPT_TCAP_FKEYS case srm_TCAP_FKEYS: result = MdBool(xw->keyboard.type == keyboardIsTermcap); @@ -5489,6 +5701,35 @@ do_dec_rqm(XtermWidget xw, int nparams, int *params) result = MdBool(screen->sixel_scrolls_right); break; #endif + case srm_DECARSM: /* ignore */ + case srm_DECATCBM: /* ignore */ + case srm_DECATCUM: /* ignore */ + case srm_DECBBSM: /* ignore */ + case srm_DECCAAM: /* ignore */ + case srm_DECCANSM: /* ignore */ + case srm_DECCAPSLK: /* ignore */ + case srm_DECCRTSM: /* ignore */ + case srm_DECECM: /* ignore */ + case srm_DECFWM: /* ignore */ + case srm_DECHCCM: /* ignore */ + case srm_DECHDPXM: /* ignore */ + case srm_DECHEM: /* ignore */ + case srm_DECHWUM: /* ignore */ + case srm_DECIPEM: /* ignore */ + case srm_DECKBUM: /* ignore */ + case srm_DECKLHIM: /* ignore */ + case srm_DECKPM: /* ignore */ + case srm_DECRLM: /* ignore */ + case srm_DECMCM: /* ignore */ + case srm_DECNAKB: /* ignore */ + case srm_DECNULM: /* ignore */ + case srm_DECNUMLK: /* ignore */ + case srm_DECOSCNM: /* ignore */ + case srm_DECPCCM: /* ignore */ + case srm_DECRLCM: /* ignore */ + case srm_DECRPL: /* ignore */ + case srm_DECVCCM: /* ignore */ + case srm_DECXRLM: /* ignore */ default: TRACE(("DATA_ERROR: requested report for unknown private mode %d\n", params[0])); @@ -5914,7 +6155,9 @@ ChangeGroup(XtermWidget xw, const char *attribute, char *value) char *buf = 0; XtSetArg(args[0], my_attr, &buf); XtGetValues(top, args, 1); - TRACE(("...comparing{%s}\n", NonNull(buf))); + TRACE(("...comparing resource{%s} to new value{%s}\n", + NonNull(buf), + NonNull(value))); if (buf != 0 && strcmp(value, buf) == 0) changed = False; } @@ -5932,7 +6175,7 @@ ChangeGroup(XtermWidget xw, const char *attribute, char *value) const char *propname = (!strcmp(my_attr, XtNtitle) ? "_NET_WM_NAME" : "_NET_WM_ICON_NAME"); - Atom my_atom = XInternAtom(dpy, propname, False); + Atom my_atom = CachedInternAtom(dpy, propname); if (my_atom != None) { changed = True; @@ -5997,9 +6240,6 @@ ChangeGroup(XtermWidget xw, const char *attribute, char *value) void ChangeIconName(XtermWidget xw, char *name) { - if (name == 0) { - name = emptyString; - } if (!showZIconBeep(xw, name)) ChangeGroup(xw, XtNiconName, name); } @@ -6023,7 +6263,7 @@ ChangeXprop(char *buf) if (pchEndPropName) *pchEndPropName = '\0'; - aprop = XInternAtom(dpy, buf, False); + aprop = CachedInternAtom(dpy, buf); if (pchEndPropName == NULL) { /* no "=value" given, so delete the property */ XDeleteProperty(dpy, w, aprop); @@ -6581,7 +6821,7 @@ xt_error(String message) if (x_getenv("DISPLAY") == 0) { xtermWarning("DISPLAY is not set\n"); } - exit(1); + exit(ERROR_MISC); } int @@ -7593,6 +7833,90 @@ xtermSetWinSize(XtermWidget xw) } } +static void +xtermInitTitle(TScreen *screen, int which) +{ + TRACE(("xtermInitTitle #%d\n", which)); + screen->saved_titles.data[which].iconName = NULL; + screen->saved_titles.data[which].windowName = NULL; +} + +/* + * Store/update an item on the title stack. + */ +void +xtermPushTitle(TScreen *screen, int which, SaveTitle * item) +{ + if (which-- <= 0) { + which = screen->saved_titles.used++; + screen->saved_titles.used %= MAX_SAVED_TITLES; + } + which %= MAX_SAVED_TITLES; + xtermFreeTitle(&screen->saved_titles.data[which]); + screen->saved_titles.data[which] = *item; + TRACE(("xtermPushTitle #%d: icon='%s', window='%s'\n", which, + NonNull(item->iconName), + NonNull(item->windowName))); +} + +/* + * Pop/retrieve an item from the title stack. + */ +Boolean +xtermPopTitle(TScreen *screen, int which, SaveTitle * item) +{ + Boolean result = True; + Boolean popped = False; + + if (which-- > 0) { + which %= MAX_SAVED_TITLES; + } else if (screen->saved_titles.used > 0) { + which = ((--(screen->saved_titles.used) + MAX_SAVED_TITLES) % MAX_SAVED_TITLES); + popped = True; + } else { + result = False; + } + if (result) { + *item = screen->saved_titles.data[which]; + TRACE(("xtermPopTitle #%d: icon='%s', window='%s'\n", which, + NonNull(item->iconName), + NonNull(item->windowName))); + + /* if the data is incomplete, try to get it from the next levels */ +#define TryHigher(name) \ + if (item->name == NULL) { \ + int n; \ + for (n = 1; n < MAX_SAVED_TITLES; ++n) { \ + int nw = ((which - n) + MAX_SAVED_TITLES) % MAX_SAVED_TITLES; \ + if ((item->name = screen->saved_titles.data[nw].name) != NULL) { \ + item->name = x_strdup(item->name); \ + break; \ + } \ + } \ + } + TryHigher(iconName); + TryHigher(windowName); + + if (popped) { + xtermInitTitle(screen, which); + } + } + return result; +} + +/* + * Discard data used for pushing or popping title. + */ +void +xtermFreeTitle(SaveTitle * item) +{ + TRACE(("xtermFreeTitle icon='%s', window='%s'\n", + NonNull(item->iconName), + NonNull(item->windowName))); + FreeAndNull(item->iconName); + FreeAndNull(item->windowName); +} + #if OPT_XTERM_SGR #if OPT_TRACE diff --git a/app/xterm/package/debian/changelog b/app/xterm/package/debian/changelog index f5318151f..9952d47bc 100644 --- a/app/xterm/package/debian/changelog +++ b/app/xterm/package/debian/changelog @@ -1,3 +1,93 @@ +xterm-dev (393) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 25 May 2024 09:03:00 -0400 + +xterm-dev (392) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Wed, 15 May 2024 16:52:03 -0400 + +xterm-dev (391) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Tue, 16 Apr 2024 03:51:06 -0400 + +xterm-dev (390) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Thu, 11 Jan 2024 16:18:30 -0500 + +xterm-dev (389) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Sun, 12 Nov 2023 16:48:50 -0500 + +xterm-dev (388) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Fri, 20 Oct 2023 16:43:09 -0400 + +xterm-dev (387) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Tue, 10 Oct 2023 20:02:59 -0400 + +xterm-dev (386) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Mon, 02 Oct 2023 17:19:01 -0400 + +xterm-dev (385) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Thu, 13 Jul 2023 14:57:11 -0400 + +xterm-dev (384) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Thu, 29 Jun 2023 18:22:58 -0400 + +xterm-dev (383) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Wed, 31 May 2023 13:04:55 -0400 + +xterm-dev (382) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Mon, 29 May 2023 07:15:40 -0400 + +xterm-dev (381) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Sun, 28 May 2023 04:34:22 -0400 + +xterm-dev (380) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Sun, 26 Feb 2023 20:00:24 -0500 + +xterm-dev (379) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Tue, 24 Jan 2023 20:14:44 -0500 + xterm-dev (378) unstable; urgency=low * maintenance updates diff --git a/app/xterm/package/debian/compat b/app/xterm/package/debian/compat index f599e28b8..48082f72f 100644 --- a/app/xterm/package/debian/compat +++ b/app/xterm/package/debian/compat @@ -1 +1 @@ -10 +12 diff --git a/app/xterm/package/debian/copyright b/app/xterm/package/debian/copyright index c1f48e825..dcd9b3b61 100644 --- a/app/xterm/package/debian/copyright +++ b/app/xterm/package/debian/copyright @@ -35,7 +35,7 @@ authorization. Files: * */* License: MIT-X11 -Copyright 1996-2022,2023 by Thomas E. Dickey +Copyright 1996-2023,2024 by Thomas E. Dickey (date ranges vary, depending on when the respective files were first changed significantly, and run through the most recent change date). diff --git a/app/xterm/package/debian/rules b/app/xterm/package/debian/rules index 5dffe59c4..1342b2e5d 100644 --- a/app/xterm/package/debian/rules +++ b/app/xterm/package/debian/rules @@ -109,7 +109,7 @@ install: install-stamp install-stamp: build-stamp dh_testdir dh_testroot - dh_clean -k + dh_prep dh_installdirs $(MAKE) install \ @@ -123,8 +123,8 @@ install-indep: install-arch: dh_testdir dh_testroot - dh_prep -s - dh_installdirs -s + dh_prep -a + dh_installdirs -a $(MAKE) install-bin \ DESTDIR=$(DSTDIR) diff --git a/app/xterm/package/debian/xterm-dev.lintian-overrides b/app/xterm/package/debian/xterm-dev.lintian-overrides index 0712ca79b..a57ccbd04 100644 --- a/app/xterm/package/debian/xterm-dev.lintian-overrides +++ b/app/xterm/package/debian/xterm-dev.lintian-overrides @@ -4,22 +4,4 @@ xterm-dev: command-in-menu-file-and-desktop-file xterm-dev usr/share/menu/xterm-dev:7 xterm-dev: command-in-menu-file-and-desktop-file uxterm-dev usr/share/menu/xterm-dev:14 -# The lintian warning is incorrect: there is no portable path for Perl. -# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=906901 -# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=904409 -xterm-dev: wrong-path-for-interpreter usr/share/doc/xterm-dev/examples/vttests/256colors.pl (#!/usr/bin/env != /usr/bin/perl) -xterm-dev: wrong-path-for-interpreter usr/share/doc/xterm-dev/examples/vttests/256colors2.pl (#!/usr/bin/env != /usr/bin/perl) -xterm-dev: wrong-path-for-interpreter usr/share/doc/xterm-dev/examples/vttests/88colors.pl (#!/usr/bin/env != /usr/bin/perl) -xterm-dev: wrong-path-for-interpreter usr/share/doc/xterm-dev/examples/vttests/88colors2.pl (#!/usr/bin/env != /usr/bin/perl) -xterm-dev: wrong-path-for-interpreter usr/share/doc/xterm-dev/examples/vttests/closest-rgb.pl (#!/usr/bin/env != /usr/bin/perl) -xterm-dev: wrong-path-for-interpreter usr/share/doc/xterm-dev/examples/vttests/dynamic.pl (#!/usr/bin/env != /usr/bin/perl) -xterm-dev: wrong-path-for-interpreter usr/share/doc/xterm-dev/examples/vttests/paste64.pl (#!/usr/bin/env != /usr/bin/perl) -xterm-dev: wrong-path-for-interpreter usr/share/doc/xterm-dev/examples/vttests/query-color.pl (#!/usr/bin/env != /usr/bin/perl) -xterm-dev: wrong-path-for-interpreter usr/share/doc/xterm-dev/examples/vttests/query-fonts.pl (#!/usr/bin/env != /usr/bin/perl) -xterm-dev: wrong-path-for-interpreter usr/share/doc/xterm-dev/examples/vttests/query-status.pl (#!/usr/bin/env != /usr/bin/perl) -xterm-dev: wrong-path-for-interpreter usr/share/doc/xterm-dev/examples/vttests/report-sgr.pl (#!/usr/bin/env != /usr/bin/perl) -xterm-dev: wrong-path-for-interpreter usr/share/doc/xterm-dev/examples/vttests/resize.pl (#!/usr/bin/env != /usr/bin/perl) -xterm-dev: wrong-path-for-interpreter usr/share/doc/xterm-dev/examples/vttests/sgrPushPop.pl (#!/usr/bin/env != /usr/bin/perl) -xterm-dev: wrong-path-for-interpreter usr/share/doc/xterm-dev/examples/vttests/tcapquery.pl (#!/usr/bin/env != /usr/bin/perl) - # vile: confmode diff --git a/app/xterm/package/freebsd/Makefile b/app/xterm/package/freebsd/Makefile index e6c5f5c45..949b7404d 100644 --- a/app/xterm/package/freebsd/Makefile +++ b/app/xterm/package/freebsd/Makefile @@ -1,4 +1,4 @@ -# $XTermId: Makefile,v 1.99 2022/11/26 12:25:02 tom Exp $ +# $XTermId: Makefile,v 1.114 2024/05/25 13:03:00 tom Exp $ # $FreeBSD: head/x11/xterm/Makefile 492827 2019-02-13 06:43:36Z ehaupt $ # This is adapted from the FreeBSD port, installing as "xterm-dev" with @@ -7,7 +7,7 @@ # and "make makesum". PORTNAME= xterm -PORTVERSION= 378 +PORTVERSION= 393 CATEGORIES= x11 MASTER_SITES= ftp://ftp.invisible-island.net/xterm/:src1 \ https://invisible-mirror.net/archives/xterm/:src1 diff --git a/app/xterm/package/pkgsrc/Makefile b/app/xterm/package/pkgsrc/Makefile index 00322c9e7..a9802af40 100644 --- a/app/xterm/package/pkgsrc/Makefile +++ b/app/xterm/package/pkgsrc/Makefile @@ -1,6 +1,6 @@ # $NetBSD: Makefile,v 1.117 2018/03/12 11:18:00 wiz Exp $ -DISTNAME= xterm-378 +DISTNAME= xterm-393 PKGREVISION= 1 CATEGORIES= x11 MASTER_SITES= ftp://ftp.invisible-island.net/xterm/ diff --git a/app/xterm/package/xterm.spec b/app/xterm/package/xterm.spec index 67e3b732b..5eaca8027 100644 --- a/app/xterm/package/xterm.spec +++ b/app/xterm/package/xterm.spec @@ -1,15 +1,15 @@ -# $XTermId: xterm.spec,v 1.156 2022/11/26 12:25:02 tom Exp $ +# $XTermId: xterm.spec,v 1.172 2024/05/25 13:03:00 tom Exp $ Summary: X terminal emulator (development version) %global my_middle xterm %global my_suffix -dev %global fullname %{my_middle}%{my_suffix} %global my_class XTermDev Name: %{fullname} -Version: 378 +Version: 393 Release: 1 License: X11 Group: User Interface/X -Source: xterm-%{version}.tgz +Source: https://invisible-island.net/archives/xterm/xterm-%{version}.tgz URL: https://invisible-island.net/xterm/ Provides: x-terminal-emulator >= %{version} @@ -209,14 +209,6 @@ if [ -x %{_bindir}/gtk-update-icon-cache ]; then fi %endif -%clean -if rm -rf $RPM_BUILD_ROOT; then - echo OK -else - find $RPM_BUILD_ROOT -type f | grep -F -v /.nfs && exit 1 -fi -exit 0 - %files %defattr(-,root,root,-) %{_bindir}/koi8r%{fullname} diff --git a/app/xterm/print.c b/app/xterm/print.c index d97e70051..4257e1372 100644 --- a/app/xterm/print.c +++ b/app/xterm/print.c @@ -1,7 +1,7 @@ -/* $XTermId: print.c,v 1.173 2022/09/18 21:00:08 tom Exp $ */ +/* $XTermId: print.c,v 1.176 2023/11/24 12:16:37 tom Exp $ */ /* - * Copyright 1997-2021,2022 by Thomas E. Dickey + * Copyright 1997-2022,2023 by Thomas E. Dickey * * All Rights Reserved * @@ -395,6 +395,7 @@ send_SGR(XtermWidget xw, unsigned attr, unsigned fg, unsigned bg) if ((attr & FG_COLOR) && (fg != NO_COLOR)) { if (TScreenOf(xw)->boldColors && fg > 8 + && fg < 16 && (attr & BOLD) != 0) fg -= 8; } @@ -413,6 +414,17 @@ charToPrinter(XtermWidget xw, unsigned chr) { TScreen *screen = TScreenOf(xw); +#if OPT_WIDE_CHARS + if (screen->wide_chars && screen->utf8_mode) { + if (chr == UCS_REPL) { + stringToPrinter(xw, screen->default_string); + return; + } + } +#endif + if (is_NON_CHAR(chr)) + return; + if (!SPS.isOpen && (SPS.toFile || xtermHasPrinter(xw))) { switch (SPS.toFile) { /* @@ -453,7 +465,7 @@ charToPrinter(XtermWidget xw, unsigned chr) /* don't want privileges! */ if (xtermResetIds(screen) < 0) - exit(1); + exit(ERROR_MISC); SPS.fp = popen(SPS.printer_command, "w"); if (SPS.fp != 0) { diff --git a/app/xterm/ptydata.c b/app/xterm/ptydata.c index 8b664ecd6..3dd3d4a10 100644 --- a/app/xterm/ptydata.c +++ b/app/xterm/ptydata.c @@ -1,7 +1,7 @@ -/* $XTermId: ptydata.c,v 1.158 2022/10/10 19:27:56 tom Exp $ */ +/* $XTermId: ptydata.c,v 1.160 2024/05/10 22:54:17 tom Exp $ */ /* - * Copyright 1999-2020,2022 by Thomas E. Dickey + * Copyright 1999-2023,2024 by Thomas E. Dickey * * All Rights Reserved * @@ -98,13 +98,24 @@ decodeUtf8(TScreen *screen, PtyData *data) } else if (c < 0xc0) { /* We received a continuation byte */ if (utf_count < 1) { - /* - * We received a continuation byte before receiving a sequence - * state. Or an attempt to use a C1 control string. Either - * way, it is mapped to the replacement character, unless - * allowed by optional feature. - */ - data->utf_data = (IChar) (screen->c1_printable ? c : UCS_REPL); + if (screen->c1_printable) { + data->utf_data = (IChar) c; + } else if ((i + 1) < length + && data->next[i + 1] > 0x20 + && data->next[i + 1] < 0x80) { + /* + * Allow for C1 control string if the next byte is + * available for inspection. + */ + data->utf_data = (IChar) c; + } else { + /* + * We received a continuation byte before receiving a + * sequence state, or a failed attempt to use a C1 control + * string. + */ + data->utf_data = (IChar) UCS_REPL; + } data->utf_size = (i + 1); break; } else if (screen->utf8_weblike @@ -224,10 +235,10 @@ decodeUtf8(TScreen *screen, PtyData *data) } } #if OPT_TRACE > 1 - TRACE(("UTF-8 char %04X [%d..%d]\n", + TRACE(("UTF-8 char %04X [%lu..%lu]\n", data->utf_data, - (size_t) (data->next - data->buffer), - (size_t) (data->next - data->buffer + data->utf_size - 1))); + (unsigned long) (data->next - data->buffer), + (unsigned long) (data->next - data->buffer + data->utf_size - 1))); #endif return (data->utf_size != 0); @@ -889,7 +900,7 @@ do_range(const char *source) data->last = data->buffer + j; while (decodeUtf8(&screen, data)) { total_test++; - if (data->utf_data == UCS_REPL) + if (is_UCS_SPECIAL(data->utf_data)) total_errs++; data->next += data->utf_size; if (message_level > 1) { diff --git a/app/xterm/ptyx.h b/app/xterm/ptyx.h index 3ea84ed15..12e18bef1 100644 --- a/app/xterm/ptyx.h +++ b/app/xterm/ptyx.h @@ -1,7 +1,7 @@ -/* $XTermId: ptyx.h,v 1.1082 2023/01/02 13:24:41 tom Exp $ */ +/* $XTermId: ptyx.h,v 1.1124 2024/05/21 23:30:59 tom Exp $ */ /* - * Copyright 1999-2022,2023 by Thomas E. Dickey + * Copyright 1999-2023,2024 by Thomas E. Dickey * * All Rights Reserved * @@ -389,6 +389,7 @@ typedef struct { #define ANSI_OSC 0x9D #define ANSI_PM 0x9E #define ANSI_APC 0x9F +#define XTERM_PUA 0xEEEE /* internal mapping for DEC Technical */ #define BAD_ASCII '?' #define NonLatin1(c) (((c) != ANSI_LF) && \ @@ -397,6 +398,9 @@ typedef struct { ((c) >= ANSI_DEL && (c) <= ANSI_APC))) #define OnlyLatin1(c) (NonLatin1(c) ? BAD_ASCII : (c)) +#define L_BLOK '[' +#define R_BLOK ']' + #define L_CURL '{' #define R_CURL '}' @@ -445,6 +449,12 @@ typedef struct { typedef short ParmType; typedef unsigned short UParm; /* unparseputn passes ParmType */ +#define MaxSParm 0x7fff /* limit if a signed value is needed */ +#define MaxUParm 0xffff /* limit if unsigned value is needed */ + +#define SParmOf(n) ((int)(ParmType)(n)) +#define UParmOf(n) ((unsigned)(UParm)(n)) + typedef struct { Char a_type; /* CSI, etc., see unparseq() */ Char a_pintro; /* private-mode char, if any */ @@ -485,15 +495,14 @@ typedef struct { int height; } BitmapBits; -/* bit-assignments for extensions to DECRQCRA */ +/* bit-assignments for extensions to DECRQCRA, to omit DEC features */ typedef enum { csDEC = 0 - ,csPOSITIVE = xBIT(0) - ,csATTRIBS = xBIT(1) - ,csNOTRIM = xBIT(2) - ,csDRAWN = xBIT(3) - ,csBYTE = xBIT(4) - ,cs8TH = xBIT(5) + ,csPOSITIVE = xBIT(0) /* do not negate the result */ + ,csATTRIBS = xBIT(1) /* do not report the VT100 video attributes */ + ,csNOTRIM = xBIT(2) /* do not omit checksum for blanks */ + ,csDRAWN = xBIT(3) /* do not skip uninitialized cells */ + ,csBYTE = xBIT(4) /* do not mask cell value to 8 bits or ignore combining chars */ } CSBITS; #define EXCHANGE(a,b,tmp) tmp = a; a = b; b = tmp @@ -830,6 +839,10 @@ typedef enum { #define OPT_WIDE_ATTRS 1 /* true if xterm supports 16-bit attributes */ #endif +#ifndef OPT_VT525_COLORS +#define OPT_VT525_COLORS 1 /* true if xterm is configured for VT525 colors */ +#endif + #ifndef OPT_WIDE_CHARS #define OPT_WIDE_CHARS 1 /* true if xterm supports 16-bit characters */ #endif @@ -923,7 +936,7 @@ typedef enum { , gcBoldReverse , gcFiller , gcBorder -#if OPT_BOX_CHARS +#if OPT_BOX_CHARS || OPT_WIDE_CHARS , gcLine , gcDots #endif @@ -1028,6 +1041,7 @@ typedef enum { ,nrc_DEC_Supp /* vt2xx */ ,nrc_DEC_Supp_Graphic /* vt3xx */ ,nrc_DEC_Technical /* vt3xx */ + ,nrc_DEC_UPSS /* vt3xx */ ,nrc_Dutch /* vt2xx */ ,nrc_Finnish /* vt2xx */ ,nrc_Finnish2 /* vt2xx */ @@ -1043,7 +1057,7 @@ typedef enum { ,nrc_Hebrew /* vt5xx */ ,nrc_ISO_Hebrew_Supp /* vt5xx */ ,nrc_Italian /* vt2xx */ - ,nrc_ISO_Latin_1_Supp /* vt5xx */ + ,nrc_ISO_Latin_1_Supp /* vt3xx */ ,nrc_ISO_Latin_2_Supp /* vt5xx */ ,nrc_ISO_Latin_5_Supp /* vt5xx */ ,nrc_ISO_Latin_Cyrillic /* vt5xx */ @@ -1063,18 +1077,25 @@ typedef enum { } DECNRCM_codes; /* + * Default and alternate codes for user-preferred supplemental set. + */ +#define DFT_UPSS nrc_DEC_Supp_Graphic +#define ALT_UPSS nrc_ISO_Latin_1_Supp +#define PreferredUPSS(screen) ((screen)->prefer_latin1 ? ALT_UPSS : DFT_UPSS) + +/* * Use this enumerated type to check consistency among dpmodes(), savemodes() * restoremodes() and do_dec_rqm(). */ typedef enum { - srm_DECCKM = 1 - ,srm_DECANM = 2 - ,srm_DECCOLM = 3 - ,srm_DECSCLM = 4 - ,srm_DECSCNM = 5 - ,srm_DECOM = 6 - ,srm_DECAWM = 7 - ,srm_DECARM = 8 + srm_DECCKM = 1 /* Cursor Keys Mode */ + ,srm_DECANM = 2 /* ANSI Mode */ + ,srm_DECCOLM = 3 /* Column Mode */ + ,srm_DECSCLM = 4 /* Scrolling Mode */ + ,srm_DECSCNM = 5 /* Screen Mode */ + ,srm_DECOM = 6 /* Origin Mode */ + ,srm_DECAWM = 7 /* Autowrap Mode */ + ,srm_DECARM = 8 /* Autorepeat Mode */ ,srm_X10_MOUSE = SET_X10_MOUSE #if OPT_TOOLBAR ,srm_RXVT_TOOLBAR = 10 @@ -1084,19 +1105,21 @@ typedef enum { ,srm_CURSOR_BLINK_OPS = 13 ,srm_XOR_CURSOR_BLINKS = 14 #endif - ,srm_DECPFF = 18 - ,srm_DECPEX = 19 - ,srm_DECTCEM = 25 + ,srm_DECPFF = 18 /* Print Form Feed Mode */ + ,srm_DECPEX = 19 /* Printer Extent Mode */ + ,srm_DECTCEM = 25 /* Text Cursor Enable Mode */ ,srm_RXVT_SCROLLBAR = 30 + ,srm_DECRLM = 34 /* vt510:Cursor Right to Left Mode */ #if OPT_SHIFT_FONTS - ,srm_RXVT_FONTSIZE = 35 + ,srm_RXVT_FONTSIZE = 35 /* also vt520:DECHEBM */ #endif + ,srm_DECHEM = 36 /* vt510:Hebrew Encoding Mode */ #if OPT_TEK4014 ,srm_DECTEK = 38 #endif ,srm_132COLS = 40 ,srm_CURSES_HACK = 41 - ,srm_DECNRCM = 42 + ,srm_DECNRCM = 42 /* National Replacement Character Set Mode */ #if OPT_PRINT_GRAPHICS ,srm_DECGEPM = 43 /* Graphics Expanded Print Mode */ #endif @@ -1108,13 +1131,40 @@ typedef enum { ,srm_DECGPBM = 46 /* Graphics Print Background Mode */ #endif ,srm_ALTBUF = 47 /* also DECGRPM (Graphics Rotated Print Mode) */ - ,srm_DECNKM = 66 - ,srm_DECBKM = 67 - ,srm_DECLRMM = 69 + ,srm_DECNAKB = 57 /* vt510:Greek/N-A Keyboard Mapping */ + ,srm_DECIPEM = 58 /* vt510:IBM ProPrinter Emulation Mode */ + ,srm_DECHCCM = 60 /* vt420:Horizontal Cursor-Coupling Mode */ + ,srm_DECVCCM = 61 /* vt420:Vertical Cursor-Coupling Mode */ + ,srm_DECPCCM = 64 /* vt420:Page Cursor-Coupling Mode */ + ,srm_DECNKM = 66 /* vt420:Numeric Keypad Mode */ + ,srm_DECBKM = 67 /* vt420:Backarrow Key mode */ + ,srm_DECKBUM = 68 /* vt420:Keyboard Usage mode */ + ,srm_DECLRMM = 69 /* vt420:Vertical Split Screen Mode (DECVSSM) */ + ,srm_DECXRLM = 73 /* vt420:Transmit Rate Limiting */ #if OPT_SIXEL_GRAPHICS ,srm_DECSDM = 80 /* Sixel Display Mode */ #endif - ,srm_DECNCSM = 95 + ,srm_DECKPM = 81 /* vt420:Key Position Mode */ + ,srm_DECNCSM = 95 /* vt510:No Clearing Screen On Column Change */ + ,srm_DECRLCM = 96 /* vt510:Right-to-Left Copy */ + ,srm_DECCRTSM = 97 /* vt510:CRT Save Mode */ + ,srm_DECARSM = 98 /* vt510:Auto Resize Mode */ + ,srm_DECMCM = 99 /* vt510:Modem Control Mode */ + ,srm_DECCAAM = 100 /* vt510:Auto Answerback Mode */ + ,srm_DECCANSM = 101 /* vt510:Conceal Answerback Message Mode */ + ,srm_DECNULM = 102 /* vt510:Ignoring Null Mode */ + ,srm_DECHDPXM = 103 /* vt510:Half-Duplex Mode */ + ,srm_DECOSCNM = 106 /* vt510:Overscan Mode */ + ,srm_DECNUMLK = 108 /* vt510:Num Lock Mode */ + ,srm_DECCAPSLK = 109 /* vt510:Caps Lock Mode */ + ,srm_DECKLHIM = 110 /* vt510:Keyboard LEDs Host Indicator Mode */ + ,srm_DECFWM = 111 /* vt520:Framed Windows Mode */ + ,srm_DECRPL = 112 /* vt520:Review Previous Lines */ + ,srm_DECHWUM = 113 /* vt520:Host Wake-Up */ + ,srm_DECATCUM = 114 /* vt520:Alternate Text Color Underline */ + ,srm_DECATCBM = 115 /* vt520:Alternate Text Color Blink */ + ,srm_DECBBSM = 116 /* vt520:Bold and Blink Style Mode */ + ,srm_DECECM = 117 /* vt520:Erase Color Mode */ ,srm_VT200_MOUSE = SET_VT200_MOUSE ,srm_VT200_HIGHLIGHT_MOUSE = SET_VT200_HIGHLIGHT_MOUSE ,srm_BTN_EVENT_MOUSE = SET_BTN_EVENT_MOUSE @@ -1129,6 +1179,7 @@ typedef enum { ,srm_ALTERNATE_SCROLL = SET_ALTERNATE_SCROLL ,srm_RXVT_SCROLL_TTY_OUTPUT = 1010 ,srm_RXVT_SCROLL_TTY_KEYPRESS = 1011 + ,srm_FAST_SCROLL = 1014 ,srm_EIGHT_BIT_META = 1034 #if OPT_NUM_LOCK ,srm_REAL_NUMLOCK = 1035 @@ -1143,6 +1194,7 @@ typedef enum { ,srm_BELL_IS_URGENT = 1042 ,srm_POP_ON_BELL = 1043 ,srm_KEEP_CLIPBOARD = 1044 + ,srm_REVERSEWRAP2 = 1045 /* reverse-wrap without limits */ ,srm_ALLOW_ALTBUF = 1046 ,srm_OPT_ALTBUF = 1047 ,srm_SAVE_CURSOR = 1048 @@ -1295,6 +1347,7 @@ typedef enum { /* aliases */ , DATA(C0) , DATA(DEL) + , DATA(STTY) #undef DATA , epLAST } PasteControls; @@ -1531,10 +1584,10 @@ typedef enum { #if OPT_DEC_CHRSET #define if_OPT_DEC_CHRSET(code) code /* Use 2 bits for encoding the double high/wide sense of characters */ -#define CSET_SWL 0 -#define CSET_DHL_TOP 1 -#define CSET_DHL_BOT 2 -#define CSET_DWL 3 +#define CSET_SWL 0 /* character set: single-width line */ +#define CSET_DHL_TOP 1 /* character set: double-height top line */ +#define CSET_DHL_BOT 2 /* character set: double-height bottom line */ +#define CSET_DWL 3 /* character set: double-width line */ #define NUM_CHRSET 8 /* normal/bold and 4 CSET_xxx values */ /* Use remaining bits for encoding the other character-sets */ @@ -1584,6 +1637,14 @@ typedef enum { /***====================================================================***/ +#if OPT_DEC_RECTOPS +#define if_OPT_DEC_RECTOPS(stmt) stmt +#else +#define if_OPT_DEC_RECTOPS(stmt) /* nothing */ +#endif + +/***====================================================================***/ + #if OPT_EBCDIC extern int E2A(int); extern int A2E(int); @@ -1594,6 +1655,9 @@ extern int A2E(int); #define CONTROL(a) (A2E(E2A(a)&037)) +#define XTERM_ERASE A2E(CONTROL('H')) +#define XTERM_LNEXT A2E(CONTROL('V')) + /***====================================================================***/ #if OPT_TEK4014 @@ -1652,15 +1716,24 @@ typedef unsigned char IAttr; /* at least 8 bits */ #if OPT_WIDE_CHARS #define if_OPT_WIDE_CHARS(screen, code) if(screen->wide_chars) code #define if_WIDE_OR_NARROW(screen, wide, narrow) if(screen->wide_chars) wide else narrow -#define NARROW_ICHAR 0xffff +#define NARROW_ICHAR 0xffff #if OPT_WIDER_ICHAR -#define WIDEST_ICHAR 0x1fffff -typedef unsigned IChar; /* for 8-21 bit characters */ +#define is_NON_CHAR(c) (((c) >= 0xffd0 && (c) <= 0xfdef) || \ + (((c) & 0xffff) >= 0xfffe)) +#define is_UCS_SPECIAL(c) ((c) >= 0xfff0 && (c) <= 0xffff) +#define WIDEST_ICHAR 0x1fffff +typedef unsigned IChar; /* for 8-21 bit characters */ #else -#define WIDEST_ICHAR NARROW_ICHAR +#define is_NON_CHAR(c) (((c) >= 0xffd0 && (c) <= 0xfdef) || \ + ((c) >= 0xfffe && (c) <= 0xffff)) +#define is_UCS_SPECIAL(c) ((c) >= 0xfff0) +#define WIDEST_ICHAR NARROW_ICHAR typedef unsigned short IChar; /* for 8-16 bit characters */ #endif -#else +#else /* !OPT_WIDE_CHARS */ +#undef OPT_WIDER_ICHAR +#define OPT_WIDER_ICHAR 0 +#define is_NON_CHAR(c) ((c) > 255) #define if_OPT_WIDE_CHARS(screen, code) /* nothing */ #define if_WIDE_OR_NARROW(screen, wide, narrow) narrow typedef unsigned char IChar; /* for 8-bit characters */ @@ -1811,16 +1884,20 @@ typedef IChar CharData; */ typedef struct { Dimension lineSize; /* number of columns in this row */ - RowData bufHead; /* flag for wrapped lines */ + RowData bufHead; /* flag for wrapped lines */ #if OPT_WIDE_CHARS - Char combSize; /* number of items in combData[] */ + Char combSize; /* number of items in combData[] */ #endif - IAttr *attribs; /* video attributes */ +#if OPT_DEC_RECTOPS + Char *charSets; /* SCS code (DECNRCM_codes) */ + Char *charSeen; /* pre-SCS value */ +#endif + IAttr *attribs; /* video attributes */ #if OPT_ISO_COLORS CellColor *color; /* foreground+background color numbers */ #endif CharData *charData; /* cell's base character */ - CharData *combData[1]; /* first enum past fixed-offsets */ + CharData *combData[1]; /* first field past fixed-offsets */ } LineData; typedef const LineData CLineData; @@ -1830,12 +1907,16 @@ typedef const LineData CLineData; * variable. */ typedef struct { - IAttr attribs; + IAttr attribs; /* video attributes */ #if OPT_WIDE_CHARS - Char combSize; /* number of items in combData[] */ + Char combSize; /* number of items in combData[] */ +#endif +#if OPT_DEC_RECTOPS + Char charSets; /* SCS code (DECNRCM_codes) */ + Char charSeen; /* pre-SCS value */ #endif #if OPT_ISO_COLORS - CellColor color; /* color-array */ + CellColor color; /* foreground+background color numbers */ #endif CharData charData; /* cell's base character */ CharData combData[1]; /* array of combining chars */ @@ -2018,6 +2099,7 @@ typedef enum { DP_DECTCEM, DP_DELETE_IS_DEL, DP_EIGHT_BIT_META, + DP_FAST_SCROLL, DP_KEEP_CLIPBOARD, DP_KEEP_SELECTION, DP_KEYBOARD_TYPE, @@ -2038,6 +2120,7 @@ typedef enum { DP_X_MOUSE, DP_X_NCSM, DP_X_REVWRAP, + DP_X_REVWRAP2, DP_X_X10MSE, #if OPT_BLINK_CURS DP_CRS_BLINK, @@ -2138,6 +2221,10 @@ typedef struct { } ScrnColors; #define NUM_GSETS 4 +#define NUM_GSETS2 (NUM_GSETS + 1) /* include user-preferred */ +#define gsets_upss gsets[4] + +#define SAVED_CURSORS 2 typedef struct { Boolean saved; @@ -2146,7 +2233,7 @@ typedef struct { IFlags flags; /* VTxxx saves graphics rendition */ Char curgl; Char curgr; - DECNRCM_codes gsets[NUM_GSETS]; + DECNRCM_codes gsets[NUM_GSETS2]; Boolean wrap_flag; #if OPT_ISO_COLORS int cur_foreground; /* current foreground color */ @@ -2163,7 +2250,12 @@ typedef struct _SaveTitle { char *windowName; } SaveTitle; -#define SAVED_CURSORS 2 +#define MAX_SAVED_TITLES 10 + +typedef struct { + int used; /* index to current item */ + SaveTitle data[MAX_SAVED_TITLES]; +} SavedTitles; typedef struct { int width; /* if > 0, width of scrollbar, */ @@ -2330,6 +2422,7 @@ typedef struct { IChar *unparse_bfr; unsigned unparse_len; unsigned unparse_max; /* limitResponse resource */ + unsigned strings_max; /* maxStringParse resource */ #if OPT_TCAP_QUERY int tc_query_code; @@ -2365,6 +2458,14 @@ typedef struct { #if OPT_WIDE_ATTRS && OPT_SGR2_HASH Boolean faint_relative; /* faint is relative? */ #endif +#if OPT_VT525_COLORS + int assigned_fg; /* DECAC */ + int assigned_bg; + struct { + int fg; /* 0..15 */ + int bg; /* 0..15 */ + } alt_colors[16]; /* DECATC if DECSTGLT is 1 or 2 */ +#endif #endif /* OPT_ISO_COLORS */ #if OPT_DEC_CHRSET Boolean font_doublesize;/* enable font-scaling */ @@ -2404,9 +2505,10 @@ typedef struct { Boolean char_was_written; int last_written_col; int last_written_row; - TypedBuffer(XChar2b); - TypedBuffer(char); #endif + TypedBuffer(IChar); + TypedBuffer(Char); + TypedBuffer(XChar2b); #if OPT_BROKEN_OSC Boolean brokenLinuxOSC; /* true to ignore Linux palette ctls */ #endif @@ -2533,7 +2635,8 @@ typedef struct { Cursor pointer_cursor; /* current pointer cursor */ Cursor hidden_cursor; /* hidden cursor in window */ - String answer_back; /* response to ENQ */ + String answer_back; /* response to ENQ */ + Boolean prefer_latin1; /* preference for UPSS */ PrinterState printer_state; /* actual printer state */ PrinterFlags printer_flags; /* working copy of printer flags */ @@ -2547,10 +2650,13 @@ typedef struct { #if OPT_BOX_CHARS Boolean force_box_chars;/* true if we assume no boxchars */ Boolean broken_box_chars;/* true if broken boxchars */ - Boolean force_all_chars;/* true to outline missing chars */ Boolean assume_all_chars;/* true to allow missing chars */ Boolean allow_packing; /* true to allow packed-fonts */ #endif +#if OPT_BOX_CHARS || OPT_WIDE_CHARS + Boolean force_all_chars;/* true to outline missing chars */ +#endif + Dimension fnt_wide; Dimension fnt_high; float scale_height; /* scaling for font-height */ @@ -2572,6 +2678,7 @@ typedef struct { int cursor_state; /* ON, OFF, or BLINKED_OFF */ int cursor_busy; /* do not redraw... */ Boolean cursor_underline; /* true if cursor is in underline mode */ + Boolean cursor_bar; /* true if cursor is in bar mode */ XtCursorShape cursor_shape; #if OPT_BLINK_CURS BlinkOps cursor_blink; /* cursor blink enable */ @@ -2685,16 +2792,17 @@ typedef struct { int title_modes; /* control set/get of titles */ int title_modes0; /* ...initial value */ - SaveTitle *save_title; + SavedTitles saved_titles; /* Improved VT100 emulation stuff. */ String keyboard_dialect; /* default keyboard dialect */ - DECNRCM_codes gsets[NUM_GSETS]; /* G0 through G3. */ + DECNRCM_codes gsets[NUM_GSETS2]; /* G0 through G3, plus UPSS */ Char curgl; /* Current GL setting. */ Char curgr; /* Current GR setting. */ Char curss; /* Current single shift. */ String term_id; /* resource for terminal_id */ int terminal_id; /* 100=vt100, 220=vt220, etc. */ + int display_da1; /* 100=vt100, 220=vt220, etc. */ int vtXX_level; /* 0=vt52, 1,2,3 = vt100 ... vt320 */ int ansi_level; /* dpANSI levels 1,2,3 */ int protected_mode; /* 0=off, 1=DEC, 2=ISO */ @@ -2743,11 +2851,14 @@ typedef struct { #if OPT_SIXEL_GRAPHICS Boolean sixel_scrolling; /* sixel scrolling */ Boolean sixel_scrolls_right; /* sixel scrolling moves cursor to right */ + Boolean sixel_scrolls_right0; /* initial sixelScrolling mode */ #endif #if OPT_GRAPHICS int numcolorregisters; /* number of supported color registers */ Boolean privatecolorregisters; /* private color registers for each graphic */ + Boolean privatecolorregisters0; /* initial privateColorRegisters */ + Boolean incremental_graphics; /* draw graphics incrementally */ #endif /* Graphics Printing */ @@ -2782,10 +2893,10 @@ typedef struct { if (IsStatusShown(screen) && (screen)->status_active) stmt Boolean status_timeout; /* status timeout needs service */ - Boolean status_active; /* DECSASD */ + int status_active; /* DECSASD */ int status_type; /* DECSSDT */ int status_shown; /* last-displayed type */ - SavedCursor status_data[2]; + SavedCursor status_data[2]; /* main- and status-cursors */ char * status_fmt; /* format for indicator-status */ #else /* !OPT_STATUS_LINE */ @@ -2804,7 +2915,7 @@ typedef struct { Char vt52_save_curgl; Char vt52_save_curgr; Char vt52_save_curss; - DECNRCM_codes vt52_save_gsets[NUM_GSETS]; + DECNRCM_codes vt52_save_gsets[NUM_GSETS2]; #endif /* Testing */ #if OPT_XMC_GLITCH @@ -3230,6 +3341,7 @@ typedef struct _Misc { float face_size[NMENUFONTS]; char *render_font_s; int limit_fontsets; + int limit_fontheight; int limit_fontwidth; #endif } Misc; @@ -3286,6 +3398,14 @@ typedef struct _Work { ScrnColors *oldColors; Boolean palette_changed; Boolean broken_box_chars; + /* data write dotext/WriteText */ + IChar *write_text; /* points to print_area */ +#if OPT_DEC_RECTOPS + Char *write_sums; /* if non-null, points to buffer_sums */ + Char *buffer_sums; /* data for ->charSeen[] */ + Char *buffer_sets; /* data for ->charSets[] */ + size_t sizeof_sums; /* allocated size of buffer_sums */ +#endif } Work; typedef struct {int foo;} XtermClassPart, TekClassPart; @@ -3326,7 +3446,7 @@ extern WidgetClass tekWidgetClass; #define TAB_ARRAY_SIZE (1024 / TAB_BITS_WIDTH) #define MAX_TABS (TAB_BITS_WIDTH * TAB_ARRAY_SIZE) -#define OkTAB(c) ((c) >= 0 && (c) < MAX_TABS) +#define OkTAB(c) ((c) > 0 && (c) < MAX_TABS) typedef unsigned Tabs [TAB_ARRAY_SIZE]; @@ -3429,45 +3549,57 @@ typedef struct _TekWidgetRec { the screen. Used to distinguish blanks from empty parts of the screen when selecting */ +/* + * This does not fit in a byte with the other (more important) attributes, but + * if wide-attributes are configured, it is possible to maintain it there. + */ +#define INVISIBLE AttrBIT(8) /* true if writing invisible text */ #if OPT_WIDE_ATTRS -#define ATR_FAINT AttrBIT(8) -#define ATR_ITALIC AttrBIT(9) -#define ATR_STRIKEOUT AttrBIT(10) -#define ATR_DBL_UNDER AttrBIT(11) -#define ATR_DIRECT_FG AttrBIT(12) -#define ATR_DIRECT_BG AttrBIT(13) +#define ATR_FAINT AttrBIT(9) +#define ATR_ITALIC AttrBIT(10) +#define ATR_STRIKEOUT AttrBIT(11) +#define ATR_DBL_UNDER AttrBIT(12) +#define ATR_DIRECT_FG AttrBIT(13) +#define ATR_DIRECT_BG AttrBIT(14) #define SGR_MASK2 (ATR_FAINT | ATR_ITALIC | ATR_STRIKEOUT | ATR_DBL_UNDER | ATR_DIRECT_FG | ATR_DIRECT_BG) +#define AttrEND 15 #else #define SGR_MASK2 0 +#define AttrEND 9 #endif /* * Other flags */ -#define WRAPAROUND MiscBIT(0) /* true if auto wraparound mode */ -#define REVERSEWRAP MiscBIT(1) /* true if reverse wraparound mode */ -#define REVERSE_VIDEO MiscBIT(2) /* true if screen white on black */ -#define LINEFEED MiscBIT(3) /* true if in auto linefeed mode */ -#define ORIGIN MiscBIT(4) /* true if in origin mode */ -#define INSERT MiscBIT(5) /* true if in insert mode */ -#define SMOOTHSCROLL MiscBIT(6) /* true if in smooth scroll mode */ -#define IN132COLUMNS MiscBIT(7) /* true if in 132 column mode */ -#define INVISIBLE MiscBIT(8) /* true if writing invisible text */ +#define REVERSE_VIDEO MiscBIT(0) /* true if screen white on black */ +#define WRAPAROUND MiscBIT(1) /* true if auto wraparound mode */ +#define REVERSEWRAP MiscBIT(2) /* true if reverse wraparound mode */ +#define REVERSEWRAP2 MiscBIT(3) /* true if extended reverse wraparound */ +#define LINEFEED MiscBIT(4) /* true if in auto linefeed mode */ +#define ORIGIN MiscBIT(5) /* true if in origin mode */ +#define INSERT MiscBIT(6) /* true if in insert mode */ +#define SMOOTHSCROLL MiscBIT(7) /* true if in smooth scroll mode */ +#define IN132COLUMNS MiscBIT(8) /* true if in 132 column mode */ #define NATIONAL MiscBIT(9) /* true if writing national charset */ #define LEFT_RIGHT MiscBIT(10) /* true if left/right margin mode */ #define NOCLEAR_COLM MiscBIT(11) /* true if no clear on DECCOLM change */ -#define DrawBIT(n) xBIT(n + 8) /* XTermDraw.draw_flags */ +/* + * Drawing-bits start after the video/color attributes, and are independent + * of the miscellaneous flags. + */ +#define DrawBIT(n) xBIT(n + AttrEND) /* XTermDraw.draw_flags */ /* The following attributes are used in the argument of drawXtermText() */ #define NOBACKGROUND DrawBIT(0) /* Used for overstrike */ #define NOTRANSLATION DrawBIT(1) /* No scan for chars missing in font */ #define DOUBLEWFONT DrawBIT(2) /* The actual X-font is double-width */ #define DOUBLEHFONT DrawBIT(3) /* The actual X-font is double-height */ -#define CHARBYCHAR DrawBIT(4) /* Draw chars one-by-one */ +#define DOUBLEFIRST DrawBIT(4) /* Draw chars one-by-one */ +#define CHARBYCHAR DrawBIT(5) /* Draw chars one-by-one */ /* The following attribute is used in the argument of xtermSpecialFont etc */ -#define NORESOLUTION DrawBIT(5) /* find the font without resolution */ +#define NORESOLUTION DrawBIT(6) /* find the font without resolution */ /* * Groups of attributes diff --git a/app/xterm/resize.c b/app/xterm/resize.c index 860311ccc..2199e73e2 100644 --- a/app/xterm/resize.c +++ b/app/xterm/resize.c @@ -1,7 +1,7 @@ -/* $XTermId: resize.c,v 1.148 2022/02/18 20:32:48 tom Exp $ */ +/* $XTermId: resize.c,v 1.150 2023/03/31 23:09:38 tom Exp $ */ /* - * Copyright 2003-2021,2022 by Thomas E. Dickey + * Copyright 2003-2022,2023 by Thomas E. Dickey * * All Rights Reserved * @@ -98,7 +98,7 @@ int ignore_unused; #define SUN 1 #define VT100 0 -#define TIMEOUT 10 +#define TIMEOUT 3 #define SHELL_UNKNOWN 0 #define SHELL_C 1 @@ -133,6 +133,11 @@ static const char *const emuname[EMULATIONS] = }; static char *myname; static int shell_type = SHELL_UNKNOWN; +static const char *const getattr[EMULATIONS] = +{ + ESCAPE("[c"), + NULL, +}; static const char *const getsize[EMULATIONS] = { ESCAPE("7") ESCAPE("[r") ESCAPE("[9999;9999H") ESCAPE("[6n"), @@ -164,7 +169,12 @@ static struct termios tioorig; static struct sgttyb sgorig; #endif /* USE_ANY_SYSV_TERMIO/USE_TERMIOS */ -static const char *const size[EMULATIONS] = +static const char *const reply_attr[EMULATIONS] = +{ + ESCAPE("[?%d;%dc"), + NULL, +}; +static const char *const reply_size[EMULATIONS] = { ESCAPE("[%d;%dR"), ESCAPE("[8;%d;%dt"), @@ -211,10 +221,12 @@ onintr(int sig GCC_UNUSED) exit(EXIT_FAILURE); } +const char *timeout_message = "?"; + static void resize_timeout(int sig) { - fprintf(stderr, "\n%s: Time out occurred\r\n", myname); + fprintf(stderr, "\n%s: %s\r\n", myname, timeout_message); onintr(sig); } @@ -267,7 +279,9 @@ checkdigits(char *str) static void unexpected_char(int c) { - fprintf(stderr, "%s: unknown character %#x, exiting.\r\n", myname, c); + fprintf(stderr, + "%s: unknown character %#x, exiting.\r\n", + myname, (unsigned) c); onintr(0); } @@ -275,19 +289,18 @@ static void readstring(FILE *fp, char *buf, const char *str) { int last, c; -#if !defined(USG) && !defined(__minix) - /* What is the advantage of setitimer() over alarm()? */ +#if HAVE_SETITIMER struct itimerval it; #endif int limit = (BUFSIZ - 3); signal(SIGALRM, resize_timeout); -#if defined(USG) || defined(__minix) - alarm(TIMEOUT); -#else +#if HAVE_SETITIMER memset((char *) &it, 0, sizeof(struct itimerval)); it.it_value.tv_sec = TIMEOUT; setitimer(ITIMER_REAL, &it, (struct itimerval *) NULL); +#else + alarm(TIMEOUT); #endif if ((c = getc(fp)) == 0233) { /* meta-escape, CSI */ c = ESCAPE("")[0]; @@ -312,11 +325,11 @@ readstring(FILE *fp, char *buf, const char *str) if (c == last) break; } -#if defined(USG) || defined(__minix) - alarm(0); -#else +#if HAVE_SETITIMER memset((char *) &it, 0, sizeof(struct itimerval)); setitimer(ITIMER_REAL, &it, (struct itimerval *) NULL); +#else + alarm(0); #endif *buf = 0; } @@ -513,9 +526,15 @@ main(int argc, char **argv ENVP_ARG) free(tmpbuf); } } + if (getattr[emu]) { + timeout_message = "Terminal is not VT100-compatible"; + IGNORE_RC(write(tty, getattr[emu], strlen(getattr[emu]))); + readstring(ttyfp, buf, reply_attr[emu]); + } + timeout_message = "Time out occurred"; IGNORE_RC(write(tty, getsize[emu], strlen(getsize[emu]))); - readstring(ttyfp, buf, size[emu]); - if (sscanf(buf, size[emu], &rows, &cols) != 2) { + readstring(ttyfp, buf, reply_size[emu]); + if (sscanf(buf, reply_size[emu], &rows, &cols) != 2) { fprintf(stderr, "%s: Can't get rows and columns\r\n", myname); onintr(0); } diff --git a/app/xterm/resize.man b/app/xterm/resize.man index a0eedc524..783f7a43d 100644 --- a/app/xterm/resize.man +++ b/app/xterm/resize.man @@ -1,6 +1,6 @@ -.\" $XTermId: resize.man,v 1.37 2019/02/07 00:16:12 tom Exp $ +.\" $XTermId: resize.man,v 1.40 2024/01/11 22:06:30 tom Exp $ .\" -.\" Copyright 1998-2017,2019 by Thomas E. Dickey +.\" Copyright 1998-2023,2024 by Thomas E. Dickey .\" .\" All Rights Reserved .\" @@ -32,22 +32,49 @@ .\" .ds N Resize .ds n resize +. +.TH RESIZE 1 "__app_date__" "__app_version__" "X Window System" .\" -.\" Bulleted paragraph +.ie n .ds CW R +.el \{ +.ie \n(.g .ds CW CR +.el .ds CW CW +.\} +. +.ie \n(.g \{\ +.ds `` \(lq +.ds '' \(rq +.ds ' \(aq +.\} +.el \{\ +.ie t .ds `` `` +.el .ds `` "" +.ie t .ds '' '' +.el .ds '' "" +.ie t .ds ' \(aq +.el .ds ' ' +.\} .de bP .ie n .IP \(bu 4 .el .IP \(bu 2 .. -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds AQ \(aq -.el .ds AQ ' -.ie \n(.g .ds `` \(lq -.el .ds `` `` -.ie \n(.g .ds '' \(rq -.el .ds '' '' -.TH RESIZE 1 "__app_date__" "__app_version__" "X Window System" +.de NE +.fi +.ft R +.ie n .in -4 +.el .in -2 +.. +.de NS +.ie n .sp +.el .sp .5 +.ie n .in +4 +.el .in +2 +.nf +.ft \*(CW +.. .SH NAME -resize \- set environment and terminal settings to current xterm window size +resize \- +set environment and terminal settings to current xterm window size .SH SYNOPSIS .B \*n [ \fB\-v\fP | \fB\-u\fP | \fB\-c\fP ] [ \fB\-s\fP [ \fIrow col\fP ] ] @@ -98,34 +125,6 @@ This affects the values shown by \fIstty\fP. finally, \fI\*n\fP generates shell commands for setting the environment variables, and writes that to the standard output. -.SH EXAMPLES -For \fI\*n\fP's output to take effect, -\fI\*n\fP must either be evaluated -as part of the command line (usually done with a shell alias or function) or -else redirected to a file which can then be read in. -From the C shell (usually -known as \fI/bin/csh\fP), the following alias could be defined in the -user's \fI.cshrc\fP: -.sp -.nf - % alias rs \*(AQset noglob; eval \fC\`\fP\*n\fC\`\fP\*(AQ -.fi -.sp -After resizing the window, the user would type: -.sp -.nf - % rs -.fi -.sp -Users of versions of the Bourne shell (usually known as \fI/bin/sh\fP) that -don't have command -functions will need to send the output to a temporary file and then read it back -in with the \*(``.\*('' command: -.sp -.nf - $ \*n > /tmp/out - $ .\0/tmp/out -.fi .SH OPTIONS The following options may be used with \fI\*n\fP: .TP 8 @@ -167,13 +166,6 @@ which causes makes it assume the \fB\-s\fP option. The \fIrows\fP and \fIcolumns\fP arguments must appear last; though they are normally associated with the \fB\-s\fP option, they are parsed separately. -.SH FILES -.TP 15 -/etc/termcap -for the base termcap entry to modify. -.TP 15 -~/.cshrc -user's alias for the command. .SH ENVIRONMENT .TP 15 SHELL @@ -215,14 +207,40 @@ COLUMNS, LINES .IR \*N 's generated shell command sets these variables on systems using terminfo. -Many applications (including the curses library) +Many applications (including the curses library) use those variables when set to override their screensize. -.SH "SEE ALSO" -use_env(3x) -.br -csh(1), stty(1), tset(1) -.br -xterm(__mansuffix__) +.SH FILES +.TP 15 +/etc/termcap +for the base termcap entry to modify. +.TP 15 +~/.cshrc +user's alias for the command. +.SH EXAMPLES +For \fI\*n\fP's output to take effect, +\fI\*n\fP must either be evaluated +as part of the command line (usually done with a shell alias or function) or +else redirected to a file which can then be read in. +From the C shell (usually +known as \fI/bin/csh\fP), the following alias could be defined in the +user's \fI.cshrc\fP: +.NS +% alias rs \*'set noglob; eval \`\*n\`\*' +.NE +.PP +After resizing the window, the user would type: +.NS +% rs +.NE +.PP +Users of versions of the Bourne shell (usually known as \fI/bin/sh\fP) that +don't have command +functions will need to send the output to a temporary file and then read it back +in with the \*(``.\*('' command: +.NS +$ \*n > /tmp/out +$ .\0/tmp/out +.NE .SH AUTHORS Mark Vandevoorde (MIT-Athena), Edward Moy (Berkeley) .br @@ -233,3 +251,9 @@ Copyright (c) 1984, 1985 by X Consortium See .IR X (__miscmansuffix__) for a complete copyright notice. +.SH "SEE ALSO" +use_env(3x) +.br +csh(1), stty(1), tset(1) +.br +xterm(__mansuffix__) diff --git a/app/xterm/screen.c b/app/xterm/screen.c index e78b9608a..9fb636661 100644 --- a/app/xterm/screen.c +++ b/app/xterm/screen.c @@ -1,7 +1,7 @@ -/* $XTermId: screen.c,v 1.627 2022/10/23 22:57:40 tom Exp $ */ +/* $XTermId: screen.c,v 1.651 2024/02/13 22:10:51 tom Exp $ */ /* - * Copyright 1999-2021,2022 by Thomas E. Dickey + * Copyright 1999-2023,2024 by Thomas E. Dickey * * All Rights Reserved * @@ -193,6 +193,9 @@ setupLineData(TScreen *screen, /* these names are based on types */ unsigned skipNcolIAttr; unsigned skipNcolCharData; +#if OPT_DEC_RECTOPS + unsigned skipNcolChar; +#endif #if OPT_ISO_COLORS unsigned skipNcolCellColor; #endif @@ -207,8 +210,12 @@ setupLineData(TScreen *screen, } #endif - skipNcolIAttr = (ncol * SizeofScrnPtr(attribs)); - skipNcolCharData = (ncol * SizeofScrnPtr(charData)); + /* *INDENT-EQLS* */ + skipNcolIAttr = (ncol * SizeofScrnPtr(attribs)); + skipNcolCharData = (ncol * SizeofScrnPtr(charData)); +#if OPT_DEC_RECTOPS + skipNcolChar = (ncol * SizeofScrnPtr(charSeen)); /* = charSets */ +#endif #if OPT_ISO_COLORS skipNcolCellColor = (ncol * SizeofScrnPtr(color)); #endif @@ -226,6 +233,10 @@ setupLineData(TScreen *screen, SetupScrnPtr(ptr->color, data, CellColor); #endif SetupScrnPtr(ptr->charData, data, CharData); +#if OPT_DEC_RECTOPS + SetupScrnPtr(ptr->charSeen, data, Char); + SetupScrnPtr(ptr->charSets, data, Char); +#endif #if OPT_WIDE_CHARS if (screen->wide_chars) { unsigned extra = (unsigned) screen->max_combining; @@ -302,9 +313,16 @@ sizeofScrnRow(TScreen *screen, unsigned ncol) (void) screen; - result = (ncol * (unsigned) sizeof(CharData)); + result = (ncol * (unsigned) sizeof(CharData)); /* ->charData */ AlignValue(result); +#if OPT_DEC_RECTOPS + result += (ncol * (unsigned) sizeof(Char)); /* ->charSeen */ + AlignValue(result); + result += (ncol * (unsigned) sizeof(Char)); /* ->charSets */ + AlignValue(result); +#endif + #if OPT_WIDE_CHARS if (screen->wide_chars) { result *= (unsigned) (1 + screen->max_combining); @@ -800,6 +818,7 @@ ClearCells(XtermWidget xw, int flags, unsigned len, int row, int col) flags = (int) ((unsigned) flags | TERM_COLOR_FLAGS(xw)); for (n = 0; n < len; ++n) { + if_OPT_DEC_RECTOPS(ld->charSeen[(unsigned) col + n] = ' '); ld->charData[(unsigned) col + n] = (CharData) ' '; } @@ -867,16 +886,20 @@ ScrnDisownSelection(XtermWidget xw) */ void ScrnWriteText(XtermWidget xw, - IChar *str, + Cardinal offset, + Cardinal length, unsigned flags, - CellColor cur_fg_bg, - unsigned length) + CellColor cur_fg_bg) { + IChar *str = xw->work.write_text + offset; TScreen *screen = TScreenOf(xw); LineData *ld; IAttr *attrs; int avail = MaxCols(screen) - screen->cur_col; IChar *chars; +#if OPT_DEC_RECTOPS + Char *seens; +#endif #if OPT_WIDE_CHARS IChar starcol1; #endif @@ -898,6 +921,7 @@ ScrnWriteText(XtermWidget xw, ld = getLineData(screen, screen->cur_row); + if_OPT_DEC_RECTOPS(seens = ld->charSeen + screen->cur_col); chars = ld->charData + screen->cur_col; attrs = ld->attribs + screen->cur_col; @@ -905,12 +929,26 @@ ScrnWriteText(XtermWidget xw, starcol1 = *chars; #endif - /* write blanks if we're writing invisible text */ + /* + * Copy the string onto the line, + * writing blanks if we're writing invisible text. + */ for (n = 0; n < length; ++n) { - if ((flags & INVISIBLE)) - chars[n] = ' '; - else - chars[n] = str[n]; +#if OPT_DEC_RECTOPS + if (xw->work.write_sums != NULL) { + ld->charSeen[screen->cur_col + (int) n] = xw->work.buffer_sums[n]; + ld->charSets[screen->cur_col + (int) n] = xw->work.buffer_sets[n]; + } else { + seens[n] = (str[n] < 32 +#if OPT_WIDE_CHARS + || str[n] > 255 +#endif + ) + ? ANSI_ESC + : (Char) str[n]; + } +#endif /* OPT_DEC_RECTOPS */ + chars[n] = str[n]; } #if OPT_BLINK_TEXT @@ -1049,6 +1087,10 @@ ScrnClearLines(XtermWidget xw, ScrnBuf sb, int where, unsigned n, unsigned size) memset(work->color, 0, size * sizeof(work->color[0])); #endif } + if_OPT_DEC_RECTOPS({ + memset(work->charSeen, 0, size * sizeof(Char)); + memset(work->charSets, 0, size * sizeof(work->charSets[0])); + }); #if OPT_WIDE_CHARS if (screen->wide_chars) { size_t off; @@ -1636,7 +1678,6 @@ ScrnRefresh(XtermWidget xw, fg = extract_fg(xw, fg_bg, flags); bg = extract_bg(xw, fg_bg, flags); }); - #if OPT_WIDE_ATTRS old_attrs = xtermUpdateItalics(xw, flags, old_attrs); #endif @@ -1896,7 +1937,7 @@ freeLineData(TScreen *screen, LineData *source) #define ALLOC_IT(field) \ if (result != NULL) { \ - if ((result->field = calloc(ncol, sizeof(*result->field))) == NULL) { \ + if ((result->field = calloc((size_t) ncol, sizeof(*result->field))) == NULL) { \ result = freeLineData(screen, result); \ } \ } @@ -1913,14 +1954,18 @@ allocLineData(TScreen *screen, LineData *source) #if OPT_WIDE_CHARS size += source->combSize * sizeof(result->combData[0]); #endif - if ((result = calloc(1, size)) != NULL) { + if ((result = calloc((size_t) 1, size)) != NULL) { result->lineSize = ncol; ALLOC_IT(attribs); #if OPT_ISO_COLORS ALLOC_IT(color); #endif +#if OPT_DEC_RECTOPS + ALLOC_IT(charSeen); ALLOC_IT(charData); +#endif #if OPT_WIDE_CHARS + ALLOC_IT(charSets); if_OPT_WIDE_CHARS(screen, { size_t off; for_each_combData(off, source) { @@ -2603,11 +2648,6 @@ ScrnCopyRectangle(XtermWidget xw, XTermRect *source, int nparam, int *params) /* * Modifies the video-attributes only - so selection (not a video attribute) is * unaffected. Colors and double-size flags are unaffected as well. - * - * FIXME: our representation for "invisible" does not work with this operation, - * since the attribute byte is fully-allocated for other flags. The logic - * is shown for INVISIBLE because it's harmless, and useful in case the - * CHARDRAWN or PROTECTED flags are reassigned. */ void ScrnMarkRectangle(XtermWidget xw, @@ -2812,14 +2852,13 @@ xtermCheckRect(XtermWidget xw, int trimmed = 0; int mode = screen->checksum_ext; - TRACE(("xtermCheckRect: %s%s%s%s%s%s%s\n", + TRACE(("xtermCheckRect: %s%s%s%s%s%s\n", (mode == csDEC) ? "DEC" : "checksumExtension", (mode & csPOSITIVE) ? " !negative" : "", (mode & csATTRIBS) ? " !attribs" : "", (mode & csNOTRIM) ? " !trimmed" : "", (mode & csDRAWN) ? " !drawn" : "", - (mode & csBYTE) ? " !byte" : "", - (mode & cs8TH) ? " !7bit" : "")); + (mode & csBYTE) ? " !byte" : "")); if (nparam > 2) { nparam -= 2; @@ -2832,29 +2871,62 @@ xtermCheckRect(XtermWidget xw, int row, col; Boolean first = True; int embedded = 0; - DECNRCM_codes my_GR = screen->gsets[(int) screen->curgr]; for (row = top; row <= bottom; ++row) { int left = (target.left - 1); int right = (target.right - 1); + int ch; ld = getLineData(screen, row); if (ld == 0) continue; for (col = left; col <= right && col < (int) ld->lineSize; ++col) { - int ch = ((ld->attribs[col] & CHARDRAWN) - ? (int) ld->charData[col] - : ' '); - if (!(mode & csBYTE)) { - unsigned c2 = (unsigned) ch; - if (c2 > 0x7f && my_GR != nrc_ASCII) { - c2 = xtermCharSetIn(xw, c2, my_GR); - if (!(mode & cs8TH) && (c2 < 0x80)) - c2 |= 0x80; - } - ch = (c2 & 0xff); + if (!(ld->attribs[col] & CHARDRAWN)) { + if (!(mode & (csNOTRIM | csDRAWN))) + continue; + ch = ' '; + } else if (!(mode & csBYTE)) { + ch = xtermCharSetDec(xw, + ld->charSeen[col], + ld->charSets[col]); + } else { + ch = (int) ld->charData[col]; + if_OPT_WIDE_CHARS(screen, { + if (is_UCS_SPECIAL(ch)) + continue; + }); } if (!(mode & csATTRIBS)) { +#if OPT_ISO_COLORS && OPT_VT525_COLORS + if (screen->terminal_id == 525) { + IAttr flags = ld->attribs[col]; + CellColor fg_bg = ld->color[col]; + int fg = (int) extract_fg(xw, fg_bg, flags); + int bg = (int) extract_bg(xw, fg_bg, flags); + Boolean dft_bg = (bg < 0); + Boolean dft_fg = (fg < 0); + + if (dft_bg) + bg = screen->assigned_bg; + if (bg >= 0 && bg < 16) + ch += bg; + + if (dft_fg) + fg = screen->assigned_fg; + if (fg >= 0 && fg < 16) + ch += (fg << 4); + + /* special case to match VT525 behavior */ + if (dft_bg && !dft_fg && (ld->attribs[col] & BOLD)) + ch -= 0x80; + } +#endif + if (ld->attribs[col] & PROTECTED) + ch += 0x4; +#if OPT_WIDE_ATTRS + if (ld->attribs[col] & INVISIBLE) + ch += 0x8; +#endif if (ld->attribs[col] & UNDERLINE) ch += 0x10; if (ld->attribs[col] & INVERSE) @@ -2871,20 +2943,16 @@ xtermCheckRect(XtermWidget xw, if ((mode & csNOTRIM)) embedded += ch; } - if ((ld->attribs[col] & CHARDRAWN)) { - total += ch; - if_OPT_WIDE_CHARS(screen, { - /* FIXME - not counted if trimming blanks */ - if (!(mode & csBYTE)) { - size_t off; - for_each_combData(off, ld) { - total += (int) ld->combData[off][col]; - } + total += ch; + if_OPT_WIDE_CHARS(screen, { + /* FIXME - not counted if trimming blanks */ + if (!(mode & csBYTE)) { + size_t off; + for_each_combData(off, ld) { + total += (int) ld->combData[off][col]; } - }) - } else if (!(mode & csDRAWN)) { - total += ch; - } + } + }); first = ((mode & csNOTRIM) != 0) ? True : False; } if (!(mode & csNOTRIM)) { @@ -2901,6 +2969,55 @@ xtermCheckRect(XtermWidget xw, } #endif /* OPT_DEC_RECTOPS */ +static void +set_ewmh_hint(XtermWidget xw, int operation, _Xconst char *prop) +{ + TScreen *screen = TScreenOf(xw); + Display *dpy = screen->display; + Window window; + XEvent e; + Atom atom_fullscreen = CachedInternAtom(dpy, prop); + Atom atom_state = CachedInternAtom(dpy, "_NET_WM_STATE"); + +#if OPT_TRACE + const char *what = "?"; + switch (operation) { + case _NET_WM_STATE_ADD: + what = "adding"; + break; + case _NET_WM_STATE_REMOVE: + what = "removing"; + break; + } + TRACE(("set_ewmh_hint %s %s\n", what, prop)); +#endif + +#if OPT_TEK4014 + if (TEK4014_ACTIVE(xw)) { + window = TShellWindow; + } else +#endif + window = VShellWindow(xw); + + memset(&e, 0, sizeof(e)); + e.xclient.type = ClientMessage; + e.xclient.message_type = atom_state; + e.xclient.display = dpy; + e.xclient.window = window; + e.xclient.format = 32; + e.xclient.data.l[0] = operation; + e.xclient.data.l[1] = (long) atom_fullscreen; + + XSendEvent(dpy, DefaultRootWindow(dpy), False, + SubstructureRedirectMask, &e); +} + +void +ResetHiddenHint(XtermWidget xw) +{ + set_ewmh_hint(xw, _NET_WM_STATE_REMOVE, "_NET_WM_STATE_HIDDEN"); +} + #if OPT_MAXIMIZE static _Xconst char * @@ -2982,39 +3099,6 @@ unset_resize_increments(XtermWidget xw) XFlush(XtDisplay(xw)); } -static void -set_ewmh_hint(Display *dpy, Window window, int operation, _Xconst char *prop) -{ - XEvent e; - Atom atom_fullscreen = XInternAtom(dpy, prop, False); - Atom atom_state = XInternAtom(dpy, "_NET_WM_STATE", False); - -#if OPT_TRACE - const char *what = "?"; - switch (operation) { - case _NET_WM_STATE_ADD: - what = "adding"; - break; - case _NET_WM_STATE_REMOVE: - what = "removing"; - break; - } - TRACE(("set_ewmh_hint %s %s\n", what, prop)); -#endif - - memset(&e, 0, sizeof(e)); - e.xclient.type = ClientMessage; - e.xclient.message_type = atom_state; - e.xclient.display = dpy; - e.xclient.window = window; - e.xclient.format = 32; - e.xclient.data.l[0] = operation; - e.xclient.data.l[1] = (long) atom_fullscreen; - - XSendEvent(dpy, DefaultRootWindow(dpy), False, - SubstructureRedirectMask, &e); -} - /* * Check if the given property is supported on the root window. * @@ -3029,8 +3113,8 @@ set_ewmh_hint(Display *dpy, Window window, int operation, _Xconst char *prop) static Boolean probe_netwm(Display *dpy, _Xconst char *propname) { - Atom atom_fullscreen = XInternAtom(dpy, propname, False); - Atom atom_supported = XInternAtom(dpy, "_NET_SUPPORTED", False); + Atom atom_fullscreen = CachedInternAtom(dpy, propname); + Atom atom_supported = CachedInternAtom(dpy, "_NET_SUPPORTED"); Atom actual_type; int actual_format; long long_offset = 0; @@ -3107,15 +3191,10 @@ FullScreen(XtermWidget xw, int new_ewmh_mode) _Xconst char *newprop; int which = 0; - Window window; - #if OPT_TEK4014 - if (TEK4014_ACTIVE(xw)) { + if (TEK4014_ACTIVE(xw)) which = 1; - window = TShellWindow; - } else #endif - window = VShellWindow(xw); old_ewmh_mode = xw->work.ewmh[which].mode; oldprop = ewmhProperty(old_ewmh_mode); @@ -3146,15 +3225,15 @@ FullScreen(XtermWidget xw, int new_ewmh_mode) TRACE(("...new EWMH mode is allowed\n")); if (new_ewmh_mode && !xw->work.ewmh[which].mode) { unset_resize_increments(xw); - set_ewmh_hint(dpy, window, _NET_WM_STATE_ADD, newprop); + set_ewmh_hint(xw, _NET_WM_STATE_ADD, newprop); } else if (xw->work.ewmh[which].mode && !new_ewmh_mode) { if (!xw->misc.resizeByPixel) { set_resize_increments(xw); } - set_ewmh_hint(dpy, window, _NET_WM_STATE_REMOVE, oldprop); + set_ewmh_hint(xw, _NET_WM_STATE_REMOVE, oldprop); } else { - set_ewmh_hint(dpy, window, _NET_WM_STATE_REMOVE, oldprop); - set_ewmh_hint(dpy, window, _NET_WM_STATE_ADD, newprop); + set_ewmh_hint(xw, _NET_WM_STATE_REMOVE, oldprop); + set_ewmh_hint(xw, _NET_WM_STATE_ADD, newprop); } xw->work.ewmh[which].mode = new_ewmh_mode; update_fullscreen(); diff --git a/app/xterm/scrollbar.c b/app/xterm/scrollbar.c index 1b0a0ac2e..c743c049c 100644 --- a/app/xterm/scrollbar.c +++ b/app/xterm/scrollbar.c @@ -1,7 +1,7 @@ -/* $XTermId: scrollbar.c,v 1.214 2021/12/31 23:35:02 tom Exp $ */ +/* $XTermId: scrollbar.c,v 1.215 2023/11/12 22:08:19 tom Exp $ */ /* - * Copyright 2000-2020,2021 by Thomas E. Dickey + * Copyright 2000-2021,2023 by Thomas E. Dickey * * All Rights Reserved * @@ -862,7 +862,7 @@ getXkbLED(Display *dpy, const char *name, Boolean *result) Bool state; if (have_xkb(dpy)) { - my_atom = XInternAtom(dpy, name, False); + my_atom = CachedInternAtom(dpy, name); if ((my_atom != None) && XkbGetNamedIndicator(dpy, my_atom, NULL, &state, NULL, NULL)) { *result = (Boolean) state; @@ -883,7 +883,7 @@ showXkbLED(Display *dpy, const char *name, Bool enable) Boolean result = False; if (have_xkb(dpy)) { - my_atom = XInternAtom(dpy, name, False); + my_atom = CachedInternAtom(dpy, name); if ((my_atom != None) && XkbGetNamedIndicator(dpy, my_atom, NULL, NULL, NULL, NULL) && XkbSetNamedIndicator(dpy, my_atom, True, enable, False, NULL)) { diff --git a/app/xterm/svg.c b/app/xterm/svg.c index 73207e2af..18a7f1eb0 100644 --- a/app/xterm/svg.c +++ b/app/xterm/svg.c @@ -1,7 +1,7 @@ -/* $XTermId: svg.c,v 1.21 2021/09/19 18:22:57 tom Exp $ */ +/* $XTermId: svg.c,v 1.23 2023/03/31 23:08:13 tom Exp $ */ /* - * Copyright 2017-2020,2021 Thomas E. Dickey + * Copyright 2017-2021,2023 Thomas E. Dickey * Copyright 2015-2016,2017 Jens Schweikhardt * * All Rights Reserved @@ -105,11 +105,12 @@ dumpSvgScreen(XtermWidget xw, FILE *fp) int row; fprintf(fp, " <rect x='0' y='0' width='%u' height='%u' fill='%s'/>\n", - cols * CELLW + 2 * (bw + ib), rows * CELLH + 2 * (bw + ib), + (unsigned) (cols * CELLW + 2 * (bw + ib)), + (unsigned) (rows * CELLH + 2 * (bw + ib)), PixelToCSSColor(xw, xw->core.border_pixel)); fprintf(fp, " <rect x='%u' y='%u' width='%u' height='%u' fill='%s'/>\n", bw, bw, - MaxCols(s) * CELLW + 2 * ib, + (unsigned) (MaxCols(s) * CELLW + 2 * ib), (unsigned) (rows * CELLH + 2 * ib), PixelToCSSColor(xw, xw->old_background)); diff --git a/app/xterm/terminfo b/app/xterm/terminfo index 953b92cba..df6adb5e8 100644 --- a/app/xterm/terminfo +++ b/app/xterm/terminfo @@ -1,10 +1,10 @@ -# $XTermId: terminfo,v 1.206 2023/01/08 10:51:12 tom Exp $ +# $XTermId: terminfo,v 1.209 2024/02/11 23:35:48 tom Exp $ # # Updates/notes/new entries (e.g., xterm-8bit, xterm-16color, xterm-256color) # - Thomas E. Dickey # #------------------------------------------------------------------------------ -# Copyright 1996-2022,2023 by Thomas E. Dickey +# Copyright 1996-2023,2024 by Thomas E. Dickey # # All Rights Reserved # @@ -130,11 +130,6 @@ # respectively. # xterm-new|modern xterm terminal emulator, - npc, - indn=\E[%p1%dS, - kcbt=\E[Z, - kent=\EOM, - nel=\EE, use=dec+sl, use=ecma+index, use=xterm+keypad, @@ -147,6 +142,7 @@ xterm-new|modern xterm terminal emulator, use=xterm+nofkeys, use=bracketed+paste, use=report+version, + use=xterm+focus, # Left/right margins are supported in xterm since patch #279 (2012/05/10) vt420+lrmm|VT420 left/right margins, @@ -155,9 +151,23 @@ vt420+lrmm|VT420 left/right margins, smglr=\E[?69h\E[%i%p1%d;%p2%ds, smgrp=\E[?69h\E[%i;%p1%ds, -# These "ansi+XXX" blocks were added in ncurses 5.0: -ansi+rep, - rep=%p1%c\E[%p2%{1}%-%db, +# These "ansi+XXX" blocks were added in ncurses 5.0 or 5.1: +ansi+arrows|ANSI normal-mode home and cursor-keys, + kbs=^H, + kcub1=\E[D, + kcud1=\E[B, + kcuf1=\E[C, + kcuu1=\E[A, + khome=\E[H, + +ansi+csr|ANSI scroll-region plus cursor save & restore, + csr=\E[%i%p1%d;%p2%dr, + rc=\E8, + sc=\E7, + +ansi+cup|ANSI absolute cursor-addressing, + cup=\E[%i%p1%d;%p2%dH, + home=\E[H, ansi+enq|ncurses extension for ANSI ENQ, u6=\E[%i%d;%dR, @@ -165,6 +175,172 @@ ansi+enq|ncurses extension for ANSI ENQ, u8=\E[?%[;0123456789]c, u9=\E[c, +ansi+erase|ANSI clear screen/line, + clear=\E[H\E[J, + ed=\E[J, + el=\E[K, + +ansi+idc1|ANSI insert/delete one character, + dch1=\E[P, + ich1=\E[@, + rmir=\E[4l, + smir=\E[4h, + +ansi+idc|ANSI insert/delete characters, + dch=\E[%p1%dP, + ich=\E[%p1%d@, + use=ansi+idc1, + +ansi+idl1|ANSI insert/delete one line, + dl1=\E[M, + il1=\E[L, + +ansi+idl|ANSI insert/delete lines, + dl=\E[%p1%dM, + il=\E[%p1%dL, + use=ansi+idl1, + +ansi+inittabs|ANSI initial tab-stops, + it#8, + use=ansi+tabs, + +ansi+local1|ANSI normal-mode cursor-keys, + cub1=\E[D, + cud1=\E[B, + cuf1=\E[C, + cuu1=\E[A, + +ansi+local|ANSI normal-mode parameterized cursor-keys, + cub=\E[%p1%dD, + cud=\E[%p1%dB, + cuf=\E[%p1%dC, + cuu=\E[%p1%dA, + use=ansi+local1, + +ansi+pp|ANSI printer port, + mc5i, + mc0=\E[i, + mc4=\E[4i, + mc5=\E[5i, + +ansi+rep|ANSI repeat-character, + rep=%p1%c\E[%p2%{1}%-%db, + +ansi+sgr|ANSI graphic renditions, + blink=\E[5m, + invis=\E[8m, + rev=\E[7m, + sgr=\E[0 + %? + %p3 + %t;7 + %; + %? + %p4 + %t;5 + %; + %? + %p7 + %t;8 + %; + m, + sgr0=\E[0m, + +ansi+sgrso|ANSI standout only, + rmso=\E[m, + smso=\E[7m, + +ansi+sgrul|ANSI underline only, + rmul=\E[m, + smul=\E[4m, + +ansi+sgrbold|ANSI graphic renditions; assuming terminal has bold; not dim, + bold=\E[1m, + sgr=\E[ + %? + %p1 + %t7; + %; + %? + %p2 + %t4; + %; + %? + %p3 + %t7; + %; + %? + %p4 + %t5; + %; + %? + %p6 + %t1; + %; + %? + %p7 + %t8; + %; + m, + use=ansi+sgr, + use=ansi+sgrso, + use=ansi+sgrul, + +ansi+sgrdim|ANSI graphic renditions; assuming terminal has dim; not bold, + dim=\E[2m, + sgr=\E[ + %? + %p1 + %t7; + %; + %? + %p2 + %t4; + %; + %? + %p3 + %t7; + %; + %? + %p4 + %t5; + %; + %? + %p5 + %t2; + %; + %? + %p7 + %t8; + %; + m, + use=ansi+sgr, + use=ansi+sgrso, + use=ansi+sgrul, + +ansi+tabs|ANSI tab-stops, + cbt=\E[Z, + ht=^I, + hts=\EH, + tbc=\E[3g, + +# These were added after ncurses 6.0: +ansi+apparrows|ANSI application-mode home and cursor-keys, + kcub1=\EOD, + kcud1=\EOB, + kcuf1=\EOC, + kcuu1=\EOA, + khome=\EOH, + use=ansi+arrows, + +ansi+cpr|ncurses extension for ANSI CPR, + u6=\E[%i%d;%dR, + u7=\E[6n, + +ansi+rca2|ANSI relative cursor-addressing, + hpa=\E[%i%p1%dG, + vpa=\E[%i%p1%dd, + # Encode modifiers using parameters (see "Xterm Control Sequences" ctlseqs.ms). # Note that this is unrelated to PCTERM. # @@ -908,7 +1084,7 @@ xterm+pce0|fragment with modifyCursorKeys:0, kPRV5=\E[5;5~, kPRV6=\E[5;6~, kPRV7=\E[5;7~, - use=xterm+edit, + use=vt220+pcedit, ecma+italics|ECMA-48 italics, ritm=\E[23m, @@ -968,6 +1144,16 @@ xterm+x11mouse|X11 xterm mouse protocol, %p2%'!'%+%c %p1%'!'%+%c, +# xterm patch #224 2007/2/11 added private mode 1004, for enabling/disabling +# focus in/out event reporting. The 1004 is normally part of XM in a different +# building-block, e.g., for reporting any events. +xterm+focus|xterm focus-in/out event "keys", + XF, + fd=\E[?1004l, + fe=\E[?1004h, + kxIN=\E[I, + kxOUT=\E[O, + # https://invisible-island.net/xterm/xterm-paste64.html # # Bracketed paste was introduced by xterm patch #203 in May 2005, as part of a @@ -988,7 +1174,21 @@ bracketed+paste|xterm bracketed paste, # For example: # ^[P>|XTerm(354)^[\ report+version|Report xterm name and version (XTVERSION)., - RV=\E[>0q, + XR=\E[>0q, + xr=\EP>\\|XTerm\\([1-9][0-9]+\\) + \E\\\\, + use=report+da2, + +# Vim uses RV to denote the secondary device attributes. Xterm documents the +# - first parameter as the terminal type (extending it to VT100), +# - the second as the patch number for xterm, and +# - the third parameter as zero. +# Other terminals may provide useful responses, though few are documented. +# +# Since patch #280 2012/06/24, xterm by default reports itself as a VT420. +report+da2|report secondary device attributes (DA2), + RV=\E[>c, + rv=\E\\[41;[1-6][0-9][0-9];0c, # This chunk is used for building the VT220/Sun/PC keyboard variants. xterm-basic|modern xterm terminal emulator - common, @@ -996,7 +1196,6 @@ xterm-basic|modern xterm terminal emulator - common, am, bce, km, - mc5i, mir, msgr, xenl, @@ -1004,59 +1203,34 @@ xterm-basic|modern xterm terminal emulator - common, XT, colors#8, cols#80, - it#8, lines#24, pairs#64, acsc=``aaffggiijjkkllmmnnooppqqr rssttuuvvwwxxyyzz{{||}}~~, bel=^G, - blink=\E[5m, - bold=\E[1m, - cbt=\E[Z, civis=\E[?25l, clear=\E[H\E[2J, cnorm=\E[?12l\E[?25h, cr=\r, - csr=\E[%i%p1%d;%p2%dr, - cub=\E[%p1%dD, cub1=^H, - cud=\E[%p1%dB, cud1=\n, - cuf=\E[%p1%dC, - cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, - cuu=\E[%p1%dA, - cuu1=\E[A, cvvis=\E[?12;25h, dch=\E[%p1%dP, dch1=\E[P, - dim=\E[2m, - dl=\E[%p1%dM, - dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, flash=\E[?5h$<100/>\E[?5l, home=\E[H, - hpa=\E[%i%p1%dG, - ht=^I, - hts=\EH, ich=\E[%p1%d@, - il=\E[%p1%dL, - il1=\E[L, ind=\n, - invis=\E[8m, is2=\E[!p\E[?3;4l\E[4l\E>, kmous=\E[M, - mc0=\E[i, - mc4=\E[4i, - mc5=\E[5i, meml=\El, memu=\Em, op=\E[39;49m, - rc=\E8, - rev=\E[7m, ri=\EM, rmacs=\E(B, rmam=\E[?7l, @@ -1067,7 +1241,6 @@ xterm-basic|modern xterm terminal emulator - common, rmul=\E[24m, rs1=\Ec, rs2=\E[!p\E[?3;4l\E[4l\E>, - sc=\E7, setab=\E[4%p1%dm, setaf=\E[3%p1%dm, setb=\E[4 @@ -1144,12 +1317,16 @@ xterm-basic|modern xterm terminal emulator - common, smir=\E[4h, smkx=\E[?1h\E=, smm=\E[?1034h, - smso=\E[7m, - smul=\E[4m, - tbc=\E[3g, - vpa=\E[%i%p1%dd, E3=\E[3J, + use=ansi+csr, use=ansi+enq, + use=ansi+idl, + use=ansi+inittabs, + use=ansi+local, + use=ansi+pp, + use=ansi+rca2, + use=ansi+sgrbold, + use=ansi+sgrdim, use=xterm+alt+title, use=xterm+kbs, @@ -1164,6 +1341,7 @@ xterm+nofkeys|building block for xterm fkey-variants, use=vt420+lrmm, use=xterm+sm+1006, use=xterm+tmux, + use=xterm+focus, use=ecma+italics, use=xterm+keypad, use=xterm-basic, @@ -1184,12 +1362,7 @@ xterm+nofkeys|building block for xterm fkey-variants, xterm-vt220|xterm emulating vt220, npc, kcbt=\E[Z, - kcub1=\EOD, - kcud1=\EOB, - kcuf1=\EOC, - kcuu1=\EOA, kend=\E[4~, - kent=\EOM, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, @@ -1207,18 +1380,16 @@ xterm-vt220|xterm emulating vt220, kf8=\E[19~, kf9=\E[20~, khome=\E[1~, - kich1=\E[2~, kmous=\E[M, - knp=\E[6~, - kpp=\E[5~, nel=\EE, use=xterm+app, - use=xterm+edit, use=vt220+keypad, + use=vt220+pcedit, use=ecma+italics, use=ecma+index, use=ansi+rep, use=ecma+strikeout, + use=xterm+focus, use=xterm+sm+1006, use=xterm+tmux, use=xterm+keypad, @@ -1333,13 +1504,8 @@ vt52+keypad|DECScope auxiliary keypad, xterm-sun|xterm with sun function keys, kb2=\E[218z, kcpy=\E[197z, - kcub1=\EOD, - kcud1=\EOB, - kcuf1=\EOC, - kcuu1=\EOA, kdch1=\E[3z, kend=\E[220z, - kent=\EOM, kf1=\E[224z, kf10=\E[233z, kf11=\E[192z, @@ -1379,6 +1545,8 @@ xterm-sun|xterm with sun function keys, knp=\E[222z, kpp=\E[216z, kund=\E[195z, + use=xterm+kbs, + use=ansi+apparrows, use=xterm+nopcfkeys, use=xterm+nofkeys, @@ -1491,7 +1659,7 @@ xterm-sco|xterm with SCO function keys, kmous=\E[>M, knp=\E[G, kpp=\E[I, - use=xterm+noapp, + use=vt100+noapp, use=xterm+nofkeys, # # Other variants (these are all very old entries, from X11R5): @@ -1569,15 +1737,22 @@ xterm-noapp|xterm with cursor keys in normal mode, rmkx=\E>, smcup@, smkx=\E=, - use=xterm+noapp, + use=vt100+noapp, use=xterm, -xterm+noapp|fragment with cursor keys in normal mode, +vt100+noapp|fragment with cursor keys in normal mode, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, - use=xterm+noapp+pc, + use=vt100+noapp+pc, + +xterm+acs|ISO-2022 alternate character-switching for xterm, + acsc=``aaffggiijjkkllmmnnooppqqr + rssttuuvvwwxxyyzz{{||}}~~, + enacs@, + rmacs=\E(B, + smacs=\E(0, xterm+app|fragment with cursor keys in application mode, kcub1=\EOD, @@ -1586,7 +1761,7 @@ xterm+app|fragment with cursor keys in application mode, kcuu1=\EOA, use=xterm+app+pc, -xterm+noapp+pc|fragment for noapp pc-style home/end, +vt100+noapp+pc|fragment for noapp pc-style home/end, kend=\E[F, khome=\E[H, @@ -1594,7 +1769,7 @@ xterm+app+pc|fragment for app pc-style home/end, kend=\EOF, khome=\EOH, -xterm+edit|fragment for 6-key editing-keypad, +vt220+pcedit|fragment for 6-key editing-keypad, kdch1=\E[3~, kich1=\E[2~, knp=\E[6~, @@ -1616,10 +1791,6 @@ xterm+vt+edit|fragment for vt220-style editing keypad, kfnd=\E[1~, kslt=\E[4~, -xterm+noalt|xterm without altscreen, - rmcup@, - smcup@, - xterm+alt1049|xterm 90 feature, rmcup=\E[?1049l, smcup=\E[?1049h, @@ -2066,8 +2237,6 @@ xterm+256color2|xterm 256-color feature, %p1%d %; m, - setb@, - setf@, use=xterm+256color, xterm-256color|xterm with 256 colors, use=xterm+256color2, @@ -2150,8 +2319,6 @@ xterm-8bit|xterm terminal emulator with 8-bit controls (X Window System), it#8, lines#24, pairs#64, - acsc=``aaffggiijjkkllmmnnooppqqr - rssttuuvvwwxxyyzz{{||}}~~, bel=^G, blink=\2335m, bold=\2331m, @@ -2240,7 +2407,6 @@ xterm-8bit|xterm terminal emulator with 8-bit controls (X Window System), rc=\E8, rev=\2337m, ri=\215, - rmacs=\E(B, rmam=\233?7l, rmcup=\233?1049l, rmir=\2334l, @@ -2318,7 +2484,6 @@ xterm-8bit|xterm terminal emulator with 8-bit controls (X Window System), \E(B %;, sgr0=\2330m\E(B, - smacs=\E(0, smam=\233?7h, smcup=\233?1049h, smir=\2334h, @@ -2331,6 +2496,7 @@ xterm-8bit|xterm terminal emulator with 8-bit controls (X Window System), u8=\233[?%[;0123456789]c, u9=\E[c, vpa=\233%i%p1%dd, + use=xterm+acs, use=xterm+kbs, # xterm-xf86-v44|xterm terminal emulator (XFree86 4.4 Window System), @@ -2338,7 +2504,6 @@ xterm-xf86-v44|xterm terminal emulator (XFree86 4.4 Window System), am, bce, km, - mc5i, mir, msgr, npc, @@ -2347,50 +2512,30 @@ xterm-xf86-v44|xterm terminal emulator (XFree86 4.4 Window System), XT, colors#8, cols#80, - it#8, lines#24, pairs#64, acsc=``aaffggiijjkkllmmnnooppqqr rssttuuvvwwxxyyzz{{||}}~~, bel=^G, - blink=\E[5m, - bold=\E[1m, - cbt=\E[Z, civis=\E[?25l, clear=\E[H\E[2J, cnorm=\E[?12l\E[?25h, cr=\r, - csr=\E[%i%p1%d;%p2%dr, - cub=\E[%p1%dD, cub1=^H, - cud=\E[%p1%dB, cud1=\n, - cuf=\E[%p1%dC, - cuf1=\E[C, - cup=\E[%i%p1%d;%p2%dH, - cuu=\E[%p1%dA, - cuu1=\E[A, cvvis=\E[?12;25h, dch=\E[%p1%dP, dch1=\E[P, - dl=\E[%p1%dM, - dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, enacs=\E(B\E)0, flash=\E[?5h$<100/>\E[?5l, - home=\E[H, hpa=\E[%i%p1%dG, - ht=^I, - hts=\EH, ich=\E[%p1%d@, - il=\E[%p1%dL, - il1=\E[L, ind=\n, indn=\E[%p1%dS, - invis=\E[8m, is2=\E[!p\E[?3;4l\E[4l\E>, kDC=\E[3;2~, kEND=\E[1;2F, @@ -2402,10 +2547,6 @@ xterm-xf86-v44|xterm terminal emulator (XFree86 4.4 Window System), kRIT=\E[1;2C, kb2=\EOE, kcbt=\E[Z, - kcub1=\EOD, - kcud1=\EOB, - kcuf1=\EOC, - kcuu1=\EOA, kdch1=\E[3~, kend=\EOF, kent=\EOM, @@ -2457,19 +2598,13 @@ xterm-xf86-v44|xterm terminal emulator (XFree86 4.4 Window System), kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, - khome=\EOH, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~, - mc0=\E[i, - mc4=\E[4i, - mc5=\E[5i, meml=\El, memu=\Em, op=\E[39;49m, - rc=\E8, - rev=\E[7m, ri=\EM, rin=\E[%p1%dT, rmacs=^O, @@ -2480,7 +2615,6 @@ xterm-xf86-v44|xterm terminal emulator (XFree86 4.4 Window System), rmul=\E[24m, rs1=\Ec, rs2=\E[!p\E[?3;4l\E[4l\E>, - sc=\E7, setab=\E[4%p1%dm, setaf=\E[3%p1%dm, setb=\E[4 @@ -2551,20 +2685,24 @@ xterm-xf86-v44|xterm terminal emulator (XFree86 4.4 Window System), smam=\E[?7h, smir=\E[4h, smkx=\E[?1h\E=, - smso=\E[7m, - smul=\E[4m, - tbc=\E[3g, - u6=\E[%i%d;%dR, - u7=\E[6n, u8=\E[?1;2c, - u9=\E[c, vpa=\E[%i%p1%dd, ka2=\EOx, kb1=\EOt, kb3=\EOv, kc2=\EOr, - use=xterm+alt1049, use=xterm+kbs, + use=ansi+apparrows, + use=ansi+csr, + use=ansi+cup, + use=ansi+enq, + use=ansi+idl, + use=ansi+inittabs, + use=ansi+local, + use=ansi+pp, + use=ansi+sgrbold, + use=xterm+alt1049, + xterm-xfree86|xterm terminal emulator (XFree86 4.4 Window System), use=xterm-xf86-v44, # @@ -2590,24 +2728,19 @@ xterm-r6|xterm X11R6 version, bold=\E[1m, clear=\E[H\E[2J, cr=\r, - csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=\n, cuf=\E[%p1%dC, cuf1=\E[C, - cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, - ed=\E[J, - el=\E[K, enacs=\E)0, - home=\E[H, ht=^I, hts=\EH, il=\E[%p1%dL, @@ -2619,7 +2752,6 @@ xterm-r6|xterm X11R6 version, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, - kdch1=\E[3~, kf1=\E[11~, kf10=\E[21~, kf11=\E[23~, @@ -2643,7 +2775,6 @@ xterm-r6|xterm X11R6 version, kmous=\E[M, meml=\El, memu=\Em, - rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, @@ -2654,7 +2785,6 @@ xterm-r6|xterm X11R6 version, rmul=\E[m, rs2=\E[m\E[?7h\E[4l\E>\E7\E[r\E[ ?1;3;4;6l\E8, - sc=\E7, sgr0=\E[m, smacs=^N, smcup=\E7\E[?47h, @@ -2663,10 +2793,12 @@ xterm-r6|xterm X11R6 version, smso=\E[7m, smul=\E[4m, tbc=\E[3g, - u6=\E[%i%d;%dR, - u7=\E[6n, u8=\E[?1;2c, u9=\E[c, + use=ansi+cpr, + use=ansi+csr, + use=ansi+cup, + use=ansi+erase, use=xterm+kbs, use=xterm+decedit, xterm-old|antique xterm version, @@ -2697,34 +2829,15 @@ xterm-r5|xterm R5 version, bold=\E[1m, clear=\E[H\E[2J, cr=\r, - csr=\E[%i%p1%d;%p2%dr, - cub=\E[%p1%dD, cub1=^H, - cud=\E[%p1%dB, cud1=\n, - cuf=\E[%p1%dC, - cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, - cuu=\E[%p1%dA, - cuu1=\E[A, - dch=\E[%p1%dP, - dch1=\E[P, - dl=\E[%p1%dM, - dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H, ht=^I, hts=\EH, - ich=\E[%p1%d@, - ich1=\E[@, - il=\E[%p1%dL, - il1=\E[L, ind=\n, - kcub1=\EOD, - kcud1=\EOB, - kcuf1=\EOC, - kcuu1=\EOA, kdch1=\E[3~, kdl1=\E[31~, kel=\E[8~, @@ -2748,16 +2861,12 @@ xterm-r5|xterm R5 version, kmous=\E[M, knp=\E[6~, kpp=\E[5~, - rc=\E8, rev=\E[7m, ri=\EM, - rmir=\E[4l, rmkx=\E[?1l\E>, - rmso=\E[m, rmul=\E[m, rs2=\E>\E[?1;3;4;5;6l\E[4l\E[?7h \E[m\E[r\E[2J\E[H, - sc=\E7, sgr=\E[ %? %p1 @@ -2781,16 +2890,18 @@ xterm-r5|xterm R5 version, %; m, sgr0=\E[m, - smir=\E[4h, smkx=\E[?1h\E=, - smso=\E[7m, smul=\E[4m, tbc=\E[3g, - u6=\E[%i%d;%dR, - u7=\E[6n, u8=\E[?1;2c, - u9=\E[c, use=xterm+kbs, + use=ansi+apparrows, + use=ansi+csr, + use=ansi+enq, + use=ansi+idc, + use=ansi+idl, + use=ansi+local, + use=ansi+sgrso, # DEC status-line is an extension for VT220, and standard with VT320 and up. dec+sl|DEC VTxx status line, diff --git a/app/xterm/trace.c b/app/xterm/trace.c index aaabed314..0b3f7292f 100644 --- a/app/xterm/trace.c +++ b/app/xterm/trace.c @@ -1,7 +1,7 @@ -/* $XTermId: trace.c,v 1.239 2022/10/06 20:43:02 tom Exp $ */ +/* $XTermId: trace.c,v 1.240 2023/10/14 16:52:49 tom Exp $ */ /* - * Copyright 1997-2021,2022 by Thomas E. Dickey + * Copyright 1997-2022,2023 by Thomas E. Dickey * * All Rights Reserved * @@ -269,6 +269,7 @@ visibleScsCode(DECNRCM_codes chrset) MAP("1", nrc_DEC_Alt_Chars); MAP("2", nrc_DEC_Alt_Graphics); MAP("<", nrc_DEC_Supp); + MAP("<", nrc_DEC_UPSS); MAP("%5", nrc_DEC_Supp_Graphic); MAP(">", nrc_DEC_Technical); MAP("4", nrc_Dutch); diff --git a/app/xterm/trace.h b/app/xterm/trace.h index fa9d90abe..3ed17c05a 100644 --- a/app/xterm/trace.h +++ b/app/xterm/trace.h @@ -1,7 +1,7 @@ -/* $XTermId: trace.h,v 1.94 2022/10/06 20:40:49 tom Exp $ */ +/* $XTermId: trace.h,v 1.95 2024/05/15 23:51:40 tom Exp $ */ /* - * Copyright 1997-2021,2022 by Thomas E. Dickey + * Copyright 1997-2022,2024 by Thomas E. Dickey * * All Rights Reserved * @@ -92,7 +92,7 @@ extern void TraceArgv(const char * /* tag */, char ** /* argv */); extern const char *trace_who; #undef TRACE_CHILD -#define TRACE_CHILD int tracing_child = (trace_who = "child") != 0; (void) tracing_child; +#define TRACE_CHILD int tracing_child = (trace_who = "child") != 0; (void) tracing_child extern void TraceEvent(const char *, XEvent *, String *, Cardinal *); #undef TRACE_EVENT diff --git a/app/xterm/util.c b/app/xterm/util.c index 5ea56ebff..06de3e64f 100644 --- a/app/xterm/util.c +++ b/app/xterm/util.c @@ -1,7 +1,7 @@ -/* $XTermId: util.c,v 1.914 2023/01/04 09:21:31 tom Exp $ */ +/* $XTermId: util.c,v 1.950 2024/07/10 20:22:19 tom Exp $ */ /* - * Copyright 1999-2022,2023 by Thomas E. Dickey + * Copyright 1999-2023,2024 by Thomas E. Dickey * * All Rights Reserved * @@ -1007,10 +1007,13 @@ setZIconBeep(XtermWidget xw) * If warning should be given then give it */ Boolean -showZIconBeep(XtermWidget xw, char *name) +showZIconBeep(XtermWidget xw, const char *name) { Boolean code = False; + if (name == NULL) + name = ""; + if (resource.zIconBeep && TScreenOf(xw)->zIconBeep_flagged) { char *format = resource.zIconFormat; char *newname = malloc(strlen(name) + strlen(format) + 2); @@ -1090,25 +1093,26 @@ resetZIconBeep(XtermWidget xw) #endif /* OPT_ZICONBEEP */ /* - * write a string str of length len onto the screen at - * the current cursor position. update cursor position. + * Write a string onto the screen at the current cursor position. + * Update cursor position. */ void -WriteText(XtermWidget xw, IChar *str, Cardinal len) +WriteText(XtermWidget xw, Cardinal offset, Cardinal length) { + IChar *str = xw->work.write_text + offset; TScreen *screen = TScreenOf(xw); XTermDraw params; CLineData *ld = 0; unsigned attr_flags = xw->flags; CellColor fg_bg = xtermColorPair(xw); - unsigned cells = visual_width(str, len); + unsigned cells = visual_width(str, length); GC currentGC; TRACE(("WriteText %d (%2d,%2d) %3d:%s\n", screen->topline, screen->cur_row, screen->cur_col, - len, visibleIChars(str, len))); + length, visibleIChars(str, length))); if (cells + (unsigned) screen->cur_col > (unsigned) MaxCols(screen)) { cells = (unsigned) (MaxCols(screen) - screen->cur_col); @@ -1156,12 +1160,6 @@ WriteText(XtermWidget xw, IChar *str, Cardinal len) ClearInLine(xw, screen->cur_row, kl, (unsigned) (kr - kl + 1)); }); - if (attr_flags & INVISIBLE) { - Cardinal n; - for (n = 0; n < cells; ++n) - str[n] = ' '; - } - TRACE(("WriteText calling drawXtermText (%d) (%d,%d)\n", LineCharSet(screen, ld), screen->cur_row, @@ -1195,12 +1193,12 @@ WriteText(XtermWidget xw, IChar *str, Cardinal len) currentGC, LineCursorX(screen, ld, screen->cur_col), CursorY(screen, screen->cur_row), - str, len); + str, length); resetXtermGC(xw, attr_flags, False); } - ScrnWriteText(xw, str, attr_flags, fg_bg, len); + ScrnWriteText(xw, offset, length, attr_flags, fg_bg); CursorForward(xw, (int) cells); if (screen->cur_row <= screen->max_row) { @@ -2540,12 +2538,53 @@ GetColors(XtermWidget xw, ScrnColors * pColors) } } +Boolean +AssignFgColor(XtermWidget xw, Pixel fg) +{ + Boolean repaint = False; + TScreen *screen = TScreenOf(xw); + VTwin *win = WhichVWin(screen); + + T_COLOR(screen, TEXT_FG) = fg; + TRACE(("... TEXT_FG: %#lx\n", fg)); + if (screen->Vshow) { + setCgsFore(xw, win, gcNorm, fg); + setCgsBack(xw, win, gcNormReverse, fg); + setCgsFore(xw, win, gcBold, fg); + setCgsBack(xw, win, gcBoldReverse, fg); + repaint = True; + } + FreeMarkGCs(xw); + + return repaint; +} + +Boolean +AssignBgColor(XtermWidget xw, Pixel bg) +{ + Boolean repaint = False; + TScreen *screen = TScreenOf(xw); + VTwin *win = WhichVWin(screen); + + T_COLOR(screen, TEXT_BG) = bg; + TRACE(("... TEXT_BG: %#lx\n", bg)); + if (screen->Vshow) { + setCgsBack(xw, win, gcNorm, bg); + setCgsFore(xw, win, gcNormReverse, bg); + setCgsBack(xw, win, gcBold, bg); + setCgsFore(xw, win, gcBoldReverse, bg); + set_background(xw, -1); + repaint = True; + } + + return repaint; +} + void ChangeColors(XtermWidget xw, ScrnColors * pNew) { - Bool repaint = False; + Boolean repaint = False; TScreen *screen = TScreenOf(xw); - VTwin *win = WhichVWin(screen); TRACE(("ChangeColors\n")); @@ -2565,32 +2604,14 @@ ChangeColors(XtermWidget xw, ScrnColors * pNew) FreeMarkGCs(xw); } - if (COLOR_DEFINED(pNew, TEXT_FG)) { - Pixel fg = COLOR_VALUE(pNew, TEXT_FG); - T_COLOR(screen, TEXT_FG) = fg; - TRACE(("... TEXT_FG: %#lx\n", T_COLOR(screen, TEXT_FG))); - if (screen->Vshow) { - setCgsFore(xw, win, gcNorm, fg); - setCgsBack(xw, win, gcNormReverse, fg); - setCgsFore(xw, win, gcBold, fg); - setCgsBack(xw, win, gcBoldReverse, fg); - repaint = True; - } - FreeMarkGCs(xw); + if (COLOR_DEFINED(pNew, TEXT_FG) + && AssignFgColor(xw, COLOR_VALUE(pNew, TEXT_FG))) { + repaint = True; } - if (COLOR_DEFINED(pNew, TEXT_BG)) { - Pixel bg = COLOR_VALUE(pNew, TEXT_BG); - T_COLOR(screen, TEXT_BG) = bg; - TRACE(("... TEXT_BG: %#lx\n", T_COLOR(screen, TEXT_BG))); - if (screen->Vshow) { - setCgsBack(xw, win, gcNorm, bg); - setCgsFore(xw, win, gcNormReverse, bg); - setCgsBack(xw, win, gcBold, bg); - setCgsFore(xw, win, gcBoldReverse, bg); - set_background(xw, -1); - repaint = True; - } + if (COLOR_DEFINED(pNew, TEXT_BG) + && AssignBgColor(xw, COLOR_VALUE(pNew, TEXT_BG))) { + repaint = True; } #if OPT_HIGHLIGHT_COLOR if (COLOR_DEFINED(pNew, HIGHLIGHT_BG)) { @@ -3319,7 +3340,6 @@ xtermFillCells(XTermDraw * params, break; case gcVTcursFilled: case gcVTcursOutline: - /* FIXME */ break; case gcNorm: dstId = gcNormReverse; @@ -3337,16 +3357,14 @@ xtermFillCells(XTermDraw * params, case gcFiller: dstId = srcId; break; -#if OPT_BOX_CHARS +#if OPT_BOX_CHARS || OPT_WIDE_CHARS case gcLine: case gcDots: - /* FIXME */ break; #endif #if OPT_DEC_CHRSET case gcCNorm: case gcCBold: - /* FIXME */ break; #endif #if OPT_WIDE_CHARS @@ -3358,12 +3376,10 @@ xtermFillCells(XTermDraw * params, break; case gcWideReverse: case gcWBoldReverse: - /* FIXME */ break; #endif #if OPT_TEK4014 case gcTKcurs: - /* FIXME */ break; #endif case gcMAX: @@ -3469,7 +3485,8 @@ drawClippedXftString(XTermDraw * params, font, x, y, text, len); - TScreen *screen = TScreenOf(params->xw); + XtermWidget xw = params->xw; + TScreen *screen = TScreenOf(xw); int fontHigh = FontHeight(screen); int fontWide = FontWidth(screen); @@ -3498,8 +3515,10 @@ drawClippedXftString(XTermDraw * params, fontHigh = font->height; fontWide = font->max_advance_width; /* check if this is really a double-height font */ +#define DoubleScale(macro,field) \ + (int) (macro(screen) * (1.0 + (Max(20, xw->misc.field) / 100.))) if (halfHigh) { - int wantHigh = (int) (FontHeight(screen) * 1.8); + int wantHigh = DoubleScale(FontHeight, limit_fontheight); halfHigh = (fontHigh >= wantHigh); TRACE(("comparing fontHigh %d/%d vs %d:" " double-height %s for %s\n", @@ -3512,7 +3531,7 @@ drawClippedXftString(XTermDraw * params, : FontHeight(screen)); /* check if this is really a double-width font */ if (halfWide) { - int wantWide = (int) (FontWidth(screen) * 1.8); + int wantWide = DoubleScale(FontWidth, limit_fontwidth); halfWide = (fontWide >= wantWide); TRACE(("comparing fontWide %d/%d vs %d:" " double-width %s for %s\n", @@ -3720,6 +3739,230 @@ fakeDoubleChars(XTermDraw * params, #define MaxImageString 255 +#define UCS2SBUF(value) buffer2[dst].byte2 = LO_BYTE(value);\ + buffer2[dst].byte1 = HI_BYTE(value) + +#if OPT_WIDE_CHARS +static int +xtermDrawMissing(TScreen *screen, unsigned flags, GC gc, + int x, int y, int ncells, Bool fullWidth) +{ + /* *INDENT-EQLS* */ + int width = FontWidth(screen) * ncells; + int height = FontHeight(screen); + int descent = FontDescent(screen); + int thick = Max((height / 16), 1); + int thick2 = 2 * thick; + int yhigh = height - thick2; + int too_big = (flags & (DOUBLEWFONT | DOUBLEHFONT)) != 0; + + TRACE(("*missing [%4d,%4d] %dx%d (%d)/%d%s%s%s%s\n", + y, x, + height, width, + ncells, + descent, + flags ? " recur" : "", + flags & DOUBLEFIRST ? "*" : "", + flags & DOUBLEWFONT ? ":W" : "", + flags & DOUBLEHFONT ? ":H" : "")); + if (width > thick2 && height > thick2) { + if (too_big) { + if (flags & DOUBLEWFONT) { + width *= 2; + } + if (flags & DOUBLEHFONT) { + if (flags & DOUBLEFIRST) { + height *= 2; + height -= thick; + } else { + height += thick; + } + descent *= 2; + } + } else { + beginClipping(screen, gc, (Cardinal) width, (Cardinal) ncells); + } +#if OPT_BOX_CHARS + if (screen->force_all_chars) +#endif + { + int xpos = x; + int ypos = (y - height + descent + thick); + unsigned high = (unsigned) yhigh; + unsigned wide = (unsigned) (width - thick2); + + if (fullWidth) + ncells /= 2; + setXtermLineAttributes(screen->display, gc, thick, LineOnOffDash); + XDrawImageString(screen->display, VDrawable(screen), gc, + x, y, + " ", + Min(4, ncells)); + XDrawRectangle(screen->display, + VDrawable(screen), gc, + xpos, ypos, + wide, high); + resetXtermLineAttributes(screen->display, gc); + } + if (!too_big) { + endClipping(screen, gc); + } + } + return x + width; +} + +static int +xtermPartString16(TScreen *screen, unsigned flags, GC gc, int x, int y, int length) +{ + if (length > 0) { + IChar *mapped = BfBuf(IChar); + XChar2b *buffer2 = BfBuf(XChar2b); + Char *buffer1 = BfBuf(Char); + int n; + Bool eightBit = True; + int ncells = 0; + + for (n = 0; n < length; ++n) { + IChar ch = mapped[n]; + int bump = 1; + if (buffer2[n].byte1 != 0) { + bump = CharWidth(screen, ch); + bump = Max(1, bump); + eightBit = False; + } else { + buffer1[n] = buffer2[n].byte2; + } + ncells += bump; + } + + if ((flags & NOBACKGROUND)) { + if (eightBit) { + XDrawString(screen->display, + VDrawable(screen), gc, + x, y, + (char *) buffer1, length); + } else { + XDrawString16(screen->display, + VDrawable(screen), gc, + x, y, + buffer2, length); + } + } else { + int b_pos; + int b_max = MaxImageString; + for (b_pos = 0; b_pos < length; b_pos += b_max) { + if (b_pos + b_max > length) + b_max = (length - b_pos); + if (eightBit) { + XDrawImageString(screen->display, + VDrawable(screen), gc, + x + (b_pos * FontWidth(screen)), + y, + (char *) buffer1 + b_pos, + b_max); + } else { + XDrawImageString16(screen->display, + VDrawable(screen), gc, + x + (b_pos * FontWidth(screen)), + y, + buffer2 + b_pos, + b_max); + } + } + } + x += ncells * FontWidth(screen); + } + return x; +} + +static int +xtermFullString16(XTermDraw * params, unsigned flags, GC gc, + int x, int y, int length, Bool fullwidth) +{ + XtermWidget xw = params->xw; + TScreen *screen = TScreenOf(xw); + int src, dst; + IChar *mapped = BfBuf(IChar); + XChar2b *buffer2 = BfBuf(XChar2b); + VTwin *currentWin = WhichVWin(screen); + XTermFonts *xf = getCgsFont(xw, currentWin, gc); + XTermFonts *fn = getNormalFont(screen, fNorm); + XTermFonts *fp = xf ? xf : fn; + + for (src = dst = 0; src < (int) length; src++) { + IChar ch = mapped[src]; + int ch_width = CharWidth(screen, ch); + /* + * X11 bitmap-fonts are limited to 16-bits. + */ + assert(ch != HIDDEN_CHAR); + if ( +#if OPT_WIDER_ICHAR + (ch > NARROW_ICHAR) || +#endif + xtermMissingChar(ch, + (((xf >= fn) && (xf - fn) <= fMAX) + ? XTermFontsRef(screen->fnts, + (VTFontEnum) (xf - fn)) + : fp))) { + x = xtermPartString16(screen, flags, gc, x, y, dst); + if (xtermIsDecTechnical(ch)) { + xtermDrawBoxChar(params, ch, gc, + x, y - FontAscent(screen), 1, False); + x += FontWidth(screen); + } else { + x = xtermDrawMissing(screen, flags, gc, x, y, ch_width, fullwidth); + } + dst = 0; + } else { + UCS2SBUF(ch); + ++dst; + } + } + + x = xtermPartString16(screen, flags, gc, x, y, dst); + return x; +} +#endif /* OPT_WIDE_CHARS */ + +static void +xtermPartString(TScreen *screen, unsigned flags, GC gc, int x, int y, int length) +{ + Char *buffer1 = BfBuf(Char); + + if ((flags & NOBACKGROUND)) { + XDrawString(screen->display, VDrawable(screen), gc, + x, y, (char *) buffer1, length); + } else { + int b_pos; + int b_max = MaxImageString; + for (b_pos = 0; b_pos < length; b_pos += b_max) { + if (b_pos + b_max > length) + b_max = (length - b_pos); + XDrawImageString(screen->display, + VDrawable(screen), gc, + x + (b_pos * FontWidth(screen)), + y, + (char *) (buffer1 + b_pos), + b_max); + } + } +} + +static void +xtermDrawString(TScreen *screen, unsigned flags, GC gc, int x, int y, int length) +{ + IChar *mapped = BfBuf(IChar); + Char *buffer1 = BfBuf(Char); + + int dst; + + for (dst = 0; dst < length; ++dst) + buffer1[dst] = (Char) LO_BYTE(mapped[dst]); + + xtermPartString(screen, flags, gc, x, y, length); +} + /* * Draws text with the specified combination of bold/underline. The return * value is the updated x position. @@ -3775,15 +4018,16 @@ drawXtermText(XTermDraw * params, #if OPT_RENDERFONT if (UsingRenderFont(recur.xw)) { if (!IsIcon(screen) && screen->font_doublesize) { + int next; TRACE(("drawing %s\n", visibleDblChrset((unsigned) recur.this_chrset))); recur.real_chrset = recur.this_chrset; recur.this_chrset = CSET_SWL; - x = drawXtermText(&recur, - gc, - x, y, - text, - len); - x += ((int) len) * FontWidth(screen); + next = drawXtermText(&recur, + gc, + x, y, + text, + len); + x += (next - x) * 2; } else { x = fakeDoubleChars(&recur, gc, y, x, @@ -3797,13 +4041,21 @@ drawXtermText(XTermDraw * params, XFontStruct *fs = getDoubleFont(screen, inx)->fs; XRectangle rect, *rp = ▭ Cardinal nr = 1; + Cardinal nlen; + int ncells = (int) len; font_width *= 2; recur.draw_flags |= DOUBLEWFONT; + for (nlen = 0; nlen < len; ++nlen) { + int ch_width = CharWidth(screen, text[nlen]); + if (ch_width > 1) + ncells += (ch_width - 1); + } + rect.x = 0; rect.y = 0; - rect.width = (unsigned short) ((int) len * font_width); + rect.width = (unsigned short) (ncells * font_width); rect.height = (unsigned short) (FontHeight(screen)); TRACE(("drawing %s\n", visibleDblChrset((unsigned) recur.this_chrset))); @@ -3811,12 +4063,13 @@ drawXtermText(XTermDraw * params, case CSET_DHL_TOP: rect.y = (short) -(fs->ascent / 2); y -= rect.y; - recur.draw_flags |= DOUBLEHFONT; + recur.draw_flags |= (DOUBLEHFONT | DOUBLEFIRST); break; case CSET_DHL_BOT: rect.y = (short) (rect.height - (fs->ascent / 2)); y -= rect.y; recur.draw_flags |= DOUBLEHFONT; + recur.draw_flags &= (unsigned) ~DOUBLEFIRST; break; case CSET_DWL: break; @@ -3828,7 +4081,8 @@ drawXtermText(XTermDraw * params, if (nr) { xtermSetClipRectangles(screen->display, gc2, x, y, rp, nr, YXBanded); - xtermFillCells(&recur, gc, x, y + rect.y, len * 2); + xtermFillCells(&recur, gc, x, y + rect.y, + (Cardinal) ncells * 2); } else { XSetClipMask(screen->display, gc2, None); } @@ -3850,22 +4104,23 @@ drawXtermText(XTermDraw * params, XTermDraw param2 = recur; param2.this_chrset = CSET_SWL; while (len--) { - x = drawXtermText(¶m2, - gc2, - x, y, - text++, - 1); - x += FontWidth(screen); + int next = drawXtermText(¶m2, + gc2, + x, y, + text++, + 1); + x += (next - x) * 2; } } else { + int next; XTermDraw param2 = recur; param2.this_chrset = CSET_SWL; - x = drawXtermText(¶m2, - gc2, - x, y, - text, - len); - x += (int) len *FontWidth(screen); + next = drawXtermText(¶m2, + gc2, + x, y, + text, + len); + x += (next - x) * 2; } } else { /* simulate double-sized characters */ @@ -3873,7 +4128,7 @@ drawXtermText(XTermDraw * params, gc, y, x, text, len); } - TRACE(("DrewText [%4d,%4d]\n", y, x)); + TRACE(("DrewText [%4d,%4d] @%d\n", y, x, __LINE__)); return x; } #endif @@ -3883,13 +4138,14 @@ drawXtermText(XTermDraw * params, Display *dpy = screen->display; XTermXftFonts *ndata; XGCValues values; -#if OPT_WIDE_CHARS +#if OPT_WIDE_CHARS && OPT_BOX_CHARS XTermXftFonts *ndata0; #endif -#if OPT_RENDERWIDE +#if OPT_RENDERWIDE && OPT_BOX_CHARS XTermXftFonts *wdata; XTermXftFonts *wdata0; #endif + int ncells = 0; #if OPT_DEC_CHRSET /* @@ -3923,10 +4179,10 @@ drawXtermText(XTermDraw * params, #define IS_BOLD (recur.attr_flags & BOLDATTR(screen)) #define NOT_BOLD (recur.attr_flags & ~BOLDATTR(screen)) ndata = getNormXftFont(&recur, recur.attr_flags, &did_ul); -#if OPT_WIDE_CHARS +#if OPT_WIDE_CHARS && OPT_BOX_CHARS ndata0 = IS_BOLD ? getNormXftFont(&recur, NOT_BOLD, &did_ul) : ndata; #endif -#if OPT_RENDERWIDE +#if OPT_RENDERWIDE && OPT_BOX_CHARS wdata = getWideXftFont(&recur, recur.attr_flags); wdata0 = IS_BOLD ? getWideXftFont(&recur, NOT_BOLD) : wdata; #endif @@ -3939,15 +4195,15 @@ drawXtermText(XTermDraw * params, if (!(recur.draw_flags & NOBACKGROUND)) { XftColor *bg_color = GET_XFT_BG(); - int ncells = xtermXftWidth(&recur, recur.attr_flags, - bg_color, - XftFp(ndata), x, y, - text, - len); + int nc = xtermXftWidth(&recur, recur.attr_flags, + bg_color, + XftFp(ndata), x, y, + text, + len); XftDrawRect(screen->renderDraw, bg_color, x, y, - (unsigned) (ncells * FontWidth(screen)), + (unsigned) (nc * FontWidth(screen)), (unsigned) FontHeight(screen)); } @@ -3962,14 +4218,15 @@ drawXtermText(XTermDraw * params, Boolean replace = False; Boolean missing = False; unsigned ch = (unsigned) text[last]; + int ch_width = CharWidth(screen, ch); int filler = 0; #if OPT_WIDE_CHARS - int needed = forceDbl ? 2 : CharWidth(screen, ch); + int needed = forceDbl ? 2 : ch_width; XTermXftFonts *currData = pickXftData(needed, ndata, wdata); XftFont *tempFont = 0; #define CURR_TEMP (tempFont ? tempFont : XftFp(currData)) - if (xtermIsDecGraphic(ch) || ch == 0) { + if (xtermIsInternalCs(ch) || ch == 0) { /* * Xft generally does not have the line-drawing characters * in cells 0-31. Assume this (we cannot inspect the @@ -3996,7 +4253,7 @@ drawXtermText(XTermDraw * params, */ if_OPT_WIDE_CHARS(screen, { unsigned part = ucs2dec(screen, ch); - if (xtermIsDecGraphic(part)) { + if (xtermIsInternalCs(part)) { if (screen->force_box_chars || screen->broken_box_chars) { SetMissing("case 2"); @@ -4034,7 +4291,7 @@ drawXtermText(XTermDraw * params, #else XTermXftFonts *currData = ndata; #define CURR_TEMP XftFp(currData) - if (xtermIsDecGraphic(ch)) { + if (xtermIsInternalCs(ch)) { /* * Xft generally does not have the line-drawing characters * in cells 1-31. Check for this, and attempt to fill in @@ -4111,30 +4368,33 @@ drawXtermText(XTermDraw * params, } first = last + 1; } + if (ch_width > 0) + ncells += ch_width; } if (last > first) { - underline_len += (Cardinal) - drawClippedXftString(&recur, - recur.attr_flags, - XftFp(ndata), - GET_XFT_FG(), - curX, - y, - text + first, - (Cardinal) (last - first)); + int nc = drawClippedXftString(&recur, + recur.attr_flags, + XftFp(ndata), + GET_XFT_FG(), + curX, + y, + text + first, + (Cardinal) (last - first)); + underline_len += (Cardinal) nc; } } #else { - underline_len += (Cardinal) - drawClippedXftString(&recur, - recur.attr_flags, - XftFp(ndata), - GET_XFT_FG(), - x, - y, - text, - len); + int nc = drawClippedXftString(&recur, + recur.attr_flags, + XftFp(ndata), + GET_XFT_FG(), + x, + y, + text, + len); + underline_len += (Cardinal) nc; + ncells = nc; } #endif /* OPT_BOX_CHARS */ @@ -4147,8 +4407,9 @@ drawXtermText(XTermDraw * params, y + y_shift, did_ul); - x += (int) len *FontWidth(screen); + x += (int) ncells *FontWidth(screen); + TRACE(("DrewText [%4d,%4d] @%d\n", y, x, __LINE__)); return x; } #endif /* OPT_RENDERFONT */ @@ -4200,6 +4461,7 @@ drawXtermText(XTermDraw * params, text++, 1) - adj; } + TRACE(("DrewText [%4d,%4d] @%d\n", y, x, __LINE__)); return x; } #if OPT_BOX_CHARS @@ -4323,18 +4585,21 @@ drawXtermText(XTermDraw * params, } } if (last <= first) { + TRACE(("DrewText [%4d,%4d] @%d\n", y, x, __LINE__)); return x; } text += first; len = (Cardinal) (last - first); recur.draw_flags |= NOTRANSLATION; if (drewBoxes) { - return drawXtermText(&recur, - gc, - x, - y, - text, - len); + x = drawXtermText(&recur, + gc, + x, + y, + text, + len); + TRACE(("DrewText [%4d,%4d] @%d\n", y, x, __LINE__)); + return x; } } #endif /* OPT_BOX_CHARS */ @@ -4377,77 +4642,69 @@ drawXtermText(XTermDraw * params, } if (need_wide) { - XChar2b *buffer; + IChar *mapped; Bool needWide = False; int src, dst; Bool useBoldFont; int ascent_adjust = 0; BumpTypedBuffer(XChar2b, len); - buffer = BfBuf(XChar2b); + BumpTypedBuffer(Char, len); + BumpTypedBuffer(IChar, len); + mapped = BfBuf(IChar); - for (src = dst = 0; src < (int) len; src++) { + /* transform characters first, to decide how to draw them */ + for (src = 0; src < (int) len; src++) { IChar ch = text[src]; - - if (ch == HIDDEN_CHAR) - continue; - + if (ch != HIDDEN_CHAR) { #if OPT_BOX_CHARS - if ((screen->fnt_boxes == 1) && (ch >= 256)) { - unsigned part = ucs2dec(screen, ch); - if (part < 32) - ch = (IChar) part; - } -#endif - - if (!needWide - && !IsIcon(screen) - && ((recur.on_wide || CharWidth(screen, ch) > 1) - && okFont(NormalWFont(screen)))) { - needWide = True; - } -#if OPT_WIDER_ICHAR - /* - * bitmap-fonts are limited to 16-bits. - */ - if (ch > NARROW_ICHAR) { - ch = 0; - } + if ((screen->fnt_boxes == 1) && (ch >= 256)) { + unsigned part = ucs2dec(screen, ch); + if (part < 32) + ch = (IChar) part; + } #endif - buffer[dst].byte2 = LO_BYTE(ch); - buffer[dst].byte1 = HI_BYTE(ch); #if OPT_MINI_LUIT -#define UCS2SBUF(value) buffer[dst].byte2 = LO_BYTE(value);\ - buffer[dst].byte1 = HI_BYTE(value) - -#define Map2Sbuf(from,to) (text[src] == from) { UCS2SBUF(to); } - - if (screen->latin9_mode && !screen->utf8_mode && text[src] < 256) { - - /* see http://www.cs.tut.fi/~jkorpela/latin9.html */ - /* *INDENT-OFF* */ - if Map2Sbuf(0xa4, 0x20ac) - else if Map2Sbuf(0xa6, 0x0160) - else if Map2Sbuf(0xa8, 0x0161) - else if Map2Sbuf(0xb4, 0x017d) - else if Map2Sbuf(0xb8, 0x017e) - else if Map2Sbuf(0xbc, 0x0152) - else if Map2Sbuf(0xbd, 0x0153) - else if Map2Sbuf(0xbe, 0x0178) - /* *INDENT-ON* */ +#define Map2Sbuf(from,to) (ch == from) { ch = to; } + if (screen->latin9_mode && !screen->utf8_mode && ch < 256) { + + /* see http://www.cs.tut.fi/~jkorpela/latin9.html */ + /* *INDENT-OFF* */ + if Map2Sbuf(0xa4, 0x20ac) + else if Map2Sbuf(0xa6, 0x0160) + else if Map2Sbuf(0xa8, 0x0161) + else if Map2Sbuf(0xb4, 0x017d) + else if Map2Sbuf(0xb8, 0x017e) + else if Map2Sbuf(0xbc, 0x0152) + else if Map2Sbuf(0xbd, 0x0153) + else if Map2Sbuf(0xbe, 0x0178) + /* *INDENT-ON* */ + } + if (screen->unicode_font + && (ch == ANSI_DEL || + ch < ANSI_SPA)) { + ch = (IChar) dec2ucs(screen, + (unsigned) ((ch == ANSI_DEL) ? 0 : ch)); + } +#endif /* OPT_MINI_LUIT */ } - if (screen->unicode_font - && (text[src] == ANSI_DEL || - text[src] < ANSI_SPA)) { - unsigned ni = dec2ucs(screen, - (unsigned) ((text[src] == ANSI_DEL) - ? 0 - : text[src])); - UCS2SBUF(ni); + mapped[src] = ch; + } + + for (src = dst = 0; src < (int) len; src++) { + IChar ch = mapped[src]; + + if (ch != HIDDEN_CHAR) { + int ch_width = CharWidth(screen, ch); + if (!needWide + && !IsIcon(screen) + && ((recur.on_wide || ch_width > 1) + && okFont(NormalWFont(screen)))) { + needWide = True; + } + mapped[dst++] = ch; } -#endif /* OPT_MINI_LUIT */ - ++dst; } /* @@ -4473,12 +4730,10 @@ drawXtermText(XTermDraw * params, } if (useBoldFont && FontIsIncomplete(bold)) { - for (src = 0; src < (int) len; src++) { - IChar ch = text[src]; - - if (ch == HIDDEN_CHAR) - continue; + for (src = 0; src < dst; src++) { + IChar ch = mapped[src]; + (void) ch; noBold = IsXtermMissingChar(screen, ch, bold); if (noBold) { noNorm = IsXtermMissingChar(screen, ch, norm); @@ -4491,8 +4746,8 @@ drawXtermText(XTermDraw * params, } } - /* FIXME This is probably wrong. But it works. */ - underline_len = len; + /* This is probably wrong. But it works. */ + underline_len = (Cardinal) dst; /* Set the drawing font */ if (!(recur.draw_flags & (DOUBLEHFONT | DOUBLEWFONT))) { @@ -4526,11 +4781,13 @@ drawXtermText(XTermDraw * params, #if OPT_DEC_CHRSET if (!(CSET_DOUBLE(recur.this_chrset) || (recur.draw_flags & DOUBLEWFONT))) #endif + { need_clipping = fixupItalics(&recur, gc, getCgsFont(recur.xw, currentWin, gc), y, x, font_width, len); + } #endif if (fntId != fNorm) { XFontStruct *thisFp = WhichVFont(screen, fntId); @@ -4540,40 +4797,21 @@ drawXtermText(XTermDraw * params, NormalFont(screen)->max_bounds.width * 2) { underline_len = real_length = (Cardinal) (dst * 2); } else if (cgsId == gcWide || cgsId == gcWBold) { + int ascent2 = Max(NormalFont(screen)->ascent, + thisFp->ascent); underline_len = real_length = (Cardinal) (dst * 2); xtermFillCells(&recur, gc, x, - y - thisFp->ascent, + y - ascent2, real_length); } } } - if (recur.draw_flags & NOBACKGROUND) { - XDrawString16(screen->display, - VDrawable(screen), gc, + xtermFullString16(&recur, recur.draw_flags, gc, x, y + y_shift + ascent_adjust, - buffer, dst); - } else if (dst <= MaxImageString) { - XDrawImageString16(screen->display, - VDrawable(screen), gc, - x, y + y_shift + ascent_adjust, - buffer, dst); - } else { - int b_pos; - int b_max = MaxImageString; - for (b_pos = 0; b_pos < dst; b_pos += b_max) { - if (b_pos + b_max > dst) - b_max = (dst - b_pos); - XDrawImageString16(screen->display, - VDrawable(screen), gc, - x + (b_pos * FontWidth(screen)), - y + y_shift + ascent_adjust, - buffer + b_pos, - b_max); - } - } + dst, needWide); #if OPT_WIDE_ATTRS if (need_clipping) { endClipping(screen, gc); @@ -4584,10 +4822,9 @@ drawXtermText(XTermDraw * params, if (!(recur.draw_flags & (DOUBLEWFONT | DOUBLEHFONT))) { beginClipping(screen, gc, (Cardinal) font_width, len); } - XDrawString16(screen->display, VDrawable(screen), gc, - x + 1, - y + y_shift + ascent_adjust, - buffer, dst); + xtermFullString16(&recur, recur.draw_flags | NOBACKGROUND, + gc, x + 1, y + y_shift + ascent_adjust, + dst, needWide); if (!(recur.draw_flags & (DOUBLEWFONT | DOUBLEHFONT))) { endClipping(screen, gc); } @@ -4596,61 +4833,41 @@ drawXtermText(XTermDraw * params, } else #endif /* OPT_WIDE_CHARS */ { - int length = (int) len; /* X should have used unsigned */ -#if OPT_WIDE_CHARS - char *buffer; - int dst; + IChar *mapped; + Cardinal dst; - BumpTypedBuffer(char, len); - buffer = BfBuf(char); + BumpTypedBuffer(IChar, len); + BumpTypedBuffer(Char, len); - for (dst = 0; dst < length; ++dst) - buffer[dst] = (char) LO_BYTE(text[dst]); -#else - char *buffer = (char *) text; -#endif + mapped = BfBuf(IChar); + for (dst = 0; dst < len; ++dst) + mapped[dst] = text[dst]; #if OPT_WIDE_ATTRS #if OPT_DEC_CHRSET if (!(CSET_DOUBLE(recur.this_chrset) || (recur.draw_flags & DOUBLEWFONT))) #endif + { need_clipping = fixupItalics(&recur, gc, curFont, y, x, font_width, len); + } #endif - if (recur.draw_flags & NOBACKGROUND) { - XDrawString(screen->display, VDrawable(screen), gc, - x, y + y_shift, buffer, length); - } else if (length <= MaxImageString) { - XDrawImageString(screen->display, VDrawable(screen), gc, - x, y + y_shift, buffer, length); - } else { - int b_pos; - int b_max = MaxImageString; - for (b_pos = 0; b_pos < length; b_pos += b_max) { - if (b_pos + b_max > length) - b_max = (length - b_pos); - XDrawImageString(screen->display, - VDrawable(screen), gc, - x + (b_pos * FontWidth(screen)), - y + y_shift, - buffer + b_pos, - b_max); - } - } + xtermDrawString(screen, recur.draw_flags, gc, + x, y + y_shift, (int) len); #if OPT_WIDE_ATTRS if (need_clipping) { endClipping(screen, gc); } #endif - underline_len = (Cardinal) length; + underline_len = len; if ((recur.attr_flags & BOLDATTR(screen)) && screen->enbolden) { if (!(recur.draw_flags & (DOUBLEWFONT | DOUBLEHFONT))) { - beginClipping(screen, gc, font_width, length); + beginClipping(screen, gc, font_width, (int) len); } - XDrawString(screen->display, VDrawable(screen), gc, - x + 1, y + y_shift, buffer, length); + xtermDrawString(screen, (recur.draw_flags | NOBACKGROUND), + gc, x + 1, y + y_shift, (int) len); if (!(recur.draw_flags & (DOUBLEWFONT | DOUBLEHFONT))) { endClipping(screen, gc); } @@ -4667,6 +4884,7 @@ drawXtermText(XTermDraw * params, did_ul); x += ((int) real_length) * FontWidth(screen); + TRACE(("DrewText [%4d,%4d] @%d\n", y, x, __LINE__)); return x; } @@ -4890,6 +5108,9 @@ updatedXtermGC(XtermWidget xw, unsigned attr_flags, CellColor fg_bg, } #endif + if (attr_flags & INVISIBLE) { + fg_pix = bg_pix; + } setCgsFore(xw, win, cgsId, fg_pix); setCgsBack(xw, win, cgsId, bg_pix); return getCgsGC(xw, win, cgsId); diff --git a/app/xterm/uxterm b/app/xterm/uxterm index 25c6f5f21..cc6a722f6 100644 --- a/app/xterm/uxterm +++ b/app/xterm/uxterm @@ -1,9 +1,9 @@ #!/bin/sh -# $XTermId: uxterm,v 1.29 2020/03/07 15:52:31 tom Exp $ +# $XTermId: uxterm,v 1.30 2023/05/03 23:47:34 tom Exp $ # ----------------------------------------------------------------------------- # this file is part of xterm # -# Copyright 2001-2007,2020 by Thomas E. Dickey +# Copyright 2001-2020,2023 by Thomas E. Dickey # # All Rights Reserved # @@ -83,7 +83,7 @@ done # user's shell does not reset unknown locale specifiers, but not all shells do. if test $found != yes ; then if test -n "$value" ; then - value=`echo ${value} |sed -e 's/[.@].*//'`.UTF-8 + value=`echo "${value}" |sed -e 's/[.@].*//'`.UTF-8 else expect= for name in LC_ALL LC_CTYPE LANG @@ -146,4 +146,4 @@ fi # for testing: #test -f ./xterm && XTERM_PROGRAM=./xterm -exec "$XTERM_PROGRAM" -class UXTerm -title "$whoami" -u8 "$@" +exec "$XTERM_PROGRAM" -class UXTerm -u8 "$@" diff --git a/app/xterm/uxterm.man b/app/xterm/uxterm.man index fa7c5b4b7..bdd83aba6 100644 --- a/app/xterm/uxterm.man +++ b/app/xterm/uxterm.man @@ -1,6 +1,6 @@ -.\" $XTermId: uxterm.man,v 1.8 2018/06/23 00:19:44 tom Exp $ +.\" $XTermId: uxterm.man,v 1.9 2024/01/11 22:10:29 tom Exp $ .\" -.\" Copyright 2007-2012, 2018 Thomas E. Dickey +.\" Copyright 2007-2018,2024 Thomas E. Dickey .\" Copyright 2001, 2004 Branden Robinson .\" .\" Permission is hereby granted, free of charge, to any person obtaining a @@ -23,17 +23,25 @@ .\" .ds N Uxterm .ds n uxterm -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds AQ \(aq -.el .ds AQ ' -.ie \n(.g .ds `` \(lq -.el .ds `` `` -.ie \n(.g .ds '' \(rq -.el .ds '' '' -.\" .TH UXTERM 1 "__app_date__" "__app_version__" "X Window System" +. +.ie \n(.g \{\ +.ds `` \(lq +.ds '' \(rq +.ds ' \(aq +.\} +.el \{\ +.ie t .ds `` `` +.el .ds `` "" +.ie t .ds '' '' +.el .ds '' "" +.ie t .ds ' \(aq +.el .ds ' ' +.\} +. .SH NAME -uxterm \- X terminal emulator for Unicode (UTF-8) environments +uxterm \- +X terminal emulator for Unicode (UTF-8) environments .SH SYNOPSIS .B \*n [ @@ -94,7 +102,7 @@ is available for KOI8-R environments. .B LC_ALL\fR, \fBLC_CTYPE\fR, \fBLANG The values of these variables are checked, in order, to determine the character set used by the current locale. -.SH AUTHOR +.SH AUTHORS Thomas Dickey .SH "SEE ALSO" .B locale(1), diff --git a/app/xterm/version.h b/app/xterm/version.h index 38de495d4..e4b4c3756 100644 --- a/app/xterm/version.h +++ b/app/xterm/version.h @@ -1,7 +1,7 @@ -/* $XTermId: version.h,v 1.536 2023/01/09 10:29:58 tom Exp $ */ +/* $XTermId: version.h,v 1.565 2024/07/11 23:38:21 tom Exp $ */ /* - * Copyright 1998-2022,2023 by Thomas E. Dickey + * Copyright 1998-2023,2024 by Thomas E. Dickey * * All Rights Reserved * @@ -38,8 +38,8 @@ * version of X to which this version of xterm has been built. The resulting * number in parentheses is my patch number (Thomas E. Dickey). */ -#define XTERM_PATCH 378 -#define XTERM_DATE 2023-01-09 +#define XTERM_PATCH 393 +#define XTERM_DATE 2024-07-11 #ifndef __vendorversion__ #define __vendorversion__ "XTerm/OpenBSD" diff --git a/app/xterm/vttests/insdelln.pl b/app/xterm/vttests/insdelln.pl index 9ce7e5175..b9d6e0caa 100644 --- a/app/xterm/vttests/insdelln.pl +++ b/app/xterm/vttests/insdelln.pl @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# $XTermId: vxt-insdelln,v 1.10 2022/10/10 17:05:38 tom Exp $ +# $XTermId: insdelln.pl,v 1.10 2022/10/10 17:05:38 tom Exp $ # ----------------------------------------------------------------------------- # this file is part of xterm # diff --git a/app/xterm/wcwidth.c b/app/xterm/wcwidth.c index b19d3b95f..6a15eb4f8 100644 --- a/app/xterm/wcwidth.c +++ b/app/xterm/wcwidth.c @@ -1,9 +1,9 @@ -/* $XTermId: wcwidth.c,v 1.61 2022/09/24 00:24:57 tom Exp $ */ +/* $XTermId: wcwidth.c,v 1.73 2024/07/06 00:45:04 tom Exp $ */ /* $XFree86: xc/programs/xterm/wcwidth.c,v 1.9 2006/06/19 00:36:52 dickey Exp $ */ /* - * Copyright 2002-2021,2022 by Thomas E. Dickey + * Copyright 2002-2023,2024 by Thomas E. Dickey * * All Rights Reserved * @@ -115,16 +115,23 @@ *----------------------------------------------------------------------------- */ +#ifdef HAVE_CONFIG_H +#include <xtermcfg.h> +#endif + #ifdef TEST_DRIVER #include <stdio.h> #include <stdlib.h> /* EXIT_SUCCESS, etc. */ #include <unistd.h> /* getopt() */ #include <string.h> /* strncmp() */ #include <locale.h> /* setlocale() */ -#include <wchar.h> /* wcwidth() */ #include <wctype.h> /* this module */ #endif +#ifdef HAVE_WCHAR_H +#include <wchar.h> /* wcwidth() */ +#endif + #include <wcwidth.h> struct interval { @@ -223,7 +230,7 @@ int mk_wcwidth(wchar_t ucs) { 0x0890, 0x0891 }, { 0x08E2, 0x08E2 }, { 0x180E, 0x180E }, { 0x200B, 0x200F }, { 0x202A, 0x202E }, { 0x2060, 0x2064 }, { 0x2066, 0x206F }, { 0xFEFF, 0xFEFF }, { 0xFFF9, 0xFFFB }, - { 0x110BD, 0x110BD }, { 0x110CD, 0x110CD }, { 0x13430, 0x13438 }, + { 0x110BD, 0x110BD }, { 0x110CD, 0x110CD }, { 0x13430, 0x1343F }, { 0x1BCA0, 0x1BCA3 }, { 0x1D173, 0x1D17A }, { 0xE0001, 0xE0001 }, { 0xE0020, 0xE007F } }; @@ -267,7 +274,7 @@ int mk_wcwidth(wchar_t ucs) { 0x0D4D, 0x0D4D }, { 0x0D62, 0x0D63 }, { 0x0D81, 0x0D81 }, { 0x0DCA, 0x0DCA }, { 0x0DD2, 0x0DD4 }, { 0x0DD6, 0x0DD6 }, { 0x0E31, 0x0E31 }, { 0x0E34, 0x0E3A }, { 0x0E47, 0x0E4E }, - { 0x0EB1, 0x0EB1 }, { 0x0EB4, 0x0EBC }, { 0x0EC8, 0x0ECD }, + { 0x0EB1, 0x0EB1 }, { 0x0EB4, 0x0EBC }, { 0x0EC8, 0x0ECE }, { 0x0F18, 0x0F19 }, { 0x0F35, 0x0F35 }, { 0x0F37, 0x0F37 }, { 0x0F39, 0x0F39 }, { 0x0F71, 0x0F7E }, { 0x0F80, 0x0F84 }, { 0x0F86, 0x0F87 }, { 0x0F8D, 0x0F97 }, { 0x0F99, 0x0FBC }, @@ -311,44 +318,48 @@ int mk_wcwidth(wchar_t ucs) { 0x102E0, 0x102E0 }, { 0x10376, 0x1037A }, { 0x10A01, 0x10A03 }, { 0x10A05, 0x10A06 }, { 0x10A0C, 0x10A0F }, { 0x10A38, 0x10A3A }, { 0x10A3F, 0x10A3F }, { 0x10AE5, 0x10AE6 }, { 0x10D24, 0x10D27 }, - { 0x10EAB, 0x10EAC }, { 0x10F46, 0x10F50 }, { 0x10F82, 0x10F85 }, - { 0x11001, 0x11001 }, { 0x11038, 0x11046 }, { 0x11070, 0x11070 }, - { 0x11073, 0x11074 }, { 0x1107F, 0x11081 }, { 0x110B3, 0x110B6 }, - { 0x110B9, 0x110BA }, { 0x110C2, 0x110C2 }, { 0x11100, 0x11102 }, - { 0x11127, 0x1112B }, { 0x1112D, 0x11134 }, { 0x11173, 0x11173 }, - { 0x11180, 0x11181 }, { 0x111B6, 0x111BE }, { 0x111C9, 0x111CC }, - { 0x111CF, 0x111CF }, { 0x1122F, 0x11231 }, { 0x11234, 0x11234 }, - { 0x11236, 0x11237 }, { 0x1123E, 0x1123E }, { 0x112DF, 0x112DF }, - { 0x112E3, 0x112EA }, { 0x11300, 0x11301 }, { 0x1133B, 0x1133C }, - { 0x11340, 0x11340 }, { 0x11366, 0x1136C }, { 0x11370, 0x11374 }, - { 0x11438, 0x1143F }, { 0x11442, 0x11444 }, { 0x11446, 0x11446 }, - { 0x1145E, 0x1145E }, { 0x114B3, 0x114B8 }, { 0x114BA, 0x114BA }, - { 0x114BF, 0x114C0 }, { 0x114C2, 0x114C3 }, { 0x115B2, 0x115B5 }, - { 0x115BC, 0x115BD }, { 0x115BF, 0x115C0 }, { 0x115DC, 0x115DD }, - { 0x11633, 0x1163A }, { 0x1163D, 0x1163D }, { 0x1163F, 0x11640 }, - { 0x116AB, 0x116AB }, { 0x116AD, 0x116AD }, { 0x116B0, 0x116B5 }, - { 0x116B7, 0x116B7 }, { 0x1171D, 0x1171F }, { 0x11722, 0x11725 }, - { 0x11727, 0x1172B }, { 0x1182F, 0x11837 }, { 0x11839, 0x1183A }, - { 0x1193B, 0x1193C }, { 0x1193E, 0x1193E }, { 0x11943, 0x11943 }, - { 0x119D4, 0x119D7 }, { 0x119DA, 0x119DB }, { 0x119E0, 0x119E0 }, - { 0x11A01, 0x11A0A }, { 0x11A33, 0x11A38 }, { 0x11A3B, 0x11A3E }, - { 0x11A47, 0x11A47 }, { 0x11A51, 0x11A56 }, { 0x11A59, 0x11A5B }, - { 0x11A8A, 0x11A96 }, { 0x11A98, 0x11A99 }, { 0x11C30, 0x11C36 }, - { 0x11C38, 0x11C3D }, { 0x11C3F, 0x11C3F }, { 0x11C92, 0x11CA7 }, - { 0x11CAA, 0x11CB0 }, { 0x11CB2, 0x11CB3 }, { 0x11CB5, 0x11CB6 }, - { 0x11D31, 0x11D36 }, { 0x11D3A, 0x11D3A }, { 0x11D3C, 0x11D3D }, - { 0x11D3F, 0x11D45 }, { 0x11D47, 0x11D47 }, { 0x11D90, 0x11D91 }, - { 0x11D95, 0x11D95 }, { 0x11D97, 0x11D97 }, { 0x11EF3, 0x11EF4 }, - { 0x16AF0, 0x16AF4 }, { 0x16B30, 0x16B36 }, { 0x16F4F, 0x16F4F }, - { 0x16F8F, 0x16F92 }, { 0x16FE4, 0x16FE4 }, { 0x1BC9D, 0x1BC9E }, - { 0x1CF00, 0x1CF2D }, { 0x1CF30, 0x1CF46 }, { 0x1D167, 0x1D169 }, - { 0x1D17B, 0x1D182 }, { 0x1D185, 0x1D18B }, { 0x1D1AA, 0x1D1AD }, - { 0x1D242, 0x1D244 }, { 0x1DA00, 0x1DA36 }, { 0x1DA3B, 0x1DA6C }, - { 0x1DA75, 0x1DA75 }, { 0x1DA84, 0x1DA84 }, { 0x1DA9B, 0x1DA9F }, - { 0x1DAA1, 0x1DAAF }, { 0x1E000, 0x1E006 }, { 0x1E008, 0x1E018 }, - { 0x1E01B, 0x1E021 }, { 0x1E023, 0x1E024 }, { 0x1E026, 0x1E02A }, + { 0x10EAB, 0x10EAC }, { 0x10EFD, 0x10EFF }, { 0x10F46, 0x10F50 }, + { 0x10F82, 0x10F85 }, { 0x11001, 0x11001 }, { 0x11038, 0x11046 }, + { 0x11070, 0x11070 }, { 0x11073, 0x11074 }, { 0x1107F, 0x11081 }, + { 0x110B3, 0x110B6 }, { 0x110B9, 0x110BA }, { 0x110C2, 0x110C2 }, + { 0x11100, 0x11102 }, { 0x11127, 0x1112B }, { 0x1112D, 0x11134 }, + { 0x11173, 0x11173 }, { 0x11180, 0x11181 }, { 0x111B6, 0x111BE }, + { 0x111C9, 0x111CC }, { 0x111CF, 0x111CF }, { 0x1122F, 0x11231 }, + { 0x11234, 0x11234 }, { 0x11236, 0x11237 }, { 0x1123E, 0x1123E }, + { 0x11241, 0x11241 }, { 0x112DF, 0x112DF }, { 0x112E3, 0x112EA }, + { 0x11300, 0x11301 }, { 0x1133B, 0x1133C }, { 0x11340, 0x11340 }, + { 0x11366, 0x1136C }, { 0x11370, 0x11374 }, { 0x11438, 0x1143F }, + { 0x11442, 0x11444 }, { 0x11446, 0x11446 }, { 0x1145E, 0x1145E }, + { 0x114B3, 0x114B8 }, { 0x114BA, 0x114BA }, { 0x114BF, 0x114C0 }, + { 0x114C2, 0x114C3 }, { 0x115B2, 0x115B5 }, { 0x115BC, 0x115BD }, + { 0x115BF, 0x115C0 }, { 0x115DC, 0x115DD }, { 0x11633, 0x1163A }, + { 0x1163D, 0x1163D }, { 0x1163F, 0x11640 }, { 0x116AB, 0x116AB }, + { 0x116AD, 0x116AD }, { 0x116B0, 0x116B5 }, { 0x116B7, 0x116B7 }, + { 0x1171D, 0x1171F }, { 0x11722, 0x11725 }, { 0x11727, 0x1172B }, + { 0x1182F, 0x11837 }, { 0x11839, 0x1183A }, { 0x1193B, 0x1193C }, + { 0x1193E, 0x1193E }, { 0x11943, 0x11943 }, { 0x119D4, 0x119D7 }, + { 0x119DA, 0x119DB }, { 0x119E0, 0x119E0 }, { 0x11A01, 0x11A0A }, + { 0x11A33, 0x11A38 }, { 0x11A3B, 0x11A3E }, { 0x11A47, 0x11A47 }, + { 0x11A51, 0x11A56 }, { 0x11A59, 0x11A5B }, { 0x11A8A, 0x11A96 }, + { 0x11A98, 0x11A99 }, { 0x11C30, 0x11C36 }, { 0x11C38, 0x11C3D }, + { 0x11C3F, 0x11C3F }, { 0x11C92, 0x11CA7 }, { 0x11CAA, 0x11CB0 }, + { 0x11CB2, 0x11CB3 }, { 0x11CB5, 0x11CB6 }, { 0x11D31, 0x11D36 }, + { 0x11D3A, 0x11D3A }, { 0x11D3C, 0x11D3D }, { 0x11D3F, 0x11D45 }, + { 0x11D47, 0x11D47 }, { 0x11D90, 0x11D91 }, { 0x11D95, 0x11D95 }, + { 0x11D97, 0x11D97 }, { 0x11EF3, 0x11EF4 }, { 0x11F00, 0x11F01 }, + { 0x11F36, 0x11F3A }, { 0x11F40, 0x11F40 }, { 0x11F42, 0x11F42 }, + { 0x13440, 0x13440 }, { 0x13447, 0x13455 }, { 0x16AF0, 0x16AF4 }, + { 0x16B30, 0x16B36 }, { 0x16F4F, 0x16F4F }, { 0x16F8F, 0x16F92 }, + { 0x16FE4, 0x16FE4 }, { 0x1BC9D, 0x1BC9E }, { 0x1CF00, 0x1CF2D }, + { 0x1CF30, 0x1CF46 }, { 0x1D167, 0x1D169 }, { 0x1D17B, 0x1D182 }, + { 0x1D185, 0x1D18B }, { 0x1D1AA, 0x1D1AD }, { 0x1D242, 0x1D244 }, + { 0x1DA00, 0x1DA36 }, { 0x1DA3B, 0x1DA6C }, { 0x1DA75, 0x1DA75 }, + { 0x1DA84, 0x1DA84 }, { 0x1DA9B, 0x1DA9F }, { 0x1DAA1, 0x1DAAF }, + { 0x1E000, 0x1E006 }, { 0x1E008, 0x1E018 }, { 0x1E01B, 0x1E021 }, + { 0x1E023, 0x1E024 }, { 0x1E026, 0x1E02A }, { 0x1E08F, 0x1E08F }, { 0x1E130, 0x1E136 }, { 0x1E2AE, 0x1E2AE }, { 0x1E2EC, 0x1E2EF }, - { 0x1E8D0, 0x1E8D6 }, { 0x1E944, 0x1E94A }, { 0xE0100, 0xE01EF } + { 0x1E4EC, 0x1E4EF }, { 0x1E8D0, 0x1E8D6 }, { 0x1E944, 0x1E94A }, + { 0xE0100, 0xE01EF } }; /* *INDENT-ON* */ @@ -399,7 +410,7 @@ int mk_wcwidth(wchar_t ucs) { 0x0CA9, 0x0CA9 }, { 0x0CB4, 0x0CB4 }, { 0x0CBA, 0x0CBB }, { 0x0CC5, 0x0CC5 }, { 0x0CC9, 0x0CC9 }, { 0x0CCE, 0x0CD4 }, { 0x0CD7, 0x0CDC }, { 0x0CDF, 0x0CDF }, { 0x0CE4, 0x0CE5 }, - { 0x0CF0, 0x0CF0 }, { 0x0CF3, 0x0CFF }, { 0x0D0D, 0x0D0D }, + { 0x0CF0, 0x0CF0 }, { 0x0CF4, 0x0CFF }, { 0x0D0D, 0x0D0D }, { 0x0D11, 0x0D11 }, { 0x0D45, 0x0D45 }, { 0x0D49, 0x0D49 }, { 0x0D50, 0x0D53 }, { 0x0D64, 0x0D65 }, { 0x0D80, 0x0D80 }, { 0x0D84, 0x0D84 }, { 0x0D97, 0x0D99 }, { 0x0DB2, 0x0DB2 }, @@ -409,7 +420,7 @@ int mk_wcwidth(wchar_t ucs) { 0x0E3B, 0x0E3E }, { 0x0E5C, 0x0E80 }, { 0x0E83, 0x0E83 }, { 0x0E85, 0x0E85 }, { 0x0E8B, 0x0E8B }, { 0x0EA4, 0x0EA4 }, { 0x0EA6, 0x0EA6 }, { 0x0EBE, 0x0EBF }, { 0x0EC5, 0x0EC5 }, - { 0x0EC7, 0x0EC7 }, { 0x0ECE, 0x0ECF }, { 0x0EDA, 0x0EDB }, + { 0x0EC7, 0x0EC7 }, { 0x0ECF, 0x0ECF }, { 0x0EDA, 0x0EDB }, { 0x0EE0, 0x0EFF }, { 0x0F48, 0x0F48 }, { 0x0F6D, 0x0F70 }, { 0x0F98, 0x0F98 }, { 0x0FBD, 0x0FBD }, { 0x0FCD, 0x0FCD }, { 0x0FDB, 0x0FFF }, { 0x10C6, 0x10C6 }, { 0x10C8, 0x10CC }, @@ -449,117 +460,120 @@ int mk_wcwidth(wchar_t ucs) { 0x2DBF, 0x2DBF }, { 0x2DC7, 0x2DC7 }, { 0x2DCF, 0x2DCF }, { 0x2DD7, 0x2DD7 }, { 0x2DDF, 0x2DDF }, { 0x2E5E, 0x2E7F }, { 0x2E9A, 0x2E9A }, { 0x2EF4, 0x2EFF }, { 0x2FD6, 0x2FEF }, - { 0x2FFC, 0x2FFF }, { 0x3040, 0x3040 }, { 0x3097, 0x3098 }, - { 0x3100, 0x3104 }, { 0x3130, 0x3130 }, { 0x318F, 0x318F }, - { 0x31E4, 0x31EF }, { 0x321F, 0x321F }, { 0x4DB6, 0x4DBF }, - { 0x9FD6, 0x9FFF }, { 0xA48D, 0xA48F }, { 0xA4C7, 0xA4CF }, - { 0xA62C, 0xA63F }, { 0xA6F8, 0xA6FF }, { 0xA7CB, 0xA7CF }, - { 0xA7D2, 0xA7D2 }, { 0xA7D4, 0xA7D4 }, { 0xA7DA, 0xA7F1 }, - { 0xA82D, 0xA82F }, { 0xA83A, 0xA83F }, { 0xA878, 0xA87F }, - { 0xA8C6, 0xA8CD }, { 0xA8DA, 0xA8DF }, { 0xA954, 0xA95E }, - { 0xA97D, 0xA97F }, { 0xA9CE, 0xA9CE }, { 0xA9DA, 0xA9DD }, - { 0xA9FF, 0xA9FF }, { 0xAA37, 0xAA3F }, { 0xAA4E, 0xAA4F }, - { 0xAA5A, 0xAA5B }, { 0xAAC3, 0xAADA }, { 0xAAF7, 0xAB00 }, - { 0xAB07, 0xAB08 }, { 0xAB0F, 0xAB10 }, { 0xAB17, 0xAB1F }, - { 0xAB27, 0xAB27 }, { 0xAB2F, 0xAB2F }, { 0xAB6C, 0xAB6F }, - { 0xABEE, 0xABEF }, { 0xABFA, 0xABFF }, { 0xD7A4, 0xD7AF }, - { 0xD7C7, 0xD7CA }, { 0xD7FC, 0xDFFF }, { 0xFA6E, 0xFA6F }, - { 0xFADA, 0xFAFF }, { 0xFB07, 0xFB12 }, { 0xFB18, 0xFB1C }, - { 0xFB37, 0xFB37 }, { 0xFB3D, 0xFB3D }, { 0xFB3F, 0xFB3F }, - { 0xFB42, 0xFB42 }, { 0xFB45, 0xFB45 }, { 0xFBC3, 0xFBD2 }, - { 0xFD90, 0xFD91 }, { 0xFDC8, 0xFDCE }, { 0xFDD0, 0xFDEF }, - { 0xFE1A, 0xFE1F }, { 0xFE53, 0xFE53 }, { 0xFE67, 0xFE67 }, - { 0xFE6C, 0xFE6F }, { 0xFE75, 0xFE75 }, { 0xFEFD, 0xFEFE }, - { 0xFF00, 0xFF00 }, { 0xFFBF, 0xFFC1 }, { 0xFFC8, 0xFFC9 }, - { 0xFFD0, 0xFFD1 }, { 0xFFD8, 0xFFD9 }, { 0xFFDD, 0xFFDF }, - { 0xFFE7, 0xFFE7 }, { 0xFFEF, 0xFFF8 }, { 0xFFFE, 0xFFFF }, - { 0x1000C, 0x1000C }, { 0x10027, 0x10027 }, { 0x1003B, 0x1003B }, - { 0x1003E, 0x1003E }, { 0x1004E, 0x1004F }, { 0x1005E, 0x1007F }, - { 0x100FB, 0x100FF }, { 0x10103, 0x10106 }, { 0x10134, 0x10136 }, - { 0x1018F, 0x1018F }, { 0x1019D, 0x1019F }, { 0x101A1, 0x101CF }, - { 0x101FE, 0x1027F }, { 0x1029D, 0x1029F }, { 0x102D1, 0x102DF }, - { 0x102FC, 0x102FF }, { 0x10324, 0x1032C }, { 0x1034B, 0x1034F }, - { 0x1037B, 0x1037F }, { 0x1039E, 0x1039E }, { 0x103C4, 0x103C7 }, - { 0x103D6, 0x103FF }, { 0x1049E, 0x1049F }, { 0x104AA, 0x104AF }, - { 0x104D4, 0x104D7 }, { 0x104FC, 0x104FF }, { 0x10528, 0x1052F }, - { 0x10564, 0x1056E }, { 0x1057B, 0x1057B }, { 0x1058B, 0x1058B }, - { 0x10593, 0x10593 }, { 0x10596, 0x10596 }, { 0x105A2, 0x105A2 }, - { 0x105B2, 0x105B2 }, { 0x105BA, 0x105BA }, { 0x105BD, 0x105FF }, - { 0x10737, 0x1073F }, { 0x10756, 0x1075F }, { 0x10768, 0x1077F }, - { 0x10786, 0x10786 }, { 0x107B1, 0x107B1 }, { 0x107BB, 0x107FF }, - { 0x10806, 0x10807 }, { 0x10809, 0x10809 }, { 0x10836, 0x10836 }, - { 0x10839, 0x1083B }, { 0x1083D, 0x1083E }, { 0x10856, 0x10856 }, - { 0x1089F, 0x108A6 }, { 0x108B0, 0x108DF }, { 0x108F3, 0x108F3 }, - { 0x108F6, 0x108FA }, { 0x1091C, 0x1091E }, { 0x1093A, 0x1093E }, - { 0x10940, 0x1097F }, { 0x109B8, 0x109BB }, { 0x109D0, 0x109D1 }, - { 0x10A04, 0x10A04 }, { 0x10A07, 0x10A0B }, { 0x10A14, 0x10A14 }, - { 0x10A18, 0x10A18 }, { 0x10A36, 0x10A37 }, { 0x10A3B, 0x10A3E }, - { 0x10A49, 0x10A4F }, { 0x10A59, 0x10A5F }, { 0x10AA0, 0x10ABF }, - { 0x10AE7, 0x10AEA }, { 0x10AF7, 0x10AFF }, { 0x10B36, 0x10B38 }, - { 0x10B56, 0x10B57 }, { 0x10B73, 0x10B77 }, { 0x10B92, 0x10B98 }, - { 0x10B9D, 0x10BA8 }, { 0x10BB0, 0x10BFF }, { 0x10C49, 0x10C7F }, - { 0x10CB3, 0x10CBF }, { 0x10CF3, 0x10CF9 }, { 0x10D28, 0x10D2F }, - { 0x10D3A, 0x10E5F }, { 0x10E7F, 0x10E7F }, { 0x10EAA, 0x10EAA }, - { 0x10EAE, 0x10EAF }, { 0x10EB2, 0x10EFF }, { 0x10F28, 0x10F2F }, - { 0x10F5A, 0x10F6F }, { 0x10F8A, 0x10FAF }, { 0x10FCC, 0x10FDF }, - { 0x10FF7, 0x10FFF }, { 0x1104E, 0x11051 }, { 0x11076, 0x1107E }, - { 0x110C3, 0x110CC }, { 0x110CE, 0x110CF }, { 0x110E9, 0x110EF }, - { 0x110FA, 0x110FF }, { 0x11135, 0x11135 }, { 0x11148, 0x1114F }, - { 0x11177, 0x1117F }, { 0x111E0, 0x111E0 }, { 0x111F5, 0x111FF }, - { 0x11212, 0x11212 }, { 0x1123F, 0x1127F }, { 0x11287, 0x11287 }, - { 0x11289, 0x11289 }, { 0x1128E, 0x1128E }, { 0x1129E, 0x1129E }, - { 0x112AA, 0x112AF }, { 0x112EB, 0x112EF }, { 0x112FA, 0x112FF }, - { 0x11304, 0x11304 }, { 0x1130D, 0x1130E }, { 0x11311, 0x11312 }, - { 0x11329, 0x11329 }, { 0x11331, 0x11331 }, { 0x11334, 0x11334 }, - { 0x1133A, 0x1133A }, { 0x11345, 0x11346 }, { 0x11349, 0x1134A }, - { 0x1134E, 0x1134F }, { 0x11351, 0x11356 }, { 0x11358, 0x1135C }, - { 0x11364, 0x11365 }, { 0x1136D, 0x1136F }, { 0x11375, 0x113FF }, - { 0x1145C, 0x1145C }, { 0x11462, 0x1147F }, { 0x114C8, 0x114CF }, - { 0x114DA, 0x1157F }, { 0x115B6, 0x115B7 }, { 0x115DE, 0x115FF }, - { 0x11645, 0x1164F }, { 0x1165A, 0x1165F }, { 0x1166D, 0x1167F }, - { 0x116BA, 0x116BF }, { 0x116CA, 0x116FF }, { 0x1171B, 0x1171C }, - { 0x1172C, 0x1172F }, { 0x11747, 0x117FF }, { 0x1183C, 0x1189F }, - { 0x118F3, 0x118FE }, { 0x11907, 0x11908 }, { 0x1190A, 0x1190B }, - { 0x11914, 0x11914 }, { 0x11917, 0x11917 }, { 0x11936, 0x11936 }, - { 0x11939, 0x1193A }, { 0x11947, 0x1194F }, { 0x1195A, 0x1199F }, - { 0x119A8, 0x119A9 }, { 0x119D8, 0x119D9 }, { 0x119E5, 0x119FF }, - { 0x11A48, 0x11A4F }, { 0x11AA3, 0x11AAF }, { 0x11AF9, 0x11BFF }, + { 0x3040, 0x3040 }, { 0x3097, 0x3098 }, { 0x3100, 0x3104 }, + { 0x3130, 0x3130 }, { 0x318F, 0x318F }, { 0x31E4, 0x31EE }, + { 0x321F, 0x321F }, { 0x4DB6, 0x4DBF }, { 0x9FD6, 0x9FFF }, + { 0xA48D, 0xA48F }, { 0xA4C7, 0xA4CF }, { 0xA62C, 0xA63F }, + { 0xA6F8, 0xA6FF }, { 0xA7CB, 0xA7CF }, { 0xA7D2, 0xA7D2 }, + { 0xA7D4, 0xA7D4 }, { 0xA7DA, 0xA7F1 }, { 0xA82D, 0xA82F }, + { 0xA83A, 0xA83F }, { 0xA878, 0xA87F }, { 0xA8C6, 0xA8CD }, + { 0xA8DA, 0xA8DF }, { 0xA954, 0xA95E }, { 0xA97D, 0xA97F }, + { 0xA9CE, 0xA9CE }, { 0xA9DA, 0xA9DD }, { 0xA9FF, 0xA9FF }, + { 0xAA37, 0xAA3F }, { 0xAA4E, 0xAA4F }, { 0xAA5A, 0xAA5B }, + { 0xAAC3, 0xAADA }, { 0xAAF7, 0xAB00 }, { 0xAB07, 0xAB08 }, + { 0xAB0F, 0xAB10 }, { 0xAB17, 0xAB1F }, { 0xAB27, 0xAB27 }, + { 0xAB2F, 0xAB2F }, { 0xAB6C, 0xAB6F }, { 0xABEE, 0xABEF }, + { 0xABFA, 0xABFF }, { 0xD7A4, 0xD7AF }, { 0xD7C7, 0xD7CA }, + { 0xD7FC, 0xDFFF }, { 0xFA6E, 0xFA6F }, { 0xFADA, 0xFAFF }, + { 0xFB07, 0xFB12 }, { 0xFB18, 0xFB1C }, { 0xFB37, 0xFB37 }, + { 0xFB3D, 0xFB3D }, { 0xFB3F, 0xFB3F }, { 0xFB42, 0xFB42 }, + { 0xFB45, 0xFB45 }, { 0xFBC3, 0xFBD2 }, { 0xFD90, 0xFD91 }, + { 0xFDC8, 0xFDCE }, { 0xFDD0, 0xFDEF }, { 0xFE1A, 0xFE1F }, + { 0xFE53, 0xFE53 }, { 0xFE67, 0xFE67 }, { 0xFE6C, 0xFE6F }, + { 0xFE75, 0xFE75 }, { 0xFEFD, 0xFEFE }, { 0xFF00, 0xFF00 }, + { 0xFFBF, 0xFFC1 }, { 0xFFC8, 0xFFC9 }, { 0xFFD0, 0xFFD1 }, + { 0xFFD8, 0xFFD9 }, { 0xFFDD, 0xFFDF }, { 0xFFE7, 0xFFE7 }, + { 0xFFEF, 0xFFF8 }, { 0xFFFE, 0xFFFF }, { 0x1000C, 0x1000C }, + { 0x10027, 0x10027 }, { 0x1003B, 0x1003B }, { 0x1003E, 0x1003E }, + { 0x1004E, 0x1004F }, { 0x1005E, 0x1007F }, { 0x100FB, 0x100FF }, + { 0x10103, 0x10106 }, { 0x10134, 0x10136 }, { 0x1018F, 0x1018F }, + { 0x1019D, 0x1019F }, { 0x101A1, 0x101CF }, { 0x101FE, 0x1027F }, + { 0x1029D, 0x1029F }, { 0x102D1, 0x102DF }, { 0x102FC, 0x102FF }, + { 0x10324, 0x1032C }, { 0x1034B, 0x1034F }, { 0x1037B, 0x1037F }, + { 0x1039E, 0x1039E }, { 0x103C4, 0x103C7 }, { 0x103D6, 0x103FF }, + { 0x1049E, 0x1049F }, { 0x104AA, 0x104AF }, { 0x104D4, 0x104D7 }, + { 0x104FC, 0x104FF }, { 0x10528, 0x1052F }, { 0x10564, 0x1056E }, + { 0x1057B, 0x1057B }, { 0x1058B, 0x1058B }, { 0x10593, 0x10593 }, + { 0x10596, 0x10596 }, { 0x105A2, 0x105A2 }, { 0x105B2, 0x105B2 }, + { 0x105BA, 0x105BA }, { 0x105BD, 0x105FF }, { 0x10737, 0x1073F }, + { 0x10756, 0x1075F }, { 0x10768, 0x1077F }, { 0x10786, 0x10786 }, + { 0x107B1, 0x107B1 }, { 0x107BB, 0x107FF }, { 0x10806, 0x10807 }, + { 0x10809, 0x10809 }, { 0x10836, 0x10836 }, { 0x10839, 0x1083B }, + { 0x1083D, 0x1083E }, { 0x10856, 0x10856 }, { 0x1089F, 0x108A6 }, + { 0x108B0, 0x108DF }, { 0x108F3, 0x108F3 }, { 0x108F6, 0x108FA }, + { 0x1091C, 0x1091E }, { 0x1093A, 0x1093E }, { 0x10940, 0x1097F }, + { 0x109B8, 0x109BB }, { 0x109D0, 0x109D1 }, { 0x10A04, 0x10A04 }, + { 0x10A07, 0x10A0B }, { 0x10A14, 0x10A14 }, { 0x10A18, 0x10A18 }, + { 0x10A36, 0x10A37 }, { 0x10A3B, 0x10A3E }, { 0x10A49, 0x10A4F }, + { 0x10A59, 0x10A5F }, { 0x10AA0, 0x10ABF }, { 0x10AE7, 0x10AEA }, + { 0x10AF7, 0x10AFF }, { 0x10B36, 0x10B38 }, { 0x10B56, 0x10B57 }, + { 0x10B73, 0x10B77 }, { 0x10B92, 0x10B98 }, { 0x10B9D, 0x10BA8 }, + { 0x10BB0, 0x10BFF }, { 0x10C49, 0x10C7F }, { 0x10CB3, 0x10CBF }, + { 0x10CF3, 0x10CF9 }, { 0x10D28, 0x10D2F }, { 0x10D3A, 0x10E5F }, + { 0x10E7F, 0x10E7F }, { 0x10EAA, 0x10EAA }, { 0x10EAE, 0x10EAF }, + { 0x10EB2, 0x10EFC }, { 0x10F28, 0x10F2F }, { 0x10F5A, 0x10F6F }, + { 0x10F8A, 0x10FAF }, { 0x10FCC, 0x10FDF }, { 0x10FF7, 0x10FFF }, + { 0x1104E, 0x11051 }, { 0x11076, 0x1107E }, { 0x110C3, 0x110CC }, + { 0x110CE, 0x110CF }, { 0x110E9, 0x110EF }, { 0x110FA, 0x110FF }, + { 0x11135, 0x11135 }, { 0x11148, 0x1114F }, { 0x11177, 0x1117F }, + { 0x111E0, 0x111E0 }, { 0x111F5, 0x111FF }, { 0x11212, 0x11212 }, + { 0x11242, 0x1127F }, { 0x11287, 0x11287 }, { 0x11289, 0x11289 }, + { 0x1128E, 0x1128E }, { 0x1129E, 0x1129E }, { 0x112AA, 0x112AF }, + { 0x112EB, 0x112EF }, { 0x112FA, 0x112FF }, { 0x11304, 0x11304 }, + { 0x1130D, 0x1130E }, { 0x11311, 0x11312 }, { 0x11329, 0x11329 }, + { 0x11331, 0x11331 }, { 0x11334, 0x11334 }, { 0x1133A, 0x1133A }, + { 0x11345, 0x11346 }, { 0x11349, 0x1134A }, { 0x1134E, 0x1134F }, + { 0x11351, 0x11356 }, { 0x11358, 0x1135C }, { 0x11364, 0x11365 }, + { 0x1136D, 0x1136F }, { 0x11375, 0x113FF }, { 0x1145C, 0x1145C }, + { 0x11462, 0x1147F }, { 0x114C8, 0x114CF }, { 0x114DA, 0x1157F }, + { 0x115B6, 0x115B7 }, { 0x115DE, 0x115FF }, { 0x11645, 0x1164F }, + { 0x1165A, 0x1165F }, { 0x1166D, 0x1167F }, { 0x116BA, 0x116BF }, + { 0x116CA, 0x116FF }, { 0x1171B, 0x1171C }, { 0x1172C, 0x1172F }, + { 0x11747, 0x117FF }, { 0x1183C, 0x1189F }, { 0x118F3, 0x118FE }, + { 0x11907, 0x11908 }, { 0x1190A, 0x1190B }, { 0x11914, 0x11914 }, + { 0x11917, 0x11917 }, { 0x11936, 0x11936 }, { 0x11939, 0x1193A }, + { 0x11947, 0x1194F }, { 0x1195A, 0x1199F }, { 0x119A8, 0x119A9 }, + { 0x119D8, 0x119D9 }, { 0x119E5, 0x119FF }, { 0x11A48, 0x11A4F }, + { 0x11AA3, 0x11AAF }, { 0x11AF9, 0x11AFF }, { 0x11B0A, 0x11BFF }, { 0x11C09, 0x11C09 }, { 0x11C37, 0x11C37 }, { 0x11C46, 0x11C4F }, { 0x11C6D, 0x11C6F }, { 0x11C90, 0x11C91 }, { 0x11CA8, 0x11CA8 }, { 0x11CB7, 0x11CFF }, { 0x11D07, 0x11D07 }, { 0x11D0A, 0x11D0A }, { 0x11D37, 0x11D39 }, { 0x11D3B, 0x11D3B }, { 0x11D3E, 0x11D3E }, { 0x11D48, 0x11D4F }, { 0x11D5A, 0x11D5F }, { 0x11D66, 0x11D66 }, { 0x11D69, 0x11D69 }, { 0x11D8F, 0x11D8F }, { 0x11D92, 0x11D92 }, - { 0x11D99, 0x11D9F }, { 0x11DAA, 0x11EDF }, { 0x11EF9, 0x11FAF }, + { 0x11D99, 0x11D9F }, { 0x11DAA, 0x11EDF }, { 0x11EF9, 0x11EFF }, + { 0x11F11, 0x11F11 }, { 0x11F3B, 0x11F3D }, { 0x11F5A, 0x11FAF }, { 0x11FB1, 0x11FBF }, { 0x11FF2, 0x11FFE }, { 0x1239A, 0x123FF }, { 0x1246F, 0x1246F }, { 0x12475, 0x1247F }, { 0x12544, 0x12F8F }, - { 0x12FF3, 0x12FFF }, { 0x1342F, 0x1342F }, { 0x13439, 0x143FF }, - { 0x14647, 0x167FF }, { 0x16A39, 0x16A3F }, { 0x16A5F, 0x16A5F }, - { 0x16A6A, 0x16A6D }, { 0x16ABF, 0x16ABF }, { 0x16ACA, 0x16ACF }, - { 0x16AEE, 0x16AEF }, { 0x16AF6, 0x16AFF }, { 0x16B46, 0x16B4F }, - { 0x16B5A, 0x16B5A }, { 0x16B62, 0x16B62 }, { 0x16B78, 0x16B7C }, - { 0x16B90, 0x16E3F }, { 0x16E9B, 0x16EFF }, { 0x16F4B, 0x16F4E }, - { 0x16F88, 0x16F8E }, { 0x16FA0, 0x16FDF }, { 0x16FE5, 0x16FEF }, - { 0x16FF2, 0x187FF }, { 0x18CD6, 0x1AFEF }, { 0x1AFF4, 0x1AFF4 }, - { 0x1AFFC, 0x1AFFC }, { 0x1AFFF, 0x1AFFF }, { 0x1B123, 0x1B14F }, - { 0x1B153, 0x1B163 }, { 0x1B168, 0x1B16F }, { 0x1B2FC, 0x1BBFF }, - { 0x1BC6B, 0x1BC6F }, { 0x1BC7D, 0x1BC7F }, { 0x1BC89, 0x1BC8F }, - { 0x1BC9A, 0x1BC9B }, { 0x1BCA4, 0x1CEFF }, { 0x1CF2E, 0x1CF2F }, - { 0x1CF47, 0x1CF4F }, { 0x1CFC4, 0x1CFFF }, { 0x1D0F6, 0x1D0FF }, - { 0x1D127, 0x1D128 }, { 0x1D1EB, 0x1D1FF }, { 0x1D246, 0x1D2DF }, - { 0x1D2F4, 0x1D2FF }, { 0x1D357, 0x1D35F }, { 0x1D379, 0x1D3FF }, - { 0x1D455, 0x1D455 }, { 0x1D49D, 0x1D49D }, { 0x1D4A0, 0x1D4A1 }, - { 0x1D4A3, 0x1D4A4 }, { 0x1D4A7, 0x1D4A8 }, { 0x1D4AD, 0x1D4AD }, - { 0x1D4BA, 0x1D4BA }, { 0x1D4BC, 0x1D4BC }, { 0x1D4C4, 0x1D4C4 }, - { 0x1D506, 0x1D506 }, { 0x1D50B, 0x1D50C }, { 0x1D515, 0x1D515 }, - { 0x1D51D, 0x1D51D }, { 0x1D53A, 0x1D53A }, { 0x1D53F, 0x1D53F }, - { 0x1D545, 0x1D545 }, { 0x1D547, 0x1D549 }, { 0x1D551, 0x1D551 }, - { 0x1D6A6, 0x1D6A7 }, { 0x1D7CC, 0x1D7CD }, { 0x1DA8C, 0x1DA9A }, - { 0x1DAA0, 0x1DAA0 }, { 0x1DAB0, 0x1DEFF }, { 0x1DF1F, 0x1DFFF }, + { 0x12FF3, 0x12FFF }, { 0x13456, 0x143FF }, { 0x14647, 0x167FF }, + { 0x16A39, 0x16A3F }, { 0x16A5F, 0x16A5F }, { 0x16A6A, 0x16A6D }, + { 0x16ABF, 0x16ABF }, { 0x16ACA, 0x16ACF }, { 0x16AEE, 0x16AEF }, + { 0x16AF6, 0x16AFF }, { 0x16B46, 0x16B4F }, { 0x16B5A, 0x16B5A }, + { 0x16B62, 0x16B62 }, { 0x16B78, 0x16B7C }, { 0x16B90, 0x16E3F }, + { 0x16E9B, 0x16EFF }, { 0x16F4B, 0x16F4E }, { 0x16F88, 0x16F8E }, + { 0x16FA0, 0x16FDF }, { 0x16FE5, 0x16FEF }, { 0x16FF2, 0x187FF }, + { 0x18CD6, 0x1AFEF }, { 0x1AFF4, 0x1AFF4 }, { 0x1AFFC, 0x1AFFC }, + { 0x1AFFF, 0x1AFFF }, { 0x1B123, 0x1B131 }, { 0x1B133, 0x1B14F }, + { 0x1B153, 0x1B154 }, { 0x1B156, 0x1B163 }, { 0x1B168, 0x1B16F }, + { 0x1B2FC, 0x1BBFF }, { 0x1BC6B, 0x1BC6F }, { 0x1BC7D, 0x1BC7F }, + { 0x1BC89, 0x1BC8F }, { 0x1BC9A, 0x1BC9B }, { 0x1BCA4, 0x1CEFF }, + { 0x1CF2E, 0x1CF2F }, { 0x1CF47, 0x1CF4F }, { 0x1CFC4, 0x1CFFF }, + { 0x1D0F6, 0x1D0FF }, { 0x1D127, 0x1D128 }, { 0x1D1EB, 0x1D1FF }, + { 0x1D246, 0x1D2BF }, { 0x1D2D4, 0x1D2DF }, { 0x1D2F4, 0x1D2FF }, + { 0x1D357, 0x1D35F }, { 0x1D379, 0x1D3FF }, { 0x1D455, 0x1D455 }, + { 0x1D49D, 0x1D49D }, { 0x1D4A0, 0x1D4A1 }, { 0x1D4A3, 0x1D4A4 }, + { 0x1D4A7, 0x1D4A8 }, { 0x1D4AD, 0x1D4AD }, { 0x1D4BA, 0x1D4BA }, + { 0x1D4BC, 0x1D4BC }, { 0x1D4C4, 0x1D4C4 }, { 0x1D506, 0x1D506 }, + { 0x1D50B, 0x1D50C }, { 0x1D515, 0x1D515 }, { 0x1D51D, 0x1D51D }, + { 0x1D53A, 0x1D53A }, { 0x1D53F, 0x1D53F }, { 0x1D545, 0x1D545 }, + { 0x1D547, 0x1D549 }, { 0x1D551, 0x1D551 }, { 0x1D6A6, 0x1D6A7 }, + { 0x1D7CC, 0x1D7CD }, { 0x1DA8C, 0x1DA9A }, { 0x1DAA0, 0x1DAA0 }, + { 0x1DAB0, 0x1DEFF }, { 0x1DF1F, 0x1DF24 }, { 0x1DF2B, 0x1DFFF }, { 0x1E007, 0x1E007 }, { 0x1E019, 0x1E01A }, { 0x1E022, 0x1E022 }, - { 0x1E025, 0x1E025 }, { 0x1E02B, 0x1E0FF }, { 0x1E12D, 0x1E12F }, - { 0x1E13E, 0x1E13F }, { 0x1E14A, 0x1E14D }, { 0x1E150, 0x1E28F }, - { 0x1E2AF, 0x1E2BF }, { 0x1E2FA, 0x1E2FE }, { 0x1E300, 0x1E7DF }, + { 0x1E025, 0x1E025 }, { 0x1E02B, 0x1E02F }, { 0x1E06E, 0x1E08E }, + { 0x1E090, 0x1E0FF }, { 0x1E12D, 0x1E12F }, { 0x1E13E, 0x1E13F }, + { 0x1E14A, 0x1E14D }, { 0x1E150, 0x1E28F }, { 0x1E2AF, 0x1E2BF }, + { 0x1E2FA, 0x1E2FE }, { 0x1E300, 0x1E4CF }, { 0x1E4FA, 0x1E7DF }, { 0x1E7E7, 0x1E7E7 }, { 0x1E7EC, 0x1E7EC }, { 0x1E7EF, 0x1E7EF }, { 0x1E7FF, 0x1E7FF }, { 0x1E8C5, 0x1E8C6 }, { 0x1E8D7, 0x1E8FF }, { 0x1E94C, 0x1E94F }, { 0x1E95A, 0x1E95D }, { 0x1E960, 0x1EC70 }, @@ -579,17 +593,16 @@ int mk_wcwidth(wchar_t ucs) { 0x1F0C0, 0x1F0C0 }, { 0x1F0D0, 0x1F0D0 }, { 0x1F0F6, 0x1F0FF }, { 0x1F1AE, 0x1F1E5 }, { 0x1F203, 0x1F20F }, { 0x1F23C, 0x1F23F }, { 0x1F249, 0x1F24F }, { 0x1F252, 0x1F25F }, { 0x1F266, 0x1F2FF }, - { 0x1F6D8, 0x1F6DC }, { 0x1F6ED, 0x1F6EF }, { 0x1F6FD, 0x1F6FF }, - { 0x1F774, 0x1F77F }, { 0x1F7D9, 0x1F7DF }, { 0x1F7EC, 0x1F7EF }, + { 0x1F6D8, 0x1F6DB }, { 0x1F6ED, 0x1F6EF }, { 0x1F6FD, 0x1F6FF }, + { 0x1F777, 0x1F77A }, { 0x1F7DA, 0x1F7DF }, { 0x1F7EC, 0x1F7EF }, { 0x1F7F1, 0x1F7FF }, { 0x1F80C, 0x1F80F }, { 0x1F848, 0x1F84F }, { 0x1F85A, 0x1F85F }, { 0x1F888, 0x1F88F }, { 0x1F8AE, 0x1F8AF }, { 0x1F8B2, 0x1F8FF }, { 0x1FA54, 0x1FA5F }, { 0x1FA6E, 0x1FA6F }, - { 0x1FA75, 0x1FA77 }, { 0x1FA7D, 0x1FA7F }, { 0x1FA87, 0x1FA8F }, - { 0x1FAAD, 0x1FAAF }, { 0x1FABB, 0x1FABF }, { 0x1FAC6, 0x1FACF }, - { 0x1FADA, 0x1FADF }, { 0x1FAE8, 0x1FAEF }, { 0x1FAF7, 0x1FAFF }, - { 0x1FB93, 0x1FB93 }, { 0x1FBCB, 0x1FBEF }, { 0x1FBFA, 0x1FFFF }, - { 0x2A6D7, 0x2F7FF }, { 0x2FA1E, 0xE0000 }, { 0xE0002, 0xE001F }, - { 0xE0080, 0xE00FF }, { 0xE01F0, 0x10FFFD } + { 0x1FA7D, 0x1FA7F }, { 0x1FA89, 0x1FA8F }, { 0x1FABE, 0x1FABE }, + { 0x1FAC6, 0x1FACD }, { 0x1FADC, 0x1FADF }, { 0x1FAE9, 0x1FAEF }, + { 0x1FAF9, 0x1FAFF }, { 0x1FB93, 0x1FB93 }, { 0x1FBCB, 0x1FBEF }, + { 0x1FBFA, 0x1FFFF }, { 0x2A6D7, 0x2F7FF }, { 0x2FA1E, 0xE0000 }, + { 0xE0002, 0xE001F }, { 0xE0080, 0xE00FF }, { 0xE01F0, 0x10FFFD } }; /* *INDENT-ON* */ @@ -612,35 +625,37 @@ int mk_wcwidth(wchar_t ucs) { 0x2753, 0x2755 }, { 0x2757, 0x2757 }, { 0x2795, 0x2797 }, { 0x27B0, 0x27B0 }, { 0x27BF, 0x27BF }, { 0x2B1B, 0x2B1C }, { 0x2B50, 0x2B50 }, { 0x2B55, 0x2B55 }, { 0x2E80, 0x2E99 }, - { 0x2E9B, 0x2EF3 }, { 0x2F00, 0x2FD5 }, { 0x2FF0, 0x2FFB }, - { 0x3000, 0x3029 }, { 0x302E, 0x303E }, { 0x3041, 0x3096 }, - { 0x309B, 0x30FF }, { 0x3105, 0x312F }, { 0x3131, 0x318E }, - { 0x3190, 0x31E3 }, { 0x31F0, 0x321E }, { 0x3220, 0x3247 }, - { 0x3250, 0x4DBF }, { 0x4E00, 0xA48C }, { 0xA490, 0xA4C6 }, - { 0xA960, 0xA97C }, { 0xAC00, 0xD7A3 }, { 0xF900, 0xFAFF }, + { 0x2E9B, 0x2EF3 }, { 0x2F00, 0x2FD5 }, { 0x2FF0, 0x3029 }, + { 0x302E, 0x303E }, { 0x3041, 0x3096 }, { 0x309B, 0x30FF }, + { 0x3105, 0x312F }, { 0x3131, 0x318E }, { 0x3190, 0x31E3 }, + { 0x31EF, 0x321E }, { 0x3220, 0x3247 }, { 0x3250, 0x4DBF }, + { 0x4E00, 0xA48C }, { 0xA490, 0xA4C6 }, { 0xA960, 0xA97C }, + { 0xAC00, 0xD7A3 }, { 0xF900, 0xFA6D }, { 0xFA70, 0xFAD9 }, { 0xFE10, 0xFE19 }, { 0xFE30, 0xFE52 }, { 0xFE54, 0xFE66 }, { 0xFE68, 0xFE6B }, { 0xFF01, 0xFF60 }, { 0xFFE0, 0xFFE6 }, { 0x16FE0, 0x16FE3 }, { 0x16FF0, 0x16FF1 }, { 0x17000, 0x187F7 }, { 0x18800, 0x18CD5 }, { 0x18D00, 0x18D08 }, { 0x1AFF0, 0x1AFF3 }, { 0x1AFF5, 0x1AFFB }, { 0x1AFFD, 0x1AFFE }, { 0x1B000, 0x1B122 }, - { 0x1B150, 0x1B152 }, { 0x1B164, 0x1B167 }, { 0x1B170, 0x1B2FB }, - { 0x1F004, 0x1F004 }, { 0x1F0CF, 0x1F0CF }, { 0x1F18E, 0x1F18E }, - { 0x1F191, 0x1F19A }, { 0x1F200, 0x1F202 }, { 0x1F210, 0x1F23B }, - { 0x1F240, 0x1F248 }, { 0x1F250, 0x1F251 }, { 0x1F260, 0x1F265 }, - { 0x1F300, 0x1F320 }, { 0x1F32D, 0x1F335 }, { 0x1F337, 0x1F37C }, - { 0x1F37E, 0x1F393 }, { 0x1F3A0, 0x1F3CA }, { 0x1F3CF, 0x1F3D3 }, - { 0x1F3E0, 0x1F3F0 }, { 0x1F3F4, 0x1F3F4 }, { 0x1F3F8, 0x1F43E }, - { 0x1F440, 0x1F440 }, { 0x1F442, 0x1F4FC }, { 0x1F4FF, 0x1F53D }, - { 0x1F54B, 0x1F54E }, { 0x1F550, 0x1F567 }, { 0x1F57A, 0x1F57A }, - { 0x1F595, 0x1F596 }, { 0x1F5A4, 0x1F5A4 }, { 0x1F5FB, 0x1F64F }, - { 0x1F680, 0x1F6C5 }, { 0x1F6CC, 0x1F6CC }, { 0x1F6D0, 0x1F6D2 }, - { 0x1F6D5, 0x1F6D7 }, { 0x1F6DD, 0x1F6DF }, { 0x1F6EB, 0x1F6EC }, - { 0x1F6F4, 0x1F6FC }, { 0x1F7E0, 0x1F7EB }, { 0x1F7F0, 0x1F7F0 }, - { 0x1F90C, 0x1F93A }, { 0x1F93C, 0x1F945 }, { 0x1F947, 0x1F9FF }, - { 0x1FA70, 0x1FA74 }, { 0x1FA78, 0x1FA7C }, { 0x1FA80, 0x1FA86 }, - { 0x1FA90, 0x1FAAC }, { 0x1FAB0, 0x1FABA }, { 0x1FAC0, 0x1FAC5 }, - { 0x1FAD0, 0x1FAD9 }, { 0x1FAE0, 0x1FAE7 }, { 0x1FAF0, 0x1FAF6 }, - { 0x20000, 0x2FFFD }, { 0x30000, 0x3FFFD } + { 0x1B132, 0x1B132 }, { 0x1B150, 0x1B152 }, { 0x1B155, 0x1B155 }, + { 0x1B164, 0x1B167 }, { 0x1B170, 0x1B2FB }, { 0x1F004, 0x1F004 }, + { 0x1F0CF, 0x1F0CF }, { 0x1F18E, 0x1F18E }, { 0x1F191, 0x1F19A }, + { 0x1F200, 0x1F202 }, { 0x1F210, 0x1F23B }, { 0x1F240, 0x1F248 }, + { 0x1F250, 0x1F251 }, { 0x1F260, 0x1F265 }, { 0x1F300, 0x1F320 }, + { 0x1F32D, 0x1F335 }, { 0x1F337, 0x1F37C }, { 0x1F37E, 0x1F393 }, + { 0x1F3A0, 0x1F3CA }, { 0x1F3CF, 0x1F3D3 }, { 0x1F3E0, 0x1F3F0 }, + { 0x1F3F4, 0x1F3F4 }, { 0x1F3F8, 0x1F43E }, { 0x1F440, 0x1F440 }, + { 0x1F442, 0x1F4FC }, { 0x1F4FF, 0x1F53D }, { 0x1F54B, 0x1F54E }, + { 0x1F550, 0x1F567 }, { 0x1F57A, 0x1F57A }, { 0x1F595, 0x1F596 }, + { 0x1F5A4, 0x1F5A4 }, { 0x1F5FB, 0x1F64F }, { 0x1F680, 0x1F6C5 }, + { 0x1F6CC, 0x1F6CC }, { 0x1F6D0, 0x1F6D2 }, { 0x1F6D5, 0x1F6D7 }, + { 0x1F6DC, 0x1F6DF }, { 0x1F6EB, 0x1F6EC }, { 0x1F6F4, 0x1F6FC }, + { 0x1F7E0, 0x1F7EB }, { 0x1F7F0, 0x1F7F0 }, { 0x1F90C, 0x1F93A }, + { 0x1F93C, 0x1F945 }, { 0x1F947, 0x1F9FF }, { 0x1FA70, 0x1FA7C }, + { 0x1FA80, 0x1FA88 }, { 0x1FA90, 0x1FABD }, { 0x1FABF, 0x1FAC5 }, + { 0x1FACE, 0x1FADB }, { 0x1FAE0, 0x1FAE8 }, { 0x1FAF0, 0x1FAF8 }, + { 0x20000, 0x2A6DF }, { 0x2A700, 0x2B739 }, { 0x2B740, 0x2B81D }, + { 0x2B820, 0x2CEA1 }, { 0x2CEB0, 0x2EBE0 }, { 0x2EBF0, 0x2EE5D }, + { 0x2F800, 0x2FA1D }, { 0x30000, 0x3134A }, { 0x31350, 0x323AF } }; /* *INDENT-ON* */ @@ -659,7 +674,7 @@ int mk_wcwidth(wchar_t ucs) result = use_latin1; } else if (Lookup(cmp, formatting)) { /* treat formatting characters like control characters */ - result = -1; + result = 0; } else if (Lookup(cmp, combining)) { /* binary search in table of non-spacing characters */ result = 0; @@ -669,6 +684,12 @@ int mk_wcwidth(wchar_t ucs) if (Lookup(cmp, doublewidth)) { result = 2; + } else if (cmp >= 0xd800 && cmp <= 0xdfff) { +#ifdef HAVE_WCWIDTH + result = (wcwidth)(ucs); +#else + result = -1; +#endif } else if (cmp >= unknowns[0].first && Lookup(cmp, unknowns)) { result = -1; } @@ -868,8 +889,9 @@ static void do_range(const char *source) int lo, hi; if (decode_range(source, &lo, &hi)) { while (lo <= hi) { - int local_rc = opt_wider ? mk_wcwidth_cjk(lo) : mk_wcwidth(lo); - int other_rc = wcwidth(lo); + wchar_t wlo = (wchar_t) lo; + int local_rc = opt_wider ? mk_wcwidth_cjk(wlo) : mk_wcwidth(wlo); + int other_rc = wcwidth(wlo); ++total_test; if (opt_all || (local_rc != other_rc)) { if (!opt_quiet) diff --git a/app/xterm/xstrings.c b/app/xterm/xstrings.c index f85620d07..94173ddbb 100644 --- a/app/xterm/xstrings.c +++ b/app/xterm/xstrings.c @@ -1,7 +1,7 @@ -/* $XTermId: xstrings.c,v 1.79 2022/11/16 23:54:32 tom Exp $ */ +/* $XTermId: xstrings.c,v 1.80 2023/05/09 08:13:56 tom Exp $ */ /* - * Copyright 2000-2020,2022 by Thomas E. Dickey + * Copyright 2000-2022,2023 by Thomas E. Dickey * * All Rights Reserved * @@ -163,9 +163,8 @@ login_alias(char *login_name, uid_t uid, struct passwd *in_out) if (!IsEmpty(login_name) && strcmp(login_name, in_out->pw_name)) { struct passwd pw2; - Boolean ok2; - if ((ok2 = x_getpwnam(login_name, &pw2))) { + if (x_getpwnam(login_name, &pw2)) { uid_t uid2 = pw2.pw_uid; struct passwd pw3; Boolean ok3; @@ -177,8 +176,7 @@ login_alias(char *login_name, uid_t uid, struct passwd *in_out) } else { FreeAndNull(login_name); } - if (ok2) - free_pw(&pw2); + free_pw(&pw2); if (ok3) free_pw(&pw3); } diff --git a/app/xterm/xterm.appdata.xml b/app/xterm/xterm.appdata.xml index 17cd3c1a4..06387816e 100644 --- a/app/xterm/xterm.appdata.xml +++ b/app/xterm/xterm.appdata.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright 2014-2022,2023 Thomas Dickey <dickey@invisible-island.net> --> +<!-- Copyright 2014-2023,2024 Thomas Dickey <dickey@invisible-island.net> --> <component type="desktop"> <id>xterm.desktop</id> <metadata_license>CC-BY-3.0</metadata_license> @@ -35,7 +35,7 @@ <keyword>terminal</keyword> </keywords> <releases> - <release version="378" date="2023-01-09"/> + <release version="393" date="2024-07-11"/> </releases> <url type="homepage">https://invisible-island.net/xterm/</url> <update_contact>dickey@invisible-island.net</update_contact> diff --git a/app/xterm/xterm.h b/app/xterm/xterm.h index 06c2a9b3b..50001626e 100644 --- a/app/xterm/xterm.h +++ b/app/xterm/xterm.h @@ -1,7 +1,7 @@ -/* $XTermId: xterm.h,v 1.922 2023/01/04 09:21:42 tom Exp $ */ +/* $XTermId: xterm.h,v 1.948 2024/06/26 07:45:55 tom Exp $ */ /* - * Copyright 1999-2022,2023 by Thomas E. Dickey + * Copyright 1999-2023,2024 by Thomas E. Dickey * * All Rights Reserved * @@ -135,15 +135,15 @@ #define HAVE_UTMP_UT_SESSION 1 #endif -#if !(defined(linux) && (!defined(__GLIBC__) || (__GLIBC__ < 2))) && !defined(SVR4) && !defined(__FreeBSD__) +#if !(defined(__linux__) && (!defined(__GLIBC__) || (__GLIBC__ < 2))) && !defined(SVR4) && !defined(__FreeBSD__) #define ut_xstatus ut_exit.e_exit #endif -#if defined(SVR4) || defined(__SCO__) || defined(BSD_UTMPX) || (defined(linux) && defined(__GLIBC__) && (__GLIBC__ >= 2) && !(defined(__powerpc__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0))) +#if defined(SVR4) || defined(__SCO__) || defined(BSD_UTMPX) || (defined(__linux__) && defined(__GLIBC__) && (__GLIBC__ >= 2) && !(defined(__powerpc__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0))) #define HAVE_UTMP_UT_XTIME 1 #endif -#if defined(linux) || defined(__CYGWIN__) +#if defined(__linux__) || defined(__CYGWIN__) #define USE_LASTLOG #define HAVE_LASTLOG_H #define USE_STRUCT_LASTLOG @@ -170,11 +170,11 @@ #define OPT_SCO_FUNC_KEYS 1 #endif -#if defined(__SCO__) || defined(SVR4) || defined(_POSIX_SOURCE) || defined(__QNX__) || defined(__hpux) || (defined(BSD) && (BSD >= 199103)) || defined(__CYGWIN__) +#if defined(__SCO__) || defined(SVR4) || defined(_POSIX_VERSION) || defined(__QNX__) || defined(__hpux) || (defined(BSD) && (BSD >= 199103)) || defined(__CYGWIN__) #define USE_POSIX_WAIT #endif -#if defined(AIXV3) || defined(CRAY) || defined(__SCO__) || defined(SVR4) || (defined(SYSV) && defined(i386)) || defined(__MVS__) || defined(__hpux) || defined(__osf__) || defined(linux) || defined(macII) || defined(BSD_UTMPX) +#if defined(AIXV3) || defined(CRAY) || defined(__SCO__) || defined(SVR4) || (defined(SYSV) && defined(i386)) || defined(__MVS__) || defined(__hpux) || defined(__osf__) || defined(__linux__) || defined(macII) || defined(BSD_UTMPX) #define USE_SYSV_UTMP #endif @@ -205,14 +205,28 @@ #define HAVE_XKB_BELL_EXT 1 #endif -#if (defined(SVR4) && !defined(__CYGWIN__)) || defined(linux) || (defined(BSD) && (BSD >= 199103)) +#if (defined(SVR4) && !defined(__CYGWIN__)) || defined(__linux__) || (defined(BSD) && (BSD >= 199103)) #define HAVE_POSIX_SAVED_IDS #endif -#if defined(linux) || defined(__GLIBC__) || (defined(SYSV) && (defined(CRAY) || defined(macII) || defined(__hpux) || defined(__osf__) || defined(__sgi))) || !(defined(SYSV) || defined(__QNX__) || defined(VMS) || defined(__INTERIX)) +#if defined(__linux__) || defined(__GLIBC__) || (defined(SYSV) && (defined(CRAY) || defined(macII) || defined(__hpux) || defined(__osf__) || defined(__sgi))) || !(defined(SYSV) || defined(__QNX__) || defined(VMS) || defined(__INTERIX)) #define HAVE_INITGROUPS #endif +#if defined(__linux__) +#define HAVE_PTY_H +#endif + +#if !defined(USG) && !defined(__minix) +#define HAVE_SETITIMER 1 +#else +#define HAVE_SETITIMER 0 +#endif + +#if defined(_POSIX_VERSION) || defined(SVR4) || defined(__convex__) || defined(__SCO__) || defined(__QNX__) +#define HAVE_SETSID 1 +#endif + #endif /* HAVE_CONFIG_H */ #ifndef HAVE_X11_DECKEYSYM_H @@ -283,7 +297,7 @@ extern int errno; * FIXME: Toggling logging from xterm hangs under Linux 2.0.29 with libc5 if * we use 'waitpid()', while 'wait()' seems to work properly. */ -#ifdef linux +#ifdef __linux__ #undef HAVE_WAITPID #endif @@ -386,7 +400,7 @@ extern int errno; #include <setjmp.h> -#if !defined(VMS) && !(defined(linux) && defined(__USE_GNU)) && !defined(__hpux) && !defined(_ALL_SOURCE) && !defined(__osf__) +#if !defined(VMS) && !(defined(__linux__) && defined(__USE_GNU)) && !defined(__hpux) && !defined(_ALL_SOURCE) && !defined(__osf__) extern char **environ; #endif @@ -434,6 +448,7 @@ extern char **environ; /***====================================================================***/ +#define XtNactiveIcon "activeIcon" #define XtNallowBoldFonts "allowBoldFonts" #define XtNallowC1Printable "allowC1Printable" #define XtNallowColorOps "allowColorOps" @@ -455,10 +470,11 @@ extern char **environ; #define XtNappcursorDefault "appcursorDefault" #define XtNappkeypadDefault "appkeypadDefault" #define XtNassumeAllChars "assumeAllChars" -#define XtNautoWrap "autoWrap" #define XtNautoScrollLock "autoScrollLock" +#define XtNautoWrap "autoWrap" #define XtNawaitInput "awaitInput" #define XtNbackarrowKey "backarrowKey" +#define XtNbackarrowKeyIsErase "backarrowKeyIsErase" #define XtNbellIsUrgent "bellIsUrgent" #define XtNbellOnReset "bellOnReset" #define XtNbellSuppressTime "bellSuppressTime" @@ -487,11 +503,13 @@ extern char **environ; #define XtNcombiningChars "combiningChars" #define XtNctrlFKeys "ctrlFKeys" #define XtNcurses "curses" +#define XtNcursorBar "cursorBar" #define XtNcursorBlink "cursorBlink" #define XtNcursorBlinkXOR "cursorBlinkXOR" #define XtNcursorColor "cursorColor" #define XtNcursorOffTime "cursorOffTime" #define XtNcursorOnTime "cursorOnTime" +#define XtNcursorTheme "cursorTheme" #define XtNcursorUnderLine "cursorUnderLine" #define XtNcutNewline "cutNewline" #define XtNcutToBeginningOfLine "cutToBeginningOfLine" @@ -538,9 +556,16 @@ extern char **environ; #define XtNhighlightReverse "highlightReverse" #define XtNhighlightSelection "highlightSelection" #define XtNhighlightTextColor "highlightTextColor" +#define XtNhold "hold" +#define XtNhpFunctionKeys "hpFunctionKeys" #define XtNhpLowerleftBugCompat "hpLowerleftBugCompat" #define XtNi18nSelections "i18nSelections" +#define XtNiconBorderColor "iconBorderColor" +#define XtNiconBorderWidth "iconBorderWidth" +#define XtNiconFont "iconFont" +#define XtNiconGeometry "iconGeometry" #define XtNiconHint "iconHint" +#define XtNincrementalGraphics "incrementalGraphics" #define XtNindicatorFormat "indicatorFormat" #define XtNinitialFont "initialFont" #define XtNinternalBorder "internalBorder" @@ -549,8 +574,10 @@ extern char **environ; #define XtNkeepClipboard "keepClipboard" #define XtNkeepSelection "keepSelection" #define XtNkeyboardDialect "keyboardDialect" -#define XtNlimitFontsets "limitFontsets" +#define XtNkeyboardType "keyboardType" +#define XtNlimitFontHeight "limitFontHeight" #define XtNlimitFontWidth "limitFontWidth" +#define XtNlimitFontsets "limitFontsets" #define XtNlimitResize "limitResize" #define XtNlimitResponse "limitResponse" #define XtNlocale "locale" @@ -560,11 +587,16 @@ extern char **environ; #define XtNlogging "logging" #define XtNloginShell "loginShell" #define XtNmarginBell "marginBell" +#define XtNmaxBufSize "maxBufSize" #define XtNmaxGraphicSize "maxGraphicSize" +#define XtNmaxStringParse "maxStringParse" #define XtNmaximized "maximized" #define XtNmenuBar "menuBar" /* internal */ #define XtNmenuHeight "menuHeight" +#define XtNmenuLocale "menuLocale" +#define XtNmessages "messages" #define XtNmetaSendsEscape "metaSendsEscape" +#define XtNminBufSize "minBufSize" #define XtNmkSamplePass "mkSamplePass" #define XtNmkSampleSize "mkSampleSize" #define XtNmkWidth "mkWidth" @@ -581,6 +613,7 @@ extern char **environ; #define XtNnumColorRegisters "numColorRegisters" #define XtNnumLock "numLock" #define XtNoldXtermFKeys "oldXtermFKeys" +#define XtNomitTranslation "omitTranslation" #define XtNpointerColor "pointerColor" #define XtNpointerColorBackground "pointerColorBackground" #define XtNpointerFont "pointerFont" @@ -588,7 +621,14 @@ extern char **environ; #define XtNpointerShape "pointerShape" #define XtNpopOnBell "popOnBell" #define XtNprecompose "precompose" +#define XtNpreferLatin1 "preferLatin1" #define XtNprintAttributes "printAttributes" +#define XtNprintFileImmediate "printFileImmediate" +#define XtNprintFileOnXError "printFileOnXError" +#define XtNprintModeImmediate "printModeImmediate" +#define XtNprintModeOnXError "printModeOnXError" +#define XtNprintOptsImmediate "printOptsImmediate" +#define XtNprintOptsOnXError "printOptsOnXError" #define XtNprinterAutoClose "printerAutoClose" #define XtNprinterCommand "printerCommand" #define XtNprinterControlMode "printerControlMode" @@ -596,23 +636,34 @@ extern char **environ; #define XtNprinterFormFeed "printerFormFeed" #define XtNprinterNewLine "printerNewLine" #define XtNprivateColorRegisters "privateColorRegisters" +#define XtNptyHandshake "ptyHandshake" +#define XtNptyInitialErase "ptyInitialErase" +#define XtNptySttySize "ptySttySize" #define XtNquietGrab "quietGrab" #define XtNregisDefaultFont "regisDefaultFont" #define XtNregisScreenSize "regisScreenSize" #define XtNrenderFont "renderFont" +#define XtNreportCClass "reportCClass" +#define XtNreportColors "reportColors" +#define XtNreportFonts "reportFonts" +#define XtNreportIcons "reportIcons" +#define XtNreportXRes "reportXRes" #define XtNresizeByPixel "resizeByPixel" #define XtNresizeGravity "resizeGravity" #define XtNretryInputMethod "retryInputMethod" #define XtNreverseWrap "reverseWrap" #define XtNrightScrollBar "rightScrollBar" +#define XtNsameName "sameName" #define XtNsaveLines "saveLines" #define XtNscaleHeight "scaleHeight" +#define XtNscoFunctionKeys "scoFunctionKeys" #define XtNscrollBar "scrollBar" #define XtNscrollBarBorder "scrollBarBorder" #define XtNscrollKey "scrollKey" #define XtNscrollLines "scrollLines" #define XtNscrollTtyOutput "scrollTtyOutput" #define XtNselectToClipboard "selectToClipboard" +#define XtNsessionMgt "sessionMgt" #define XtNshiftEscape "shiftEscape" #define XtNshiftFonts "shiftFonts" #define XtNshowBlinkAsBold "showBlinkAsBold" @@ -621,29 +672,39 @@ extern char **environ; #define XtNsignalInhibit "signalInhibit" #define XtNsixelScrolling "sixelScrolling" #define XtNsixelScrollsRight "sixelScrollsRight" +#define XtNsunFunctionKeys "sunFunctionKeys" +#define XtNsunKeyboard "sunKeyboard" +#define XtNtcapFunctionKeys "tcapFunctionKeys" #define XtNtekGeometry "tekGeometry" #define XtNtekInhibit "tekInhibit" #define XtNtekSmall "tekSmall" #define XtNtekStartup "tekStartup" +#define XtNtermName "termName" #define XtNtiXtraScroll "tiXtraScroll" #define XtNtiteInhibit "titeInhibit" #define XtNtitleModes "titleModes" #define XtNtoolBar "toolBar" #define XtNtrimSelection "trimSelection" +#define XtNttyModes "ttyModes" #define XtNunderLine "underLine" #define XtNuseBorderClipping "useBorderClipping" #define XtNuseClipping "useClipping" +#define XtNuseInsertMode "useInsertMode" #define XtNutf8 "utf8" #define XtNutf8Fonts "utf8Fonts" #define XtNutf8Latin1 "utf8Latin1" #define XtNutf8SelectTypes "utf8SelectTypes" #define XtNutf8Title "utf8Title" #define XtNutf8Weblike "utf8Weblike" +#define XtNutmpDisplayId "utmpDisplayId" +#define XtNutmpInhibit "utmpInhibit" +#define XtNvalidShells "validShells" #define XtNveryBoldColors "veryBoldColors" #define XtNvisualBell "visualBell" #define XtNvisualBellDelay "visualBellDelay" #define XtNvisualBellLine "visualBellLine" #define XtNvt100Graphics "vt100Graphics" +#define XtNwaitForMap "waitForMap" #define XtNwideBoldFont "wideBoldFont" #define XtNwideChars "wideChars" #define XtNwideFont "wideFont" @@ -655,7 +716,10 @@ extern char **environ; #define XtNxmcGlitch "xmcGlitch" /* ncurses-testing */ #define XtNxmcInline "xmcInline" /* ncurses-testing */ #define XtNxmcMoveSGR "xmcMoveSGR" /* ncurses-testing */ +#define XtNzIconBeep "zIconBeep" +#define XtNzIconTitleFormat "zIconTitleFormat" +#define XtCActiveIcon "ActiveIcon" #define XtCAllowBoldFonts "AllowBoldFonts" #define XtCAllowC1Printable "AllowC1Printable" #define XtCAllowColorOps "AllowColorOps" @@ -676,10 +740,11 @@ extern char **environ; #define XtCAppcursorDefault "AppcursorDefault" #define XtCAppkeypadDefault "AppkeypadDefault" #define XtCAssumeAllChars "AssumeAllChars" -#define XtCAutoWrap "AutoWrap" #define XtCAutoScrollLock "AutoScrollLock" +#define XtCAutoWrap "AutoWrap" #define XtCAwaitInput "AwaitInput" #define XtCBackarrowKey "BackarrowKey" +#define XtCBackarrowKeyIsErase "BackarrowKeyIsErase" #define XtCBellIsUrgent "BellIsUrgent" #define XtCBellOnReset "BellOnReset" #define XtCBellSuppressTime "BellSuppressTime" @@ -703,10 +768,12 @@ extern char **environ; #define XtCCombiningChars "CombiningChars" #define XtCCtrlFKeys "CtrlFKeys" #define XtCCurses "Curses" +#define XtCCursorBar "CursorBar" #define XtCCursorBlink "CursorBlink" #define XtCCursorBlinkXOR "CursorBlinkXOR" #define XtCCursorOffTime "CursorOffTime" #define XtCCursorOnTime "CursorOnTime" +#define XtCCursorTheme "CursorTheme" #define XtCCursorUnderLine "CursorUnderLine" #define XtCCutNewline "CutNewline" #define XtCCutToBeginningOfLine "CutToBeginningOfLine" @@ -751,17 +818,25 @@ extern char **environ; #define XtCHighlightColorMode "HighlightColorMode" #define XtCHighlightReverse "HighlightReverse" #define XtCHighlightSelection "HighlightSelection" +#define XtCHold "Hold" +#define XtCHpFunctionKeys "HpFunctionKeys" #define XtCHpLowerleftBugCompat "HpLowerleftBugCompat" #define XtCI18nSelections "I18nSelections" +#define XtCIconFont "IconFont" +#define XtCIconGeometry "IconGeometry" #define XtCIconHint "IconHint" +#define XtCIncrementalGraphics "IncrementalGraphics" #define XtCIndicatorFormat "IndicatorFormat" #define XtCInitialFont "InitialFont" +#define XtCInternalBorder "InternalBorder" #define XtCJumpScroll "JumpScroll" #define XtCKeepClipboard "KeepClipboard" #define XtCKeepSelection "KeepSelection" #define XtCKeyboardDialect "KeyboardDialect" -#define XtCLimitFontsets "LimitFontsets" +#define XtCKeyboardType "KeyboardType" +#define XtCLimitFontHeight "LimitFontHeight" #define XtCLimitFontWidth "LimitFontWidth" +#define XtCLimitFontsets "LimitFontsets" #define XtCLimitResize "LimitResize" #define XtCLimitResponse "LimitResponse" #define XtCLocale "Locale" @@ -771,11 +846,16 @@ extern char **environ; #define XtCLogging "Logging" #define XtCLoginShell "LoginShell" #define XtCMarginBell "MarginBell" +#define XtCMaxBufSize "MaxBufSize" #define XtCMaxGraphicSize "MaxGraphicSize" +#define XtCMaxStringParse "MaxStringParse" #define XtCMaximized "Maximized" #define XtCMenuBar "MenuBar" /* internal */ #define XtCMenuHeight "MenuHeight" +#define XtCMenuLocale "MenuLocale" +#define XtCMessages "Messages" #define XtCMetaSendsEscape "MetaSendsEscape" +#define XtCMinBufSize "MinBufSize" #define XtCMkSamplePass "MkSamplePass" #define XtCMkSampleSize "MkSampleSize" #define XtCMkWidth "MkWidth" @@ -791,11 +871,19 @@ extern char **environ; #define XtCNumColorRegisters "NumColorRegisters" #define XtCNumLock "NumLock" #define XtCOldXtermFKeys "OldXtermFKeys" +#define XtCOmitTranslation "OmitTranslation" #define XtCPointerFont "PointerFont" #define XtCPointerMode "PointerMode" #define XtCPopOnBell "PopOnBell" #define XtCPrecompose "Precompose" +#define XtCPreferLatin1 "PreferLatin1" #define XtCPrintAttributes "PrintAttributes" +#define XtCPrintFileImmediate "PrintFileImmediate" +#define XtCPrintFileOnXError "PrintFileOnXError" +#define XtCPrintModeImmediate "PrintModeImmediate" +#define XtCPrintModeOnXError "PrintModeOnXError" +#define XtCPrintOptsImmediate "PrintOptsImmediate" +#define XtCPrintOptsOnXError "PrintOptsOnXError" #define XtCPrinterAutoClose "PrinterAutoClose" #define XtCPrinterCommand "PrinterCommand" #define XtCPrinterControlMode "PrinterControlMode" @@ -803,22 +891,33 @@ extern char **environ; #define XtCPrinterFormFeed "PrinterFormFeed" #define XtCPrinterNewLine "PrinterNewLine" #define XtCPrivateColorRegisters "PrivateColorRegisters" +#define XtCPtyHandshake "PtyHandshake" +#define XtCPtyInitialErase "PtyInitialErase" +#define XtCPtySttySize "PtySttySize" #define XtCQuietGrab "QuietGrab" #define XtCRegisDefaultFont "RegisDefaultFont" #define XtCRegisScreenSize "RegisScreenSize" #define XtCRenderFont "RenderFont" +#define XtCReportCClass "ReportCClass" +#define XtCReportColors "ReportColors" +#define XtCReportFonts "ReportFonts" +#define XtCReportIcons "ReportIcons" +#define XtCReportXRes "ReportXRes" #define XtCResizeByPixel "ResizeByPixel" #define XtCResizeGravity "ResizeGravity" #define XtCRetryInputMethod "RetryInputMethod" #define XtCReverseWrap "ReverseWrap" #define XtCRightScrollBar "RightScrollBar" +#define XtCSameName "SameName" #define XtCSaveLines "SaveLines" #define XtCScaleHeight "ScaleHeight" +#define XtCScoFunctionKeys "ScoFunctionKeys" #define XtCScrollBar "ScrollBar" #define XtCScrollBarBorder "ScrollBarBorder" #define XtCScrollCond "ScrollCond" #define XtCScrollLines "ScrollLines" #define XtCSelectToClipboard "SelectToClipboard" +#define XtCSessionMgt "SessionMgt" #define XtCShiftEscape "ShiftEscape" #define XtCShiftFonts "ShiftFonts" #define XtCShowBlinkAsBold "ShowBlinkAsBold" @@ -827,28 +926,38 @@ extern char **environ; #define XtCSignalInhibit "SignalInhibit" #define XtCSixelScrolling "SixelScrolling" #define XtCSixelScrollsRight "SixelScrollsRight" +#define XtCSunFunctionKeys "SunFunctionKeys" +#define XtCSunKeyboard "SunKeyboard" +#define XtCTcapFunctionKeys "TcapFunctionKeys" #define XtCTekInhibit "TekInhibit" #define XtCTekSmall "TekSmall" #define XtCTekStartup "TekStartup" +#define XtCTermName "TermName" #define XtCTiXtraScroll "TiXtraScroll" #define XtCTiteInhibit "TiteInhibit" #define XtCTitleModes "TitleModes" #define XtCToolBar "ToolBar" #define XtCTrimSelection "TrimSelection" +#define XtCTtyModes "TtyModes" #define XtCUnderLine "UnderLine" #define XtCUseBorderClipping "UseBorderClipping" #define XtCUseClipping "UseClipping" +#define XtCUseInsertMode "UseInsertMode" #define XtCUtf8 "Utf8" #define XtCUtf8Fonts "Utf8Fonts" #define XtCUtf8Latin1 "Utf8Latin1" #define XtCUtf8SelectTypes "Utf8SelectTypes" #define XtCUtf8Title "Utf8Title" #define XtCUtf8Weblike "Utf8Weblike" +#define XtCUtmpDisplayId "UtmpDisplayId" +#define XtCUtmpInhibit "UtmpInhibit" #define XtCVT100Graphics "VT100Graphics" +#define XtCValidShells "ValidShells" #define XtCVeryBoldColors "VeryBoldColors" #define XtCVisualBell "VisualBell" #define XtCVisualBellDelay "VisualBellDelay" #define XtCVisualBellLine "VisualBellLine" +#define XtCWaitForMap "WaitForMap" #define XtCWideBoldFont "WideBoldFont" #define XtCWideChars "WideChars" #define XtCWideFont "WideFont" @@ -860,6 +969,8 @@ extern char **environ; #define XtCXmcGlitch "XmcGlitch" /* ncurses-testing */ #define XtCXmcInline "XmcInline" /* ncurses-testing */ #define XtCXmcMoveSGR "XmcMoveSGR" /* ncurses-testing */ +#define XtCZIconBeep "ZIconBeep" +#define XtCZIconTitleFormat "ZIconTitleFormat" #if defined(NO_ACTIVE_ICON) && !defined(XtNgeometry) #define XtNgeometry "geometry" @@ -896,13 +1007,13 @@ extern void HandleGINInput PROTO_XT_ACTIONS_ARGS; extern void TCursorToggle (TekWidget /* tw */, int /* toggle */); extern void TekCopy (TekWidget /* tw */); extern void TekEnqMouse (TekWidget /* tw */, int /* c */); -extern void TekExpose (Widget /* w */, XEvent * /* event */, Region /* region */); +extern void TekExpose (Widget /* w */, XEvent * /* event */, Region /* region */); extern void TekGINoff (TekWidget /* tw */); extern void TekRefresh (TekWidget /* tw */); extern void TekRepaint (TekWidget /* xw */); extern void TekReverseVideo (XtermWidget /* xw */, TekWidget /* tw */); extern void TekRun (void); -extern void TekSetFontSize (TekWidget /* tw */, Bool /* fromMenu */, int /* newitem */); +extern void TekSetFontSize (TekWidget /* tw */, Bool /* fromMenu */, int /* newitem */); extern void TekSetWinSize (TekWidget /* tw */); extern void TekSimulatePageButton (TekWidget /* tw */, Bool /* reset */); #endif @@ -918,11 +1029,11 @@ extern void TekSimulatePageButton (TekWidget /* tw */, Bool /* reset */); (s)->event_mask |= PointerMotionMask; \ XSelectInput(XtDisplay((t)), XtWindow((t)), (long) (s)->event_mask); } -extern Bool SendMousePosition (XtermWidget /* w */, XEvent* /* event */); +extern Bool SendMousePosition (XtermWidget /* w */, XEvent* /* event */); extern XtermMouseModes okSendMousePos(XtermWidget /* xw */); extern void DiredButton PROTO_XT_ACTIONS_ARGS; -extern void DisownSelection (XtermWidget /* xw */); -extern void UnhiliteSelection (XtermWidget /* xw */); +extern void DisownSelection (XtermWidget /* xw */); +extern void UnhiliteSelection (XtermWidget /* xw */); extern void HandleCopySelection PROTO_XT_ACTIONS_ARGS; extern void HandleInsertSelection PROTO_XT_ACTIONS_ARGS; extern void HandleKeyboardSelectEnd PROTO_XT_ACTIONS_ARGS; @@ -936,8 +1047,8 @@ extern void HandleSelectExtend PROTO_XT_ACTIONS_ARGS; extern void HandleSelectSet PROTO_XT_ACTIONS_ARGS; extern void HandleSelectStart PROTO_XT_ACTIONS_ARGS; extern void HandleStartExtend PROTO_XT_ACTIONS_ARGS; -extern void ResizeSelection (TScreen * /* screen */, int /* rows */, int /* cols */); -extern void ScrollSelection (TScreen * /* screen */, int /* amount */, Bool /* always */); +extern void ResizeSelection (TScreen * /* screen */, int /* rows */, int /* cols */); +extern void ScrollSelection (TScreen * /* screen */, int /* amount */, Bool /* always */); extern void TrackMouse (XtermWidget /* xw */, int /* func */, CELL * /* start */, int /* firstrow */, int /* lastrow */); extern void ViButton PROTO_XT_ACTIONS_ARGS; @@ -946,8 +1057,8 @@ extern int xtermUtf8ToTextList (XtermWidget /* xw */, XTextProperty * /* text_pr extern void xtermButtonInit (XtermWidget /* xw */); #if OPT_DEC_LOCATOR -extern void GetLocatorPosition (XtermWidget /* w */); -extern void InitLocatorFilter (XtermWidget /* w */); +extern void GetLocatorPosition (XtermWidget /* w */); +extern void InitLocatorFilter (XtermWidget /* w */); #endif /* OPT_DEC_LOCATOR */ #if OPT_FOCUS_EVENT @@ -957,10 +1068,10 @@ extern void SendFocusButton(XtermWidget /* xw */, XFocusChangeEvent * /* event * #endif #if OPT_PASTE64 -extern void AppendToSelectionBuffer (TScreen * /* screen */, unsigned /* c */, String /* selection */); +extern void AppendToSelectionBuffer (TScreen * /* screen */, unsigned /* c */, String /* selection */); extern void ClearSelectionBuffer (TScreen * /* screen */, String /* selection */); -extern void CompleteSelection (XtermWidget /* xw */, String * /* args */, Cardinal /* len */); -extern void xtermGetSelection (Widget /* w */, Time /* ev_time */, String * /* params */, Cardinal /* num_params */, Atom * /* targets */); +extern void CompleteSelection (XtermWidget /* xw */, String * /* args */, Cardinal /* len */); +extern void xtermGetSelection (Widget /* w */, Time /* ev_time */, String * /* params */, Cardinal /* num_params */, Atom * /* targets */); #endif #if OPT_READLINE @@ -971,18 +1082,20 @@ extern void ReadLineButton PROTO_XT_ACTIONS_ARGS; extern void report_char_class(XtermWidget); #endif -#define IsLatin1(n) (((n) >= 32 && (n) <= 126) || ((n) >= 160 && (n) <= 255)) +#define IsAscii1(n) (((n) >= 32 && (n) <= 126)) #if OPT_WIDE_CHARS #define WideCells(n) (((IChar)(n) >= first_widechar) ? my_wcwidth((wchar_t) (n)) : 1) #define isWideFrg(n) (((n) == HIDDEN_CHAR) || (WideCells((n)) == 2)) #define isWide(n) (((IChar)(n) >= first_widechar) && isWideFrg(n)) -#define CharWidth(screen, n) ((!((screen)->utf8_mode) && ((n) < 256)) \ +#define CharWidth(screen, n) (((n) < 256) \ ? (IsLatin1(n) ? 1 : 0) \ : my_wcwidth((wchar_t) (n))) +#define IsLatin1(n) (IsAscii1(n) || ((n) >= 160 && (n) <= 255)) #else #define WideCells(n) 1 #define CharWidth(screen, n) (IsLatin1(n) ? 1 : 0) +#define IsLatin1(n) (IsAscii1(n) || ((n) >= 160)) #endif /* cachedCgs.c */ @@ -1000,6 +1113,7 @@ extern void setCgsCSet(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/ extern void setCgsFont(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/, XTermFonts * /*font*/); extern void setCgsFont2(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/, XTermFonts * /*font*/, unsigned /*which*/); extern void setCgsFore(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/, Pixel /*fg*/); +extern void setCgsLine(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/, Pixel /*fg*/); extern void swapCgs(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*dstCgsId*/, CgsEnum /*srcCgsId*/); #ifdef NO_LEAKS @@ -1011,7 +1125,7 @@ extern Bool CheckBufPtrs (TScreen * /* screen */); extern Bool set_cursor_gcs (XtermWidget /* xw */); extern char * vt100ResourceToString (XtermWidget /* xw */, const char * /* name */); extern int VTInit (XtermWidget /* xw */); -extern Bool FindFontSelection (XtermWidget /* xw */, const char * /* atom_name */, Bool /* justprobe */); +extern Bool FindFontSelection (XtermWidget /* xw */, const char * /* atom_name */, Bool /* justprobe */); extern void HideCursor (XtermWidget /* xw */); extern void RestartBlinking(XtermWidget /* xw */); extern void ShowCursor (XtermWidget /* xw */); @@ -1020,7 +1134,7 @@ extern void ToggleAlternate (XtermWidget /* xw */); extern void VTInitTranslations (void); extern GCC_NORETURN void VTReset (XtermWidget /* xw */, int /* full */, int /* saved */); extern void VTRun (XtermWidget /* xw */); -extern void dotext (XtermWidget /* xw */, DECNRCM_codes /* charset */, IChar * /* buf */, Cardinal /* len */); +extern void dotext (XtermWidget /* xw */, DECNRCM_codes /* charset */, IChar * /* buf */, Cardinal /* len */); extern void getKeymapResources(Widget /* w */, const char * /*mapName */, const char * /* mapClass */, const char * /* type */, void * /* result */, size_t /* size */); extern void initBorderGC (XtermWidget /* xw */, VTwin * /* win */); extern void lookupSelectUnit(XtermWidget /* xw */, Cardinal /* item */, String /* value */); @@ -1030,16 +1144,16 @@ extern void resetCharsets (TScreen * /* screen */); extern void resetMargins (XtermWidget /* xw */); extern void restoreCharsets (TScreen * /* screen */, DECNRCM_codes * /* source */); extern void saveCharsets (TScreen * /* screen */, DECNRCM_codes * /* target */); -extern void set_max_col(TScreen * /* screen */, int /* cols */); -extern void set_max_row(TScreen * /* screen */, int /* rows */); +extern void set_max_col(TScreen * /* screen */, int /* cols */); +extern void set_max_row(TScreen * /* screen */, int /* rows */); extern void unparse_disallowed_ops (XtermWidget /* xw */, char * /* value */); extern void unparse_end (XtermWidget /* xw */); -extern void unparseputc (XtermWidget /* xw */, int /* c */); -extern void unparseputc1 (XtermWidget /* xw */, int /* c */); +extern void unparseputc (XtermWidget /* xw */, int /* c */); +extern void unparseputc1 (XtermWidget /* xw */, int /* c */); extern void unparseputn (XtermWidget /* xw */, unsigned /* n */); extern void unparseputs (XtermWidget /* xw */, const char * /* s */); extern void unparseseq (XtermWidget /* xw */, ANSI * /* ap */); -extern void v_write (int /* f */, const Char * /* d */, size_t /* len */); +extern void v_write (int /* f */, const Char * /* d */, size_t /* len */); extern void xtermAddInput (Widget /* w */); extern void xtermDecodeSCS (XtermWidget /* xw */, int /* which */, int /* sgroup */, int /* prefix */, int /* suffix */); @@ -1056,8 +1170,8 @@ extern TInput *lookupTInput (XtermWidget /* xw */, Widget /* w */); #endif #if OPT_ISO_COLORS -extern void SGR_Background (XtermWidget /* xw */, int /* color */); -extern void SGR_Foreground (XtermWidget /* xw */, int /* color */); +extern void SGR_Background (XtermWidget /* xw */, int /* color */); +extern void SGR_Foreground (XtermWidget /* xw */, int /* color */); extern void setExtendedColors (XtermWidget /* xw */); #endif @@ -1066,8 +1180,9 @@ extern void noleaks_charproc (void); #endif /* charsets.c */ -extern unsigned xtermCharSetIn (XtermWidget /* xw */, unsigned /* code */, DECNRCM_codes /* charset */); -extern int xtermCharSetOut (XtermWidget /* xw */, IChar * /* buf */, IChar * /* ptr */, DECNRCM_codes /* charset */); +extern unsigned xtermCharSetIn (XtermWidget /* xw */, unsigned /* code */, DECNRCM_codes /* charset */); +extern Cardinal xtermCharSetOut (XtermWidget /* xw */, Cardinal /* length */, DECNRCM_codes /* charset */); +extern int xtermCharSetDec (XtermWidget /* xw */, IChar /* ch */, DECNRCM_codes /* cs */); /* cursor.c */ extern int CursorCol (XtermWidget /* xw */); @@ -1080,17 +1195,17 @@ extern void CursorForward (XtermWidget /* xw */, int /* n */); extern void CursorNextLine (XtermWidget /* xw */, int /* count */); extern void CursorPrevLine (XtermWidget /* xw */, int /* count */); extern void CursorRestore2 (XtermWidget /* xw */, SavedCursor * /* sc */); -extern void CursorRestore (XtermWidget /* xw */); +extern void CursorRestore (XtermWidget /* xw */); extern void CursorSave2 (XtermWidget /* xw */, SavedCursor * /* sc */); -extern void CursorSave (XtermWidget /* xw */); -extern void CursorSet (TScreen * /* screen */, int /* row */, int /* col */, unsigned /* flags */); -extern void CursorUp (TScreen * /* screen */, int /* n */); -extern void RevIndex (XtermWidget /* xw */, int /* amount */); -extern void xtermIndex (XtermWidget /* xw */, int /* amount */); +extern void CursorSave (XtermWidget /* xw */); +extern void CursorSet (TScreen * /* screen */, int /* row */, int /* col */, unsigned /* flags */); +extern void CursorUp (TScreen * /* screen */, int /* n */); +extern void RevIndex (XtermWidget /* xw */, int /* amount */); +extern void xtermIndex (XtermWidget /* xw */, int /* amount */); #if OPT_TRACE -extern int set_cur_col(TScreen * /* screen */, int /* value */); -extern int set_cur_row(TScreen * /* screen */, int /* value */); +extern int set_cur_col(TScreen * /* screen */, int /* value */); +extern int set_cur_row(TScreen * /* screen */, int /* value */); #else #define set_cur_col(screen, value) screen->cur_col = value #define set_cur_row(screen, value) \ @@ -1104,11 +1219,11 @@ extern int set_cur_row(TScreen * /* screen */, int /* value */); #endif /* cursorfont.c */ -extern Cursor CreateAlternateCursorFontCursor(Display * /* dpy */, char const * /* cursorfont */, unsigned int /* which */); +extern Cursor CreateAlternateCursorFontCursor(Display * /* dpy */, char const * /* cursorfont */, unsigned int /* which */); extern int CursorFontIndexFromShapeName(char const * /* shapename */); /* doublechr.c */ -extern void xterm_DECDHL (XtermWidget /* xw */, Bool /* top */); +extern void xterm_DECDHL (XtermWidget /* xw */, Bool /* top */); extern void xterm_DECSWL (XtermWidget /* xw */); extern void xterm_DECDWL (XtermWidget /* xw */); extern void xterm_ResetDouble(XtermWidget /* xw */); @@ -1125,7 +1240,7 @@ extern unsigned xtermParamToState (XtermWidget /* xw */, unsigned /* param */); extern unsigned xtermStateToParam (XtermWidget /* xw */, unsigned /* state */); extern Bool xtermDeleteIsDEL (XtermWidget /* xw */); extern void Input (XtermWidget /* xw */, XKeyEvent */* event */, Bool /* eightbit */); -extern void StringInput (XtermWidget /* xw */, const Char * /* string */, size_t /* nbytes */); +extern void StringInput (XtermWidget /* xw */, const Char * /* string */, size_t /* nbytes */); #if OPT_NUM_LOCK extern void VTInitModifiers(XtermWidget /* xw */); @@ -1145,10 +1260,19 @@ extern void restoreCellData(TScreen * /* screen */, const CellData * /* data */, /* main.c */ #define ENVP_ARG /**/ -extern int main (int /* argc */, char ** /* argv */ ENVP_ARG); -extern int GetBytesAvailable (int /* fd */); -extern int kill_process_group (int /* pid */, int /* sig */); +extern int main (int /* argc */, char ** /* argv */ ENVP_ARG); +extern int xtermDisabledChar(void); +extern int GetBytesAvailable (Display * /* dpy */); +extern int kill_process_group (int /* pid */, int /* sig */); extern int nonblocking_wait (void); +extern Atom CachedInternAtom(Display * /* display */, const char * /* name */); + +extern int get_tty_erase(int /* fd */, int /* default_erase */, const char * /* tag */); +extern int get_tty_lnext(int /* fd */, int /* default_lnext */, const char * /* tag */); + +#if (defined(VMS) || defined(__VMS)) +#define GetBytesAvailable(dpy) ((dpy)->qlen > 0) +#endif #if OPT_PTY_HANDSHAKE extern void first_map_occurred (void); @@ -1243,6 +1367,7 @@ extern void hide_tek_window (void); extern void hide_vt_window (void); extern GCC_NORETURN void ice_error (IceConn /* iceConn */); extern void init_colored_cursor (Display * /* dpy */); +extern void parse_ansi_params(ANSI * /* params */, const char ** /* string */); extern void reset_decudk (XtermWidget /* xw */); extern void set_tek_visibility (Bool /* on */); extern void set_vt_visibility (Bool /* on */); @@ -1265,6 +1390,10 @@ extern void xtermShowPointer (XtermWidget /* xw */, Bool /* enable */); extern void xtermUnsetenv (const char * /* var */); extern void xtermWarning (const char * /*fmt*/,...) GCC_PRINTFLIKE(1,2); +extern Boolean xtermPopTitle(TScreen * /* screen */, int /* which */, SaveTitle * /* item */); +extern void xtermPushTitle(TScreen * /* screen */, int /* which */, SaveTitle * /* item */); +extern void xtermFreeTitle(SaveTitle *item); + #if OPT_DABBREV extern void HandleDabbrevExpand PROTO_XT_ACTIONS_ARGS; #endif @@ -1298,12 +1427,12 @@ extern Boolean QueryOneColor(XtermWidget /* xw */, XColor * /* def */); #endif #if OPT_MAXIMIZE -extern int QueryMaximize (XtermWidget /* xw */, unsigned * /* width */, unsigned * /* height */); +extern int QueryMaximize (XtermWidget /* xw */, unsigned * /* width */, unsigned * /* height */); extern void HandleDeIconify PROTO_XT_ACTIONS_ARGS; extern void HandleIconify PROTO_XT_ACTIONS_ARGS; extern void HandleMaximize PROTO_XT_ACTIONS_ARGS; extern void HandleRestoreSize PROTO_XT_ACTIONS_ARGS; -extern void RequestMaximize (XtermWidget /* xw */, int /* maximize */); +extern void RequestMaximize (XtermWidget /* xw */, int /* maximize */); #endif #if OPT_REPORT_ICONS @@ -1372,8 +1501,8 @@ extern PrinterFlags *getPrinterFlags (XtermWidget /* xw */, String * /* params * extern int xtermPrinterControl (XtermWidget /* xw */, int /* chr */); extern void setPrinterControlMode (XtermWidget /* xw */, int /* mode */); extern void xtermAutoPrint (XtermWidget /* xw */, unsigned /* chr */); -extern void xtermMediaControl (XtermWidget /* xw */, int /* param */, int /* private_seq */); -extern void xtermPrintScreen (XtermWidget /* xw */, Bool /* use_DECPEX */, PrinterFlags * /* p */); +extern void xtermMediaControl (XtermWidget /* xw */, int /* param */, int /* private_seq */); +extern void xtermPrintScreen (XtermWidget /* xw */, Bool /* use_DECPEX */, PrinterFlags * /* p */); extern void xtermPrintEverything (XtermWidget /* xw */, PrinterFlags * /* p */); extern void xtermPrintImmediately (XtermWidget /* xw */, String /* filename */, int /* opts */, int /* attributes */); extern void xtermPrintOnXError (XtermWidget /* xw */, int /* n */); @@ -1395,7 +1524,7 @@ extern void xtermDumpSvg (XtermWidget /* xw */); extern Bool decodeUtf8 (TScreen * /* screen */, PtyData * /* data */); extern int readPtyData (XtermWidget /* xw */, PtySelect * /* select_mask */, PtyData * /* data */); -extern void fillPtyData (XtermWidget /* xw */, PtyData * /* data */, const char * /* value */, size_t /* length */); +extern void fillPtyData (XtermWidget /* xw */, PtyData * /* data */, const char * /* value */, size_t /* length */); extern void initPtyData (PtyData ** /* data */); extern void trimPtyData (XtermWidget /* xw */, PtyData * /* data */); @@ -1405,12 +1534,12 @@ extern void noleaks_ptydata ( void ); #if OPT_WIDE_CHARS extern Boolean isValidUTF8 (Char * /* lp */); -extern Char *convertToUTF8 (Char * /* lp */, unsigned /* c */); +extern Char *convertToUTF8 (Char * /* lp */, unsigned /* c */); extern Char *convertFromUTF8 (Char * /* lp */, unsigned * /* cp */); extern IChar nextPtyData (TScreen * /* screen */, PtyData * /* data */); extern PtyData * fakePtyData (PtyData * /* result */, Char * /* next */, Char * /* last */); -extern void switchPtyData (TScreen * /* screen */, int /* f */); -extern void writePtyData (int /* f */, IChar * /* d */, size_t /* len */); +extern void switchPtyData (TScreen * /* screen */, int /* f */); +extern void writePtyData (int /* f */, IChar * /* d */, size_t /* len */); #define morePtyData(screen, data) \ (((data)->last > (data)->next) \ @@ -1443,30 +1572,31 @@ extern void writePtyData (int /* f */, IChar * /* d */, size_t /* len */); #define _NET_WM_STATE_ADD 1 /* add/set property */ #define _NET_WM_STATE_TOGGLE 2 /* toggle property */ -extern Bool non_blank_line (TScreen */* screen */, int /* row */, int /* col */, int /* len */); +extern Bool non_blank_line (TScreen */* screen */, int /* row */, int /* col */, int /* len */); extern Char * allocScrnData (TScreen * /* screen */, unsigned /* nrow */, unsigned /* ncol */, Bool /* bottom */); -extern ScrnBuf allocScrnBuf (XtermWidget /* xw */, unsigned /* nrow */, unsigned /* ncol */, ScrnPtr * /* addr */); +extern ScrnBuf allocScrnBuf (XtermWidget /* xw */, unsigned /* nrow */, unsigned /* ncol */, ScrnPtr * /* addr */); extern ScrnBuf scrnHeadAddr (TScreen * /* screen */, ScrnBuf /* base */, unsigned /* offset */); -extern size_t ScrnPointers (TScreen * /* screen */, size_t /* len */); -extern void ClearBufRows (XtermWidget /* xw */, int /* first */, int /* last */); +extern size_t ScrnPointers (TScreen * /* screen */, size_t /* len */); +extern void ClearBufRows (XtermWidget /* xw */, int /* first */, int /* last */); extern void ClearCells (XtermWidget /* xw */, int /* flags */, unsigned /* len */, int /* row */, int /* col */); extern void CopyCells (TScreen * /* screen */, LineData * /* src */, LineData * /* dst */, int /* col */, int /* len */, Bool /* down */); extern void FullScreen (XtermWidget /* xw */, int /* mode */); extern void FreeMarkGCs (XtermWidget /* xw */); -extern void ScreenResize (XtermWidget /* xw */, int /* width */, int /* height */, unsigned * /* flags */); +extern void ResetHiddenHint (XtermWidget /* xw */); +extern void ScreenResize (XtermWidget /* xw */, int /* width */, int /* height */, unsigned * /* flags */); extern void ScrnAllocBuf (XtermWidget /* xw */); extern void ScrnClearCells (XtermWidget /* xw */, int /* row */, int /* col */, unsigned /* len */); -extern void ScrnDeleteChar (XtermWidget /* xw */, unsigned /* n */); -extern void ScrnDeleteCol (XtermWidget /* xw */, unsigned /* n */); -extern void ScrnDeleteLine (XtermWidget /* xw */, ScrnBuf /* sb */, int /* n */, int /* last */, unsigned /* where */); +extern void ScrnDeleteChar (XtermWidget /* xw */, unsigned /* n */); +extern void ScrnDeleteCol (XtermWidget /* xw */, unsigned /* n */); +extern void ScrnDeleteLine (XtermWidget /* xw */, ScrnBuf /* sb */, int /* n */, int /* last */, unsigned /* where */); extern void ScrnDisownSelection (XtermWidget /* xw */); extern void ScrnFillRectangle (XtermWidget /* xw */, XTermRect *, int , unsigned /* flags */, Bool /* keepColors */); -extern void ScrnInsertChar (XtermWidget /* xw */, unsigned /* n */); -extern void ScrnInsertCol (XtermWidget /* xw */, unsigned /* n */); -extern void ScrnInsertLine (XtermWidget /* xw */, ScrnBuf /* sb */, int /* last */, int /* where */, unsigned /* n */); -extern void ScrnRefresh (XtermWidget /* xw */, int /* toprow */, int /* leftcol */, int /* nrows */, int /* ncols */, Bool /* force */); -extern void ScrnUpdate (XtermWidget /* xw */, int /* toprow */, int /* leftcol */, int /* nrows */, int /* ncols */, Bool /* force */); -extern void ScrnWriteText (XtermWidget /* xw */, IChar * /* str */, unsigned /* flags */, CellColor /* cur_fg_bg */, unsigned /* length */); +extern void ScrnInsertChar (XtermWidget /* xw */, unsigned /* n */); +extern void ScrnInsertCol (XtermWidget /* xw */, unsigned /* n */); +extern void ScrnInsertLine (XtermWidget /* xw */, ScrnBuf /* sb */, int /* last */, int /* where */, unsigned /* n */); +extern void ScrnRefresh (XtermWidget /* xw */, int /* toprow */, int /* leftcol */, int /* nrows */, int /* ncols */, Bool /* force */); +extern void ScrnUpdate (XtermWidget /* xw */, int /* toprow */, int /* leftcol */, int /* nrows */, int /* ncols */, Bool /* force */); +extern void ScrnWriteText (XtermWidget /* xw */, Cardinal /* offset */, Cardinal /* length */, unsigned /* flags */, CellColor /* cur_fg_bg */); extern void ShowWrapMarks (XtermWidget /* xw */, int /* row */, CLineData * /* ld */); extern void setupLineData (TScreen * /* screen */, ScrnBuf /* base */, Char * /* data */, unsigned /* nrow */, unsigned /* ncol */, Bool /* bottom */); extern void xtermParseRect (XtermWidget /* xw */, int, int *, XTermRect *); @@ -1556,16 +1686,16 @@ extern void DoResizeScreen (XtermWidget /* xw */); extern void HandleScrollBack PROTO_XT_ACTIONS_ARGS; extern void HandleScrollForward PROTO_XT_ACTIONS_ARGS; extern void HandleScrollTo PROTO_XT_ACTIONS_ARGS; -extern void ResizeScrollBar (XtermWidget /* xw */); -extern void ScrollBarDrawThumb (XtermWidget /* xw */, int /* mode */); -extern void ScrollBarOff (XtermWidget /* xw */); -extern void ScrollBarOn (XtermWidget /* xw */, Bool /* init */); -extern void ScrollBarReverseVideo (Widget /* scrollWidget */); -extern void ToggleScrollBar (XtermWidget /* xw */); -extern void WindowScroll (XtermWidget /* xw */, int /* top */, Bool /* always */); +extern void ResizeScrollBar (XtermWidget /* xw */); +extern void ScrollBarDrawThumb (XtermWidget /* xw */, int /* mode */); +extern void ScrollBarOff (XtermWidget /* xw */); +extern void ScrollBarOn (XtermWidget /* xw */, Bool /* init */); +extern void ScrollBarReverseVideo (Widget /* scrollWidget */); +extern void ToggleScrollBar (XtermWidget /* xw */); +extern void WindowScroll (XtermWidget /* xw */, int /* top */, Bool /* always */); #ifdef SCROLLBAR_RIGHT -extern void updateRightScrollbar(XtermWidget /* xw */); +extern void updateRightScrollbar(XtermWidget /* xw */); #else #define updateRightScrollbar(xw) /* nothing */ #endif @@ -1580,10 +1710,12 @@ extern void TabZonk (Tabs /* tabs */); extern Bool TabIsSet (Tabs /* tabs */, int /* col */); /* util.c */ +extern Boolean AssignFgColor (XtermWidget /* xw */, Pixel /* bg */); +extern Boolean AssignBgColor (XtermWidget /* xw */, Pixel /* bg */); extern Boolean isDefaultBackground (const char * /* name */); extern Boolean isDefaultForeground (const char * /* name */); extern CgsEnum whichXtermCgs (XtermWidget /* xw */, unsigned /* attr_flags */, Bool /* hilite */); -extern GC updatedXtermGC (XtermWidget /* xw */, unsigned /* flags */, CellColor /* fg_bg */, Bool /* hilite */); +extern GC updatedXtermGC (XtermWidget /* xw */, unsigned /* flags */, CellColor /* fg_bg */, Bool /* hilite */); extern Pixel getXtermBackground (XtermWidget /* xw */, unsigned /* flags */, int /* color */); extern Pixel getXtermForeground (XtermWidget /* xw */, unsigned /* flags */, int /* color */); extern char * xtermSetLocale (int /* category */, String /* after */); @@ -1592,32 +1724,32 @@ extern int HandleExposure (XtermWidget /* xw */, XEvent * /* event */); extern int dimRound (double /* value */); extern int drawXtermText (XTermDraw * /* param */, GC /* gc */, int /* x */, int /* y */, const IChar * /* text */, Cardinal /* len */); extern int extendedBoolean (const char * /* value */, const FlagList * /* table */, Cardinal /* limit */); -extern void ChangeColors (XtermWidget /* xw */, ScrnColors * /* pNew */); +extern void ChangeColors (XtermWidget /* xw */, ScrnColors * /* pNew */); extern void ClearLine (XtermWidget /* xw */); extern void ClearRight (XtermWidget /* xw */, int /* n */); extern void ClearScreen (XtermWidget /* xw */); extern void DeleteChar (XtermWidget /* xw */, unsigned /* n */); extern void DeleteLine (XtermWidget /* xw */, int /* n */, Bool /* canSave */); extern void FlushScroll (XtermWidget /* xw */); -extern void GetColors (XtermWidget /* xw */, ScrnColors * /* pColors */); +extern void GetColors (XtermWidget /* xw */, ScrnColors * /* pColors */); extern void InsertChar (XtermWidget /* xw */, unsigned /* n */); -extern void InsertLine (XtermWidget /* xw */, int /* n */); -extern void RevScroll (XtermWidget /* xw */, int /* amount */); +extern void InsertLine (XtermWidget /* xw */, int /* n */); +extern void RevScroll (XtermWidget /* xw */, int /* amount */); extern void ReverseVideo (XtermWidget /* xw */); -extern void WriteText (XtermWidget /* xw */, IChar * /* str */, Cardinal /* len */); +extern void WriteText (XtermWidget /* xw */, Cardinal /* offset */, Cardinal /* len */); extern void decode_keyboard_type (XtermWidget /* xw */, struct XTERM_RESOURCE * /* rp */); -extern void decode_wcwidth (XtermWidget /* xw */); +extern void decode_wcwidth (XtermWidget /* xw */); extern void do_cd_xtra_scroll (XtermWidget /* xw */, int /* param */); -extern void do_erase_display (XtermWidget /* xw */, int /* param */, int /* mode */); -extern void do_erase_char (XtermWidget /* xw */, int /* param */, int /* mode */); -extern void do_erase_line (XtermWidget /* xw */, int /* param */, int /* mode */); +extern void do_erase_display (XtermWidget /* xw */, int /* param */, int /* mode */); +extern void do_erase_char (XtermWidget /* xw */, int /* param */, int /* mode */); +extern void do_erase_line (XtermWidget /* xw */, int /* param */, int /* mode */); extern void do_ti_xtra_scroll (XtermWidget /* xw */); extern void getXtermSizeHints (XtermWidget /* xw */); -extern void recolor_cursor (TScreen * /* screen */, Cursor /* cursor */, unsigned long /* fg */, unsigned long /* bg */); -extern void resetXtermGC (XtermWidget /* xw */, unsigned /* flags */, Bool /* hilite */); -extern void scrolling_copy_area (XtermWidget /* xw */, int /* firstline */, int /* nlines */, int /* amount */); -extern void set_keyboard_type (XtermWidget /* xw */, xtermKeyboardType /* type */, Bool /* set */); -extern void toggle_keyboard_type (XtermWidget /* xw */, xtermKeyboardType /* type */); +extern void recolor_cursor (TScreen * /* screen */, Cursor /* cursor */, unsigned long /* fg */, unsigned long /* bg */); +extern void resetXtermGC (XtermWidget /* xw */, unsigned /* flags */, Bool /* hilite */); +extern void scrolling_copy_area (XtermWidget /* xw */, int /* firstline */, int /* nlines */, int /* amount */); +extern void set_keyboard_type (XtermWidget /* xw */, xtermKeyboardType /* type */, Bool /* set */); +extern void toggle_keyboard_type (XtermWidget /* xw */, xtermKeyboardType /* type */); extern void update_keyboard_type (void); extern void xtermClear (XtermWidget /* xw */); extern void xtermClear2 (XtermWidget /* xw */, int /* x */, int /* y */, unsigned /* width */, unsigned /* height */); @@ -1627,7 +1759,7 @@ extern void xtermRepaint (XtermWidget /* xw */); extern void xtermResetLocale (int /* category */, char * /* before */); extern void xtermScroll (XtermWidget /* xw */, int /* amount */); extern void xtermScrollLR (XtermWidget /* xw */, int /* amount */, Bool /* toLeft */); -extern void xtermSizeHints (XtermWidget /* xw */, int /* scrollbarWidth */); +extern void xtermSizeHints (XtermWidget /* xw */, int /* scrollbarWidth */); struct Xinerama_geometry { int x; @@ -1643,10 +1775,10 @@ extern int XParseXineramaGeometry(Display * /* display */, char * /* parsestring #if OPT_ISO_COLORS -extern Pixel extract_fg (XtermWidget /* xw */, CellColor /* color */, unsigned /* flags */); -extern Pixel extract_bg (XtermWidget /* xw */, CellColor /* color */, unsigned /* flags */); +extern Pixel extract_fg (XtermWidget /* xw */, CellColor /* color */, unsigned /* flags */); +extern Pixel extract_bg (XtermWidget /* xw */, CellColor /* color */, unsigned /* flags */); extern CellColor makeColorPair (XtermWidget /* xw */); -extern void ClearCurBackground (XtermWidget /* xw */, int /* top */, int /* left */, unsigned /* height */, unsigned /* width */, unsigned /* fw */); +extern void ClearCurBackground (XtermWidget /* xw */, int /* top */, int /* left */, unsigned /* height */, unsigned /* width */, unsigned /* fw */); #define xtermColorPair(xw) makeColorPair(xw) @@ -1735,7 +1867,7 @@ extern void discardRenderDraw(TScreen * /* screen */); #if OPT_ZICONBEEP extern void initZIconBeep(void); extern void resetZIconBeep(XtermWidget /* xw */); -extern Boolean showZIconBeep(XtermWidget /* xw */, char * /* name */); +extern Boolean showZIconBeep(XtermWidget /* xw */, const char * /* name */); #else #define initZIconBeep() /* nothing */ #define resetZIconBeep(xw) /* nothing */ @@ -1744,9 +1876,9 @@ extern Boolean showZIconBeep(XtermWidget /* xw */, char * /* name */); #define XTERM_CELL(row,col) getXtermCell(screen, ROW2INX(screen, row), col) -extern unsigned getXtermCell (TScreen * /* screen */, int /* row */, int /* col */); +extern unsigned getXtermCell (TScreen * /* screen */, int /* row */, int /* col */); extern unsigned getXtermCombining(TScreen * /* screen */, int /* row */, int /* col */, int /* off */); -extern void putXtermCell (TScreen * /* screen */, int /* row */, int /* col */, int /* ch */); +extern void putXtermCell (TScreen * /* screen */, int /* row */, int /* col */, int /* ch */); #define IsCellCombined(screen, row, col) (getXtermCombining(screen, row, col, 0) != 0) @@ -1763,22 +1895,28 @@ extern void putXtermCell (TScreen * /* screen */, int /* row */, int /* col */ && (sel) != (xw)->dft_background) #endif +#define setXtermLineAttributes(dpy, gc, width, style) \ + XSetLineAttributes(dpy, gc, (unsigned) width, style, CapProjecting, JoinMiter); + +#define resetXtermLineAttributes(dpy, gc) \ + setXtermLineAttributes(dpy, gc, 0, LineSolid); + #if OPT_WIDE_CHARS extern int DamagedCells(TScreen * /* screen */, unsigned /* n */, int * /* klp */, int * /* krp */, int /* row */, int /* col */); extern int DamagedCurCells(TScreen * /* screen */, unsigned /* n */, int * /* klp */, int * /* krp */); extern unsigned AsciiEquivs(unsigned /* ch */); -extern void addXtermCombining (TScreen * /* screen */, int /* row */, int /* col */, unsigned /* ch */); +extern void addXtermCombining (TScreen * /* screen */, int /* row */, int /* col */, unsigned /* ch */); extern void allocXtermChars(ScrnPtr * /* buffer */, Cardinal /* length */); #endif #if OPT_XMC_GLITCH -extern void Mark_XMC (XtermWidget /* xw */, int /* param */); +extern void Mark_XMC (XtermWidget /* xw */, int /* param */); extern void Jump_XMC (XtermWidget /* xw */); extern void Resolve_XMC (XtermWidget /* xw */); #endif #if OPT_WIDE_CHARS -unsigned visual_width(const IChar * /* str */, Cardinal /* len */); +unsigned visual_width(const IChar * /* str */, Cardinal /* len */); #else #define visual_width(a, b) (b) #endif diff --git a/app/xterm/xterm.log.html b/app/xterm/xterm.log.html index 52d344eba..7bed04559 100644 --- a/app/xterm/xterm.log.html +++ b/app/xterm/xterm.log.html @@ -2,7 +2,7 @@ ***************************************************************************** * this file is part of xterm * * * - * Copyright 1997-2022,2023 by Thomas E. Dickey * + * Copyright 1997-2023,2024 by Thomas E. Dickey * * * * All Rights Reserved * * * @@ -30,7 +30,7 @@ * sale, use or other dealings in this Software without prior written * * authorization. * ***************************************************************************** - $XTermId: xterm.log.html,v 1.2478 2023/01/09 10:29:25 tom Exp $ + $XTermId: xterm.log.html,v 1.2635 2024/07/11 23:37:57 tom Exp $ --> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> @@ -50,7 +50,7 @@ <body> <hr> - <p>Copyright © 1997-2022,2023 by <a href= + <p>Copyright © 1997-2023,2024 by <a href= "mailto:dickey@invisible-island.net">Thomas E. Dickey</a></p> <hr> @@ -70,6 +70,36 @@ CHANGELOG</a>).</p> <ul> + <li><a href="#xterm_393">Patch #393 - 2024/07/11</a></li> + + <li><a href="#xterm_392">Patch #392 - 2024/05/22</a></li> + + <li><a href="#xterm_391">Patch #391 - 2024/05/12</a></li> + + <li><a href="#xterm_390">Patch #390 - 2024/02/19</a></li> + + <li><a href="#xterm_389">Patch #389 - 2024/01/01</a></li> + + <li><a href="#xterm_388">Patch #388 - 2023/10/22</a></li> + + <li><a href="#xterm_387">Patch #387 - 2023/10/15</a></li> + + <li><a href="#xterm_386">Patch #386 - 2023/10/09</a></li> + + <li><a href="#xterm_385">Patch #385 - 2023/10/01</a></li> + + <li><a href="#xterm_384">Patch #384 - 2023/07/10</a></li> + + <li><a href="#xterm_383">Patch #383 - 2023/06/27</a></li> + + <li><a href="#xterm_382">Patch #382 - 2023/05/30</a></li> + + <li><a href="#xterm_381">Patch #381 - 2023/05/28</a></li> + + <li><a href="#xterm_380">Patch #380 - 2023/05/09</a></li> + + <li><a href="#xterm_379">Patch #379 - 2023/02/15</a></li> + <li><a href="#xterm_378">Patch #378 - 2023/01/09</a></li> <li><a href="#xterm_377">Patch #377 - 2022/11/25</a></li> @@ -1034,6 +1064,606 @@ <li><a href="#xterm_01">Patch #1 - 1996/1/6</a></li> </ul> + <h1><a name="xterm_393" id="xterm_393">Patch #393 - + 2024/07/11</a></h1> + + <ul> + <li>add a check for ANSI SC/RC, to ignore CSI parameters.</li> + + <li>improve check for missing characters for bitmap-fonts by + using the normal font for reference in the case where the + current font, e.g., the wide-font was derived from the normal + font and lacks per-character metrics (report by Rajeev V. + Pillai).</li> + + <li>fix regression in error-recovery for SGR parameters from + <a href="#xterm_357">patch #357</a> (report by James + Holderness).</li> + + <li>remove some duplicates in <tt>xtermcfg.h</tt> (report by + Matthew Green).</li> + + <li>change default for <tt>--enable-imake</tt> configure + option.</li> + + <li>fixes for <tt>wcwidth</tt>: + <ul> + <li>return 0 for format effectors, like a zero-width + printing character rather than -1 like a control character + (report by Rajeev V. Pillai).</li> + + <li>correct <tt>doublewidth</tt> to account for reserved + codepoints which are listed in the EastAsianWidth + file.</li> + + <li>add a special case for surrogate pairs, which might be + checked in testing the <tt>wcwidth</tt> function.</li> + </ul> + </li> + + <li>amend sixel bounds-check added in <a href= + "#xterm_371">patch #371</a> to not wrap out-of-bounds + data.</li> + + <li>eliminate <tt>maxStringParse</tt> limit for SIXEL.</li> + + <li>improve logic which ignores APC, PM and SOS controls to + also not accumulate their data temporarily in a buffer.</li> + + <li>exclude <tt>TERM_INGRESS</tt> from cleanup of environment + variables (patch by Iain Riley).</li> + + <li>fix some documentation typos (report by Thomas Wolff).</li> + </ul> + + <h1><a name="xterm_392" id="xterm_392">Patch #392 - + 2024/05/22</a></h1> + + <ul> + <li>improve input decoding for non-Latin1 character sets by + preserving the sense of GL/GR.</li> + + <li>add resource <tt>preferLatin1</tt> to simplify UPSS + configuration (Gentoo #932154).</li> + + <li>build-fix for <tt>--disable-boxchars</tt>; <a href= + "#xterm_390">patch #390</a> reuses that feature's code to draw + the part of the DEC Technical character set which has no + Unicode equivalent.</li> + + <li>modify <tt>#include</tt> of <tt>pty.h</tt> to work with + musl (report by Khem Raj).</li> + + <li>improve definitions used in <tt>clock_gettime</tt> logic in + <tt>graphics_sixel.c</tt>, as well as updating comments (patch + by Ben Wong).</li> + + <li>amend <code>allowC1Printable</code> changes from <a href= + "#xterm_391">patch #391</a>, restoring a special case which + caused C1 characters to be ignored (report/testcase by Dmytro + Bagrii).</li> + </ul> + + <h1><a name="xterm_391" id="xterm_391">Patch #391 - + 2024/05/12</a></h1> + + <ul> + <li>improve integration between UTF-8 and + <code>allowC1Printable</code>.</li> + + <li>alter SIXEL HLS computation to make blue 0 degrees (patch + by Ben Wong).</li> + + <li>disable SIXEL aspect-ratio, pending a rewrite (patch by Ben + Wong).</li> + + <li>add resource <code>incrementalGraphics</code> (prompted by + patch by Ben Wong).</li> + + <li>reorganize <tt>graphics_sixel.c</tt> as a step toward + eliminating graphics buffer-size (integrated patch by Ben + Wong).</li> + + <li>use <code>__linux__</code> consistently rather than the + older <code>linux</code>.</li> + + <li>build-fix for musl (report by Jonáš Vidra, + adapted patch by Khem Raj): + <ul> + <li>modify <code><em>ifdef</em></code> for + <code>USE_OPENPTY</code>, changing test for + <code>__GLIBC__</code> to <code>__linux__</code></li> + + <li>change <code><em>ifdef</em></code>'s for + <code>_POSIX_SOURCE</code> to + <code>_POSIX_VERSION</code></li> + + <li>modify <code><em>ifdef</em></code> for + <code>setsid</code> to use a configure-script check for + that function's existence and move the old check to imake + fallbacks.</li> + </ul> + </li> + + <li>minor consistency fixes for manpage.</li> + + <li>fix regression in <a href="#xterm_390">patch #390</a>: + non-UTF8 text pasted as a XA_UTF8_STRING was not decoded + (report by Petri Kaukasoina).</li> + </ul> + + <h1><a name="xterm_390" id="xterm_390">Patch #390 - + 2024/02/19</a></h1> + + <ul> + <li>improve typography of control-sequences page (patches by + Branden Robinson).</li> + + <li>amend UPSS change from <a href="#xterm_389">patch #389</a>, + fixing a regression in VT100/VT220 character sets.</li> + + <li>modify ANSI conformance per ECMA-43 and DEC 070: + <ul> + <li>set ANSI conformance level to 3 for DEC levels 2 and + up.</li> + + <li>disable locking shifts in level 1, e.g., VT100.</li> + + <li>disable single-shifts from G2/G3 in level 1.</li> + + <li>use UPSS for G2/G3 in levels 2 and up.</li> + </ul> + </li> + + <li>modify invisible-character attribute to permit + <tt>DECRQCRA</tt> to report a consistent checksum + (report/testcase by Thomas Wolff).</li> + + <li>align terminfo building blocks in terminfo to correspond to + recent refactoring/trimming in ncurses.</li> + + <li>set flag in regexec call for + <code>on<em>N</em>Clicks</code> to handle + “<tt>^</tt>” anchor (patch by Matthew Martin).</li> + + <li>add line-drawing data for the characters in <a href= + "https://www.vt100.net/charsets/technical.html"><em>DEC + Technical</em></a> which have no Unicode equivalents.</li> + + <li>remove a special case in <tt>encode_scs</tt> which made + xterm report Latin-1 when encoding is set to UTF-8, where ASCII + is the selected character set. This fixes a regression in + vttest for the <tt>DECRSPS</tt> cursor test.</li> + + <li>correct values for <em>Ps</em> of <tt>DECAUPSS</tt> in + <tt>ctlseqs.ms</tt> (report by James Holderness).</li> + + <li>simplify/correct expression for checking Unicode + non-characters (report by Thomas Wolff).</li> + + <li>correct loop for trimming environment variables + (report/patch by Casper Dik).</li> + + <li>fixes for manpage formatting (Debian #1041809).</li> + + <li>update config.guess, config.sub</li> + </ul> + + <h1><a name="xterm_389" id="xterm_389">Patch #389 - + 2024/01/01</a></h1> + + <ul> + <li>interchange variables in subparameter parsing, fixing a bug + where subparameters after the first parameter could be + misidentified (patch by Adam Saponara).</li> + + <li>correct popping of icon/window titles in a case where only + one was pushed from <a href="#xterm_385">patch #385</a> + changes.</li> + + <li>add <tt>XTQMODKEYS</tt> response in <tt>DECRQSS</tt>, as + alternative for vim.</li> + + <li>correct <tt>DECCIR</tt> encoded information on character + set size, handle a VT525 quirk, and add <tt>DECST8C</tt> + (Windows Terminal #14984).</li> + + <li>improve <tt>DECRQCRA</tt> (prompted by discussion with + James Holderness, Windows Terminal #14974).</li> + + <li>add part of VT525 color controls: + <ul> + <li><tt>DECAC</tt>, to update default + foreground/background, respond to <tt>DECRQSS</tt></li> + + <li><tt>DECATC</tt>, to respond with <tt>DECRQSS</tt></li> + </ul> + </li> + + <li>prevent Unicode non-characters from being printed (prompted + by patch by Grady Martin).</li> + + <li>modify <tt>send_SGR()</tt> to avoid modifying colors 16 to + 255 in printed output (patch by Grady Martin).</li> + + <li>minor cleanup of miscellaneous error-codes with + <tt>ERROR_MISC</tt>.</li> + + <li>remove legacy <tt><em>CSI</em> 53</tt> for locator status, + corrected in <a href="#xterm_294">patch #294</a>.</li> + + <li>modify <tt>DECRQUPSS</tt> and <tt>DECAUPSS</tt> feature to + support VT5xx character sets (report by Thomas Wolff).</li> + + <li>improve configure script: + <ul> + <li>reduce configure-check compiler warnings (prompted by + Florian Weimer, Redhat #2251945)</li> + + <li>improve usage messages in configure script to make it + clearer when an option value is optional.</li> + </ul> + </li> + + <li>improve EWMH handling (report/analysis by Edward Rosten) + <ul> + <li>reset <tt>_NET_WM_STATE_HIDDEN</tt> flag from + <tt>_NET_WM_STATE</tt> before mapping the window to + deiconify.</li> + + <li>cache X properties to reduce latency (adapted from + patch by Edward Rosten).</li> + </ul> + </li> + </ul> + + <h1><a name="xterm_388" id="xterm_388">Patch #388 - + 2023/10/22</a></h1> + + <ul> + <li>improve <tt>disallowPasteControls</tt> by adding a category + for the special characters known to <tt>stty</tt> (prompted by + discussion with David Leadbeater).</li> + + <li>amend support of <tt>DECAUPSS</tt>, undoing change to + initialization of G2/G3 so that pasting of GR characters works + properly (report/analysis by Petri Kaukasoina).</li> + + <li>update config.guess, config.sub</li> + </ul> + + <h1><a name="xterm_387" id="xterm_387">Patch #387 - + 2023/10/15</a></h1> + + <ul> + <li>add <tt>DECRQUPSS</tt> and <tt>DECAUPSS</tt>.</li> + + <li>add <tt>DECRQDE</tt> (report by Jake Hamby).</li> + + <li>correct indexing expression in title-stack, from <a href= + "#xterm_385">patch #385</a> changes (report by Brian + Lindholm).</li> + </ul> + + <h1><a name="xterm_386" id="xterm_386">Patch #386 - + 2023/10/09</a></h1> + + <ul> + <li>improve references in <tt>ctlseqs.ms</tt> (prompted by + discussion with Kirill Chibisov).</li> + + <li>make the maximum amount of memory used for buffering DCS + and OSC strings configurable with <tt>maxStringParse</tt> + resource (report by Daniel Franke).</li> + + <li>improve performance of ReGIS when initializing the largest + fontsize (report by Ben Wong).</li> + + <li>fix regression in SIXEL colors, in <a href= + "#xterm_385">patch #385</a> (report/patch by Jonny + Langley).</li> + + <li>fix typo in <code>--with-wtmp</code> (report/patch by Sven + Joachim)</li> + </ul> + + <h1><a name="xterm_385" id="xterm_385">Patch #385 - + 2023/10/01</a></h1> + + <ul> + <li>fixes for ReGIS (report by Ben Wong). + <ul> + <li>correct conversion from HLS to RGB</li> + + <li>improve font-caching performance.</li> + </ul> + </li> + + <li>update tables in <code>wcwidth.c</code> based on Unicode + 15.1.0</li> + + <li>improve <code>fastScroll</code> resource: + <ul> + <li>suppress screen-refreshes for carriage-returns</li> + + <li>add <code>-jf</code> option to simplify use of this + resource.</li> + + <li>add a control sequence for enabling/disabling the + resource.</li> + + <li>enable this feature by default</li> + </ul> + </li> + + <li>extend title-stack feature to allow an additional parameter + to directly access the stack, like the + <code>XTPUSHCOLORS</code> and <code>XTPOPCOLORS</code> + feature.</li> + + <li>correct size and position of box shown for double-cell + character which happens to be missing from the bitmap font + (report by Peter Fabinski).</li> + + <li>improved configure script: + <ul> + <li>add pattern for uClibc-ng to <tt>CF_XOPEN_SOURCE</tt> + (report/patch by Waldemar Brodkorb).</li> + + <li>add configure options <tt>--with-utmp-path</tt> and + <tt>--with-wtmp-path</tt> to override configure script's + check for utmp/wtmp pathnames which are shown in the manual + (Debian #1042767).</li> + + <li><tt>CF_XOPEN_SOURCE</tt> provides for defining + <tt>_DEFAULT_SOURCE</tt> for MinGW32 and MinGW64.</li> + + <li>sed expression used to report gcc version now works + with MinGW</li> + </ul> + </li> + + <li>ensure that line-attributes are reset after drawing missing + character (report by Christian Weisgerber).</li> + + <li>update config.guess, config.sub</li> + </ul> + + <h1><a name="xterm_384" id="xterm_384">Patch #384 - + 2023/07/10</a></h1> + + <ul> + <li>exclude ASCII space from <code>showMissingGlyphs</code>, + since a few bitmap fonts lack this (report by "SanRemo", + Emanuel Haupt).</li> + + <li>correct a step in rendering double-width characters with + bitmap-fonts (report by Peter Fabinski, Debian #1039986).</li> + + <li>fixes for ReGIS-related problems (report by Ben Wong): + <ul> + <li>mimic an undocumented hardware VT340 feature which + handles color initialization with incomplete + parameters.</li> + + <li>handle whitespace between operator/operands for color + values.</li> + + <li>reset ReGIS-context when resetting graphics in + <tt>RIS</tt>.</li> + </ul> + </li> + </ul> + + <h1><a name="xterm_383" id="xterm_383">Patch #383 - + 2023/06/27</a></h1> + + <ul> + <li>expand description of full- and soft-reset in the + manual.</li> + + <li>fixes for full- and soft-reset: + <ul> + <li>clear alternate screen on full reset.</li> + + <li>disable menu-entry for active icon; it merely shows + whether the feature is enabled.</li> + + <li>use <tt>appcursorDefault</tt> and + <tt>appkeypadDefault</tt> resources for reset of + <tt>DECCKM</tt> and <tt>DECKPAM</tt>.</li> + + <li>save initial resource values for + <tt>sixelScrolling</tt> and <tt>privateColorRegisters</tt>, + using those in full reset.</li> + + <li>update checkbox for <em>Enable Blinking Cursor</em> + (report by Rajeev V. Pillai).</li> + </ul> + </li> + + <li>add reply for <tt>DECSACE</tt> with <tt>DECRQSS</tt>.</li> + + <li>modify status-line feature to exit without erasing for + <tt>DECSTR</tt>.</li> + + <li>add private mode <tt>1045</tt> which imitates the original + xterm cursor-back reverse wrapping mode <tt>45</tt> (see + <a href="#xterm_380">patch #380</a>).</li> + + <li>improve checks for non-Unicode values, e.g., in + <tt>DECRQCRA</tt>.</li> + + <li>re-checkout from RCS archive to fix stale identifiers + (report by Sven Joachim).</li> + </ul> + + <h1><a name="xterm_382" id="xterm_382">Patch #382 - + 2023/05/30</a></h1> + + <ul> + <li>amend change to <tt>CursorBack</tt> in <a href= + "#xterm_380">patch #380</a>, allowing the result to be on the + hidden right-half of double-cell characters (report by Rajeev + V. Pillai).</li> + + <li>amend <tt>xtermDrawString</tt>, fixing regression with + <tt>--disable-wide-chars</tt> configuration from <a href= + "#xterm_380">patch #380</a>.</li> + + <li>corrected pathname for <tt>run-tic.sh</tt>, for full + install in an out-of-tree build (report by Rajeev V. + Pillai).</li> + </ul> + + <h1><a name="xterm_381" id="xterm_381">Patch #381 - + 2023/05/28</a></h1> + + <ul> + <li>fix a regression in wide bitmap fonts versus check for + missing glyphs (report by Rajeev V. Pillai).</li> + </ul> + + <h1><a name="xterm_380" id="xterm_380">Patch #380 - + 2023/05/09</a></h1> + + <ul> + <li>simplify the change for <code>sixelScrolling</code> from + <a href="#xterm_374">patch #374</a> (report by Per + Bothner).</li> + + <li>add <tt>xterm+focus</tt> and <tt>report+da2</tt>, update + <tt>report+version</tt> building blocks in terminfo, from + post-ncurses 6.4</li> + + <li>drop the <tt>-title</tt> option from <tt>uxterm</tt> and + <tt>koi8rxterm</tt>, because that interferes with deriving the + default title from the <tt>-e</tt> option (Debian #1031837). + Compensate for this by using the <tt>-class</tt> option to + derive a default title.</li> + + <li>improve description of readline 2003 mode in + <tt>ctlseqs.ms</tt> (report by Thomas Wolff).</li> + + <li>other improvements to status-line feature (report by Thomas + Wolff): + <ul> + <li>clear status line on <tt>DECCOLM</tt></li> + + <li>ignore <tt>DECSASD</tt> if no previous + <tt>DECSSDT</tt></li> + + <li>allow <tt>DECSSDT 1</tt> immediately after + <tt>DECSSDT 2</tt>, i.e., without switching back to + host mode.</li> + </ul> + </li> + + <li>adjust <tt>RequestResize</tt> to avoid shrinking screen + when using <tt>DECCOLM</tt> while the status-line is active + (report/patch by Thomas Wolff).</li> + + <li>disallow wrapping before the beginning of the screen, to + the end of the screen, for cursor-back sequences (Redhat + #2182357).</li> + + <li>modify makefile to install the 16x16 xpm files (report by + Harald Dunkel).</li> + + <li>update test-package to reflect resolution of Debian + #906901.</li> + + <li>change default of <code>showMissingGlyphs</code> to + <em>True</em>.</li> + + <li>improve handling of double-sized characters when those + happen to be missing from the bitmap font and/or are + fullwidth.</li> + + <li>pointer/overflow fixes (reported by David Leadbeater): + <ul> + <li>improve limit-checks for control-sequence numeric + parameters in SIXEL graphics.</li> + + <li>add null-pointer checks in <tt>WriteNow</tt> macro to + handle a case where <tt>SS2</tt> or <tt>SS3</tt> might be + in effect while processing a combining character.</li> + + <li>disallow ReGIS reporting for character-set names + containing characters other than alphanumerics or + underscore.</li> + + <li>implement TrueType fallback font for double-sized + characters, including Unicode fullwidth. Also add + <tt>limitFontHeight</tt> to provide for configuring the + distinction between slightly-oversized glyphs and + double-sized glyphs.</li> + </ul> + </li> + + <li>configure script improvements: + <ul> + <li>check for <tt>nfsd_t</tt></li> + </ul> + </li> + + <li>fix a typo in the underline cursor thickness derivation + (patch by Jan Engelhardt).</li> + </ul> + + <h1><a name="xterm_379" id="xterm_379">Patch #379 - + 2023/02/15</a></h1> + + <ul> + <li>improve text-cursor (patch by Jan Engelhardt): + <ul> + <li>allow selecting <tt>CURSOR_BAR</tt> mode from + command-line/Xresources.</li> + + <li>draw cursor using filled rectangle instead of rectangle + outline to permit thicker underlines/bars.</li> + + <li>scale up cursor relative to font size.</li> + </ul> + </li> + + <li>improve readline modes (Fedora #2166860): + <ul> + <li>document readline modes</li> + + <li>change the feature to configure by default</li> + + <li>replace hard-coded SS3 for cursor movement with current + mode</li> + + <li>replace hard-coded erase/lnext characters with current + values</li> + </ul> + </li> + + <li>improve status-line (report by Thomas Wolff): + <ul> + <li><tt>RIS</tt> turns off status-line</li> + + <li>Right-margin (<tt>DECLRMM</tt> and <tt>DECSLRM</tt>) + limits the length of text written/updated in the + status-line.</li> + + <li>Most controls which affect the whole screen are ignored + while updating the status-line.</li> + </ul> + </li> + + <li>modify configure check for <tt>tgetent</tt> to allow for + some special cases of ncurses configuration (report by Satadru + Pramani).</li> + + <li>reduce timeout, improve warning message if resize is run on + a terminal which is not VT100-compatible.</li> + + <li>reduce compiler warnings in configure script.</li> + </ul> + <h1><a name="xterm_378" id="xterm_378">Patch #378 - 2023/01/09</a></h1> diff --git a/app/xterm/xterm.man b/app/xterm/xterm.man index dbc146a28..15b07fe5e 100644 --- a/app/xterm/xterm.man +++ b/app/xterm/xterm.man @@ -1,7 +1,7 @@ '\" t -.\" $XTermId: xterm.man,v 1.874 2023/01/08 19:20:45 tom Exp $ +.\" $XTermId: xterm.man,v 1.904 2024/06/28 23:56:28 tom Exp $ .\" -.\" Copyright 1996-2022,2023 by Thomas E. Dickey +.\" Copyright 1996-2023,2024 by Thomas E. Dickey .\" .\" All Rights Reserved .\" @@ -56,6 +56,7 @@ .\" .\" Updated by Thomas E. Dickey for XFree86, July 1996 - February 2006. .\" +.TH XTERM 1 "__app_date__" "__app_version__" "X Window System" .ds N Xterm .ds n xterm .\" @@ -64,15 +65,19 @@ .ie n .IP \(bu 4 .el .IP \(bu 2 .. -.\" these would be fallbacks for DS/DE, -.\" but groff changed the meaning of the macros. +.ie n .ds CW R +.el \{ +.ie \n(.g .ds CW CR +.el .ds CW CW +.\} +.\" Like EX/EE, but accounting for paragraph spacing. .de NS .ie n .sp .el .sp .5 .ie n .in +4 .el .in +2 .nf -.ft C \" Courier +.ft \*(CW .. .de NE .fi @@ -81,15 +86,22 @@ .el .in -2 .. .\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds AQ \(aq -.el .ds AQ ' -.ie \n(.g .ds `` \(lq -.el .ds `` `` -.ie \n(.g .ds '' \(rq -.el .ds '' '' -.TH XTERM 1 "__app_date__" "__app_version__" "X Window System" +.ie \n(.g \{\ +.ds `` \(lq +.ds '' \(rq +.ds ' \(aq +.\} +.el \{\ +.ie t .ds `` `` +.el .ds `` "" +.ie t .ds '' '' +.el .ds '' "" +.ie t .ds ' \(aq +.el .ds ' ' +.\}", .SH NAME -xterm \- terminal emulator for X +xterm \- +terminal emulator for X .if n .hy 0 .if n .nh .if n .na @@ -461,6 +473,14 @@ That is the \fIvt100\fP \fBinternalBorder\fP resource. The default is \*(``2\*(''. .TP 8 +.B "\-barc" +This option, corresponding to the \fBcursorBar\fP resource, +makes the cursor a bar instead of a box. +.TP 8 +.B "+barc" +This option, corresponding to the \fBcursorBar\fP resource, +makes the cursor a box instead of a bar. +.TP 8 .BI \-baudrate " number" Set the line-speed, used to test the behavior of applications that use the line-speed when optimizing their output to the screen. @@ -552,7 +572,7 @@ It sets the \fBcursorColor\fP resource according to the parameter. .TP 8 .B \-cu This option indicates that \fI\*n\fP should work around a bug in the -.IR more (1) +.BR more (1) program that causes it to incorrectly display lines that are exactly the width of the window and are followed by a line beginning with a tab @@ -564,7 +584,7 @@ cursor motion package. .TP 8 .B +cu This option indicates that \fI\*n\fP should not work around the -.IR more (1) +.BR more (1) bug mentioned above. .TP 8 .B "\-dc" @@ -739,7 +759,7 @@ Turn off the \fBhold\fP resource, i.e., .TP 8 .B \-ie Turn on the \fBptyInitialErase\fP resource, i.e., -use the pseudo-terminal's sense of the \fIstty\fP erase value. +use the pseudo-terminal's sense of the \fBstty\fP(1) erase value. .TP 8 .B +ie Turn off the \fBptyInitialErase\fP resource, i.e., @@ -792,6 +812,16 @@ feature on or off. .B +j This option indicates that \fI\*n\fP should not do jump scrolling. .TP 8 +.B \-jf +When doing jump-scrolling or related indexing, e.g., carriage returns, +\fI\*n\fP will defer flushing screen-updates, to improve speed. +This corresponds to the \fBfastScroll\fP resource. +.TP 8 +.B +jf +When doing jump-scrolling or related indexing, e.g., carriage returns, +\fI\*n\fP will not defer flushing screen-updates, to improve speed. +This corresponds to the \fBfastScroll\fP resource. +.TP 8 .B \-k8 This option sets the \fBallowC1Printable\fP resource. When \fBallowC1Printable\fP is set, \fI\*n\fP overrides the mapping @@ -929,7 +959,7 @@ may get away with something like .NE .IP Finally, \fB\-ls\fP is not completely ignored, -because \fI\*n\ \-ls\ \-e\fP does write a \fI/etc/wtmp\fP entry +because \fI\*n\ \-ls\ \-e\fP does write a \fI__wtmp_name__\fP entry (if configured to do so), whereas \fI\*n\ \-e\fP does not. .TP 8 @@ -1209,8 +1239,8 @@ The \fIterm_id\fP argument specifies the terminal ID to use. .TP 8 .BI \-tm " string" This option specifies a series of terminal setting keywords followed by the -characters that should be bound to those functions, similar to the \fIstty\fP -program. +characters that should be bound to those functions, +similar to the \fBstty\fP(1) program. The keywords and their values are described in detail in the \fBttyModes\fP resource. .TP 8 @@ -1249,10 +1279,12 @@ when your operating system does not support locale. This option resets the \fButf8\fP resource. .TP 8 .B "\-uc" -This option makes the cursor underlined instead of a box. +This option, corresponding to the \fBcursorUnderline\fP resource, +makes the cursor underlined instead of a box. .TP 8 .B "+uc" -This option makes the cursor a box instead of underlined. +This option m, corresponding to the \fBcursorUnderline\fP resource, +akes the cursor a box instead of underlined. .TP 8 .B "\-ulc" This option disables the display of characters with underline attribute as @@ -1274,11 +1306,11 @@ italics rather than with underlining. .TP 8 .B \-ut This option indicates that \fI\*n\fP should not write a record into -the system \fIutmp\fP log file. +the system \fI__utmp_name__\fP log file. .TP 8 .B +ut This option indicates that \fI\*n\fP should write a record into -the system \fIutmp\fP log file. +the system \fI__utmp_name__\fP log file. .TP 8 .B \-vb This option indicates that a visual bell is preferred over an audible one. @@ -1359,8 +1391,7 @@ which it did not open for its own use. It is possible (though probably not portable) to have an application which passes an open file descriptor down to \fI\*n\fP past the initialization or the \fB\-S\fP option to a process running in the \fI\*n\fP. -.SS Old Options -.PP +.SS "Old Options" The following command line arguments are provided for compatibility with older versions. They may not be supported in the next release as the @@ -1398,8 +1429,7 @@ It is equivalent to This option specifies the width in pixels of the border surrounding the window. It is equivalent to \fB\-borderwidth\fP or \fB\-bw\fP. . -.SS X Toolkit Options -.PP +.SS "X Toolkit Options" The following standard \fIX Toolkit\fP command line arguments are commonly used with \fI\*n\fP: .TP 8 @@ -1538,7 +1568,7 @@ parsed and used when needed. .PP Application specific resources (e.g., \*(``\fB__default_class__.\fINAME\fR\*('') follow: -.SS Application Resources +.SS "Application Resources" .TP 8 .B "backarrowKeyIsErase\fP (class\fB BackarrowKeyIsErase\fP)" Tie the VT\fIxxx\fP \fBbackarrowKey\fP and \fBptyInitialErase\fP resources @@ -1908,8 +1938,8 @@ assigns buttons 4 and 5 with different modifiers to the .TP 8 .B ptyHandshake\fP (class\fB PtyHandshake\fP) If \*(``true\*('', \fI\*n\fP will perform handshaking during initialization -to ensure that the parent and child processes update the \fIutmp\fP -and \fIstty\fP state. +to ensure that the parent and child processes update the \fI__utmp_name__\fP +and \fBstty\fP(1) state. .IP See also \fBwaitForMap\fP which waits for the pseudo-terminal's notion of the screen size, @@ -2120,7 +2150,7 @@ Use \fB\\034\fP to represent \fB^\\\fP, since a literal backslash in an X resource escapes the next character. .IP This is very useful for overriding -the default terminal settings without having to run \fIstty\fP every time +the default terminal settings without having to run \fBstty\fP(1) every time an \fI\*n\fP is started. Note, however, that the \fIstty\fP program on a given host may use different keywords; \fI\*n\fR's table is built in. @@ -2141,13 +2171,13 @@ The default is \*(``false\*(''. .B "utmpDisplayId\fP (class\fB UtmpDisplayId\fP)" Specifies whether or not \fI\*n\fP should try to record the display identifier (display number and screen number) as well as the hostname in -the system \fIutmp\fP log file. +the system \fI__utmp_name__\fP log file. The default is \*(``true\*(''. .TP 8 .B "utmpInhibit\fP (class\fB UtmpInhibit\fP)" Specifies whether or not \fI\*n\fP should try to record the user's terminal in -the system \fIutmp\fP log file. +the system \fI__utmp_name__\fP log file. If true, \fI\*n\fP will not try. The default is \*(``false\*(''. .TP 8 @@ -2194,8 +2224,7 @@ then \fI\*n\fP inserts the icon title at that point rather than prepending the string to the icon title. (Only the first \*(``%s\*('' is used). .\" -.SS VT100 Widget Resources -.PP +.SS "VT100 Widget Resources" The following resources are specified as part of the \fIvt100\fP widget (class \fIVT100\fP). They are specified by patterns such as @@ -2233,7 +2262,7 @@ default (2) \fI\*N\fP checks at startup, and shows an active icon only for window managers which it can identify and which are known to support the feature. These are \fIfvwm\fP (full support), and \fIwindow maker\fP (limited). -A few other windows managers (such as \fItwm\fP and \fIctwm\fP) +A few other window managers (such as \fItwm\fP and \fIctwm\fP) support active icons, but do not support the extensions which allow \fI\*n\fP to identify the window manager. @@ -2952,6 +2981,11 @@ should be worked around. See the \fB\-cu\fP option for details. The default is \*(``false\*(''. .TP 8 +.B "cursorBar\fP (class\fB CursorBar\fP)" +Specifies whether to make the cursor a left-bar or a box, +unless the \fBcursorUnderline\fP resource is set. +The default is \*(``false\*(''. +.TP 8 .B "cursorBlink\fP (class\fB CursorBlink\fP)" Specifies whether to make the cursor blink. \fI\*N\fP accepts either a keyword (ignoring case) @@ -3029,6 +3063,7 @@ The default is \*(``600\*(''. .TP 8 .B "cursorUnderLine\fP (class\fB CursorUnderLine\fP)" Specifies whether to make the cursor underlined or a box. +If unset (false), the \fBcursorBar\fP resource may set the cursor shape. The default is \*(``false\*(''. .TP 8 .B "cutNewline\fP (class\fB CutNewline\fP)" @@ -3216,7 +3251,7 @@ The resource value is a comma-separated list of names. \fI\*N\fP ignores capitalization. The default value is .NS -BS,DEL,ENQ,EOT,ESC,NUL +BS,DEL,ENQ,EOT,ESC,NUL,STTY .NE .IP The names are listed below: @@ -3235,6 +3270,9 @@ ASCII delete .TP 5 NL ASCII line-feed, i.e., \*(``newline\*('' is the same as LF. +.TP 5 +STTY +special characters which are set with \fBstty\fP(1). .RE .TP 8 .B "disallowedTcapOps\fP (class\fB DisallowedTcapOps\fP)" @@ -3590,7 +3628,15 @@ Modifies the effect of jump scroll (\fBjumpScroll\fP) by suppressing screen refreshes for the special case when output to the screen has completely shifted the contents off-screen. -For instance, \fIcat\fP'ing a large file to the screen does this. +Likewise, screen refreshes for related actions, e.g., carriage returns, +are suppressed. +.IP +For instance, \fIcat\fP'ing a large file to the screen normally +results in a large number of screen refreshes. +By suppressing the corresponding refreshes, +scrolling speed improves. +.IP +The default is \*(``true\*(''. .TP 8 .B "font\fP (class\fB Font\fP)" Specifies the name of the normal font. @@ -3921,6 +3967,11 @@ Specifies the font for the miniature active icon window, if this feature is compiled into \fI\*n\fR. The default is \*(``nil2\*(''. .TP 8 +.B "incrementalGraphics\fP (class\fB IncrementalGraphics\fP)" +When displaying SIXEL graphics, +refresh the screen after processing each cell. +The default is \*(``false\*(''. +.TP 8 .B "indicatorFormat\fP (class\fB IndicatorFormat\fP)" When displaying the status line using the \fIindicator\fP mode (i.e., selecting DECSSDT line type 1), @@ -4001,6 +4052,13 @@ to the standard output. .IP Set this to \*(``0\*('' to disable fallbacks entirely. .TP 8 +.B "limitFontHeight\fP (class\fB LimitFontHeight\fP)" +When scaling a TrueType font to provide the parts for a double-high +character, \fI\*n\fP compares the scaled font with the original +to ensure that it is taller. +.IP +The default is \*(``10\*('' (percent). +.TP 8 .B "limitFontWidth\fP (class\fB LimitFontWidth\fP)" When looking for fallback fonts, \fI\*n\fP checks to see that the the character to be displayed is the same width as the primary font. @@ -4010,6 +4068,9 @@ If a character extends outside the font's bounding box, This resource controls the amount by which the character can extend outside its bounding box before \fI\*n\fP looks further for a better font. .IP +This resource is also used in scaling TrueType fonts for double-wide characters, +like \fBlimitFontHeight\fP for double-wide characters. +.IP The default is \*(``10\*('' (percent). .TP 8 .B "limitResize\fP (class\fB LimitResize\fP)" @@ -4163,6 +4224,34 @@ r r. 800x480 \fIother\fP .TE .TP 8 +.B "maxStringParse\fP (class\fB MaxStringParse\fP)" +\fI\*N\fP's state parser recognizes +several types of control strings which can contain text, e.g., +.sp +.RS +\fBAPC\fP (Application Program Command), +.br +\fBDCS\fP (Device Control String), +.br +\fBOSC\fP (Operating System Command), +.br +\fBPM\fP (Privacy Message), and +.br +\fBSOS\fP (Start of String), +.RE +.IP +\fI\*N\fP reads these strings, +accumulating them into a buffer until they are properly terminated. +At that point, \fI\*n\fP interprets the strings. +If they happen to be \fBDCS\fP commands to draw ReGIS images, +these strings may be large, in the hundreds of kilobytes. +A few \fBOSC\fP commands may be as large as 10 kilobytes. +.IP +This resource sets a limit on the size of the buffer used for these strings. +The default is \*(``__strings_max__\*('' based on the features which are +configured for \fI\*n\fP. +Control strings which require larger buffer size are ignored. +.TP 8 .B "metaSendsEscape\fP (class\fB MetaSendsEscape\fP)" Tells \fI\*n\fP what to do with input-characters modified by \fIMeta\fP: .RS @@ -4288,7 +4377,6 @@ adds twice the value given by the \fBctrlFKeys\fP resource. Control/Shift adds three times the value given by the \fBctrlFKeys\fP resource. .RE -.IP .TP 8 .B "modifyKeyboard\fP (class\fB ModifyKeyboard\fP)" Normally \fI\*n\fP makes a special case regarding @@ -4664,6 +4752,15 @@ The default is \*(``true\*(''. Tells \fI\*n\fP which types of preedit (preconversion) string to display. The default is \*(``OverTheSpot,Root\*(''. .TP 8 +.B "preferLatin1\fP (class\fB PreferLatin1\fP)" +Tells \fI\*n\fP whether to use DEC Supplemental Graphic, +or ISO Latin-1 for +the user-preferred supplemental set (UPSS) +when initializing character sets. +The former is the documented setting for hardware terminals, +but the latter is expected by most users. +The default is \*(``true\*('' (ISO Latin-1). +.TP 8 .B "printAttributes\fP (class\fB PrintAttributes\fP)" Specifies whether to print graphic attributes along with the text. A real DEC VT\fIxxx\fP terminal will print the underline, highlighting codes @@ -5130,7 +5227,7 @@ otherwise the default is \*(``false\*(''. .B "showMissingGlyphs\fP (class\fB ShowMissingGlyphs\fP)" Tells \fI\*n\fP whether to display a box outlining places where a character has been used that the font does not represent. -The default is \*(``false\*(''. +The default is \*(``true\*(''. .TP 8 .B "showWrapMarks\fP (class\fB ShowWrapMarks\fP)" For debugging \fI\*n\fP and applications that may manipulate the @@ -5548,8 +5645,7 @@ This matches every font, the X library automatically chooses fonts with proper charsets. The \fBximFont\fP resource is provided to override this default font setting. .\" -.SS Tek4014 Widget Resources -.PP +.SS "Tek4014 Widget Resources" The following resources are specified as part of the \fItek4014\fP widget (class \fITek4014\fP). These are specified by patterns @@ -5587,8 +5683,7 @@ The default is \*(``large\*(''. .B "width\fP (class\fB Width\fP)" Specifies the width of the Tektronix window in pixels. .\" -.SS Menu Resources -.PP +.SS "Menu Resources" The resources that may be specified for the various menus are described in the documentation for the \fIAthena\fP \fBSimpleMenu\fP widget. The name and classes of the entries in each of the menus are listed below. @@ -5910,8 +6005,7 @@ This entry invokes the \fBset\-terminal\-type(\fIvt\fB)\fR action. .B "tekhide\fP (class\fB SmeBSB\fP)" This entry invokes the \fBset\-visibility(\fItek,toggle\fB)\fR action. .\" -.SS Scrollbar Resources -.PP +.SS "Scrollbar Resources" The following resources are useful when specified for the \fIAthena\fP Scrollbar widget: .TP 8 @@ -5940,7 +6034,6 @@ using the \fIthickness\fP value if the \fIwidth\fP is zero. . .SH "POINTER USAGE" . -.PP Once the VT\fIxxx\fP window is created, \fI\*n\fP allows you to select text and copy it within the same or other windows using the \fIpointer\fP or the keyboard. @@ -5964,7 +6057,6 @@ See \fBActions\fP for a complete list, and \fBDefault Key Bindings\fP for the built-in set of \fBtranslations\fP resources. . .SS "Selection Functions" -.PP By default, the selection functions are invoked when the pointer buttons are used with no modifiers, @@ -6065,7 +6157,6 @@ The terminal emulator and other text programs should be treating it as if it were a text file, i.e., the text is delimited by new lines. . .SS "Scrolling" -.PP The scroll region displays the position and amount of text currently showing in the window (highlighted) relative to the amount of text actually saved. As more text is saved (up to the maximum), the size of the highlighted area @@ -6084,7 +6175,6 @@ Clicking button two moves the display to a position in the saved text that corresponds to the pointer's position in the scrollbar. . .SS "Tektronix Pointer" -.PP Unlike the VT\fIxxx\fP window, the Tektronix window does not allow the copying of text. It does allow Tektronix GIN mode, and in this mode @@ -6103,7 +6193,7 @@ see for details). . . -.SH SELECT/PASTE +.SH "SELECT/PASTE" X clients provide select and paste support by responding to requests conveyed by the X server. The X server holds data in \*(``atoms\*('' which correspond @@ -6150,7 +6240,6 @@ But cut-buffers handle only ISO-8859-1 data (officially \- some clients ignore the rules). . .SS CLIPBOARD -.PP When configured to use the clipboard (using the \fBselectToClipboard\fP resource), the problem with persistence of ownership is bypassed. @@ -6178,7 +6267,6 @@ in the usual way (retaining the data to be able to return it). The request may be generated by the clipboard client described below. .RE .SS SELECT -.PP However, many applications use \fBCLIPBOARD\fP in imitation of other windowing systems. The \fBselectToClipboard\fP resource (and corresponding menu entry @@ -6190,7 +6278,6 @@ Without using this feature, one can use workarounds such as the \fIxclip\fP program to show the contents of the X clipboard within an \fI\*n\fP window. .SS SECONDARY -.PP This is used less often than \fBPRIMARY\fP or \fBCLIPBOARD\fP. According to the ICCCM, it is used .bP @@ -6200,7 +6287,7 @@ As the second argument to commands taking two arguments As a means of obtaining data when there is a primary selection and the user does not want to disturb it . -.SS Selection Targets +.SS "Selection Targets" The different types of data which are passed depend on what the receiving client asks for. These are termed \fIselection targets\fP. @@ -6258,8 +6345,7 @@ u,i,s .fi .RE . -.SS Mouse Protocol -.PP +.SS "Mouse Protocol" Applications can send escape sequences to \fI\*n\fP to cause it to send escape sequences back to the computer when you press a pointer button, or even (depending on which escape sequence) send escape sequences back @@ -6282,7 +6368,6 @@ though not eliminating changes to the selected text. . .SH MENUS . -.PP \fI\*N\fP has four menus, named .IR mainMenu , .IR vtMenu , @@ -6303,7 +6388,6 @@ name in parenthesis. . .\" ************************************************************************ .SS "Main Options" -.PP The \fI\*n\fP \fImainMenu\fP pops up when the \*(``control\*('' key and pointer button one are pressed in a window. This menu contains items that apply to @@ -6433,7 +6517,7 @@ when the screen dump was performed The \fBdump\-html\fP action can also be triggered using the Media Copy control sequence CSI 1 0 i, for example from a shell script with .NS -printf \*(AQ\\033[10i\*(AQ +printf \*'\\033[10i\*' .NE .sp Only the UTF-8 encoding is supported. @@ -6471,7 +6555,7 @@ when the screen dump was performed The \fBdump\-svg\fP action can also be triggered using the Media Copy control sequence CSI 1 1 i, for example from a shell script with .NS -printf \*(AQ\\033[11i\*(AQ +printf \*'\\033[11i\*' .NE .sp Only the UTF-8 encoding is supported. @@ -6552,11 +6636,9 @@ Stop processing X events except to support the \fB\-hold\fP option, and then send a SIGHUP signal to the process group of the process running under \fI\*n\fP (usually the shell). .RE -.PP . .\" ************************************************************************ .SS "VT Options" -.PP The \fI\*n\fP \fIvtMenu\fP sets various modes in the VT\fIxxx\fP emulation, and is popped up when the \*(``control\*('' key and pointer button two @@ -6765,25 +6847,128 @@ VT\fIxxx\fP Commands: .RS .TP .B Do Soft Reset\fP (resource \fBsoftreset\fP) -Reset scroll regions. +This corresponds to the VT220 DECSTR control sequence. +A soft reset leaves the contents of the window intact, +but resets modes which affect subsequent updates: +.RS +.PP +Soft reset differs from full reset in a minor detail: +.bP +Set the saved cursor position to the upper-left corner of the window. +.bP +Exit from the status-line without erasing it. +.PP +Both soft/full resets do the following: +.bP +Make the cursor visible, with shape reset according to the +\fBcursorUnderLine\fR and +\fBcursorBar\fR resources. +.bP +Enable or disable the cursor-blinking state +according to the \fBcursorBlink\fR resource, +and set the \fIEnable Blinking Cursor\fP menu checkmark to match. +.bP +Reset video attributes, e.g., bold, italic, underline, blink. +.bP +Reset the ANSI color mode to the \fI\*n\fP default foreground and background. +.bP +Reset the 256-color palette to its initial state. +.bP +Reset the selected character set, e.g., ASCII, alternate character set. +The UTF-8 modes are not changed. +.bP +Reset ECMA-48 KAM. +.bP +Reset DECCKM and DECKPAM per resources +.BR appcursorDefault " and" +.BR appkeypadDefault . +.bP +Reset the key-modifier modes to the values set by resources +.BR formatOtherKeys , +.BR modifyCursorKeys , +.BR modifyFunctionKeys , +.BR modifyKeyboard ", and" +.BR modifyOtherKeys . +.bP +Reset origin mode (DECOM). +.bP +Reset all margins (i.e., top/bottom and left/right). This can be convenient when some program has left the scroll regions set incorrectly (often a problem when using VMS or TOPS-20). -This corresponds to the VT220 DECSTR control sequence. +.bP +Set autowrap and reverse wrapping according to the resource values +.BR autoWrap " and" +.BR reverseWrap . +.bP +Reset checksum extension to the \fBchecksumExtension\fP resource. +.RE . .TP .B Do Full Reset\fP (resource \fBhardreset\fP) -The full reset entry will clear the screen, reset tabs to every -eight columns, and reset the terminal modes (such as wrap and smooth scroll) -to their initial states just after -\fI\*n\fP has finished processing the command line options. -This corresponds to the VT102 RIS control sequence, -with a few obvious differences. -For example, your session is not disconnected as a real VT102 would do. +A full reset does this in addition to a soft reset: +.RS +.bP +Clear the window. +.bP +Reset tab stops to every eight columns. +.bP +Reset the screen to match the \fBreverseVideo\fP resource. +.bP +Resize the screen to 80 columns if 132-column mode was initially enabled +with the \fBc132\fP resource. +.bP +Reset scrolling (jump versus smooth) per the \fBjumpScroll\fP resource. +.bP +Enable linefeed mode (ECMA-48 LNM) and send/receive mode (ECMA-48 SRM). +.bP +Reset DEC user-defined keys (DECUDK). +.bP +Disable application mode for cursor- and keypad-keys (DECCKM, DECKPAM). +.bP +Reset menu entry \fI8-bit Controls\fR, per resource \fBeightBitControl\fP. +.bP +Reset interpretation of the backarrow key, per initial resource settings. +.bP +Set the keyboard type according to the resources +.BR keyboardType , +.BR hpFunctionKeys , +.BR scoFunctionKeys , +.BR sunFunctionKeys , +.BR tcapFunctionKeys , +.BR oldXtermFKeys " and" +.BR sunKeyboard . +.bP +Turn mouse tracking off. +.bP +Reset title and pointer modes +per resources \fBtitleModes\fP and \fBpointerMode\fP. +.bP +Reset the readline and bracketed paste modes. +.bP +Discard all SIXEL and ReGIS graphics data from memory. +.bP +Reset \fBsixelScrolling\fP and \fBprivateColorRegisters\fP from +initial resource values. +.bP +Set DECSDM if the \fBsixelScrolling\fP resource is true. +Otherwise, reset DECSDM. +.PP +A full reset does this, unlike a soft reset: +.bP +Move the cursor to the upper-left corner of the window, +and then save that position. +.bP +Hide the status-line, setting its display-type to \*(``none\*(''. +.RE . .TP .B Reset and Clear Saved Lines\fP (resource \fBclearsavedlines\fP) Perform a full reset, and also clear the saved lines. +.IP +This corresponds to the VT102 RIS control sequence, +with a few obvious differences. +For example, your session is not disconnected as a real VT102 would do. .RE . .TP @@ -6826,10 +7011,8 @@ shows the normal screen. Note that the normal screen may have saved lines; the alternate screen does not. .RE -.PP . .SS "VT Fonts" -.PP The \fI\*n\fP \fIfontMenu\fP pops up when the \*(``control\*('' key and pointer button three are pressed in a window. It sets the font used in the VT\fIxxx\fP window, @@ -6972,7 +7155,6 @@ This corresponds to the \fBallowWindowOps\fP resource. .RE . .SS "Tek Options" -.PP The \fI\*n\fP \fItekMenu\fP sets various modes in the Tektronix emulation, and is popped up when the \*(``control\*('' key and pointer button two @@ -7027,7 +7209,6 @@ Windows: . .SH SECURITY . -.PP X environments differ in their security consciousness. .bP Most servers, @@ -7148,7 +7329,7 @@ static int charClass[256] = { 1, 1, 1, 1, 1, 1, 1, 1, /* CAN EM SUB ESC FS GS RS US */ 1, 1, 1, 1, 1, 1, 1, 1, -/* SP ! " # $ % & \*(AQ */ +/* SP ! " # $ % & \*' */ .\" " <- for emacs autocolor to work well :-) 32, 33, 34, 35, 36, 37, 38, 39, /* ( ) * + , \- . / */ @@ -7185,25 +7366,25 @@ static int charClass[256] = { 160, 161, 162, 163, 164, 165, 166, 167, /* .. c0 ip << _ R0 \- */ 168, 169, 170, 171, 172, 173, 174, 175, -/* o +\- 2 3 \*(AQ u q| . */ +/* o +\- 2 3 \*' u q| . */ 176, 177, 178, 179, 180, 181, 182, 183, /* , 1 2 >> 1/4 1/2 3/4 ? */ 184, 185, 186, 187, 188, 189, 190, 191, -/* A` A\*(AQ A^ A~ A: Ao AE C, */ +/* A` A\*' A^ A~ A: Ao AE C, */ 48, 48, 48, 48, 48, 48, 48, 48, -/* E` E\*(AQ E^ E: I` I\*(AQ I^ I: */ +/* E` E\*' E^ E: I` I\*' I^ I: */ 48, 48, 48, 48, 48, 48, 48, 48, -/* D\- N~ O` O\*(AQ O^ O~ O: X */ +/* D\- N~ O` O\*' O^ O~ O: X */ 48, 48, 48, 48, 48, 48, 48, 215, -/* O/ U` U\*(AQ U^ U: Y\*(AQ P B */ +/* O/ U` U\*' U^ U: Y\*' P B */ 48, 48, 48, 48, 48, 48, 48, 48, -/* a` a\*(AQ a^ a~ a: ao ae c, */ +/* a` a\*' a^ a~ a: ao ae c, */ 48, 48, 48, 48, 48, 48, 48, 48, -/* e` e\*(AQ e^ e: i` i\*(AQ i^ i: */ +/* e` e\*' e^ e: i` i\*' i^ i: */ 48, 48, 48, 48, 48, 48, 48, 48, -/* d n~ o` o\*(AQ o^ o~ o: \-: */ +/* d n~ o` o\*' o^ o~ o: \-: */ 48, 48, 48, 48, 48, 48, 48, 247, -/* o/ u` u\*(AQ u^ u: y\*(AQ P y: */ +/* o/ u` u\*' u^ u: y\*' P y: */ 48, 48, 48, 48, 48, 48, 48, 48}; .NE .IP @@ -7215,7 +7396,7 @@ for cutting and pasting electronic mailing addresses and filenames. . . .SH KEY BINDINGS -.PP +. It is possible to rebind keys (or sequences of keys) to arbitrary strings for input, by changing the \fBtranslations\fP resources for the vt100 or tek4014 widgets. @@ -7384,7 +7565,7 @@ to view a file whose name is selected while holding the shift key down. The new process is started when the mouse button is released: .NS *VT100*translations: #override Shift \\\& - <Btn1Up>:\fBexec\-formatted\fP("xterm \-e view \*(AQ%t\*(AQ", \fBSELECT\fP) + <Btn1Up>:\fBexec\-formatted\fP("xterm \-e view \*'%t\*'", \fBSELECT\fP) .NE .TP 8 .B "exec\-selectable(\fIformat\fP, \fIonClicks\fP)" @@ -8023,8 +8204,7 @@ The Tektronix window also has the following action: .B "gin\-press(\fIl/L/m/M/r/R\fP)" This action sends the indicated graphics input code. . -.SS Default Key Bindings -.PP +.SS "Default Key Bindings" The default bindings in the VT\fIxxx\fP window use the \fBSELECT\fP token, which is set by the \fBselectToClipboard\fP resource. These are for the \fIvt100\fP widget: @@ -8097,8 +8277,7 @@ These are for the \fItek4014\fP widget: Shift ~Meta<Btn3Down>: \fBgin\-press\fP(R) \\n\\\& ~Meta<Btn3Down>: \fBgin\-press\fP(r) .NE -.SS Custom Key Bindings -.PP +.SS "Custom Key Bindings" You can modify the \fBtranslations\fP resource by overriding parts of it, or merging your resources with it. .PP @@ -8191,8 +8370,7 @@ keys for entering commonly-typed words: <Key>F20: \fBstring\fP("print ") \\n\\\& \fBinsert\-selection\fP(\fBPRIMARY\fP, \fBCUT_BUFFER0\fP) .NE -.SS Default Scrollbar Bindings -.PP +.SS "Default Scrollbar Bindings" Key bindings are normally associated with the \fIvt100\fP or \fItek4014\fP widgets which act as terminal emulators. \fI\*N\fP's scrollbar (and toolbar if it is configured) are separate widgets. @@ -8284,7 +8462,6 @@ DEC Screen Alignment Test (DECALN) is this three-character sequence: .NS \fIESC\fP # 8 .NE -.PP .bP Some sequences fit into the standard format, but are not listed in the standard. @@ -8304,8 +8481,7 @@ Most of these operations are standardized, from either the DEC or Tektronix terminals, or from more widely used standards such as ISO-6429. .PP A few examples of usage are given in this section. -.SS Window and Icon Titles -.PP +.SS "Window and Icon Titles" Some scripts use \fBecho\fP with options \fB\-e\fP and \fB\-n\fP to tell the shell to interpret the string \*(``\\e\*('' as the \fIescape\fP character and @@ -8316,10 +8492,10 @@ Instead, use \fBprintf\fP (POSIX). For example, to set the \fIwindow title\fP to \*(``Hello world!\*('', you could use one of these commands in a script: .NS -printf \*(AQ\\033]2;Hello world!\\033\\\\\*(AQ -printf \*(AQ\\033]2;Hello world!\\007\*(AQ -printf \*(AQ\\033]2;%s\\033\\\\\*(AQ "Hello world!" -printf \*(AQ\\033]2;%s\\007\*(AQ "Hello world!" +printf \*'\\033]2;Hello world!\\033\\\\\*' +printf \*'\\033]2;Hello world!\\007\*' +printf \*'\\033]2;%s\\033\\\\\*' "Hello world!" +printf \*'\\033]2;%s\\007\*' "Hello world!" .NE .PP The \fBprintf\fP command interprets the octal value \*(``\\033\*('' for @@ -8329,10 +8505,10 @@ newline from the output. Some programs (such as \fBscreen\fP(1)) set both window- and icon-titles at the same time, using a slightly different control sequence: .NS -printf \*(AQ\\033]0;Hello world!\\033\\\\\*(AQ -printf \*(AQ\\033]0;Hello world!\\007\*(AQ -printf \*(AQ\\033]0;%s\\033\\\\\*(AQ "Hello world!" -printf \*(AQ\\033]0;%s\\007\*(AQ "Hello world!" +printf \*'\\033]0;Hello world!\\033\\\\\*' +printf \*'\\033]0;Hello world!\\007\*' +printf \*'\\033]0;%s\\033\\\\\*' "Hello world!" +printf \*'\\033]0;%s\\007\*' "Hello world!" .NE .PP The difference is the \fIparameter\fP \*(``0\*('' in each command. @@ -8341,14 +8517,13 @@ Some will make a distinction and allow you to set just the icon title. You can tell \fI\*n\fP to ask for this with a different parameter in the control sequence: .NS -printf \*(AQ\\033]1;Hello world!\\033\\\\\*(AQ -printf \*(AQ\\033]1;Hello world!\\007\*(AQ -printf \*(AQ\\033]1;%s\\033\\\\\*(AQ "Hello world!" -printf \*(AQ\\033]1;%s\\007\*(AQ "Hello world!" +printf \*'\\033]1;Hello world!\\033\\\\\*' +printf \*'\\033]1;Hello world!\\007\*' +printf \*'\\033]1;%s\\033\\\\\*' "Hello world!" +printf \*'\\033]1;%s\\007\*' "Hello world!" .NE . -.SS Special Keys -.PP +.SS "Special Keys" \fI\*N\fP, like any VT100-compatible terminal emulator, has two modes for the \fIspecial keys\fP (cursor-keys, numeric keypad, and certain function-keys): @@ -8406,8 +8581,7 @@ vi\-up\-line\-or\-history .NE . . -.SS Changing Colors -.PP +.SS "Changing Colors" A few shell programs provide the ability for users to add color and other video attributes to the shell prompt strings. Users can do this by setting \fB$PS1\fP (the primary prompt string). @@ -8447,8 +8621,7 @@ and cannot be easily moved between different user environments. . .SH ENVIRONMENT \fI\*N\fP sets several environment variables. -.SS System Independent -.PP +.SS "System Independent" Some variables are used on every system: .TP 5 .B DISPLAY @@ -8490,9 +8663,8 @@ build \fI\*n\fP, followed by The patch number is also part of the response to a Secondary Device Attributes (DA) control sequence (see \fIXterm Control Sequences\fP). . -.SS System Dependent +.SS "System Dependent" . -.PP Depending on your system configuration, \fI\*n\fP may also set the following: .TP 5 @@ -8508,7 +8680,7 @@ Those are very rare, none newer than the mid 1990s when SVR4 became prevalent. .TP 5 .B HOME .br -when \fI\*n\fP is configured (at build-time) to update utmp. +when \fI\*n\fP is configured (at build-time) to update __utmp_name__. .TP 5 .B LINES the height of the \fI\*n\fP in characters (cf: \*(``stty rows\*(''). @@ -8521,14 +8693,14 @@ to tell the size of the terminal. Those are very rare, none newer than the mid 1990s when SVR4 became prevalent. .TP 5 .B LOGNAME -when \fI\*n\fP is configured (at build-time) to update utmp. +when \fI\*n\fP is configured (at build-time) to update __utmp_name__. .IP Your configuration may have set \fBLOGNAME\fP; \fI\*n\fP does not modify that. If it is unset, \fI\*n\fP will use \fBUSER\fP if it is set. Finally, if neither is set, \fI\*n\fP will use the \fBgetlogin\fP(3) function. .TP 5 .B SHELL -when \fI\*n\fP is configured (at build-time) to update utmp. +when \fI\*n\fP is configured (at build-time) to update __utmp_name__. It is also set if you provide a valid shell name as the optional parameter. .IP \fI\*N\fP sets this to an absolute pathname. @@ -8552,11 +8724,10 @@ screen size. may be defined to a nonstandard location using the configure script. .\" . +.SH "WINDOW PROPERTIES" . -.SH WINDOW PROPERTIES -.PP In the output from \fBxprop\fP(1), there are several properties. -.SS Properties set by X Toolkit +.SS "Properties set by X Toolkit" .TP 5 .B WM_CLASS This shows the \fIinstance name\fP and the X resource \fIclass\fP, @@ -8599,7 +8770,7 @@ WM_LOCALE_NAME(STRING) = "en_US.UTF\-8" This holds the window title, normally at the top of \fI\*n\fP's window. It is set via the \fBtitle\fP resource. Applications can change this using control sequences. -.SS Properties set by Xterm +.SS "Properties set by Xterm" \fIX Toolkit\fP does not manage EWMH properties. \*N does this directly. .TP 5 @@ -8611,7 +8782,7 @@ stores the title string. .TP 5 .B _NET_WM_PID stores the process identifier for \fI\*n\fP's display. -.SS Properties used by Xterm +.SS "Properties used by Xterm" .TP 5 .B _NET_SUPPORTED \*N checks this property on the \fIsupporting window\fP @@ -8636,7 +8807,6 @@ and if so, what type of maximizing: .TP 5 .B _NET_WM_STATE_MAXIMIZED_VERT .RE -.PP . . .SH FILES @@ -8651,10 +8821,10 @@ On systems which have the \fIgetusershell\fP function, \fI\*n\fP will use that function rather than directly reading the file, since the file may not be present if the system uses default settings. .TP 5 -\fI/etc/utmp\fP +\fI__utmp_path__\fP the system log file, which records user logins. .TP 5 -\fI/etc/wtmp\fP +\fI__wtmp_path__\fP the system log file, which records user logins and logouts. .TP 5 .I __apploaddir__/__default_class__ @@ -8677,7 +8847,7 @@ If you do not do this, the directory in which \fI\*n\fP's pixmap icon files are installed. . . -.SH ERROR MESSAGES +.SH "ERROR MESSAGES" Most of the fatal error messages from \fI\*n\fP use the following format: .NS \*n: Error \fIXXX\fP, errno \fIYYY\fP: \fIZZZ\fR @@ -8687,7 +8857,9 @@ The \fIXXX\fP codes (which are used by \fI\*n\fP as its exit-code) are listed below, with a brief explanation. .TP 5 1 -is used for miscellaneous errors, usually accompanied by a specific message, +ERROR_MISC +.br +miscellaneous errors, usually accompanied by a specific message, .TP 11 ERROR_FIONBIO @@ -8887,7 +9059,6 @@ ScrnPointers: malloc/realloc() failed . .SH BUGS . -.PP Large pastes do not work on some systems. This is not a bug in \fI\*n\fP; it is a bug in the pseudo terminal driver of those @@ -8914,6 +9085,28 @@ pick and choose emulator widgets and stick them into a single control widget. .PP There needs to be a dialog box to allow entry of the Tek COPY file name. . +.SH AUTHORS +Far too many people. +.PP +These contributed to the X Consortium: +Loretta Guarino Reid (DEC-UEG-WSL), +Joel McCormack (DEC-UEG-WSL), Terry Weissman (DEC-UEG-WSL), +Edward Moy (Berkeley), Ralph R.\& Swick (MIT-Athena), +Mark Vandevoorde (MIT-Athena), Bob McNamara (DEC-MAD), +Jim Gettys (MIT-Athena), Bob Scheifler (MIT X Consortium), Doug Mink (SAO), +Steve Pitschke (Stellar), Ron Newman (MIT-Athena), Jim Fulton (MIT X +Consortium), Dave Serisky (HP), Jonathan Kamens (MIT-Athena). +.PP +Beginning with XFree86, there were far more identifiable contributors. +The \fITHANKS\fP file in \fI\*n\fP's source lists 243 in June 2022. +Keep in mind these: +Jason Bacon, +Jens Schweikhardt, +Ross Combs, +Stephen P.\& Wall, +David Wexelblat, and +Thomas Dickey (invisible\-island.net). +. . .SH "SEE ALSO" .na @@ -8975,28 +9168,6 @@ https://www.irif.fr/~jch/software/UTF8_STRING/ An Xorg developer removed that part of the documentation in 2004 when incorporating other work from XFree86 into Xorg. The feature is still supported in Xorg, though undocumented as of 2019. -. -.SH AUTHORS -Far too many people. -.PP -These contributed to the X Consortium: -Loretta Guarino Reid (DEC-UEG-WSL), -Joel McCormack (DEC-UEG-WSL), Terry Weissman (DEC-UEG-WSL), -Edward Moy (Berkeley), Ralph R.\& Swick (MIT-Athena), -Mark Vandevoorde (MIT-Athena), Bob McNamara (DEC-MAD), -Jim Gettys (MIT-Athena), Bob Scheifler (MIT X Consortium), Doug Mink (SAO), -Steve Pitschke (Stellar), Ron Newman (MIT-Athena), Jim Fulton (MIT X -Consortium), Dave Serisky (HP), Jonathan Kamens (MIT-Athena). -.PP -Beginning with XFree86, there were far more identifiable contributors. -The \fITHANKS\fP file in \fI\*n\fP's source lists 243 in June 2022. -Keep in mind these: -Jason Bacon, -Jens Schweikhardt, -Ross Combs, -Stephen P.\& Wall, -David Wexelblat, and -Thomas Dickey (invisible\-island.net). .SH OPENBSD SPECIFICS On OpenBSD, the Tektronix 4014 emulation is disabled and the following resources have different default values: diff --git a/app/xterm/xterm_io.h b/app/xterm/xterm_io.h index c7cf8e6ba..ebdc8ca23 100644 --- a/app/xterm/xterm_io.h +++ b/app/xterm/xterm_io.h @@ -1,7 +1,7 @@ -/* $XTermId: xterm_io.h,v 1.67 2020/01/18 18:48:19 tom Exp $ */ +/* $XTermId: xterm_io.h,v 1.69 2024/05/03 23:32:26 tom Exp $ */ /* - * Copyright 2000-2018,2020 by Thomas E. Dickey + * Copyright 2000-2023,2024 by Thomas E. Dickey * * All Rights Reserved * @@ -70,7 +70,7 @@ #endif #endif -#ifdef linux +#ifdef __linux__ #define USE_TERMIOS #define HAVE_POSIX_OPENPT 1 #define HAVE_PTSNAME 1 @@ -99,7 +99,7 @@ #define HAVE_GRANTPT_PTY_ISATTY 1 #endif -#if defined(__GLIBC__) && !(defined(linux) || defined(__GNU__)) +#if defined(__GLIBC__) && !(defined(__linux__) || defined(__GNU__)) #define USE_POSIX_TERMIOS /* GNU/KFreeBSD and GNU/KNetBSD */ #endif @@ -203,7 +203,7 @@ #ifdef Lynx #include <resource.h> -#elif !(defined(SYSV) || defined(linux) || defined(VMS) || (defined(__QNX__)&&!defined(__QNXNTO__))) +#elif !(defined(SYSV) || defined(__linux__) || defined(VMS) || (defined(__QNX__)&&!defined(__QNXNTO__))) #include <sys/resource.h> #endif @@ -225,7 +225,7 @@ #include <sys/filio.h> #endif -#if defined(TIOCSLTC) && ! (defined(linux) || defined(__MVS__) || defined(Lynx) || defined(SVR4)) +#if defined(TIOCSLTC) && ! (defined(__linux__) || defined(__MVS__) || defined(Lynx) || defined(SVR4)) #define HAS_LTCHARS #endif @@ -284,4 +284,18 @@ typedef unsigned short ttySize_t; +#ifdef USE_ANY_SYSV_TERMIO +#define TERMIO_STRUCT struct termio +#define ttySetAttr(fd, datap) ioctl(fd, TCSETA, datap) +#define ttyGetAttr(fd, datap) ioctl(fd, TCGETA, datap) +#define ttyFlush(fd) ioctl(fd, TCFLSH, 1) +#elif defined(USE_POSIX_TERMIOS) +#define TERMIO_STRUCT struct termios +#define ttySetAttr(fd, datap) tcsetattr(fd, TCSANOW, datap) +#define ttyGetAttr(fd, datap) tcgetattr(fd, datap) +#define ttyFlush(fd) tcflush(fd, TCOFLUSH) +#else +#error Neither termio or termios is enabled +#endif /* USE_ANY_SYSV_TERMIO */ + #endif /* included_xterm_io_h */ diff --git a/app/xterm/xtermcap.c b/app/xterm/xtermcap.c index 851f69c27..9cae2e7a4 100644 --- a/app/xterm/xtermcap.c +++ b/app/xterm/xtermcap.c @@ -1,4 +1,4 @@ -/* $XTermId: xtermcap.c,v 1.58 2023/01/02 18:19:19 tom Exp $ */ +/* $XTermId: xtermcap.c,v 1.59 2023/12/25 21:18:03 tom Exp $ */ /* * Copyright 2007-2020,2023 by Thomas E. Dickey @@ -649,6 +649,8 @@ free_termcap(XtermWidget xw) } FreeAndNull(screen->tcap_fkeys); } +#else + (void) xw; #endif TcapFree(); } diff --git a/app/xterm/xtermcfg.h b/app/xterm/xtermcfg.h index a18db09ad..9e126fae9 100644 --- a/app/xterm/xtermcfg.h +++ b/app/xterm/xtermcfg.h @@ -1,7 +1,7 @@ -/* $XTermId: xtermcfg.hin,v 1.225 2022/02/13 13:50:45 tom Exp $ */ +/* $XTermId: xtermcfg.hin,v 1.232 2024/05/17 08:13:42 tom Exp $ */ /* - * Copyright 1997-2021,2022 by Thomas E. Dickey + * Copyright 1997-2023,2024 by Thomas E. Dickey * * All Rights Reserved * @@ -43,7 +43,6 @@ * DEBUG* (any debug-option) * DUMP_* (mostly in the ReGIS/SIXEL code) * HAS_LTCHARS - * HAVE_SYS_PTEM_H * PUCC_PTYD * USE_LOGIN_DASH_P * USE_X11TERM @@ -65,15 +64,18 @@ #define DFT_TERMTYPE "xterm" /* AC_ARG_WITH(default-term-type) */ /* #undef DISABLE_SETGID */ /* CF_ARG_DISABLE(setgid) */ /* #undef DISABLE_SETUID */ /* CF_ARG_DISABLE(setuid) */ +#define HAVE_CLOCK_GETTIME /* CF_FUNC_GETTIME */ #define HAVE_ENDUSERSHELL /* AC_CHECK_FUNCS(endusershell) */ #define HAVE_GETHOSTNAME 1 /* AC_CHECK_FUNCS(gethostname) */ #define HAVE_GETLOGIN 1 /* AC_CHECK_FUNCS(getlogin) */ +#define HAVE_GETTIMEOFDAY /* CF_FUNC_GETTIME */ #define HAVE_GETUSERSHELL /* AC_CHECK_FUNCS(getusershell) */ /* #undef HAVE_GRANTPT */ /* CF_FUNC_GRANTPT */ /* #undef HAVE_GRANTPT_PTY_ISATTY */ /* CF_FUNC_GRANTPT */ #define HAVE_INITGROUPS 1 /* AC_CHECK_FUNCS(initgroups) */ #define HAVE_LANGINFO_CODESET 1 /* AM_LANGINFO_CODESET */ /* #undef HAVE_LASTLOG_H */ /* CF_LASTLOG */ +/* #undef HAVE_LIBUTIL_H */ /* AC_CHECK_HEADERS(libutil.h) */ #define HAVE_LIBXPM /* CF_WITH_XPM */ /* #undef HAVE_LIB_NEXTAW */ /* CF_X_ATHENA(--with-neXtaw) */ /* #undef HAVE_LIB_PCRE */ /* CF_WITH_PCRE */ @@ -84,23 +86,29 @@ /* #undef HAVE_LIB_XAWPLUS */ /* CF_X_ATHENA(--with-XawPlus) */ #define HAVE_LIB_XCURSOR 1 /* AC_CHECK_LIB(Xcursor) */ #define HAVE_MKDTEMP 1 /* AC_CHECK_FUNCS(mkdtemp) */ -#define HAVE_MKSTEMP /* CF_MKSTEMP */ +#define HAVE_MKSTEMP 1 /* CF_MKSTEMP */ /* #undef HAVE_NCURSES_CURSES_H */ /* AC_CHECK_HEADERS(ncurses/curses.h) */ /* #undef HAVE_NCURSES_TERM_H */ /* AC_CHECK_HEADERS(ncurses/term.h) */ -#define HAVE_PATHS_H 1 /* CF_LASTLOG */ +#define HAVE_PATHS_H 1 /* AC_CHECK_HEADERS(paths.h) */ /* #undef HAVE_PCRE2POSIX_H */ /* CF_WITH_PCRE2 */ /* #undef HAVE_PCRE2REGCOMP */ /* CF_WITH_PCRE2 */ /* #undef HAVE_PCREPOSIX_H */ /* CF_WITH_PCRE */ /* #undef HAVE_POSIX_OPENPT */ /* CF_FUNC_GRANTPT */ #define HAVE_POSIX_SAVED_IDS 1 /* CF_POSIX_SAVED_IDS */ /* #undef HAVE_PTSNAME */ /* CF_FUNC_GRANTPT */ +/* #undef HAVE_PTY_H */ /* AC_CHECK_HEADERS(pty.h) */ #define HAVE_PUTENV 1 /* AC_CHECK_FUNCS(putenv) */ #define HAVE_SCHED_YIELD 1 /* AC_CHECK_FUNCS(sched_yield) */ +#define HAVE_SETITIMER 1 /* CF_SETITIMER */ #define HAVE_SETPGID /* AC_CHECK_FUNCS(setpgid) */ +#define HAVE_SETSID 1 /* AC_CHECK_FUNCS(setsid) */ #define HAVE_STDINT_H 1 /* AC_PROG_CC_STDC */ #define HAVE_STDLIB_H 1 /* AC_CHECK_HEADERS(stdlib.h) */ #undef HAVE_STDNORETURN_H /* CF_C11_NORETURN */ #define HAVE_STRFTIME 1 /* AC_CHECK_FUNCS(strftime) */ +/* #undef HAVE_STROPTS_H */ /* AC_CHECK_HEADERS(stropts.h) */ +#define HAVE_SYS_PARAM_H 1 /* AC_CHECK_HEADERS(sys/param.h) */ +/* #undef HAVE_SYS_PTEM_H */ /* AC_CHECK_HEADERS(sys/ptem.h) */ /* #undef HAVE_SYS_TIME_H */ /* AC_HEADER_TIME */ #define HAVE_SYS_TTYDEFAULTS_H 1 /* AC_CHECK_HEADERS(sys/ttydefaults.h) */ #define HAVE_SYS_WAIT_H 1 /* AC_HEADER_SYS_WAIT */ @@ -113,6 +121,7 @@ #define HAVE_UNISTD_H 1 /* AC_CHECK_HEADERS(unistd.h) */ #define HAVE_UNSETENV /* AC_CHECK_FUNCS(unsetenv) */ #define HAVE_USE_EXTENDED_NAMES 1 /* AC_CHECK_FUNCS(use_extended_names) */ +#define HAVE_UTIL_H /* AC_CHECK_HEADERS(util.h) */ #define HAVE_UTMP 1 /* CF_UTMP */ #define HAVE_UTMP_UT_HOST 1 /* CF_UTMP_UT_HOST */ /* #undef HAVE_UTMP_UT_SESSION */ /* CF_UTMP_UT_SESSION */ @@ -222,6 +231,7 @@ /* #undef cc_t */ /* CF_TYPE_CC_T */ /* #undef gid_t */ /* AC_TYPE_UID_T */ /* #undef mode_t */ /* AC_TYPE_MODE_T */ +/* +#undef nfds_t */ /* CF_TYPE_NFDS_T */ /* #undef off_t */ /* AC_TYPE_OFF_T */ /* #undef pid_t */ /* AC_TYPE_PID_T */ /* #undef time_t */ /* AC_CHECK_TYPE(time_t, long) */ diff --git a/app/xterm/xtermcfg.hin b/app/xterm/xtermcfg.hin index d9344ecf8..192f3beb2 100644 --- a/app/xterm/xtermcfg.hin +++ b/app/xterm/xtermcfg.hin @@ -1,7 +1,7 @@ -/* $XTermId: xtermcfg.hin,v 1.227 2022/09/11 19:26:01 tom Exp $ */ +/* $XTermId: xtermcfg.hin,v 1.233 2024/07/05 23:37:42 tom Exp $ */ /* - * Copyright 1997-2021,2022 by Thomas E. Dickey + * Copyright 1997-2023,2024 by Thomas E. Dickey * * All Rights Reserved * @@ -43,7 +43,6 @@ * DEBUG* (any debug-option) * DUMP_* (mostly in the ReGIS/SIXEL code) * HAS_LTCHARS - * HAVE_SYS_PTEM_H * PUCC_PTYD * USE_LOGIN_DASH_P * USE_X11TERM @@ -65,15 +64,18 @@ #undef DFT_TERMTYPE /* AC_ARG_WITH(default-term-type) */ #undef DISABLE_SETGID /* CF_ARG_DISABLE(setgid) */ #undef DISABLE_SETUID /* CF_ARG_DISABLE(setuid) */ +#undef HAVE_CLOCK_GETTIME /* CF_FUNC_GETTIME */ #undef HAVE_ENDUSERSHELL /* AC_CHECK_FUNCS(endusershell) */ #undef HAVE_GETHOSTNAME /* AC_CHECK_FUNCS(gethostname) */ #undef HAVE_GETLOGIN /* AC_CHECK_FUNCS(getlogin) */ +#undef HAVE_GETTIMEOFDAY /* CF_FUNC_GETTIME */ #undef HAVE_GETUSERSHELL /* AC_CHECK_FUNCS(getusershell) */ #undef HAVE_GRANTPT /* CF_FUNC_GRANTPT */ #undef HAVE_GRANTPT_PTY_ISATTY /* CF_FUNC_GRANTPT */ #undef HAVE_INITGROUPS /* AC_CHECK_FUNCS(initgroups) */ #undef HAVE_LANGINFO_CODESET /* AM_LANGINFO_CODESET */ #undef HAVE_LASTLOG_H /* CF_LASTLOG */ +#undef HAVE_LIBUTIL_H /* AC_CHECK_HEADERS(libutil.h) */ #undef HAVE_LIBXPM /* CF_WITH_XPM */ #undef HAVE_LIB_NEXTAW /* CF_X_ATHENA(--with-neXtaw) */ #undef HAVE_LIB_PCRE /* CF_WITH_PCRE */ @@ -94,13 +96,19 @@ #undef HAVE_POSIX_OPENPT /* CF_FUNC_GRANTPT */ #undef HAVE_POSIX_SAVED_IDS /* CF_POSIX_SAVED_IDS */ #undef HAVE_PTSNAME /* CF_FUNC_GRANTPT */ +#undef HAVE_PTY_H /* AC_CHECK_HEADERS(pty.h) */ #undef HAVE_PUTENV /* AC_CHECK_FUNCS(putenv) */ #undef HAVE_SCHED_YIELD /* AC_CHECK_FUNCS(sched_yield) */ +#undef HAVE_SETITIMER /* CF_SETITIMER */ #undef HAVE_SETPGID /* AC_CHECK_FUNCS(setpgid) */ +#undef HAVE_SETSID /* AC_CHECK_FUNCS(setsid) */ #undef HAVE_STDINT_H /* AC_PROG_CC_STDC */ #undef HAVE_STDLIB_H /* AC_CHECK_HEADERS(stdlib.h) */ #undef HAVE_STDNORETURN_H /* CF_C11_NORETURN */ #undef HAVE_STRFTIME /* AC_CHECK_FUNCS(strftime) */ +#undef HAVE_STROPTS_H /* AC_CHECK_HEADERS(stropts.h) */ +#undef HAVE_SYS_PARAM_H /* AC_CHECK_HEADERS(sys/param.h) */ +#undef HAVE_SYS_PTEM_H /* AC_CHECK_HEADERS(sys/ptem.h) */ #undef HAVE_SYS_TIME_H /* AC_HEADER_TIME */ #undef HAVE_SYS_TTYDEFAULTS_H /* AC_CHECK_HEADERS(sys/ttydefaults.h) */ #undef HAVE_SYS_WAIT_H /* AC_HEADER_SYS_WAIT */ @@ -113,6 +121,7 @@ #undef HAVE_UNISTD_H /* AC_CHECK_HEADERS(unistd.h) */ #undef HAVE_UNSETENV /* AC_CHECK_FUNCS(unsetenv) */ #undef HAVE_USE_EXTENDED_NAMES /* AC_CHECK_FUNCS(use_extended_names) */ +#undef HAVE_UTIL_H /* AC_CHECK_HEADERS(util.h) */ #undef HAVE_UTMP /* CF_UTMP */ #undef HAVE_UTMP_UT_HOST /* CF_UTMP_UT_HOST */ #undef HAVE_UTMP_UT_SESSION /* CF_UTMP_UT_SESSION */ @@ -222,6 +231,7 @@ #undef cc_t /* CF_TYPE_CC_T */ #undef gid_t /* AC_TYPE_UID_T */ #undef mode_t /* AC_TYPE_MODE_T */ +#undef nfds_t /* CF_TYPE_NFDS_T */ #undef off_t /* AC_TYPE_OFF_T */ #undef pid_t /* AC_TYPE_PID_T */ #undef time_t /* AC_CHECK_TYPE(time_t, long) */ |