Skip to content

Commit

Permalink
snapshot of project "xterm", label xterm-330w
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasDickey committed Dec 26, 2017
1 parent d487695 commit 831bb44
Show file tree
Hide file tree
Showing 10 changed files with 196 additions and 75 deletions.
2 changes: 1 addition & 1 deletion MANIFEST
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 3 additions & 1 deletion charproc.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 },
Expand Down Expand Up @@ -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 },
Expand Down
90 changes: 52 additions & 38 deletions linedata.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -148,49 +136,75 @@ 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)
{
TScreen *screen = TScreenOf(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)
Expand Down
3 changes: 2 additions & 1 deletion ptyx.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
*/
Expand Down
34 changes: 32 additions & 2 deletions scrollbar.c
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down Expand Up @@ -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(
Expand Down
6 changes: 4 additions & 2 deletions termcap
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -244,3 +245,4 @@ v0|xterm|X11 terminal emulator:\
# should send.
xterm+kbs|fragment for backspace key:\
:kb=^H:
# :kb=\177:
45 changes: 33 additions & 12 deletions terminfo
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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:
# --------------------
Expand Down Expand Up @@ -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.
#
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion xterm.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 */);
Expand Down
Loading

0 comments on commit 831bb44

Please sign in to comment.