xterm: Changes to 'upstream-unstable'
MANIFEST | 2
Tekproc.c | 10
VTPrsTbl.c | 338 +++++++++++++++++++++++-
VTparse.def | 5
VTparse.h | 6
aclocal.m4 | 12
button.c | 124 +++++---
charproc.c | 231 +++++++++-------
charsets.c | 790 +++++++++++++++++++++++++++++----------------------------
config.guess | 176 ++++++------
config.sub | 82 ++++-
configure | 151 ++++++++--
configure.in | 7
ctlseqs.ms | 22 +
ctlseqs.txt | 9
main.c | 22 +
menu.c | 10
misc.c | 4
ptyx.h | 7
scrollbar.c | 14 -
trace.c | 24 +
trace.h | 19 +
version.h | 4
xterm.h | 4
xterm.log.html | 35 ++
xtermcap.c | 12
xtermcfg.hin | 3
27 files changed, 1384 insertions(+), 739 deletions(-)
New commits:
commit 0af07d4a9fecba1737173199558346c6ca24dcc0
Author: Julien Cristau <jcristau@debian.org>
Date: Tue Jul 29 14:52:25 2008 +0200
Import xterm 236
diff --git a/MANIFEST b/MANIFEST
index b8d25e5..a51ffbf 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,4 +1,4 @@
-MANIFEST for xterm-235, version xterm-235
+MANIFEST for xterm-236, version xterm-236
--------------------------------------------------------------------------------
MANIFEST this file
256colres.h resource-definitions for 256-color mode
diff --git a/Tekproc.c b/Tekproc.c
index ffdbc5e..8c99478 100644
--- a/Tekproc.c
+++ b/Tekproc.c
@@ -1,4 +1,4 @@
-/* $XTermId: Tekproc.c,v 1.159 2008/02/21 20:21:51 tom Exp $ */
+/* $XTermId: Tekproc.c,v 1.160 2008/06/03 20:55:56 tom Exp $ */
/*
* Warning, there be crufty dragons here.
@@ -1491,11 +1491,9 @@ TekRealize(Widget gw,
else
tw->hints.flags |= PSize;
- TRACE(("make resize request %dx%d\n", height, width));
- (void) XtMakeResizeRequest((Widget) tw,
- width, height,
- &tw->core.width, &tw->core.height);
- TRACE(("...made resize request %dx%d\n", tw->core.height, tw->core.width));
+ (void) REQ_RESIZE((Widget) tw,
+ width, height,
+ &tw->core.width, &tw->core.height);
/* XXX This is bogus. We are parsing geometries too late. This
* is information that the shell widget ought to have before we get
diff --git a/VTPrsTbl.c b/VTPrsTbl.c
index 47a2441..370ae0e 100644
--- a/VTPrsTbl.c
+++ b/VTPrsTbl.c
@@ -1,4 +1,4 @@
-/* $XTermId: VTPrsTbl.c,v 1.49 2008/01/27 17:41:05 tom Exp $ */
+/* $XTermId: VTPrsTbl.c,v 1.50 2008/05/26 22:38:23 tom Exp $ */
/*
*
@@ -4352,9 +4352,9 @@ CASE_SCS2_STATE,
CASE_SCS3_STATE,
/* , - . / */
CASE_ESC_IGNORE,
-CASE_ESC_IGNORE,
-CASE_ESC_IGNORE,
-CASE_ESC_IGNORE,
+CASE_SCS1A_STATE,
+CASE_SCS2A_STATE,
+CASE_SCS3A_STATE,
/* 0 1 2 3 */
CASE_GROUND_STATE,
CASE_GROUND_STATE,
@@ -4512,9 +4512,9 @@ CASE_SCS2_STATE,
CASE_SCS3_STATE,
/* notsign hyphen registered macron */
CASE_ESC_IGNORE,
-CASE_ESC_IGNORE,
-CASE_ESC_IGNORE,
-CASE_ESC_IGNORE,
+CASE_SCS1A_STATE,
+CASE_SCS2A_STATE,
+CASE_SCS3A_STATE,
/* degree plusminus twosuperior threesuperior */
CASE_GROUND_STATE,
CASE_GROUND_STATE,
@@ -5589,6 +5589,330 @@ CASE_GROUND_STATE,
CASE_IGNORE,
};
+Const PARSE_T scs96table[] = /* ESC - etc. */
+{
+/* 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,
+/* NP 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_ESC_IGNORE,
+CASE_ESC_IGNORE,
+CASE_ESC_IGNORE,
+CASE_ESC_IGNORE,
+/* $ % & ' */
+CASE_ESC_IGNORE,
+CASE_ESC_IGNORE,
+CASE_ESC_IGNORE,
+CASE_ESC_IGNORE,
+/* ( ) * + */
+CASE_ESC_IGNORE,
+CASE_ESC_IGNORE,
+CASE_ESC_IGNORE,
+CASE_ESC_IGNORE,
+/* , - . / */
+CASE_ESC_IGNORE,
+CASE_ESC_IGNORE,
+CASE_ESC_IGNORE,
+CASE_ESC_IGNORE,
+/* 0 1 2 3 */
+CASE_GROUND_STATE,
+CASE_GROUND_STATE,
+CASE_GROUND_STATE,
+CASE_GROUND_STATE,
+/* 4 5 6 7 */
+CASE_GROUND_STATE,
+CASE_GROUND_STATE,
+CASE_GROUND_STATE,
+CASE_GROUND_STATE,
+/* 8 9 : ; */
+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_GSETS,
+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_GROUND_STATE,
+CASE_GROUND_STATE,
+CASE_GROUND_STATE,
+/* x y z { */
+CASE_GROUND_STATE,
+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_ESC_IGNORE,
+CASE_ESC_IGNORE,
+CASE_ESC_IGNORE,
+CASE_ESC_IGNORE,
+/* currency yen brokenbar section */
+CASE_ESC_IGNORE,
+CASE_ESC_IGNORE,
+CASE_ESC_IGNORE,
+CASE_ESC_IGNORE,
+/* diaeresis copyright ordfeminine guillemotleft */
+CASE_ESC_IGNORE,
+CASE_ESC_IGNORE,
+CASE_ESC_IGNORE,
+CASE_ESC_IGNORE,
+/* notsign hyphen registered macron */
+CASE_ESC_IGNORE,
+CASE_ESC_IGNORE,
+CASE_ESC_IGNORE,
+CASE_ESC_IGNORE,
+/* degree plusminus twosuperior threesuperior */
+CASE_GROUND_STATE,
+CASE_GROUND_STATE,
+CASE_GROUND_STATE,
+CASE_GROUND_STATE,
+/* acute mu paragraph periodcentered */
+CASE_GROUND_STATE,
+CASE_GROUND_STATE,
+CASE_GROUND_STATE,
+CASE_GROUND_STATE,
+/* cedilla onesuperior masculine guillemotright */
+CASE_GROUND_STATE,
+CASE_GROUND_STATE,
+CASE_GROUND_STATE,
+CASE_GROUND_STATE,
+/* onequarter onehalf threequarters questiondown */
+CASE_GROUND_STATE,
+CASE_GROUND_STATE,
+CASE_GROUND_STATE,
+CASE_GROUND_STATE,
+/* Agrave Aacute Acircumflex Atilde */
+CASE_GROUND_STATE,
+CASE_GSETS,
+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_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_GROUND_STATE,
+CASE_GROUND_STATE,
+CASE_GROUND_STATE,
+CASE_IGNORE,
+};
+
/*
* This table is treated specially. The CASE_IGNORE entries correspond to the
* characters that can be accumulated for the string function (e.g., OSC).
diff --git a/VTparse.def b/VTparse.def
index 6c8751d..c1438db 100644
--- a/VTparse.def
+++ b/VTparse.def
@@ -1,4 +1,4 @@
-# $XTermId: VTparse.def,v 1.31 2008/01/27 17:08:54 tom Exp $
+# $XTermId: VTparse.def,v 1.32 2008/05/26 21:30:10 tom Exp $
#
# vile:confmode rs=lf
#
@@ -141,3 +141,6 @@ CASE_CSI_STAR_STATE
CASE_SET_MOD_FKEYS
CASE_SET_MOD_FKEYS0
CASE_HIDE_POINTER
+CASE_SCS1A_STATE
+CASE_SCS2A_STATE
+CASE_SCS3A_STATE
diff --git a/VTparse.h b/VTparse.h
index db2fd07..cdc7815 100644
--- a/VTparse.h
+++ b/VTparse.h
@@ -1,4 +1,4 @@
-/* $XTermId: VTparse.h,v 1.43 2008/01/27 17:11:37 tom Exp $ */
+/* $XTermId: VTparse.h,v 1.45 2008/05/28 21:11:23 tom Exp $ */
/*
* Copyright 2002-2006,2008 by Thomas E. Dickey
@@ -75,6 +75,7 @@ extern Const PARSE_T eigtable[];
extern Const PARSE_T esc_sp_table[];
extern Const PARSE_T esc_table[];
extern Const PARSE_T scrtable[];
+extern Const PARSE_T scs96table[];
extern Const PARSE_T scstable[];
extern Const PARSE_T sos_table[];
@@ -242,5 +243,8 @@ extern Const PARSE_T esc_pct_table[];
#define CASE_SET_MOD_FKEYS 131
#define CASE_SET_MOD_FKEYS0 132
#define CASE_HIDE_POINTER 133
+#define CASE_SCS1A_STATE 134
+#define CASE_SCS2A_STATE 135
+#define CASE_SCS3A_STATE 136
#endif /* included_VTparse_h */
diff --git a/aclocal.m4 b/aclocal.m4
index 790628e..e415299 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,4 +1,4 @@
-dnl $XTermId: aclocal.m4,v 1.251 2008/03/26 00:59:57 tom Exp $
+dnl $XTermId: aclocal.m4,v 1.253 2008/07/27 15:28:15 tom Exp $
dnl
dnl $XFree86: xc/programs/xterm/aclocal.m4,v 3.65 2006/06/19 00:36:50 dickey Exp $
dnl
@@ -635,7 +635,7 @@ if test "$GCC" = yes ; then
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_GCC_WARNINGS version: 22 updated: 2007/07/29 09:55:12
+dnl CF_GCC_WARNINGS version: 23 updated: 2008/07/26 17:54:02
dnl ---------------
dnl Check if the compiler supports useful warning options. There's a few that
dnl we don't use, simply because they're too noisy:
@@ -730,7 +730,7 @@ then
;;
Winline) #(vi
case $GCC_VERSION in
- 3.3*)
+ [[34]].*)
CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
continue;;
esac
@@ -1809,7 +1809,7 @@ else
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_TYPE_FD_MASK version: 1 updated: 2008/03/25 20:56:27
+dnl CF_TYPE_FD_MASK version: 2 updated: 2008/03/25 20:59:57
dnl ---------------
dnl Check for the declaration of fd_mask, which is like fd_set, associated
dnl with select(). The check for fd_set should have pulled in this as well,
@@ -2320,7 +2320,7 @@ int x = XkbBI_Info
test "$cf_cv_xkb_bell_ext" = yes && AC_DEFINE(HAVE_XKB_BELL_EXT)
])
dnl ---------------------------------------------------------------------------
-dnl CF_XOPEN_SOURCE version: 25 updated: 2007/01/29 18:36:38
+dnl CF_XOPEN_SOURCE version: 26 updated: 2008/07/27 11:26:57
dnl ---------------
dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,
dnl or adapt to the vendor's definitions to get equivalent functionality,
@@ -2340,7 +2340,7 @@ case $host_os in #(vi
aix[[45]]*) #(vi
CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
;;
-freebsd*) #(vi
+freebsd*|dragonfly*) #(vi
# 5.x headers associate
# _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
# _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
diff --git a/button.c b/button.c
index 66ea199..3cc1798 100644
--- a/button.c
+++ b/button.c
@@ -1,4 +1,4 @@
-/* $XTermId: button.c,v 1.285 2008/02/24 19:42:02 tom Exp $ */
+/* $XTermId: button.c,v 1.288 2008/07/27 19:36:37 tom Exp $ */
/*
* Copyright 1999-2007,2008 by Thomas E. Dickey
@@ -270,7 +270,7 @@ SendLocatorPosition(XtermWidget xw, XEvent * event)
}
/* get button # */
- button = event->xbutton.button - 1;
+ button = (int) event->xbutton.button - 1;
LocatorCoords(row, col, event->xbutton.x, event->xbutton.y, oor);
@@ -368,7 +368,7 @@ SendLocatorPosition(XtermWidget xw, XEvent * event)
* Button1 (left) and Button3 (right) are swapped in the mask relative to X.
*/
#define ButtonState(state, mask) \
-{ (state) = ((mask) & (Button1Mask | Button2Mask | Button3Mask | Button4Mask)) >> 8; \
+{ (state) = (int) (((mask) & (Button1Mask | Button2Mask | Button3Mask | Button4Mask)) >> 8); \
/* swap Button1 & Button3 */ \
(state) = ((state) & ~(4|1)) | (((state)&1)?4:0) | (((state)&4)?1:0); \
}
@@ -632,10 +632,10 @@ isClick1_clean(TScreen * screen, XEvent * event)
delta = screen->multiClickTime + 1;
} else if (event->xbutton.time > lastButtonDownTime) {
/* most of the time */
- delta = event->xbutton.time - lastButtonDownTime;
+ delta = (int) (event->xbutton.time - lastButtonDownTime);
} else {
/* time has rolled over since lastButtonUpTime */
- delta = (((Time) ~ 0) - lastButtonDownTime) + event->xbutton.time;
+ delta = (int) ((((Time) ~ 0) - lastButtonDownTime) + event->xbutton.time);
}
return delta <= screen->multiClickTime;
@@ -658,10 +658,10 @@ isDoubleClick3(TScreen * screen, XEvent * event)
delta = screen->multiClickTime + 1;
} else if (event->xbutton.time > lastButton3DoubleDownTime) {
/* most of the time */
- delta = event->xbutton.time - lastButton3DoubleDownTime;
+ delta = (int) (event->xbutton.time - lastButton3DoubleDownTime);
} else {
/* time has rolled over since lastButton3DoubleDownTime */
- delta = (((Time) ~ 0) - lastButton3DoubleDownTime) + event->xbutton.time;
+ delta = (int) ((((Time) ~ 0) - lastButton3DoubleDownTime) + event->xbutton.time);
}
if (delta <= screen->multiClickTime) {
/* Double click */
@@ -697,10 +697,10 @@ CheckSecondPress3(TScreen * screen, XEvent * event)
delta = screen->multiClickTime + 1;
} else if (event->xbutton.time > lastButton3UpTime) {
/* most of the time */
- delta = event->xbutton.time - lastButton3UpTime;
+ delta = (int) (event->xbutton.time - lastButton3UpTime);
} else {
/* time has rolled over since lastButton3UpTime */
- delta = (((Time) ~ 0) - lastButton3UpTime) + event->xbutton.time;
+ delta = (int) ((((Time) ~ 0) - lastButton3UpTime) + event->xbutton.time);
}
if (delta <= screen->multiClickTime) {
CELL cell;
@@ -772,7 +772,7 @@ ReadLineMovePoint(TScreen * screen, int col, int ldelta)
line[count++] = ANSI_ESC;
line[count++] = '['; /* XXX maybe sometimes O is better? */
}
- line[count++] = (col > 0 ? 'C' : 'D');
+ line[count++] = CharOf(col > 0 ? 'C' : 'D');
if (col < 0)
col = -col;
while (col--)
@@ -813,8 +813,8 @@ DiredButton(Widget w,
Line[0] = CONTROL('X');
Line[1] = ANSI_ESC;
Line[2] = 'G';
- Line[3] = ' ' + col;
- Line[4] = ' ' + line;
+ Line[3] = CharOf(' ' + col);
+ Line[4] = CharOf(' ' + line);
v_write(screen->respond, Line, 5);
}
}
@@ -844,10 +844,10 @@ ReadLineButton(Widget w,
delta = screen->multiClickTime + 1;
} else if (event->xbutton.time > lastButtonDownTime) {
/* most of the time */
- delta = event->xbutton.time - lastButtonDownTime;
+ delta = (int) (event->xbutton.time - lastButtonDownTime);
} else {
/* time has rolled over since lastButtonUpTime */
- delta = (((Time) ~ 0) - lastButtonDownTime) + event->xbutton.time;
+ delta = (int) ((((Time) ~ 0) - lastButtonDownTime) + event->xbutton.time);
}
if (delta > screen->multiClickTime)
goto finish; /* All this work for this... */
@@ -876,7 +876,7 @@ ReadLineButton(Widget w,
Line[0] = ANSI_ESC;
/* XXX: sometimes it is better to send '['? */
Line[1] = 'O';
- Line[2] = (col > 0 ? 'C' : 'D');
+ Line[2] = CharOf(col > 0 ? 'C' : 'D');
if (col < 0)
col = -col;
while (col--)
@@ -1042,8 +1042,8 @@ static unsigned
DECtoASCII(unsigned ch)
{
if (xtermIsDecGraphic(ch)) {
- ch = "###########+++++##-##++++|######"[ch];
- /* 01234567890123456789012345678901 */
+ ch = CharOf("###########+++++##-##++++|######"[ch]);
+ /* 01234567890123456789012345678901 */
}
return ch;
}
@@ -1076,7 +1076,7 @@ UTF8toLatin1(Char * s, unsigned len, unsigned long *result)
if (value == UCS_REPL) {
*q++ = '#';
} else if (value < 256) {
- *q++ = value;
+ *q++ = CharOf(value);
} else {
unsigned eqv = ucs2dec(value);
if (xtermIsDecGraphic(eqv)) {
@@ -1406,11 +1406,11 @@ base64_flush(TScreen * screen)
case 0:
break;
case 2:
- x = base64_code[screen->base64_accu << 4];
+ x = CharOf(base64_code[screen->base64_accu << 4]);
tty_vwrite(screen->respond, &x, 1);
break;
case 4:
- x = base64_code[screen->base64_accu << 2];
+ x = CharOf(base64_code[screen->base64_accu << 2]);
tty_vwrite(screen->respond, &x, 1);
break;
}
@@ -1436,20 +1436,20 @@ _qWriteSelectionData(TScreen * screen, Char * lag, unsigned length)
while (length--) {
switch (screen->base64_count) {
case 0:
- buf[x++] = base64_code[*p >> 2];
+ buf[x++] = CharOf(base64_code[*p >> 2]);
screen->base64_accu = (*p & 0x3);
screen->base64_count = 2;
++p;
break;
case 2:
- buf[x++] = base64_code[(screen->base64_accu << 4) + (*p >> 4)];
+ buf[x++] = CharOf(base64_code[(screen->base64_accu << 4) + (*p >> 4)]);
screen->base64_accu = (*p & 0xF);
screen->base64_count = 4;
++p;
break;
case 4:
- buf[x++] = base64_code[(screen->base64_accu << 2) + (*p >> 6)];
- buf[x++] = base64_code[*p & 0x3F];
+ buf[x++] = CharOf(base64_code[(screen->base64_accu << 2) + (*p >> 6)]);
+ buf[x++] = CharOf(base64_code[*p & 0x3F]);
screen->base64_accu = 0;
screen->base64_count = 0;
++p;
@@ -1617,15 +1617,35 @@ SelectionReceived(Widget w,
if (text_list != NULL && text_list_count != 0) {
int i;
Char *data;
- unsigned long size;
+ char **new_text_list, *tmp;
+ unsigned long size, new_size;
+ /* XLib StringList actually uses only two
+ * pointers, one for the list itself, and one for
+ * the data. Pointer to the data is the first
+ * element of the list, the rest (if any) list
+ * elements point to the same memory block as the
+ * first element
+ */
+ new_size = 0;
for (i = 0; i < text_list_count; ++i) {
data = (Char *) text_list[i];
- size = strlen(text_list[i]);
+ size = strlen(text_list[i]) + 1;
data = UTF8toLatin1(data, size, &size);
- XFree(text_list[i]);
- text_list[i] = XtMalloc(size + 1);
- memcpy(text_list[i], data, size + 1);
+ new_size += size + 1;
}
+ new_text_list =
+ (char **) XtMalloc(sizeof(char *) * text_list_count);
+ new_text_list[0] = tmp = XtMalloc(new_size);
+ for (i = 0; i < text_list_count; ++i) {
+ data = (Char *) text_list[i];
+ size = strlen(text_list[i]) + 1;
+ data = UTF8toLatin1(data, size, &size);
+ memcpy(tmp, data, size + 1);
+ new_text_list[i] = tmp;
+ tmp += size + 1;
+ }
+ XFreeStringList(text_list);
+ text_list = new_text_list;
}
} else
#endif
@@ -1737,10 +1757,10 @@ EvalSelectUnit(TScreen * screen,
delta = screen->multiClickTime + 1;
} else if (buttonDownTime > screen->lastButtonUpTime) {
/* most of the time */
- delta = buttonDownTime - screen->lastButtonUpTime;
+ delta = (int) (buttonDownTime - screen->lastButtonUpTime);
} else {
/* time has rolled over since lastButtonUpTime */
- delta = (((Time) ~ 0) - screen->lastButtonUpTime) + buttonDownTime;
+ delta = (int) ((((Time) ~ 0) - screen->lastButtonUpTime) + buttonDownTime);
}
if (delta > screen->multiClickTime) {
@@ -1923,17 +1943,17 @@ EndExtend(XtermWidget xw,
&& isSameCELL(&cell, &(screen->endSel))) {
/* Use short-form emacs select */
line[count++] = 't';
- line[count++] = ' ' + screen->endSel.col + 1;
- line[count++] = ' ' + screen->endSel.row + 1;
+ line[count++] = CharOf(' ' + screen->endSel.col + 1);
+ line[count++] = CharOf(' ' + screen->endSel.row + 1);
} else {
/* long-form, specify everything */
line[count++] = 'T';
- line[count++] = ' ' + screen->startSel.col + 1;
- line[count++] = ' ' + screen->startSel.row + 1;
- line[count++] = ' ' + screen->endSel.col + 1;
- line[count++] = ' ' + screen->endSel.row + 1;
- line[count++] = ' ' + cell.col + 1;
- line[count++] = ' ' + cell.row + 1;
+ line[count++] = CharOf(' ' + screen->startSel.col + 1);
+ line[count++] = CharOf(' ' + screen->startSel.row + 1);
+ line[count++] = CharOf(' ' + screen->endSel.col + 1);
+ line[count++] = CharOf(' ' + screen->endSel.row + 1);
+ line[count++] = CharOf(' ' + cell.col + 1);
+ line[count++] = CharOf(' ' + cell.row + 1);
}
v_write(screen->respond, line, count);
TrackText(xw, &zeroCELL, &zeroCELL);
@@ -2361,7 +2381,7 @@ class_of(TScreen * screen, CELL * cell)
}
#endif
- value = XTERM_CELL(temp.row, temp.col);
+ value = (int) XTERM_CELL(temp.row, temp.col);
if_OPT_WIDE_CHARS(screen, {
return CharacterClass(value);
});
@@ -2442,7 +2462,7 @@ lengthOfLines(TScreen * screen, int firstRow, int lastRow)
for (n = firstRow; n <= lastRow; ++n) {
int value = LastTextCol(screen, n);
if (value >= 0)
- length += (value + 1);
+ length += (unsigned) (value + 1);
}
return length;
}
@@ -2463,7 +2483,7 @@ make_indexed_text(TScreen * screen, int row, unsigned length, int *indexed)
* string were UTF-8.
*/
if_OPT_WIDE_CHARS(screen, {
- need *= (MAX_PTRS * 6);
+ need *= (unsigned) (MAX_PTRS * 6);
});
if ((result = TypeCallocN(Char, need + 1)) != 0) {
@@ -3086,20 +3106,20 @@ AppendToSelectionBuffer(TScreen * screen, unsigned c)
break;
case 2:
- ch = (screen->base64_accu << 6) + six;
+ ch = CharOf((screen->base64_accu << 6) + six);
screen->base64_count = 0;
AppendStrToSelectionBuffer(screen, &ch, 1);
break;
case 4:
- ch = (screen->base64_accu << 4) + (six >> 2);
+ ch = CharOf((screen->base64_accu << 4) + (six >> 2));
screen->base64_accu = (six & 0x3);
screen->base64_count = 2;
AppendStrToSelectionBuffer(screen, &ch, 1);
break;
case 6:
- ch = (screen->base64_accu << 2) + (six >> 4);
+ ch = CharOf((screen->base64_accu << 2) + (six >> 4));
screen->base64_accu = (six & 0xF);
screen->base64_count = 4;
AppendStrToSelectionBuffer(screen, &ch, 1);
@@ -3573,7 +3593,7 @@ SaveText(TScreen * screen,
} else if (c == 0x7f) {
c = 0x5f;
}
- *lp++ = A2E(c);
+ *lp++ = CharOf(A2E(c));
}
if (c != E2A(' '))
result = lp;
@@ -3601,7 +3621,7 @@ SaveText(TScreen * screen,
/* Position: 32 - 255. */
-static int
+static Char
BtnCode(XButtonEvent * event, int button)
{
int result = 32 + (KeyState(event->state) << 2);
@@ -3615,7 +3635,7 @@ BtnCode(XButtonEvent * event, int button)
result += 32;
result += button;
}
- return result;
+ return CharOf(result);
}
#define MOUSE_LIMIT (255 - 32)
@@ -3675,7 +3695,7 @@ EditorButton(XtermWidget xw, XButtonEvent * event)
/* Add event code to key sequence */
if (screen->send_mouse_pos == X10_MOUSE) {
- line[count++] = ' ' + button;
+ line[count++] = CharOf(' ' + button);
} else {
/* Button-Motion events */
switch (event->type) {
@@ -3714,8 +3734,8 @@ EditorButton(XtermWidget xw, XButtonEvent * event)
screen->mouse_col = col;
/* Add pointer position to key sequence */
- line[count++] = ' ' + col + 1;
- line[count++] = ' ' + row + 1;
+ line[count++] = CharOf(' ' + col + 1);
+ line[count++] = CharOf(' ' + row + 1);
TRACE(("mouse at %d,%d button+mask = %#x\n", row, col,
(screen->control_eight_bits) ? line[2] : line[3]));
@@ -3743,7 +3763,7 @@ SendFocusButton(XtermWidget xw, XFocusChangeEvent * event)
reply.a_pintro = '>';
}
#endif
- reply.a_final = (event->type == FocusIn) ? 'I' : 'O';
+ reply.a_final = CharOf((event->type == FocusIn) ? 'I' : 'O');
unparseseq(xw, &reply);
}
return;
diff --git a/charproc.c b/charproc.c
index d0a2325..1426b14 100644
--- a/charproc.c
+++ b/charproc.c
@@ -1,4 +1,4 @@
-/* $XTermId: charproc.c,v 1.842 2008/04/20 22:08:42 tom Exp $ */
+/* $XTermId: charproc.c,v 1.848 2008/07/27 19:00:21 tom Exp $ */
/*
@@ -1082,27 +1082,28 @@ which_table(Const PARSE_T * table)
char *result = "?";
/* *INDENT-OFF* */
WHICH_TABLE (ansi_table);
- else WHICH_TABLE (csi_table);
+ else WHICH_TABLE (cigtable);
else WHICH_TABLE (csi2_table);
else WHICH_TABLE (csi_ex_table);
else WHICH_TABLE (csi_quo_table);
-#if OPT_DEC_LOCATOR
- else WHICH_TABLE (csi_tick_table);
-#endif
-#if OPT_DEC_RECTOPS
- else WHICH_TABLE (csi_dollar_table);
- else WHICH_TABLE (csi_star_table);
-#endif
- else WHICH_TABLE (dec_table);
+ else WHICH_TABLE (csi_table);
else WHICH_TABLE (dec2_table);
else WHICH_TABLE (dec3_table);
- else WHICH_TABLE (cigtable);
+ else WHICH_TABLE (dec_table);
else WHICH_TABLE (eigtable);
- else WHICH_TABLE (esc_table);
else WHICH_TABLE (esc_sp_table);
+ else WHICH_TABLE (esc_table);
else WHICH_TABLE (scrtable);
+ else WHICH_TABLE (scs96table);
else WHICH_TABLE (scstable);
else WHICH_TABLE (sos_table);
+#if OPT_DEC_LOCATOR
+ else WHICH_TABLE (csi_tick_table);
+#endif
+#if OPT_DEC_RECTOPS
+ else WHICH_TABLE (csi_dollar_table);
+ else WHICH_TABLE (csi_star_table);
+#endif
#if OPT_WIDE_CHARS
else WHICH_TABLE (esc_pct_table);
#endif
@@ -1159,6 +1160,7 @@ struct ParseState {
Const PARSE_T *groundtable;
Const PARSE_T *parsestate;
int scstype;
+ int scssize;
Bool private_function; /* distinguish private-mode from standard */
int string_mode; /* nonzero iff we're processing a string */
int lastchar; /* positive iff we had a graphic character */
@@ -1170,6 +1172,32 @@ struct ParseState {
static struct ParseState myState;
+static void
+init_groundtable(TScreen * screen, struct ParseState *sp)
+{
+#if OPT_VT52_MODE
+ if (!(screen->vtXX_level)) {
+ sp->groundtable = vt52_table;
+ } else if (screen->terminal_id >= 100)
+#endif
+ {
+ sp->groundtable = ansi_table;
+ }
+}
+
+static void
+select_charset(struct ParseState *sp, int type, int size)
+{
+ TRACE(("select_charset %#x %d\n", type, size));
+ sp->scstype = type;
+ sp->scssize = size;
+ if (size == 94) {
+ sp->parsestate = scstable;
+ } else {
+ sp->parsestate = scs96table;
+ }
+}
+
static Boolean
doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
{
@@ -1266,14 +1294,25 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
}
#endif
- /*
- * The parsing tables all have 256 entries. If we're supporting
- * wide characters, we handle them by treating them the same as
- * printing characters.
- */
laststate = sp->nextstate;
+ if (c == ANSI_DEL
+ && sp->parsestate == sp->groundtable
+ && sp->scssize == 96
+ && sp->scstype != 0) {
+ /*
+ * Handle special case of shifts for 96-character sets by checking
+ * if we have a DEL. The other special case for SPACE will always
Reply to: