# ------------------------------------------------------------------------------
# INSTALL | 2
# button.c | 5 -
# charproc.c | 160 +++++++++++++++----------------------------------
# ctlseqs.ms | 8 ++
# fontutils.c | 178 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
# fontutils.h | 11 +++
# input.c | 17 +++++
# main.c | 8 +-
# menu.c | 37 ++++++++---
# menu.h | 19 +----
# misc.c | 1
# os2main.c | 2
# ptyx.h | 10 +++
# resize.c | 6 +
# scrollbar.c | 16 ++++
# version.h | 2
# xterm.h | 11 +++
# xterm.log.html | 34 ++++++++--
# 18 files changed, 375 insertions, 152 deletions
# ------------------------------------------------------------------------------
Index: INSTALL
--- xterm-91+/INSTALL Sun Dec 20 22:50:38 1998
+++ xterm-92/INSTALL Wed Feb 3 06:48:46 1999
@@ -36,7 +36,7 @@
--disable-active-icon disable X11R6.3 active-icon feature (default: on)
--disable-ansi-color disable ANSI color (default: on)
--disable-bold-color disable PC-style mapping of bold colors (default: on)
- --disable-boxchars disable fallback-support for box chars
+ --disable-boxchars disable fallback-support for box chars (default: on)
--disable-color-mode disable default colorMode resource (default: on)
--disable-doublechars disable support for double-size chars (default: on)
--disable-echo test: display "compiling" commands (default: on)
Index: button.c
--- xterm-91+/button.c Mon Feb 1 13:11:26 1999
+++ xterm-92/button.c Fri Feb 5 06:22:16 1999
@@ -1273,7 +1273,7 @@
Atom* std_targets;
unsigned long std_length;
XmuConvertStandardSelection(w, screen->selection_time, selection,
- target, type, (XtPointer *)&std_targets,
+ target, type, (XMU_POINTER *)&std_targets,
&std_length, format);
*length = std_length + 5;
targetP = (Atom*)XtMalloc(sizeof(Atom)*(*length));
@@ -1338,7 +1338,8 @@
return True;
}
if (XmuConvertStandardSelection(w, screen->selection_time, selection,
- target, type, value, length, format))
+ target, type, (XMU_POINTER *)value,
+ length, format))
return True;
/* else */
Index: charproc.c
--- xterm-91+/charproc.c Mon Feb 1 13:11:26 1999
+++ xterm-92/charproc.c Fri Feb 5 05:55:57 1999
@@ -192,14 +192,13 @@
#define XtNeightBitControl "eightBitControl"
#define XtNeightBitInput "eightBitInput"
#define XtNeightBitOutput "eightBitOutput"
-#define XtNfontDoublesize "fontDoublesize"
-/* #define XtNgeometry "geometry" */ /* See Xt/Shell.h */
+#define XtNfontDoublesize "fontDoublesize"
#define XtNhighlightColor "highlightColor"
#define XtNhighlightSelection "highlightSelection"
#define XtNhpLowerleftBugCompat "hpLowerleftBugCompat"
#define XtNinternalBorder "internalBorder"
#define XtNjumpScroll "jumpScroll"
-#define XtNkeyboardDialect "keyboardDialect"
+#define XtNkeyboardDialect "keyboardDialect"
#define XtNlogFile "logFile"
#define XtNlogInhibit "logInhibit"
#define XtNlogging "logging"
@@ -227,6 +226,7 @@
#define XtNscrollLines "scrollLines"
#define XtNscrollPos "scrollPos"
#define XtNscrollTtyOutput "scrollTtyOutput"
+#define XtNshiftKeys "shiftKeys"
#define XtNsignalInhibit "signalInhibit"
#define XtNtekGeometry "tekGeometry"
#define XtNtekInhibit "tekInhibit"
@@ -263,11 +263,11 @@
#define XtCEightBitControl "EightBitControl"
#define XtCEightBitInput "EightBitInput"
#define XtCEightBitOutput "EightBitOutput"
-#define XtCFontDoublesize "FontDoublesize"
-/* #define XtCGeometry "Geometry" */ /* See Xt/Shell.h */
+#define XtCFontDoublesize "FontDoublesize"
#define XtCHighlightSelection "HighlightSelection"
#define XtCHpLowerleftBugCompat "HpLowerleftBugCompat"
#define XtCJumpScroll "JumpScroll"
+#define XtCKeyboardDialect "KeyboardDialect"
#define XtCLogInhibit "LogInhibit"
#define XtCLogfile "Logfile"
#define XtCLogging "Logging"
@@ -290,6 +290,7 @@
#define XtCScrollCond "ScrollCond"
#define XtCScrollLines "ScrollLines"
#define XtCScrollPos "ScrollPos"
+#define XtCShiftKeys "ShiftKeys"
#define XtCSignalInhibit "SignalInhibit"
#define XtCTekInhibit "TekInhibit"
#define XtCTekSmall "TekSmall"
@@ -301,7 +302,11 @@
#define XtCXmcGlitch "XmcGlitch"
#define XtCXmcInline "XmcInline"
#define XtCXmcMoveSGR "XmcMoveSGR"
-#define XtCkeyboardDialect "KeyboardDialect"
+
+#ifdef NO_ACTIVE_ICON
+#define XtNgeometry "geometry"
+#define XtCGeometry "Geometry"
+#endif
#define doinput() (bcnt-- > 0 ? *bptr++ : in_put())
@@ -320,7 +325,6 @@
static void HandleBell PROTO_XT_ACTIONS_ARGS;
static void HandleIgnore PROTO_XT_ACTIONS_ARGS;
static void HandleKeymapChange PROTO_XT_ACTIONS_ARGS;
-static void HandleSetFont PROTO_XT_ACTIONS_ARGS;
static void HandleVisualBell PROTO_XT_ACTIONS_ARGS;
#if OPT_ZICONBEEP
static void HandleMapUnmap PROTO_XT_EV_HANDLER_ARGS;
@@ -457,6 +461,10 @@
#if OPT_HP_FUNC_KEYS
{ "set-hp-function-keys", HandleHpFunctionKeys },
#endif
+#if OPT_SHIFT_KEYS
+ { "larger-vt-font", HandleLargerFont },
+ { "smaller-vt-font", HandleSmallerFont },
+#endif
#if OPT_TEK4014
{ "set-terminal-type", HandleSetTerminalType },
{ "set-visibility", HandleVisibility },
@@ -523,7 +531,7 @@
XtOffsetOf(XtermWidgetRec, screen.cursor_blink),
XtRInt, (XtPointer) &defaultBlinkTime},
#endif
-{XtNkeyboardDialect, XtCkeyboardDialect, XtRString, sizeof(String),
+{XtNkeyboardDialect, XtCKeyboardDialect, XtRString, sizeof(String),
XtOffsetOf(XtermWidgetRec, screen.keyboard_dialect),
XtRString, (XtPointer) DFT_KBD_DIALECT},
{XtNeightBitInput, XtCEightBitInput, XtRBoolean, sizeof(Boolean),
@@ -658,6 +666,11 @@
{XtNsignalInhibit,XtCSignalInhibit,XtRBoolean, sizeof(Boolean),
XtOffsetOf(XtermWidgetRec, misc.signalInhibit),
XtRBoolean, (XtPointer) &defaultFALSE},
+#if OPT_SHIFT_KEYS
+{XtNshiftKeys, XtCShiftKeys, XtRBoolean, sizeof(Boolean),
+ XtOffsetOf(XtermWidgetRec, misc.shift_keys),
+ XtRBoolean, (XtPointer) &defaultTRUE},
+#endif
#if OPT_TEK4014
{XtNtekInhibit, XtCTekInhibit, XtRBoolean, sizeof(Boolean),
XtOffsetOf(XtermWidgetRec, misc.tekInhibit),
@@ -2716,6 +2729,7 @@
register int i, j;
for (i=0; i<nparam; ++i) {
+ TRACE(("%s %d\n", (func == bitset) ? "DECSET" : "DECRST", param[i]))
switch (param[i]) {
case 1: /* DECCKM */
(*func)(&termw->keyboard.flags, MODE_DECCKM);
@@ -2781,23 +2795,22 @@
set_mousemode(X10_MOUSE);
break;
case 18: /* DECPFF: print form feed */
- if(func == bitset)
- screen->printer_formfeed = ON;
- else
- screen->printer_formfeed = OFF;
+ screen->printer_formfeed = (func == bitset) ? ON : OFF;
break;
case 19: /* DECPEX: print extent */
- if(func == bitset)
- screen->printer_extent = ON;
- else
- screen->printer_extent = OFF;
+ screen->printer_extent = (func == bitset) ? ON : OFF;
break;
case 25: /* DECTCEM: Show/hide cursor (VT200) */
- if(func == bitset)
- screen->cursor_set = ON;
- else
- screen->cursor_set = OFF;
+ screen->cursor_set = (func == bitset) ? ON : OFF;
+ break;
+ case 30: /* rxvt */
+ if (screen->fullVwin.scrollbar != ((func == bitset) ? ON : OFF))
+ ToggleScrollBar(termw);
+ break;
+#if OPT_SHIFT_KEYS
+ term->misc.shift_keys = (func == bitset) ? ON : OFF;
break;
+#endif
case 38: /* DECTEK */
#if OPT_TEK4014
if(func == bitset && !(screen->inhibit & I_TEK)) {
@@ -2902,7 +2915,14 @@
}
XSelectInput(XtDisplay(termw), term->core.window, screen->event_mask);
break;
-
+ case 1010: /* rxvt */
+ screen->scrollttyoutput = (func == bitset) ? ON : OFF;
+ update_scrollttyoutput();
+ break;
+ case 1011: /* rxvt */
+ screen->scrollkey = (func == bitset) ? ON : OFF;
+ update_scrollkey();
+ break;
case 1048:
if (!termw->misc.titeInhibit) {
if(func == bitset)
@@ -3679,7 +3699,7 @@
char *s;
/* Zero out the entire "screen" component of "wnew" widget, then do
- * field-by-field assigment of "screen" fields that are named in the
+ * field-by-field assignment of "screen" fields that are named in the
* resource list.
*/
bzero ((char *) &wnew->screen, sizeof(wnew->screen));
@@ -3758,12 +3778,17 @@
if (wnew->screen.terminal_id > MAX_DECID)
wnew->screen.terminal_id = MAX_DECID;
TRACE(("term_id '%s' -> terminal_id %d\n",
- wnet->screen.term_id,
- wnet->screen.terminal_id))
+ wnew->screen.term_id,
+ wnew->screen.terminal_id))
wnew->screen.ansi_level = (wnew->screen.terminal_id / 100);
wnew->screen.visualbell = request->screen.visualbell;
+#if OPT_SHIFT_KEYS
+ wnew->misc.shift_keys = request->misc.shift_keys;
+#endif
#if OPT_TEK4014
+ wnew->misc.tekInhibit = request->misc.tekInhibit;
+ wnew->misc.tekSmall = request->misc.tekSmall;
wnew->screen.TekEmu = request->screen.TekEmu;
#endif
wnew->misc.re_verse = request->misc.re_verse;
@@ -4323,12 +4348,7 @@
refresh_needed = TRUE;
}
if (curvt->misc.scrollbar != newvt->misc.scrollbar) {
- if (newvt->misc.scrollbar) {
- ScrollBarOn (newvt, FALSE, FALSE);
- } else {
- ScrollBarOff (&newvt->screen);
- }
- update_scrollbar();
+ ToggleScrollBar(newvt);
}
return refresh_needed;
@@ -4941,86 +4961,6 @@
return;
}
-
-/* ARGSUSED */
-static void
-HandleSetFont(
- Widget w GCC_UNUSED,
- XEvent *event GCC_UNUSED,
- String *params,
- Cardinal *param_count)
-{
- int fontnum;
- char *name1 = NULL, *name2 = NULL;
-
- if (*param_count == 0) {
- fontnum = fontMenu_fontdefault;
- } else {
- Cardinal maxparams = 1; /* total number of params allowed */
-
- switch (params[0][0]) {
- case 'd': case 'D': case '0':
- fontnum = fontMenu_fontdefault; break;
- case '1':
- fontnum = fontMenu_font1; break;
- case '2':
- fontnum = fontMenu_font2; break;
- case '3':
- fontnum = fontMenu_font3; break;
- case '4':
- fontnum = fontMenu_font4; break;
- case '5':
- fontnum = fontMenu_font5; break;
- case '6':
- fontnum = fontMenu_font6; break;
- case 'e': case 'E':
- fontnum = fontMenu_fontescape; maxparams = 3; break;
- case 's': case 'S':
- fontnum = fontMenu_fontsel; maxparams = 2; break;
- default:
- Bell(XkbBI_MinorError,0);
- return;
- }
- if (*param_count > maxparams) { /* see if extra args given */
- Bell(XkbBI_MinorError,0);
- return;
- }
- switch (*param_count) { /* assign 'em */
- case 3:
- name2 = params[2];
- /* FALLTHRU */
- case 2:
- name1 = params[1];
- break;
- }
- }
-
- SetVTFont (fontnum, True, name1, name2);
-}
-
-
-void SetVTFont (
- int i,
- Bool doresize,
- char *name1,
- char *name2)
-{
- TScreen *screen = &term->screen;
-
- if (i < 0 || i >= NMENUFONTS) {
- Bell(XkbBI_MinorError,0);
- return;
- }
- if (i == fontMenu_fontsel) { /* go get the selection */
- FindFontSelection (name1, False); /* name1 = atom, name2 is ignored */
- return;
- }
- if (!name1) name1 = screen->menu_font_names[i];
- if (!xtermLoadFont(screen, name1, name2, doresize, i)) {
- Bell(XkbBI_MinorError,0);
- }
- return;
-}
void
set_cursor_gcs (TScreen *screen)
Index: ctlseqs.ms
--- xterm-91+/ctlseqs.ms Wed Dec 9 21:23:49 1998
+++ xterm-92/ctlseqs.ms Fri Feb 5 06:10:23 1999
@@ -775,6 +775,8 @@
\*(Ps = \*1\*8 \(-> Print form feed (DECPFF)
\*(Ps = \*1\*9 \(-> Set print extent to full screen (DECPEX)
\*(Ps = \*2\*5 \(-> Show Cursor (DECTCEM)
+ \*(Ps = \*3\*0 \(-> Show scrollbar (rxvt).
+ \*(Ps = \*3\*5 \(-> Enable shifted key-functions (rxvt).
\*(Ps = \*3\*8 \(-> Enter Tektronix Mode (DECTEK)
\*(Ps = \*4\*0 \(-> Allow 80 \z\(<-\(-> 132 Mode
\*(Ps = \*4\*1 \(-> \fImore\fP(1) fix (see \fIcurses\fP resource)
@@ -791,6 +793,8 @@
\*(Ps = \*1\*0\*0\*1 \(-> Use Hilite Mouse Tracking.
\*(Ps = \*1\*0\*0\*2 \(-> Use Cell Motion Mouse Tracking.
\*(Ps = \*1\*0\*0\*3 \(-> Use All Motion Mouse Tracking.
+ \*(Ps = \*1\*0\*1\*0 \(-> Scroll to bottom on tty output (rxvt).
+ \*(Ps = \*1\*0\*1\*1 \(-> Scroll to bottom on key press (rxvt).
\*(Ps = \*1\*0\*4\*7 \(-> Use Alternate Screen Buffer (unless
disabled by the \fBtiteInhibit\fP resource)
\*(Ps = \*1\*0\*4\*8 \(-> Save cursor as in DECSC (unless
@@ -813,6 +817,8 @@
\*(Ps = \*1\*8 \(-> Don't print form feed (DECPFF)
\*(Ps = \*1\*9 \(-> Limit print to scrolling region (DECPEX)
\*(Ps = \*2\*5 \(-> Hide Cursor (DECTCEM)
+ \*(Ps = \*3\*0 \(-> Don't show scrollbar (rxvt).
+ \*(Ps = \*3\*5 \(-> Disable shifted key-functions (rxvt).
\*(Ps = \*4\*0 \(-> Disallow 80 \z\(<-\(-> 132 Mode
\*(Ps = \*4\*1 \(-> No \fImore\fP(1) fix (see \fIcurses\fP resource)
\*(Ps = \*4\*2 \(-> Disable Nation Replacement Character sets (DECNRCM)
@@ -828,6 +834,8 @@
\*(Ps = \*1\*0\*0\*1 \(-> Don't Use Hilite Mouse Tracking
\*(Ps = \*1\*0\*0\*2 \(-> Don't Use Cell Motion Mouse Tracking
\*(Ps = \*1\*0\*0\*3 \(-> Don't Use All Motion Mouse Tracking
+ \*(Ps = \*1\*0\*1\*0 \(-> Don't scroll to bottom on tty output (rxvt).
+ \*(Ps = \*1\*0\*1\*1 \(-> Don't scroll to bottom on key press (rxvt).
\*(Ps = \*1\*0\*4\*7 \(-> Use Normal Screen Buffer, clearing screen
first if in the Alternate Screen (unless
disabled by the \fBtiteInhibit\fP resource)
Index: fontutils.c
--- xterm-91+/fontutils.c Sun Dec 20 22:50:38 1998
+++ xterm-92/fontutils.c Fri Feb 5 05:51:07 1999
@@ -356,6 +356,8 @@
#define EmptyFont(fs) ((fs)->ascent + (fs)->descent == 0 \
|| (fs)->max_bounds.width == 0)
+#define FontSize(fs) (((fs)->ascent + (fs)->descent) \
+ * (fs)->max_bounds.width)
int
xtermLoadFont (
@@ -522,6 +524,9 @@
fontMenuEntries[fontMenu_fontescape].widget,
TRUE);
}
+#if OPT_SHIFT_KEYS
+ screen->menu_font_sizes[fontnum] = FontSize(nfs);
+#endif
}
set_cursor_gcs (screen);
xtermUpdateFontInfo (screen, doresize);
@@ -874,3 +879,176 @@
XFreeGC(screen->display, gc2);
}
#endif
+
+#if OPT_SHIFT_KEYS
+static XFontStruct *
+xtermFindFont (
+ TScreen *screen,
+ int fontnum)
+{
+ XFontStruct *nfs = 0;
+ char *name;
+
+ if ((name = screen->menu_font_names[fontnum]) != 0
+ && (nfs = XLoadQueryFont (screen->display, name)) != 0) {
+ if (EmptyFont(nfs)) {
+ XFreeFont (screen->display, nfs);
+ nfs = 0;
+ }
+ }
+ return nfs;
+}
+
+/*
+ * Cache the font-sizes so subsequent larger/smaller font actions will go fast.
+ */
+static void
+lookupFontSizes(TScreen *screen)
+{
+ int n;
+ for (n = 0; n < NMENUFONTS; n++) {
+ if (screen->menu_font_sizes[n] == 0) {
+ XFontStruct *fs = xtermFindFont(screen, n);
+ screen->menu_font_sizes[n] = -1;
+ if (fs != 0) {
+ screen->menu_font_sizes[n] = FontSize(fs);
+ TRACE(("menu_font_sizes[%d] = %ld\n", n,
+ screen->menu_font_sizes[n]))
+ XFreeFont (screen->display, fs);
+ }
+ }
+ }
+}
+
+/* ARGSUSED */
+void
+HandleLargerFont(
+ Widget w GCC_UNUSED,
+ XEvent *event GCC_UNUSED,
+ String *params GCC_UNUSED,
+ Cardinal *param_count GCC_UNUSED)
+{
+ TScreen *screen = &term->screen;
+ int n, m;
+
+ lookupFontSizes(screen);
+ for (n = 0, m = -1; n < NMENUFONTS; n++) {
+ if ((screen->menu_font_sizes[n] > screen->menu_font_sizes[screen->menu_font_number])
+ && ((m < 0)
+ || (screen->menu_font_sizes[n] < screen->menu_font_sizes[m])))
+ m = n;
+ }
+ if (m >= 0) {
+ SetVTFont (m, TRUE, NULL, NULL);
+ } else {
+ Bell(XkbBI_MinorError,0);
+ }
+}
+
+/* ARGSUSED */
+void
+HandleSmallerFont(
+ Widget w GCC_UNUSED,
+ XEvent *event GCC_UNUSED,
+ String *params GCC_UNUSED,
+ Cardinal *param_count GCC_UNUSED)
+{
+ TScreen *screen = &term->screen;
+ int n, m;
+
+ lookupFontSizes(screen);
+ for (n = 0, m = -1; n < NMENUFONTS; n++) {
+ if ((screen->menu_font_sizes[n] < screen->menu_font_sizes[screen->menu_font_number])
+ && (screen->menu_font_sizes[n] > 0)
+ && ((m < 0)
+ || (screen->menu_font_sizes[n] > screen->menu_font_sizes[m])))
+ m = n;
+ }
+ if (m >= 0) {
+ SetVTFont (m, TRUE, NULL, NULL);
+ } else {
+ Bell(XkbBI_MinorError,0);
+ }
+}
+#endif
+
+/* ARGSUSED */
+void
+HandleSetFont(
+ Widget w GCC_UNUSED,
+ XEvent *event GCC_UNUSED,
+ String *params,
+ Cardinal *param_count)
+{
+ int fontnum;
+ char *name1 = NULL, *name2 = NULL;
+
+ if (*param_count == 0) {
+ fontnum = fontMenu_fontdefault;
+ } else {
+ Cardinal maxparams = 1; /* total number of params allowed */
+
+ switch (params[0][0]) {
+ case 'd': case 'D': case '0':
+ fontnum = fontMenu_fontdefault; break;
+ case '1':
+ fontnum = fontMenu_font1; break;
+ case '2':
+ fontnum = fontMenu_font2; break;
+ case '3':
+ fontnum = fontMenu_font3; break;
+ case '4':
+ fontnum = fontMenu_font4; break;
+ case '5':
+ fontnum = fontMenu_font5; break;
+ case '6':
+ fontnum = fontMenu_font6; break;
+ case 'e': case 'E':
+ fontnum = fontMenu_fontescape; maxparams = 3; break;
+ case 's': case 'S':
+ fontnum = fontMenu_fontsel; maxparams = 2; break;
+ default:
+ Bell(XkbBI_MinorError,0);
+ return;
+ }
+ if (*param_count > maxparams) { /* see if extra args given */
+ Bell(XkbBI_MinorError,0);
+ return;
+ }
+ switch (*param_count) { /* assign 'em */
+ case 3:
+ name2 = params[2];
+ /* FALLTHRU */
+ case 2:
+ name1 = params[1];
+ break;
+ }
+ }
+
+ SetVTFont (fontnum, True, name1, name2);
+}
+
+void SetVTFont (
+ int i,
+ Bool doresize,
+ char *name1,
+ char *name2)
+{
+ TScreen *screen = &term->screen;
+
+ if (i >= 0 && i < NMENUFONTS) {
+ if (i == fontMenu_fontsel) { /* go get the selection */
+ FindFontSelection (name1, False); /* name1 = atom, name2 is ignored */
+ return;
+ } else {
+ if (name1 == 0)
+ name1 = screen->menu_font_names[i];
+ if (xtermLoadFont(screen, name1, name2, doresize, i)) {
+ return;
+ }
+ }
+ }
+
+ Bell(XkbBI_MinorError,0);
+ return;
+}
Index: fontutils.h
--- xterm-91+/fontutils.h Sun Dec 20 22:50:38 1998
+++ xterm-92/fontutils.h Thu Feb 4 05:07:22 1999
@@ -38,12 +38,16 @@
#define included_fontutils_h 1
#include <ptyx.h>
+#include <proto.h>
extern int xtermLoadFont (TScreen *screen, char *nfontname, char *bfontname, Bool doresize, int fontnum);
+extern void HandleSetFont PROTO_XT_ACTIONS_ARGS;
+extern void SetVTFont (int i, Bool doresize, char *name1, char *name2);
extern void xtermComputeFontInfo (TScreen *screen, struct _vtwin *win, XFontStruct *font, int sbwidth);
extern void xtermSaveFontInfo (TScreen *screen, XFontStruct *font);
-extern void xtermUpdateFontInfo (TScreen *screen, Bool doresize);
extern void xtermSetCursorBox (TScreen *screen);
+extern void xtermUpdateFontInfo (TScreen *screen, Bool doresize);
+
#if OPT_DEC_CHRSET
extern char *xtermSpecialFont(unsigned atts, unsigned chrset);
@@ -52,6 +56,11 @@
#if OPT_BOX_CHARS
extern Bool xtermMissingChar(int ch, XFontStruct *font);
extern void xtermDrawBoxChar(TScreen *screen, int ch, unsigned flags, GC gc, int x, int y);
+#endif
+
+#if OPT_SHIFT_KEYS
+extern void HandleSmallerFont PROTO_XT_ACTIONS_ARGS;
+extern void HandleLargerFont PROTO_XT_ACTIONS_ARGS;
#endif
#endif /* included_fontutils_h */
Index: input.c
--- xterm-91+/input.c Sun Jan 24 14:44:33 1999
+++ xterm-92/input.c Wed Feb 3 20:18:19 1999
@@ -38,6 +38,7 @@
#include <X11/Xutil.h>
#include <data.h>
+#include <fontutils.h>
static char *kypd_num = " XXXXXXXX\tXXX\rXXXxxxxXXXXXXXXXXXXXXXXXXXXX*+,-./0123456789XXX=";
static char *kypd_apl = " ABCDEFGHIJKLMNOPQRSTUVWXYZ??????abcdefghijklmnopqrstuvwxyzXXX";
@@ -144,6 +145,22 @@
reply.a_final = 0;
reply.a_nparam = 0;
reply.a_inters = 0;
+
+#if OPT_SHIFT_KEYS
+ if (term->misc.shift_keys
+ && (event->state & ShiftMask) != 0) {
+ switch (keysym) {
+ case XK_KP_Add:
+ HandleLargerFont((Widget)0, (XEvent *)0, (String *)0, (Cardinal *)0);
+ return;
+ case XK_KP_Subtract:
+ HandleSmallerFont((Widget)0, (XEvent *)0, (String *)0, (Cardinal *)0);
+ return;
+ default:
+ break;
+ }
+ }
+#endif
/* VT220 & up: National Replacement Characters */
if ((nbytes == 1)
Index: main.c
--- xterm-91+/main.c Sun Jan 24 14:44:33 1999
+++ xterm-92/main.c Wed Feb 3 06:27:10 1999
@@ -2214,8 +2214,8 @@
#endif /* sony */
#endif /* USE_SYSV_TERMIO */
- char termcap [1024];
- char newtc [1024];
+ char termcap [TERMCAP_SIZE];
+ char newtc [TERMCAP_SIZE];
char *ptr, *shname, *shname_minus;
int i, no_dev_tty = FALSE;
char **envnew; /* new environment */
@@ -3628,8 +3628,8 @@
{
register TScreen *screen = &term->screen;
char *TermName = NULL;
- char termcap[1024];
- char newtc[1024];
+ char termcap[TERMCAP_SIZE];
+ char newtc[TERMCAP_SIZE];
char **envnew; /* new environment */
int envsize; /* elements in new environment */
char *ptr;
Index: menu.c
--- xterm-91+/menu.c Sun Dec 20 22:50:38 1998
+++ xterm-92/menu.c Wed Feb 3 19:58:15 1999
@@ -30,6 +30,7 @@
#include <ptyx.h>
#include <data.h>
#include <menu.h>
+#include <fontutils.h>
#include <X11/StringDefs.h>
#include <X11/Shell.h>
@@ -46,9 +47,6 @@
#include <xterm.h>
-Arg menuArgs[2] = {{ XtNleftBitmap, (XtArgVal) 0 },
- { XtNsensitive, (XtArgVal) 0 }};
-
static void do_8bit_control PROTO_XT_CALLBACK_ARGS;
static void do_allow132 PROTO_XT_CALLBACK_ARGS;
static void do_allowsends PROTO_XT_CALLBACK_ARGS;
@@ -696,14 +694,7 @@
XtPointer closure GCC_UNUSED,
XtPointer data GCC_UNUSED)
{
- register TScreen *screen = &term->screen;
-
- if (screen->fullVwin.scrollbar) {
- ScrollBarOff (screen);
- } else {
- ScrollBarOn (term, FALSE, FALSE);
- }
- update_scrollbar();
+ ToggleScrollBar(term);
}
@@ -1651,3 +1642,27 @@
do_tekcopy(w, (XtPointer)0, (XtPointer)0);
}
#endif /* OPT_TEK4014 */
+
+void
+UpdateMenuItem(Widget mi, XtArgVal val)
+{
+ static Arg menuArgs = { XtNleftBitmap, (XtArgVal) 0 };
+
+ if (mi) {
+ menuArgs.value = (XtArgVal) ((val)
+ ? term->screen.menu_item_bitmap
+ : None);
+ XtSetValues (mi, &menuArgs, (Cardinal) 1);
+ }
+}
+
+void
+SetItemSensitivity(Widget mi, XtArgVal val)
+{
+ static Arg menuArgs = { XtNsensitive, (XtArgVal) 0 };
+
+ if (mi) {
+ menuArgs.value = (XtArgVal) (val);
+ XtSetValues (mi, &menuArgs, (Cardinal) 1);
+ }
+}
Index: menu.h
--- xterm-91+/menu.h Sun Dec 20 22:50:38 1998
+++ xterm-92/menu.h Wed Feb 3 06:17:07 1999
@@ -52,8 +52,6 @@
extern MenuEntry tekMenuEntries[];
#endif
-extern Arg menuArgs[];
-
extern void Handle8BitControl PROTO_XT_ACTIONS_ARGS;
extern void HandleAllow132 PROTO_XT_ACTIONS_ARGS;
extern void HandleAllowSends PROTO_XT_ACTIONS_ARGS;
@@ -218,16 +216,11 @@
* macros for updating menus
*/
-#define update_menu_item(w,mi,val) { if (mi) { \
- menuArgs[0].value = (XtArgVal) ((val) ? term->screen.menu_item_bitmap \
- : None); \
- XtSetValues (mi, menuArgs, (Cardinal) 1); }}
-
-
-#define set_sensitivity(w,mi,val) { if (mi) { \
- menuArgs[1].value = (XtArgVal) (val); \
- XtSetValues (mi, menuArgs+1, (Cardinal) 1); }}
+#define update_menu_item(w,mi,val) UpdateMenuItem(mi,val)
+extern void UpdateMenuItem(Widget mi, XtArgVal val);
+#define set_sensitivity(w,mi,val) SetItemSensitivity(mi,val)
+extern void SetItemSensitivity(Widget mi, XtArgVal val);
/*
@@ -397,10 +390,10 @@
#define update_vttekmode() { \
update_menu_item (term->screen.vtMenu, \
vtMenuEntries[vtMenu_tekmode].widget, \
- term->screen.TekEmu) \
+ term->screen.TekEmu); \
update_menu_item (term->screen.tekMenu, \
tekMenuEntries[tekMenu_vtmode].widget, \
- !term->screen.TekEmu) }
+ !term->screen.TekEmu); }
#define update_vtshow() \
update_menu_item (term->screen.tekMenu, \
Index: misc.c
--- xterm-91+/misc.c Sun Oct 25 13:31:39 1998
+++ xterm-92/misc.c Wed Feb 3 19:58:34 1999
@@ -46,6 +46,7 @@
#include <data.h>
#include <error.h>
#include <menu.h>
+#include <fontutils.h>
#include <xcharmouse.h>
#if XtSpecificationRelease < 6
Index: os2main.c
--- xterm-91+/os2main.c Sun Jan 24 14:44:33 1999
+++ xterm-92/os2main.c Wed Feb 3 06:27:08 1999
@@ -1307,7 +1307,7 @@
struct termio tio;
int status;
- char termcap[1024], newtc[1024];
+ char termcap[TERMCAP_SIZE], newtc[TERMCAP_SIZE];
char *TermName = NULL;
char *ptr, *shname, buf[64];
int i, no_dev_tty = FALSE, envsize;
Index: ptyx.h
--- xterm-91+/ptyx.h Sun Jan 24 14:44:33 1999
+++ xterm-92/ptyx.h Fri Feb 5 05:36:09 1999
@@ -213,6 +213,8 @@
#define DFT_KBD_DIALECT "B" /* default USASCII */
#endif
+#define TERMCAP_SIZE 1500 /* 1023 is standard; 'screen' exceeds */
+
#define NMENUFONTS 9 /* font entries in fontMenu */
#define NBOX 5 /* Number of Points in box */
@@ -364,6 +366,10 @@
#define OPT_PRINT_COLORS 1 /* true if we print color information */
#endif
+#ifndef OPT_SHIFT_KEYS
+#define OPT_SHIFT_KEYS 1 /* true if xterm interprets shifted special-keys */
+#endif
+
#ifndef OPT_SUNPC_KBD
#define OPT_SUNPC_KBD 1 /* true if xterm supports Sun/PC keyboard map */
#endif
@@ -845,6 +851,7 @@
Pixmap menu_item_bitmap; /* mask for checking items */
Widget mainMenu, vtMenu, tekMenu, fontMenu;
String menu_font_names[NMENUFONTS];
+ unsigned long menu_font_sizes[NMENUFONTS];
int menu_font_number;
XIC xic;
} TScreen;
@@ -909,6 +916,9 @@
#endif /* NO_ACTIVE_ICON */
#if OPT_DEC_SOFTFONT
Boolean font_loadable;
+#endif
+#if OPT_SHIFT_KEYS
+ Boolean shift_keys; /* true if we interpret shifted special-keys */
#endif
} Misc;
Index: resize.c
--- xterm-91+/resize.c Sun Nov 22 13:07:22 1998
+++ xterm-92/resize.c Wed Feb 3 06:27:23 1999
@@ -267,6 +267,8 @@
#endif /* HAVE_TERMCAP_H */
#endif
+#define TERMCAP_SIZE 1500 /* 1023 is standard; 'screen' exceeds */
+
/*
resets termcap string to reflect current screen size
*/
@@ -290,8 +292,8 @@
#endif /* USE_SYSV_TERMIO */
#ifdef USE_TERMCAP
int ok_tcap = 1;
- char termcap [1024];
- char newtc [1024];
+ char termcap [TERMCAP_SIZE];
+ char newtc [TERMCAP_SIZE];
#endif /* USE_TERMCAP */
char buf[BUFSIZ];
#if defined(sun) && !defined(SVR4)
Index: scrollbar.c
--- xterm-91+/scrollbar.c Sun Oct 25 13:31:39 1998
+++ xterm-92/scrollbar.c Wed Feb 3 05:52:36 1999
@@ -406,6 +406,22 @@
}
}
+/*
+ * Toggle the visibility of the scrollbars.
+ */
+void
+ToggleScrollBar(XtermWidget w)
+{
+ register TScreen *screen = &w->screen;
+
+ if (screen->fullVwin.scrollbar) {
+ ScrollBarOff (screen);
+ } else {
+ ScrollBarOn (w, FALSE, FALSE);
+ }
+ update_scrollbar();
+}
+
/*ARGSUSED*/
static void
ScrollTextTo(
Index: version.h
--- xterm-91+/version.h Sun Jan 24 14:44:33 1999
+++ xterm-92/version.h Fri Feb 5 06:41:27 1999
@@ -6,4 +6,4 @@
* version of xterm has been built. The number in parentheses is my patch
* number (T.Dickey).
*/
-#define XTERM_VERSION "XFree86 3.9Nw(91)"
+#define XTERM_VERSION "XFree86 3.9Nz(92)"
Index: xterm.h
--- xterm-91+/xterm.h Sun Jan 24 14:44:33 1999
+++ xterm-92/xterm.h Fri Feb 5 06:20:53 1999
@@ -42,6 +42,8 @@
#define time_t long
#endif
+#define XMU_POINTER XtPointer
+
#endif /* HAVE_CONFIG_H */
/***====================================================================***/
@@ -78,6 +80,13 @@
#undef HAVE_WAITPID
#endif
+/*
+ * FIXME: Xmu interface in XFree86 3.9N* introduces an incompatibility.
+ */
+#ifndef XMU_POINTER
+#define XMU_POINTER XPointer
+#endif
+
/***====================================================================***/
#include <proto.h>
@@ -128,7 +137,6 @@
extern int v_write (int f, char *d, int len);
extern void FindFontSelection (char *atom_name, Bool justprobe);
extern void HideCursor (void);
-extern void SetVTFont (int i, Bool doresize, char *name1, char *name2);
extern void ShowCursor (void);
extern void SwitchBufPtrs (TScreen *screen);
extern void ToggleAlternate (TScreen *screen);
@@ -274,6 +282,7 @@
extern void ScrollBarOff (TScreen *screen);
extern void ScrollBarOn (XtermWidget xw, int init, int doalloc);
extern void ScrollBarReverseVideo (Widget scrollWidget);
+extern void ToggleScrollBar (XtermWidget w);
extern void WindowScroll (TScreen *screen, int top);
/* tabs.c */
Index: xterm.log.html
--- xterm-91+/xterm.log.html Sun Jan 24 14:44:33 1999
+++ xterm-92/xterm.log.html Fri Feb 5 06:47:06 1999
@@ -41,6 +41,7 @@
xc/programs/Xserver/hw/xfree86).
<UL>
+<LI><A HREF="#xterm_92">Patch #92 - 1999/2/5 - XFree86 3.9Nz</A>
<LI><A HREF="#xterm_91">Patch #91 - 1999/1/21 - XFree86 3.9Nw</A>
<LI><A HREF="#xterm_90">Patch #90 - 1998/12/13 - XFree86 3.9Nq</A>
<LI><A HREF="#xterm_89">Patch #89 - 1998/11/20 - XFree86 3.9Nm</A>
@@ -135,14 +136,37 @@
<LI><A HREF="#xterm_01">Patch #1 - 1996/1/6</A>
</UL>
-<H1><A NAME="xterm_91">Patch #91 - 1999/1/21 - XFree86 3.9Nw</A>/<H1>
+<H1><A NAME="xterm_92">Patch #92 - 1999/2/5 - XFree86 3.9Nz</A></H1>
+<ul>
+ <li>increase buffer size for tgetent (i.e., termcap) to 1500. This
+ fixes a problem where <em>screen</em> is built using ncurses or
+ GNU termcap and <em>xterm</em> is built using the standard termcap
+ interface. The former does not limit the termcap size, while the
+ latter is assumed to be no longer than 1023 characters. The
+ <em>screen</em> program's termcap entry is about 1200 characters
+ long.
+ <li>change update_menu_item() to a function, to simplify debugging.
+ This also reduces the executable by 4Kb.
+ <li>add control sequences for DECSET 30, 1010, 1011 like rxvt (enable
+ or disable some features that were only settable via resources or
+ command line arguments).
+ <li>add control sequence for DECSET 35, which enables/disables the
+ shifted keypad functions.
+ <li>add support for switching font sizes, by stepping through the
+ font menu using shifted keypad plus and minue.
+ <li>correct missing initialization of tekInhibit and tekSmall resources.
+ <li>correct ifdefs in charproc.c for XtNgeometry and XtCGeometry
+ (reported by Bram Moolenaar).
+</ul>
+
+<H1><A NAME="xterm_91">Patch #91 - 1999/1/21 - XFree86 3.9Nw</A></H1>
<ul>
<li>Implement logic to translate input characters which are mapped
when in vt220 National Replacement Character mode (requested by
Tomas Vanhala).
<li>Resync configure scripts with my patches to autoconf 2.13
<li>Change order of -lXmu and -lXext to accommodate cygwin32
- (reported by Vikas Vikas Agnihotri).
+ (reported by Vikas Agnihotri).
<li>Add "-ti" option to set terminal emulation level from command
line rather than via resource.
<li>Simplify some of the preprocessor logic using #elif.
@@ -1040,11 +1064,11 @@
This patch is based on analysis by Arfst Ludwig <arfst@luxor.IN-Berlin.DE>,
who reported:
-<dl>
-<P>
+<blockquote>
Setting the following resources xterm (all current versions) receives a
segmentation fault on <Btn2Up> after scrolling:
<PRE>
+
*XTerm*VT100*translations: #override \
~Shift~Ctrl<Btn2Up>: insert-selection(PRIMARY, CUT_BUFFER0)\n\
Shift~Ctrl<Btn2Up>: insert-selection(CLIPBOARD, CUT_BUFFER1)\n\
@@ -1058,7 +1082,7 @@
handler as first argument is not guaranteed to be a XtermWidget (it can
be the ScrollbarWidget). Instead of accessing the widget's member
directly XtDisplay gives the required pointer in a safe way.
-</dl>
+</blockquote>
I noticed that this was not the only instance (by reading the code, and testing
with his example), and extended the solution to check the widget-class to
ensure that it is indeed xterm's widget class before attempting to use it in