From 831bb44f34302bc76dc746c269f5f4e94a5d28d4 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Tue, 26 Dec 2017 01:58:48 +0000 Subject: [PATCH] snapshot of project "xterm", label xterm-330w --- MANIFEST | 2 +- charproc.c | 4 ++- linedata.c | 90 +++++++++++++++++++++++++++++--------------------- ptyx.h | 3 +- scrollbar.c | 34 +++++++++++++++++-- termcap | 6 ++-- terminfo | 45 ++++++++++++++++++------- xterm.h | 3 +- xterm.log.html | 16 ++++++++- xterm.man | 68 +++++++++++++++++++++++++++++--------- 10 files changed, 196 insertions(+), 75 deletions(-) diff --git a/MANIFEST b/MANIFEST index 7bfd5e64..fc86ec4f 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,4 +1,4 @@ -MANIFEST for xterm, version xterm-330v +MANIFEST for xterm, version xterm-330w -------------------------------------------------------------------------------- MANIFEST this file 256colres.h resource-definitions for 256-color mode diff --git a/charproc.c b/charproc.c index 2303b018..66804091 100644 --- a/charproc.c +++ b/charproc.c @@ -1,4 +1,4 @@ -/* $XTermId: charproc.c,v 1.1513 2017/12/24 19:07:43 tom Exp $ */ +/* $XTermId: charproc.c,v 1.1514 2017/12/26 01:23:12 tom Exp $ */ /* * Copyright 1999-2016,2017 by Thomas E. Dickey @@ -262,6 +262,7 @@ static XtActionsRec actionsList[] = { { "redraw", HandleRedraw }, { "scroll-back", HandleScrollBack }, { "scroll-forw", HandleScrollForward }, + { "scroll-to", HandleScrollTo }, { "secure", HandleSecure }, { "select-cursor-end", HandleKeyboardSelectEnd }, { "select-cursor-extend", HandleKeyboardSelectExtend }, @@ -895,6 +896,7 @@ xtermAddInput(Widget w) { "string", HandleStringEvent }, { "scroll-back", HandleScrollBack }, { "scroll-forw", HandleScrollForward }, + { "scroll-to", HandleScrollTo }, { "select-cursor-end", HandleKeyboardSelectEnd }, { "select-cursor-extend", HandleKeyboardSelectExtend }, { "select-cursor-start", HandleKeyboardSelectStart }, diff --git a/linedata.c b/linedata.c index 3450ddc8..3d5dc952 100644 --- a/linedata.c +++ b/linedata.c @@ -1,4 +1,4 @@ -/* $XTermId: linedata.c,v 1.86 2017/11/09 01:30:07 tom Exp $ */ +/* $XTermId: linedata.c,v 1.90 2017/12/25 17:12:00 tom Exp $ */ /* * Copyright 2009-2014,2017 by Thomas E. Dickey @@ -62,18 +62,6 @@ getLineData(TScreen *screen, int row) } if (row >= 0 && row <= max_row) { result = (LineData *) scrnHeadAddr(screen, buffer, (unsigned) row); - if (result != 0) { -#if 1 /* FIXME - these should be done in setupLineData, etc. */ - result->lineSize = (Dimension) MaxCols(screen); -#if OPT_WIDE_CHARS - if (screen->wide_chars) { - result->combSize = (Char) screen->max_combining; - } else { - result->combSize = 0; - } -#endif -#endif /* FIXME */ - } } return result; @@ -148,12 +136,25 @@ copyLineData(LineData *dst, CLineData *src) #if OPT_WIDE_CHARS #define initLineExtra(screen) \ - screen->lineExtra = ((size_t) (screen->max_combining) * sizeof(IChar *)) + screen->lineExtra = ((size_t) (screen->max_combining) * sizeof(IChar *)); \ + screen->cellExtra = ((size_t) (screen->max_combining) * sizeof(IChar)) #else #define initLineExtra(screen) \ - screen->lineExtra = 0 + screen->lineExtra = 0; \ + screen->cellExtra = 0 #endif +/* + * CellData size depends on the "combiningChars" resource. + */ +#define CellDataSize(screen) (SizeOfCellData + screen->cellExtra) + +#define CellDataAddr(screen, data, cell) \ + ( (CellData *)(void *) ((char *)data + (cell * CellDataSize(screen))) ) +#define ConstCellDataAddr(screen, data, cell) \ + ( (const CellData *)(const void *) ( \ + (const char *)data + (cell * CellDataSize(screen))) ) + void initLineData(XtermWidget xw) { @@ -161,36 +162,49 @@ initLineData(XtermWidget xw) initLineExtra(screen); - TRACE(("initLineData %lu\n", (unsigned long) screen->lineExtra)); - TRACE(("...sizeof(LineData) %lu\n", (unsigned long) sizeof(LineData))); + TRACE(("initLineData %lu (%d combining chars)\n", + (unsigned long) screen->lineExtra, screen->max_combining)); + + /* + * Per-line size/offsets. + */ + TRACE(("** sizeof(LineData) %lu\n", (unsigned long) sizeof(LineData))); + TRACE((" offset(lineSize) %lu\n", (unsigned long) offsetof(LineData, lineSize))); + TRACE((" offset(bufHead) %lu\n", (unsigned long) offsetof(LineData, bufHead))); +#if OPT_WIDE_CHARS + TRACE((" offset(combSize) %lu\n", (unsigned long) offsetof(LineData, combSize))); +#endif + TRACE((" offset(*attribs) %lu\n", (unsigned long) offsetof(LineData, attribs))); #if OPT_ISO_COLORS - TRACE(("...sizeof(CellColor) %lu\n", (unsigned long) sizeof(CellColor))); + TRACE((" offset(*color) %lu\n", (unsigned long) offsetof(LineData, color))); #endif - TRACE(("...sizeof(RowData) %lu\n", (unsigned long) sizeof(RowData))); - TRACE(("...offset(lineSize) %lu\n", (unsigned long) offsetof(LineData, lineSize))); - TRACE(("...offset(bufHead) %lu\n", (unsigned long) offsetof(LineData, bufHead))); + TRACE((" offset(*charData) %lu\n", (unsigned long) offsetof(LineData, charData))); + TRACE((" offset(*combData) %lu\n", (unsigned long) offsetof(LineData, combData))); + + /* + * Per-cell size/offsets. + */ + TRACE(("** sizeof(CellData) %lu\n", (unsigned long) CellDataSize(screen))); + TRACE((" offset(attribs) %lu\n", (unsigned long) offsetof(CellData, attribs))); #if OPT_WIDE_CHARS - TRACE(("...offset(combSize) %lu\n", (unsigned long) offsetof(LineData, combSize))); + TRACE((" offset(combSize) %lu\n", (unsigned long) offsetof(CellData, combSize))); #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))); + TRACE((" offset(color) %lu\n", (unsigned long) offsetof(CellData, color))); #endif - TRACE(("...offset(charData) %lu\n", (unsigned long) offsetof(LineData, charData))); - TRACE(("...offset(combData) %lu\n", (unsigned long) offsetof(LineData, combData))); -} + TRACE((" offset(charData) %lu\n", (unsigned long) offsetof(CellData, charData))); + TRACE((" offset(combData) %lu\n", (unsigned long) offsetof(CellData, combData))); -/* - * CellData size depends on the "combiningChars" resource. - * FIXME - revise this to reduce arithmetic... - */ -#define CellDataSize(screen) (SizeOfCellData + screen->lineExtra) - -#define CellDataAddr(screen, data, cell) \ - ( (CellData *)(void *) ((char *)data + (cell * CellDataSize(screen))) ) -#define ConstCellDataAddr(screen, data, cell) \ - ( (const CellData *)(const void *) ( \ - (const char *)data + (cell * CellDataSize(screen))) ) + /* + * Data-type sizes. + */ +#if OPT_ISO_COLORS + TRACE(("** sizeof(CellColor) %lu\n", (unsigned long) sizeof(CellColor))); +#endif + TRACE(("** sizeof(IAttr) %lu\n", (unsigned long) sizeof(IAttr))); + TRACE(("** sizeof(IChar) %lu\n", (unsigned long) sizeof(IChar))); + TRACE(("** sizeof(RowData) %lu\n", (unsigned long) sizeof(RowData))); +} CellData * newCellData(XtermWidget xw, Cardinal count) diff --git a/ptyx.h b/ptyx.h index df142991..cad627cf 100644 --- a/ptyx.h +++ b/ptyx.h @@ -1,4 +1,4 @@ -/* $XTermId: ptyx.h,v 1.873 2017/12/24 19:07:43 tom Exp $ */ +/* $XTermId: ptyx.h,v 1.874 2017/12/25 16:38:36 tom Exp $ */ /* * Copyright 1999-2016,2017 by Thomas E. Dickey @@ -2316,6 +2316,7 @@ typedef struct { * Working variables for getLineData(). */ size_t lineExtra; /* extra space for combining chars */ + size_t cellExtra; /* extra space for combining chars */ /* * Pointer to the current visible buffer. */ diff --git a/scrollbar.c b/scrollbar.c index 0eb2c21c..4ae351c0 100644 --- a/scrollbar.c +++ b/scrollbar.c @@ -1,7 +1,7 @@ -/* $XTermId: scrollbar.c,v 1.200 2016/05/22 16:43:12 tom Exp $ */ +/* $XTermId: scrollbar.c,v 1.202 2017/12/26 01:58:48 tom Exp $ */ /* - * Copyright 2000-2014,2016 by Thomas E. Dickey + * Copyright 2000-2016,2017 by Thomas E. Dickey * * All Rights Reserved * @@ -727,6 +727,36 @@ AlternateScroll(Widget w, long amount) } } +/*ARGSUSED*/ +void +HandleScrollTo( + Widget w, + XEvent *event GCC_UNUSED, + String *params, + Cardinal *nparams) +{ + XtermWidget xw; + TScreen *screen; + + if ((xw = getXtermWidget(w)) != 0 && + (screen = TScreenOf(xw)) != 0 && + *nparams > 0) { + long amount; + int value; + int to_top = (screen->topline - screen->savedlines); + if (!x_strcasecmp(params[0], "begin")) { + amount = to_top * FontHeight(screen); + } else if (!x_strcasecmp(params[0], "end")) { + amount = -to_top * FontHeight(screen); + } else if ((value = atoi(params[0])) >= 0) { + amount = (value + to_top) * FontHeight(screen); + } else { + amount = 0; + } + AlternateScroll(w, amount); + } +} + /*ARGSUSED*/ void HandleScrollForward( diff --git a/termcap b/termcap index fd343239..a8869e30 100644 --- a/termcap +++ b/termcap @@ -1,4 +1,4 @@ -# $XTermId: termcap,v 1.85 2017/08/14 08:55:52 tom Exp $ +# $XTermId: termcap,v 1.88 2017/12/25 21:24:41 tom Exp $ # # These are termcap entries that correspond to xterm's terminfo file. # The file is formatted using ncurses' "tic -CNx", but is not mechanically @@ -123,9 +123,10 @@ x2|xterm-88color|xterm alias:\ :Co#88:pa#7744:tc=xterm-256color: x3|xterm-256color|xterm alias:\ - :Co#256:pa#32767:\ + :Co#256:pa#65536:\ :AB=\E[48;5;%dm:AF=\E[38;5;%dm:tc=xterm-new: +# Termcap cannot do direct-colors, but users may expect this name. x4|xterm-direct|xterm alias:\ :tc=xterm-256color: @@ -244,3 +245,4 @@ v0|xterm|X11 terminal emulator:\ # should send. xterm+kbs|fragment for backspace key:\ :kb=^H: +# :kb=\177: diff --git a/terminfo b/terminfo index 3f69b1d8..ee558e4d 100644 --- a/terminfo +++ b/terminfo @@ -1,4 +1,4 @@ -# $XTermId: terminfo,v 1.171 2017/12/17 19:19:31 tom Exp $ +# $XTermId: terminfo,v 1.177 2017/12/25 21:08:55 tom Exp $ # # Updates/notes/new entries (e.g., xterm-8bit, xterm-16color, xterm-256color) # - Thomas E. Dickey @@ -32,6 +32,8 @@ # sale, use or other dealings in this Software without prior written # authorization. #------------------------------------------------------------------------------ +# format (ncurses 6.1): tic -W -1 -f -x terminfo +#------------------------------------------------------------------------------ # # Special Capabilities: # -------------------- @@ -133,13 +135,23 @@ xterm-new|modern xterm terminal emulator, kb2=\EOE, kcbt=\E[Z, kent=\EOM, - rep=%p1%c\E[%p2%{1}%-%db, rin=\E[%p1%dT, + use=ansi+rep, use=ecma+strikeout, use=xterm+pcfkeys, use=xterm+tmux, use=xterm-basic, -# + +# These "ansi+XXX" blocks were added in ncurses 5.0: +ansi+rep, + rep=%p1%c\E[%p2%{1}%-%db, + +ansi+enq|ncurses extension for ANSI ENQ, + u6=\E[%i%d;%dR, + u7=\E[6n, + u8=\E[?%[;0123456789]c, + u9=\E[c, + # Encode modifiers using parameters (see "Xterm Control Sequences" ctlseqs.ms). # Note that this is unrelated to PCTERM. # @@ -885,6 +897,7 @@ xterm+pce0|fragment with modifyCursorKeys:0, kPRV7=\E[5;7~, use=xterm+edit, +# This is an ncurses extension ecma+strikeout|ECMA-48 strikeout/crossed-out, rmxx=\E[29m, smxx=\E[9m, @@ -960,7 +973,6 @@ xterm-basic|modern xterm terminal emulator - common, ritm=\E[23m, rmacs=\E(B, rmam=\E[?7l, - rmcup=\E[?1049l, rmir=\E[4l, rmkx=\E[?1l\E>, rmm=\E[?1034l, @@ -1042,19 +1054,16 @@ xterm-basic|modern xterm terminal emulator - common, sitm=\E[3m, smacs=\E(0, smam=\E[?7h, - smcup=\E[?1049h, smir=\E[4h, smkx=\E[?1h\E=, smm=\E[?1034h, smso=\E[7m, smul=\E[4m, tbc=\E[3g, - u6=\E[%i%d;%dR, - u7=\E[6n, - u8=\E[?%[;0123456789]c, - u9=\E[c, vpa=\E[%i%p1%dd, E3=\E[3J, + use=ansi+enq, + use=xterm+alt+title, use=xterm+kbs, # # The xterm-new description has all of the features, but is not completely @@ -1451,8 +1460,21 @@ 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, + xterm+titlestack|xterm 251 feature, - rmcup=\E[23;0;0t, smcup=\E[22;0;0t, + rmcup=\E[23;0;0t, + smcup=\E[22;0;0t, + +xterm+alt+title|xterm 90 and 251 features combined, + rmcup=\E[?1049l\E[23;0;0t, + smcup=\E[?1049h\E[22;0;0t, # # This should work for the commonly used "color xterm" variations (XFree86 # xterm, color_xterm, nxterm, rxvt). Note that it does not set 'bce', so for @@ -2091,7 +2113,6 @@ xterm-xf86-v44|xterm terminal emulator (XFree86 4.4 Window System), rin=\E[%p1%dT, rmacs=^O, rmam=\E[?7l, - rmcup=\E[?1049l, rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[27m, @@ -2166,7 +2187,6 @@ xterm-xf86-v44|xterm terminal emulator (XFree86 4.4 Window System), sgr0=\E[m\017, smacs=^N, smam=\E[?7h, - smcup=\E[?1049h, smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, @@ -2181,6 +2201,7 @@ xterm-xf86-v44|xterm terminal emulator (XFree86 4.4 Window System), kb1=\EOt, kb3=\EOv, kc2=\EOr, + use=xterm+alt1049, use=xterm+kbs, xterm-xfree86|xterm terminal emulator (XFree86 4.4 Window System), use=xterm-xf86-v44, diff --git a/xterm.h b/xterm.h index cd4bacde..634025f9 100644 --- a/xterm.h +++ b/xterm.h @@ -1,4 +1,4 @@ -/* $XTermId: xterm.h,v 1.787 2017/12/24 19:07:43 tom Exp $ */ +/* $XTermId: xterm.h,v 1.788 2017/12/26 00:47:29 tom Exp $ */ /* * Copyright 1999-2016,2017 by Thomas E. Dickey @@ -1356,6 +1356,7 @@ extern void deleteScrollback (TScreen * /* screen */); 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 (Widget /* scrollWidget */); extern void ScrollBarOff (XtermWidget /* xw */); diff --git a/xterm.log.html b/xterm.log.html index bf53a84f..2accfc78 100644 --- a/xterm.log.html +++ b/xterm.log.html @@ -30,7 +30,7 @@ * sale, use or other dealings in this Software without prior written * * authorization. * ***************************************************************************** - $XTermId: xterm.log.html,v 1.1806 2017/12/25 11:33:00 tom Exp $ + $XTermId: xterm.log.html,v 1.1810 2017/12/26 01:40:45 tom Exp $ --> @@ -950,6 +950,15 @@

Contents

Development