import xterm 229
This commit is contained in:
parent
f950121973
commit
bb994eccf4
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This header file was generated by ./256colres.pl
|
||||
*/
|
||||
/* $XFree86: xc/programs/xterm/256colres.h,v 1.5 2002/10/05 17:57:11 dickey Exp $ */
|
||||
/* $XTermId: 256colres.h,v 1.11 2007/06/12 00:44:23 tom Exp $ */
|
||||
|
||||
#ifndef included_256colres_h
|
||||
#define included_256colres_h
|
||||
|
@ -1,5 +1,6 @@
|
||||
#! /usr/bin/perl
|
||||
# Author: Thomas E. Dickey
|
||||
# $XTermId: 256colres.pl,v 1.15 2007/06/08 23:58:37 tom Exp $
|
||||
# $XFree86: xc/programs/xterm/256colres.pl,v 1.8 2002/10/05 17:57:11 dickey Exp $
|
||||
|
||||
# Construct a header file defining default resources for the 256-color model
|
||||
@ -9,11 +10,17 @@
|
||||
# reproduction of the standard ANSI colors, but possibly more
|
||||
# pleasing shades
|
||||
|
||||
use strict;
|
||||
|
||||
our ( $line1, $line2, $line3 );
|
||||
our ( $red, $green, $blue, $gray );
|
||||
our ( $level, $code, @steps );
|
||||
|
||||
print <<EOF;
|
||||
/*
|
||||
* This header file was generated by $0
|
||||
*/
|
||||
/* \$XFree86\$ */
|
||||
/* \$XTermId\$ */
|
||||
|
||||
#ifndef included_256colres_h
|
||||
#define included_256colres_h
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This header file was generated by ./88colres.pl
|
||||
*/
|
||||
/* $XFree86: xc/programs/xterm/88colres.h,v 1.4 2002/10/05 17:57:11 dickey Exp $ */
|
||||
/* $XTermId: 88colres.h,v 1.11 2007/06/12 00:44:21 tom Exp $ */
|
||||
|
||||
#ifndef included_88colres_h
|
||||
#define included_88colres_h
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/perl
|
||||
# Author: Steve Wall
|
||||
# $XTermId: 88colres.pl,v 1.15 2005/09/18 23:48:11 tom Exp $
|
||||
# $XTermId: 88colres.pl,v 1.16 2007/06/08 23:57:23 tom Exp $
|
||||
# $XFree86: xc/programs/xterm/88colres.pl,v 1.7 2005/09/18 23:48:11 dickey Exp $
|
||||
# Made from 256colres.pl
|
||||
|
||||
@ -11,11 +11,17 @@
|
||||
# reproduction of the standard ANSI colors, but possibly more
|
||||
# pleasing shades
|
||||
|
||||
use strict;
|
||||
|
||||
our ( $line1, $line2, $line3 );
|
||||
our ( $red, $green, $blue, $gray );
|
||||
our ( $level, $code, @steps );
|
||||
|
||||
print <<EOF;
|
||||
/*
|
||||
* This header file was generated by $0
|
||||
*/
|
||||
/* \$XFree86\$ */
|
||||
/* \$XTermId\$ */
|
||||
|
||||
#ifndef included_88colres_h
|
||||
#define included_88colres_h
|
||||
|
@ -1,4 +1,4 @@
|
||||
-- $XTermId: INSTALL,v 1.113 2007/03/18 22:46:21 tom Exp $
|
||||
-- $XTermId: INSTALL,v 1.115 2007/06/17 13:44:39 tom Exp $
|
||||
-- $XFree86: xc/programs/xterm/INSTALL,v 3.42 2006/02/13 01:14:57 dickey Exp $
|
||||
-------------------------------------------------------------------------------
|
||||
-- Copyright 1997-2006,2007 by Thomas E. Dickey
|
||||
@ -127,6 +127,15 @@ The options (in alphabetic order):
|
||||
Do not compile-in code that sets the default value of the colorMode
|
||||
resource to ``true''.
|
||||
|
||||
--disable-desktop disable install of xterm desktop files
|
||||
|
||||
Do not install the xterm desktop files, used in menus.
|
||||
These use the icons installed in the --with-icondir option.
|
||||
Use the environment variable $DESKTOP_FLAGS to supply options
|
||||
required by desktop-file-install.
|
||||
|
||||
Note: If desktop-utils is not found they will not be installed anyway.
|
||||
|
||||
--disable-doublechars disable support for double-size chars
|
||||
|
||||
Do not compile-in code that supports font-manipulation needed to
|
||||
@ -254,6 +263,10 @@ The options (in alphabetic order):
|
||||
Do not install xterm using setuid/setgid permissions. Drop setuid
|
||||
permissions on startup.
|
||||
|
||||
--disable-sun-fkeys
|
||||
|
||||
Do not compile-in code to support Sun-style function keys.
|
||||
|
||||
--disable-tek4014 disable tek4014 emulation
|
||||
|
||||
Do not compile-in code to support Tektronix 4014 emulation.
|
||||
@ -487,6 +500,9 @@ The options (in alphabetic order):
|
||||
/usr/local, you should use this option to customize the location to
|
||||
match your system configuration.
|
||||
|
||||
Use --without-app-defaults or --with-app-defaults=no to disable the
|
||||
feature.
|
||||
|
||||
--with-freetype-cflags -D/-I options for compiling with FreeType library
|
||||
|
||||
Override options provided by xft-config or freetype-config.
|
||||
@ -495,6 +511,19 @@ The options (in alphabetic order):
|
||||
|
||||
Override options provided by xft-config or freetype-config.
|
||||
|
||||
--with-icondir=DIR directory in which to install icon files (default: EPREFIX/share/pixmaps)
|
||||
|
||||
The X libraries may automatically search these locations:
|
||||
|
||||
$HOME/.icons
|
||||
$XDG_DATA_DIRS/icons
|
||||
/usr/share/pixmaps
|
||||
|
||||
See also
|
||||
http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
|
||||
|
||||
Use --without-icondir or --with-icondir=no to disable the feature.
|
||||
|
||||
--with-neXtaw link with neXT Athena library
|
||||
|
||||
Look for, compile and link with the neXT Athena widget library.
|
||||
|
@ -1,4 +1,4 @@
|
||||
MANIFEST for xterm-225, version xterm-225
|
||||
MANIFEST for xterm-229, version xterm-229
|
||||
--------------------------------------------------------------------------------
|
||||
MANIFEST this file
|
||||
256colres.h resource-definitions for 256-color mode
|
||||
@ -80,6 +80,7 @@ trace.c debugging trace functions for 'xterm'
|
||||
trace.h interface of trace.c
|
||||
util.c miscellaneous utility functions for 'xterm'
|
||||
uxterm wrapper script to make unicode-xterm
|
||||
uxterm.desktop sample desktop file for uxterm
|
||||
version.h version of xterm
|
||||
vms.c VMS version of xterm's spawn(), etc.
|
||||
vms.h system headers and definitions for vms.c
|
||||
@ -89,6 +90,7 @@ xcharmouse.h Jason Bacon's mouse-defs, cleaned up a little
|
||||
xstrings.c a few common string functions
|
||||
xstrings.h interface of xstrings.c
|
||||
xterm.dat application defaults for VMS port of 'xterm'
|
||||
xterm.desktop sample desktop file for xterm.
|
||||
xterm.h common includes, definitions and prototypes for 'xterm'
|
||||
xterm.log.html changelog for xterm
|
||||
xterm.man manual page for 'xterm'
|
||||
@ -99,6 +101,15 @@ xtermcap.h interface of xtermcap.c
|
||||
xtermcfg.hin configure script: template for xtermcfg.h
|
||||
xutf8.c JC's cleanup of UTF8
|
||||
xutf8.h JC's cleanup of UTF8
|
||||
icons subdirectory
|
||||
icons/xterm-color_32x32.xcf gimp file for editing 32x32 icon
|
||||
icons/xterm-color_32x32.xpm 32x32 color icon
|
||||
icons/xterm-color_48x48.xcf gimp file for editing 48x48 icon
|
||||
icons/xterm-color_48x48.xpm 48x48 color icon
|
||||
icons/xterm_32x32.xcf gimp file, for editing 32x32 icon
|
||||
icons/xterm_32x32.xpm 32x32 monochrome icon
|
||||
icons/xterm_48x48.xcf gimp file, for editing 48x48 icon
|
||||
icons/xterm_48x48.xpm 48x48 monochrome icon
|
||||
tektests subdirectory
|
||||
tektests/aitest.tek tek4014 demo: draw a globe
|
||||
tektests/dmerc.tek tek4014 demo: draws a Mercator projection with orbit
|
||||
|
@ -1,3 +1,7 @@
|
||||
-- $XTermId: README,v 1.3 2007/05/24 19:49:19 tom Exp $
|
||||
-- Below is the original README for xterm from 1991, for your amusement.
|
||||
-- For a better overview, see http://invisible-island.net/xterm/
|
||||
-------------------------------------------------------------------------------
|
||||
Abandon All Hope, Ye Who Enter Here
|
||||
|
||||
|
||||
|
23
app/xterm/aclocal.m4
vendored
23
app/xterm/aclocal.m4
vendored
@ -1,4 +1,4 @@
|
||||
dnl $XTermId: aclocal.m4,v 1.242 2007/03/21 22:06:40 tom Exp $
|
||||
dnl $XTermId: aclocal.m4,v 1.245 2007/06/27 22:13:37 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: 20 updated: 2005/08/06 18:37:29
|
||||
dnl CF_GCC_WARNINGS version: 21 updated: 2007/06/27 18:12:15
|
||||
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:
|
||||
@ -681,7 +681,7 @@ then
|
||||
AC_CHECKING([for $CC warning options])
|
||||
cf_save_CFLAGS="$CFLAGS"
|
||||
EXTRA_CFLAGS="-Wall"
|
||||
for cf_opt in $1 \
|
||||
for cf_opt in \
|
||||
wd1419 \
|
||||
wd1682 \
|
||||
wd1683 \
|
||||
@ -783,7 +783,7 @@ AC_DEFUN([CF_HELP_MESSAGE],
|
||||
[AC_DIVERT_HELP([$1])dnl
|
||||
])dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl CF_IMAKE_CFLAGS version: 28 updated: 2006/10/28 14:00:40
|
||||
dnl CF_IMAKE_CFLAGS version: 29 updated: 2007/05/24 20:53:19
|
||||
dnl ---------------
|
||||
dnl Use imake to obtain compiler flags. We could, in principle, write tests to
|
||||
dnl get these, but if imake is properly configured there is no point in doing
|
||||
@ -820,11 +820,14 @@ if mkdir conftestdir; then
|
||||
|
||||
cat >fix_cflags.sed <<'CF_EOF'
|
||||
s/\\//g
|
||||
s/[[ ]][[ ]]*/ /g
|
||||
s/"//g
|
||||
s/\(-D[[a-zA-Z0-9_]][[a-zA-Z0-9_]]*\)=\([[^\\'"0-9 ]][[^ ]]*\([[ ]][[ ]]*[[^- ]][[^ ]]*\)*\)/\1='\\"\2\\"'/g
|
||||
s/\(-D[[a-zA-Z0-9_]][[a-zA-Z0-9_]]*\)=\([[^\\'"0-9 ]][[^ ]]*\)[[ ]]/\1='\\"\2\\"' /g
|
||||
s/\(-D[[a-zA-Z0-9_]][[a-zA-Z0-9_]]*\)=\([[^\\'"0-9 ]][[^ ]]*\)$/\1='\\"\2\\"'/g
|
||||
s/^IMAKE[[ ]]*/IMAKE_CFLAGS="/
|
||||
:pack
|
||||
s/\(=[[^ ]][[^ ]]*\) \([[^-]]\)/\1 \2/g
|
||||
t pack
|
||||
s/\(-D[[a-zA-Z0-9_]][[a-zA-Z0-9_]]*\)=\([[^\'0-9 ]][[^ ]]*\)/\1='\\"\2\\"'/g
|
||||
s/^IMAKE[[ ]]/IMAKE_CFLAGS="/
|
||||
s/ / /g
|
||||
s/$/"/
|
||||
CF_EOF
|
||||
|
||||
@ -2194,7 +2197,7 @@ else
|
||||
fi
|
||||
])dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl CF_WITH_PATH version: 7 updated: 2006/08/03 15:20:08
|
||||
dnl CF_WITH_PATH version: 8 updated: 2007/05/13 13:16:35
|
||||
dnl ------------
|
||||
dnl Wrapper for AC_ARG_WITH to ensure that user supplies a pathname, not just
|
||||
dnl defaulting to yes/no.
|
||||
@ -2208,7 +2211,9 @@ dnl
|
||||
AC_DEFUN([CF_WITH_PATH],
|
||||
[AC_ARG_WITH($1,[$2 ](default: ifelse($4,,empty,$4)),,
|
||||
ifelse($4,,[withval="${$3}"],[withval="${$3-ifelse($5,,$4,$5)}"]))dnl
|
||||
if ifelse($5,,true,[test -n "$5"]) ; then
|
||||
CF_PATH_SYNTAX(withval)
|
||||
fi
|
||||
$3="$withval"
|
||||
AC_SUBST($3)dnl
|
||||
])dnl
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $XTermId: button.c,v 1.272 2007/03/19 23:42:48 tom Exp $ */
|
||||
/* $XTermId: button.c,v 1.277 2007/07/22 20:37:11 tom Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1999-2006,2007 by Thomas E. Dickey
|
||||
@ -51,7 +51,6 @@
|
||||
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
*/
|
||||
/* $XFree86: xc/programs/xterm/button.c,v 3.88 2006/06/19 00:36:50 dickey Exp $ */
|
||||
|
||||
/*
|
||||
button.c Handles button events in the terminal emulator.
|
||||
@ -1039,8 +1038,8 @@ struct _SelectionList {
|
||||
Time time;
|
||||
};
|
||||
|
||||
static int
|
||||
DECtoASCII(int ch)
|
||||
static unsigned
|
||||
DECtoASCII(unsigned ch)
|
||||
{
|
||||
if (ch < 32) {
|
||||
ch = "###########+++++##-##++++|######"[ch];
|
||||
@ -1087,7 +1086,7 @@ UTF8toLatin1(Char * s, unsigned len, unsigned long *result)
|
||||
if (eqv == value)
|
||||
eqv = '#';
|
||||
*q++ = eqv;
|
||||
if (iswide(value))
|
||||
if (iswide((wchar_t) value))
|
||||
*q++ = ' ';
|
||||
}
|
||||
}
|
||||
@ -1611,7 +1610,8 @@ SelectionReceived(Widget w,
|
||||
GettingSelection(dpy, *type, line, *length);
|
||||
|
||||
#if OPT_WIDE_CHARS
|
||||
if (*type == XA_UTF8_STRING(dpy)) {
|
||||
if (*type == XA_UTF8_STRING(dpy) &&
|
||||
!(screen->wide_chars || screen->c1_printable)) {
|
||||
rc = Xutf8TextPropertyToTextList(dpy, &text_prop,
|
||||
&text_list, &text_list_count);
|
||||
if (text_list != NULL && text_list_count != 0) {
|
||||
@ -2612,17 +2612,23 @@ do_select_regex(TScreen * screen, CELL * startc, CELL * endc)
|
||||
}
|
||||
}
|
||||
if (best_col >= 0) {
|
||||
int best_nxt = best_col + best_len;
|
||||
columnToCell(screen, firstRow, best_col, startc);
|
||||
columnToCell(screen, firstRow, best_col + best_len, endc);
|
||||
columnToCell(screen, firstRow, best_nxt, endc);
|
||||
TRACE(("search::%s\n", search));
|
||||
TRACE(("indexed:%d..%d -> %d..%d\n",
|
||||
best_col, best_col + best_len,
|
||||
best_col, best_nxt,
|
||||
indexed[best_col],
|
||||
indexed[best_col + best_len]));
|
||||
TRACE(("matched:%.*s\n",
|
||||
indexed[best_col + best_len] + 1 -
|
||||
indexed[best_nxt]));
|
||||
TRACE(("matched:%d:%s\n",
|
||||
indexed[best_nxt] + 1 -
|
||||
indexed[best_col],
|
||||
search + indexed[best_col]));
|
||||
visibleChars(PAIRED_CHARS((Char *) (search +
|
||||
indexed[best_col]),
|
||||
0),
|
||||
(unsigned) (indexed[best_nxt] +
|
||||
1 -
|
||||
indexed[best_col]))));
|
||||
}
|
||||
free(search);
|
||||
}
|
||||
@ -2990,7 +2996,9 @@ SaltTextAway(XtermWidget xw,
|
||||
}
|
||||
*lp = '\0'; /* make sure we have end marked */
|
||||
|
||||
TRACE(("Salted TEXT:%d:%.*s\n", lp - line, lp - line, line));
|
||||
TRACE(("Salted TEXT:%d:%s\n", lp - line,
|
||||
visibleChars(PAIRED_CHARS(line, 0), (unsigned) (lp - line))));
|
||||
|
||||
screen->selection_length = (lp - line);
|
||||
_OwnSelection(xw, params, num_params);
|
||||
}
|
||||
@ -3492,7 +3500,7 @@ SaveText(TScreen * screen,
|
||||
are in memory attached to the HIDDEN_CHAR */
|
||||
if_OPT_WIDE_CHARS(screen, {
|
||||
if (screen->utf8_mode != uFalse) {
|
||||
int ch;
|
||||
unsigned ch;
|
||||
int off;
|
||||
for (off = OFF_FINAL; off < MAX_PTRS; off += 2) {
|
||||
if ((ch = XTERM_CELLC(row, i, off)) == 0)
|
||||
@ -3507,7 +3515,7 @@ SaveText(TScreen * screen,
|
||||
if (screen->utf8_mode != uFalse) {
|
||||
lp = convertToUTF8(lp, (c != 0) ? c : ' ');
|
||||
if_OPT_WIDE_CHARS(screen, {
|
||||
int ch;
|
||||
unsigned ch;
|
||||
int off;
|
||||
for (off = OFF_FINAL; off < MAX_PTRS; off += 2) {
|
||||
if ((ch = XTERM_CELLC(row, i, off)) == 0)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $XTermId: cachedGCs.c,v 1.35 2007/03/21 23:21:50 tom Exp $ */
|
||||
/* $XTermId: cachedGCs.c,v 1.38 2007/06/09 00:08:39 tom Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
@ -245,26 +245,36 @@ tracePixel(XtermWidget xw, Pixel value)
|
||||
#endif /* OPT_TRACE > 1 */
|
||||
#endif /* OPT_TRACE */
|
||||
|
||||
static CgsCache *
|
||||
allocCache(void **cache_pointer)
|
||||
{
|
||||
if (*cache_pointer == 0) {
|
||||
*cache_pointer = TypeCallocN(CgsCache, gcMAX);
|
||||
TRACE(("allocCache %p\n", cache_pointer));
|
||||
}
|
||||
return *((CgsCache **) cache_pointer);
|
||||
}
|
||||
|
||||
/*
|
||||
* FIXME: move the cache into XtermWidget
|
||||
* Returns the appropriate cache pointer.
|
||||
*/
|
||||
static CgsCache *
|
||||
myCache(XtermWidget xw GCC_UNUSED, VTwin * cgsWin GCC_UNUSED, CgsEnum cgsId)
|
||||
myCache(XtermWidget xw, VTwin * cgsWin, CgsEnum cgsId)
|
||||
{
|
||||
static CgsCache *main_cache;
|
||||
CgsCache *my_cache;
|
||||
CgsCache *result = 0;
|
||||
|
||||
if (main_cache == 0)
|
||||
main_cache = (CgsCache *) calloc(gcMAX, sizeof(CgsCache));
|
||||
my_cache = main_cache;
|
||||
if ((int) cgsId >= 0 && cgsId < gcMAX) {
|
||||
#ifndef NO_ACTIVE_ICON
|
||||
static CgsCache icon_cache[gcMAX];
|
||||
#ifdef NO_ACTIVE_ICON
|
||||
(void) xw;
|
||||
(void) cgsWin;
|
||||
#else
|
||||
if (cgsWin == &(xw->screen.iconVwin))
|
||||
my_cache = icon_cache;
|
||||
result = allocCache(&(xw->screen.icon_cgs_cache));
|
||||
else
|
||||
#endif
|
||||
result = my_cache + cgsId;
|
||||
result = allocCache(&(xw->screen.main_cgs_cache));
|
||||
|
||||
result += cgsId;
|
||||
if (result->data == 0) {
|
||||
result->data = result->list;
|
||||
}
|
||||
@ -803,3 +813,14 @@ freeCgs(XtermWidget xw, VTwin * cgsWin, CgsEnum cgsId)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef NO_LEAKS
|
||||
void
|
||||
noleaks_cachedCgs(XtermWidget xw)
|
||||
{
|
||||
#ifndef NO_ACTIVE_ICON
|
||||
free(xw->screen.icon_cgs_cache);
|
||||
#endif
|
||||
free(xw->screen.main_cgs_cache);
|
||||
}
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $XTermId: charclass.c,v 1.14 2006/02/13 01:14:58 tom Exp $ */
|
||||
/* $XTermId: charclass.c,v 1.18 2007/07/15 16:18:41 tom Exp $ */
|
||||
|
||||
/*
|
||||
* Compact and efficient reimplementation of the
|
||||
@ -6,21 +6,22 @@
|
||||
*
|
||||
* Markus Kuhn -- mkuhn@acm.org -- 2000-07-03
|
||||
*
|
||||
* Xterm allows users to select entire words with a double-click on
|
||||
* the left mouse button. Opinions might differ on what type of
|
||||
* characters are part of separate words, therefore xterm allows users
|
||||
* to configure a class code for each 8-bit character. Words are
|
||||
* maximum length sequences of neighboring characters with identical
|
||||
* class code. Extending this mechanism to Unicode naively would
|
||||
* create an at least 2^16 entries (128 kB) long class code table.
|
||||
* Instead, we transform the character class table into a list
|
||||
* of intervals, that will be accessed via a linear search.
|
||||
* Changes made to the table by the user will be appended. A special
|
||||
* class code -1 (default) marks characters who have their code number
|
||||
* as the class code. We could alternatively use a sorted table of
|
||||
* non-overlapping intervals that can be accessed via binary search,
|
||||
* but merging in new intervals is significantly more hassle and
|
||||
* not worth the effort here.
|
||||
* Xterm allows users to select entire words with a double-click on the left
|
||||
* mouse button. Opinions might differ on what type of characters are part of
|
||||
* separate words, therefore xterm allows users to configure a class code for
|
||||
* each 8-bit character. Words are maximum length sequences of neighboring
|
||||
* characters with identical class code. Extending this mechanism to Unicode
|
||||
* naively would create an at least 2^16 entries (128 kB) long class code
|
||||
* table.
|
||||
*
|
||||
* Instead, we transform the character class table into a list of intervals,
|
||||
* that will be accessed via a linear search. Changes made to the table by the
|
||||
* user will be appended. A special class code IDENT (default) marks
|
||||
* characters who have their code number as the class code.
|
||||
*
|
||||
* We could alternatively use a sorted table of non-overlapping intervals that
|
||||
* can be accessed via binary search, but merging in new intervals is
|
||||
* significantly more hassle and not worth the effort here.
|
||||
*/
|
||||
/* $XFree86: xc/programs/xterm/charclass.c,v 1.7 2006/02/13 01:14:58 dickey Exp $ */
|
||||
|
||||
@ -65,6 +66,13 @@ SetCharacterClassRange(int low, int high, int value)
|
||||
return 0;
|
||||
}
|
||||
|
||||
enum {
|
||||
IDENT = -1,
|
||||
ALNUM = 48,
|
||||
CNTRL = 1,
|
||||
BLANK = 32,
|
||||
} Classes;
|
||||
|
||||
void
|
||||
init_classtab(void)
|
||||
{
|
||||
@ -78,48 +86,48 @@ init_classtab(void)
|
||||
classtab[0].last = 0;
|
||||
|
||||
/* old xterm default classes */
|
||||
SetCharacterClassRange(0, 0, 32);
|
||||
SetCharacterClassRange(1, 31, 1);
|
||||
SetCharacterClassRange('\t', '\t', 32);
|
||||
SetCharacterClassRange('0', '9', 48);
|
||||
SetCharacterClassRange('A', 'Z', 48);
|
||||
SetCharacterClassRange('_', '_', 48);
|
||||
SetCharacterClassRange('a', 'z', 48);
|
||||
SetCharacterClassRange(127, 159, 1);
|
||||
SetCharacterClassRange(160, 191, -1);
|
||||
SetCharacterClassRange(192, 255, 48);
|
||||
SetCharacterClassRange(215, 215, 216);
|
||||
SetCharacterClassRange(247, 247, 248);
|
||||
SetCharacterClassRange(0, 0, BLANK);
|
||||
SetCharacterClassRange(1, 31, CNTRL);
|
||||
SetCharacterClassRange('\t', '\t', BLANK);
|
||||
SetCharacterClassRange('0', '9', ALNUM);
|
||||
SetCharacterClassRange('A', 'Z', ALNUM);
|
||||
SetCharacterClassRange('_', '_', ALNUM);
|
||||
SetCharacterClassRange('a', 'z', ALNUM);
|
||||
SetCharacterClassRange(127, 159, CNTRL);
|
||||
SetCharacterClassRange(160, 191, IDENT);
|
||||
SetCharacterClassRange(192, 255, ALNUM);
|
||||
SetCharacterClassRange(215, 215, IDENT);
|
||||
SetCharacterClassRange(247, 247, IDENT);
|
||||
|
||||
/* added Unicode classes */
|
||||
SetCharacterClassRange(0x0100, 0xffdf, 48); /* mostly characters */
|
||||
SetCharacterClassRange(0x037e, 0x037e, -1); /* Greek question mark */
|
||||
SetCharacterClassRange(0x0387, 0x0387, -1); /* Greek ano teleia */
|
||||
SetCharacterClassRange(0x055a, 0x055f, -1); /* Armenian punctuation */
|
||||
SetCharacterClassRange(0x0589, 0x0589, -1); /* Armenian full stop */
|
||||
SetCharacterClassRange(0x0700, 0x070d, -1); /* Syriac punctuation */
|
||||
SetCharacterClassRange(0x104a, 0x104f, -1); /* Myanmar punctuation */
|
||||
SetCharacterClassRange(0x10fb, 0x10fb, -1); /* Georgian punctuation */
|
||||
SetCharacterClassRange(0x1361, 0x1368, -1); /* Ethiopic punctuation */
|
||||
SetCharacterClassRange(0x166d, 0x166e, -1); /* Canadian Syl. punctuation */
|
||||
SetCharacterClassRange(0x17d4, 0x17dc, -1); /* Khmer punctuation */
|
||||
SetCharacterClassRange(0x1800, 0x180a, -1); /* Mongolian punctuation */
|
||||
SetCharacterClassRange(0x2000, 0x200a, 32); /* spaces */
|
||||
SetCharacterClassRange(0x200b, 0x27ff, -1); /* punctuation and symbols */
|
||||
SetCharacterClassRange(0x0100, 0xffdf, ALNUM); /* mostly characters */
|
||||
SetCharacterClassRange(0x037e, 0x037e, IDENT); /* Greek question mark */
|
||||
SetCharacterClassRange(0x0387, 0x0387, IDENT); /* Greek ano teleia */
|
||||
SetCharacterClassRange(0x055a, 0x055f, IDENT); /* Armenian punctuation */
|
||||
SetCharacterClassRange(0x0589, 0x0589, IDENT); /* Armenian full stop */
|
||||
SetCharacterClassRange(0x0700, 0x070d, IDENT); /* Syriac punctuation */
|
||||
SetCharacterClassRange(0x104a, 0x104f, IDENT); /* Myanmar punctuation */
|
||||
SetCharacterClassRange(0x10fb, 0x10fb, IDENT); /* Georgian punctuation */
|
||||
SetCharacterClassRange(0x1361, 0x1368, IDENT); /* Ethiopic punctuation */
|
||||
SetCharacterClassRange(0x166d, 0x166e, IDENT); /* Canadian Syl. punctuation */
|
||||
SetCharacterClassRange(0x17d4, 0x17dc, IDENT); /* Khmer punctuation */
|
||||
SetCharacterClassRange(0x1800, 0x180a, IDENT); /* Mongolian punctuation */
|
||||
SetCharacterClassRange(0x2000, 0x200a, BLANK); /* spaces */
|
||||
SetCharacterClassRange(0x200b, 0x27ff, IDENT); /* punctuation and symbols */
|
||||
SetCharacterClassRange(0x2070, 0x207f, 0x2070); /* superscript */
|
||||
SetCharacterClassRange(0x2080, 0x208f, 0x2080); /* subscript */
|
||||
SetCharacterClassRange(0x3000, 0x3000, 32); /* ideographic space */
|
||||
SetCharacterClassRange(0x3001, 0x3020, -1); /* ideographic punctuation */
|
||||
SetCharacterClassRange(0x3000, 0x3000, BLANK); /* ideographic space */
|
||||
SetCharacterClassRange(0x3001, 0x3020, IDENT); /* ideographic punctuation */
|
||||
SetCharacterClassRange(0x3040, 0x309f, 0x3040); /* Hiragana */
|
||||
SetCharacterClassRange(0x30a0, 0x30ff, 0x30a0); /* Katakana */
|
||||
SetCharacterClassRange(0x3300, 0x9fff, 0x4e00); /* CJK Ideographs */
|
||||
SetCharacterClassRange(0xac00, 0xd7a3, 0xac00); /* Hangul Syllables */
|
||||
SetCharacterClassRange(0xf900, 0xfaff, 0x4e00); /* CJK Ideographs */
|
||||
SetCharacterClassRange(0xfe30, 0xfe6b, -1); /* punctuation forms */
|
||||
SetCharacterClassRange(0xff00, 0xff0f, -1); /* half/fullwidth ASCII */
|
||||
SetCharacterClassRange(0xff1a, 0xff20, -1); /* half/fullwidth ASCII */
|
||||
SetCharacterClassRange(0xff3b, 0xff40, -1); /* half/fullwidth ASCII */
|
||||
SetCharacterClassRange(0xff5b, 0xff64, -1); /* half/fullwidth ASCII */
|
||||
SetCharacterClassRange(0xfe30, 0xfe6b, IDENT); /* punctuation forms */
|
||||
SetCharacterClassRange(0xff00, 0xff0f, IDENT); /* half/fullwidth ASCII */
|
||||
SetCharacterClassRange(0xff1a, 0xff20, IDENT); /* half/fullwidth ASCII */
|
||||
SetCharacterClassRange(0xff3b, 0xff40, IDENT); /* half/fullwidth ASCII */
|
||||
SetCharacterClassRange(0xff5b, 0xff64, IDENT); /* half/fullwidth ASCII */
|
||||
|
||||
return;
|
||||
}
|
||||
@ -127,7 +135,7 @@ init_classtab(void)
|
||||
int
|
||||
CharacterClass(int c)
|
||||
{
|
||||
int i, cclass = -1;
|
||||
int i, cclass = IDENT;
|
||||
|
||||
for (i = classtab[0].first; i <= classtab[0].last; i++)
|
||||
if (classtab[i].first <= c && classtab[i].last >= c)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $XTermId: charproc.c,v 1.784 2007/03/20 23:59:25 tom Exp $ */
|
||||
/* $XTermId: charproc.c,v 1.810 2007/07/17 21:09:48 tom Exp $ */
|
||||
|
||||
/* $XFree86: xc/programs/xterm/charproc.c,v 3.185 2006/06/20 00:42:38 dickey Exp $ */
|
||||
|
||||
@ -133,12 +133,6 @@ in this Software without prior written authorization from The Open Group.
|
||||
#include <charclass.h>
|
||||
#include <xstrings.h>
|
||||
|
||||
#if OPT_ZICONBEEP || OPT_TOOLBAR
|
||||
#define HANDLE_STRUCT_NOTIFY 1
|
||||
#else
|
||||
#define HANDLE_STRUCT_NOTIFY 0
|
||||
#endif
|
||||
|
||||
static IChar doinput(void);
|
||||
static int set_character_class(char *s);
|
||||
static void FromAlternate(XtermWidget /* xw */ );
|
||||
@ -146,9 +140,6 @@ static void RequestResize(XtermWidget termw, int rows, int cols, Bool text);
|
||||
static void SwitchBufs(XtermWidget xw);
|
||||
static void ToAlternate(XtermWidget /* xw */ );
|
||||
static void VTallocbuf(void);
|
||||
static void WriteText(XtermWidget xw,
|
||||
PAIRED_CHARS(Char * str, Char * str2),
|
||||
Cardinal len);
|
||||
static void ansi_modes(XtermWidget termw,
|
||||
void (*func) (unsigned *p, unsigned mask));
|
||||
static void bitclr(unsigned *p, unsigned mask);
|
||||
@ -399,6 +390,7 @@ static XtActionsRec actionsList[] = {
|
||||
static XtResource resources[] =
|
||||
{
|
||||
Bres(XtNallowSendEvents, XtCAllowSendEvents, screen.allowSendEvent0, False),
|
||||
Bres(XtNallowTitleOps, XtCAllowTitleOps, screen.allowTitleOp0, True),
|
||||
Bres(XtNallowWindowOps, XtCAllowWindowOps, screen.allowWindowOp0, True),
|
||||
Bres(XtNaltIsNotMeta, XtCAltIsNotMeta, screen.alt_is_not_meta, False),
|
||||
Bres(XtNaltSendsEscape, XtCAltSendsEscape, screen.alt_sends_esc, False),
|
||||
@ -550,6 +542,7 @@ static XtResource resources[] =
|
||||
#if OPT_HIGHLIGHT_COLOR
|
||||
Tres(XtNhighlightColor, XtCHighlightColor, HIGHLIGHT_BG, XtDefaultForeground),
|
||||
Tres(XtNhighlightTextColor, XtCHighlightTextColor, HIGHLIGHT_FG, XtDefaultBackground),
|
||||
Bres(XtNhighlightReverse, XtCHighlightReverse, screen.hilite_reverse, True),
|
||||
#endif /* OPT_HIGHLIGHT_COLOR */
|
||||
|
||||
#if OPT_INPUT_METHOD
|
||||
@ -656,6 +649,8 @@ static XtResource resources[] =
|
||||
Bres(XtNvt100Graphics, XtCVT100Graphics, screen.vt100_graphics, True),
|
||||
Bres(XtNwideChars, XtCWideChars, screen.wide_chars, False),
|
||||
Ires(XtNcombiningChars, XtCCombiningChars, screen.max_combining, 2),
|
||||
Ires(XtNmkSamplePass, XtCMkSamplePass, misc.mk_samplepass, 256),
|
||||
Ires(XtNmkSampleSize, XtCMkSampleSize, misc.mk_samplesize, 1024),
|
||||
Ires(XtNutf8, XtCUtf8, screen.utf8_mode, uDefault),
|
||||
Sres(XtNwideBoldFont, XtCWideBoldFont, misc.default_font.f_wb, DEFWIDEBOLDFONT),
|
||||
Sres(XtNwideFont, XtCWideFont, misc.default_font.f_w, DEFWIDEFONT),
|
||||
@ -814,6 +809,11 @@ xtermAddInput(Widget w)
|
||||
XtAppAddActions(app_con, input_actions, XtNumber(input_actions));
|
||||
#endif
|
||||
XtAugmentTranslations(w, XtParseTranslationTable(defaultTranslations));
|
||||
|
||||
#if OPT_EXTRA_PASTE
|
||||
if (term && term->keyboard.extra_translations)
|
||||
XtOverrideTranslations((Widget) term, XtParseTranslationTable(term->keyboard.extra_translations));
|
||||
#endif
|
||||
}
|
||||
|
||||
#if OPT_ISO_COLORS
|
||||
@ -1214,7 +1214,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* substitute combined character with precomposed character
|
||||
/* substitute combined character with precomposed character
|
||||
* only if it does not change the width of the base character
|
||||
*/
|
||||
if (precomposed != -1 && my_wcwidth(precomposed) == my_wcwidth(prev)) {
|
||||
@ -1527,7 +1527,8 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
|
||||
xtermIndex(xw, 1);
|
||||
if (xw->flags & LINEFEED)
|
||||
CarriageReturn(screen);
|
||||
do_xevents();
|
||||
else
|
||||
do_xevents();
|
||||
break;
|
||||
|
||||
case CASE_CBT:
|
||||
@ -2488,7 +2489,6 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
|
||||
TRACE(("CASE_NEL\n"));
|
||||
xtermIndex(xw, 1);
|
||||
CarriageReturn(screen);
|
||||
do_xevents();
|
||||
sp->parsestate = sp->groundtable;
|
||||
break;
|
||||
|
||||
@ -3266,13 +3266,8 @@ in_put(XtermWidget xw)
|
||||
#endif
|
||||
#if OPT_SESSION_MGT
|
||||
} else if (resource.sessionMgt) {
|
||||
/*
|
||||
* When session management is enabled, we should not block since
|
||||
* session related events can arrive any time.
|
||||
*/
|
||||
select_timeout.tv_sec = 1;
|
||||
select_timeout.tv_usec = 0;
|
||||
time_select = 1;
|
||||
if (ice_fd >= 0)
|
||||
FD_SET(ice_fd, &select_mask);
|
||||
#endif
|
||||
}
|
||||
if (need_cleanup)
|
||||
@ -3337,6 +3332,18 @@ PreeditPosition(TScreen * screen)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
WrapLine(XtermWidget xw)
|
||||
{
|
||||
TScreen *screen = &(xw->screen);
|
||||
|
||||
/* mark that we had to wrap this line */
|
||||
ScrnSetFlag(screen, screen->cur_row, LINEWRAPPED);
|
||||
xtermAutoPrint('\n');
|
||||
xtermIndex(xw, 1);
|
||||
set_cur_col(screen, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* process a string of characters according to the character set indicated
|
||||
* by charset. worry about end of line conditions (wraparound if selected).
|
||||
@ -3387,15 +3394,13 @@ dotext(XtermWidget xw,
|
||||
int last_chomp = 0;
|
||||
chars_chomped = 0;
|
||||
|
||||
if (screen->do_wrap && (xw->flags & WRAPAROUND)) {
|
||||
/* mark that we had to wrap this line */
|
||||
ScrnSetWrapped(screen, screen->cur_row);
|
||||
xtermAutoPrint('\n');
|
||||
xtermIndex(xw, 1);
|
||||
set_cur_col(screen, 0);
|
||||
if (screen->do_wrap) {
|
||||
screen->do_wrap = 0;
|
||||
width_available = MaxCols(screen) - screen->cur_col;
|
||||
next_col = screen->cur_col;
|
||||
if ((xw->flags & WRAPAROUND)) {
|
||||
WrapLine(xw);
|
||||
width_available = MaxCols(screen) - screen->cur_col;
|
||||
next_col = screen->cur_col;
|
||||
}
|
||||
}
|
||||
|
||||
while (width_here <= width_available && chars_chomped < (len - offset)) {
|
||||
@ -3409,10 +3414,13 @@ dotext(XtermWidget xw,
|
||||
}
|
||||
|
||||
if (width_here > width_available) {
|
||||
if (last_chomp > MaxCols(screen))
|
||||
break; /* give up - it is too big */
|
||||
chars_chomped--;
|
||||
width_here -= last_chomp;
|
||||
if (chars_chomped > 0 || (xw->flags & WRAPAROUND))
|
||||
if (chars_chomped > 0) {
|
||||
need_wrap = 1;
|
||||
}
|
||||
} else if (width_here == width_available) {
|
||||
need_wrap = 1;
|
||||
} else if (chars_chomped != (len - offset)) {
|
||||
@ -3438,8 +3446,9 @@ dotext(XtermWidget xw,
|
||||
lobyte = (Char *) XtRealloc((char *) lobyte, limit);
|
||||
hibyte = (Char *) XtRealloc((char *) hibyte, limit);
|
||||
}
|
||||
for (j = offset; j < offset + chars_chomped; j++) {
|
||||
k = j - offset;
|
||||
for (j = offset, k = 0; j < offset + chars_chomped; j++) {
|
||||
if (buf[j] == HIDDEN_CHAR)
|
||||
continue;
|
||||
lobyte[k] = buf[j];
|
||||
if (buf[j] > 255) {
|
||||
hibyte[k] = (buf[j] >> 8);
|
||||
@ -3447,11 +3456,12 @@ dotext(XtermWidget xw,
|
||||
} else {
|
||||
hibyte[k] = 0;
|
||||
}
|
||||
++k;
|
||||
}
|
||||
|
||||
WriteText(xw, PAIRED_CHARS(lobyte,
|
||||
(both ? hibyte : 0)),
|
||||
chars_chomped);
|
||||
k);
|
||||
#ifdef NO_LEAKS
|
||||
if (limit != 0) {
|
||||
limit = 0;
|
||||
@ -3471,16 +3481,13 @@ dotext(XtermWidget xw,
|
||||
last_col = CurMaxCol(screen, screen->cur_row);
|
||||
this_col = last_col - screen->cur_col + 1;
|
||||
if (this_col <= 1) {
|
||||
if (screen->do_wrap && (xw->flags & WRAPAROUND)) {
|
||||
/* mark that we had to wrap this line */
|
||||
ScrnSetWrapped(screen, screen->cur_row);
|
||||
xtermAutoPrint('\n');
|
||||
xtermIndex(xw, 1);
|
||||
set_cur_col(screen, 0);
|
||||
if (screen->do_wrap) {
|
||||
screen->do_wrap = 0;
|
||||
this_col = last_col + 1;
|
||||
} else
|
||||
this_col = 1;
|
||||
if ((xw->flags & WRAPAROUND)) {
|
||||
WrapLine(xw);
|
||||
}
|
||||
}
|
||||
this_col = 1;
|
||||
}
|
||||
if (offset + this_col > len) {
|
||||
this_col = len - offset;
|
||||
@ -3492,9 +3499,9 @@ dotext(XtermWidget xw,
|
||||
(unsigned) this_col);
|
||||
|
||||
/*
|
||||
* the call to WriteText updates screen->cur_col.
|
||||
* If screen->cur_col != next_col, we must have
|
||||
* hit the right margin, so set the do_wrap flag.
|
||||
* The call to WriteText updates screen->cur_col.
|
||||
* If screen->cur_col is less than next_col, we must have
|
||||
* hit the right margin - so set the do_wrap flag.
|
||||
*/
|
||||
screen->do_wrap = (screen->cur_col < next_col);
|
||||
}
|
||||
@ -3502,19 +3509,6 @@ dotext(XtermWidget xw,
|
||||
#endif /* OPT_WIDE_CHARS */
|
||||
}
|
||||
|
||||
#if HANDLE_STRUCT_NOTIFY
|
||||
/* Flag icon name with "*** " on window output when iconified.
|
||||
* I'd like to do something like reverse video, but I don't
|
||||
* know how to tell this to window managers in general.
|
||||
*
|
||||
* mapstate can be IsUnmapped, !IsUnmapped, or -1;
|
||||
* -1 means no change; the other two are set by event handlers
|
||||
* and indicate a new mapstate. !IsMapped is done in the handler.
|
||||
* we worry about IsUnmapped when output occurs. -IAN!
|
||||
*/
|
||||
static int mapstate = -1;
|
||||
#endif /* HANDLE_STRUCT_NOTIFY */
|
||||
|
||||
#if OPT_WIDE_CHARS
|
||||
unsigned
|
||||
visual_width(PAIRED_CHARS(Char * str, Char * str2), Cardinal len)
|
||||
@ -3540,122 +3534,6 @@ visual_width(PAIRED_CHARS(Char * str, Char * str2), Cardinal len)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* write a string str of length len onto the screen at
|
||||
* the current cursor position. update cursor position.
|
||||
*/
|
||||
static void
|
||||
WriteText(XtermWidget xw, PAIRED_CHARS(Char * str, Char * str2), Cardinal len)
|
||||
{
|
||||
TScreen *screen = &(xw->screen);
|
||||
ScrnPtr PAIRED_CHARS(temp_str = 0, temp_str2 = 0);
|
||||
unsigned test;
|
||||
unsigned flags = xw->flags;
|
||||
unsigned fg_bg = makeColorPair(xw->cur_foreground, xw->cur_background);
|
||||
unsigned cells = visual_width(PAIRED_CHARS(str, str2), len);
|
||||
GC currentGC;
|
||||
|
||||
TRACE(("WriteText (%2d,%2d) (%d) %3d:%s\n",
|
||||
screen->cur_row,
|
||||
screen->cur_col,
|
||||
curXtermChrSet(xw, screen->cur_row),
|
||||
len, visibleChars(PAIRED_CHARS(str, str2), len)));
|
||||
|
||||
if (ScrnHaveSelection(screen)
|
||||
&& ScrnIsLineInSelection(screen, INX2ROW(screen, screen->cur_row))) {
|
||||
ScrnDisownSelection(xw);
|
||||
}
|
||||
|
||||
if (INX2ROW(screen, screen->cur_row) <= screen->max_row) {
|
||||
if (screen->cursor_state)
|
||||
HideCursor();
|
||||
|
||||
if (flags & INSERT) {
|
||||
InsertChar(xw, cells);
|
||||
}
|
||||
if (!AddToRefresh(screen)) {
|
||||
|
||||
if (screen->scroll_amt)
|
||||
FlushScroll(xw);
|
||||
|
||||
if (flags & INVISIBLE) {
|
||||
if (cells > len) {
|
||||
str = temp_str = TypeMallocN(Char, cells);
|
||||
if (str == 0)
|
||||
return;
|
||||
}
|
||||
if_OPT_WIDE_CHARS(screen, {
|
||||
if (cells > len) {
|
||||
str2 = temp_str2 = TypeMallocN(Char, cells);
|
||||
}
|
||||
});
|
||||
len = cells;
|
||||
|
||||
memset(str, ' ', len);
|
||||
if_OPT_WIDE_CHARS(screen, {
|
||||
if (str2 != 0)
|
||||
memset(str2, 0, len);
|
||||
});
|
||||
}
|
||||
|
||||
TRACE(("WriteText calling drawXtermText (%d,%d)\n",
|
||||
screen->cur_col,
|
||||
screen->cur_row));
|
||||
|
||||
test = flags;
|
||||
checkVeryBoldColors(test, xw->cur_foreground);
|
||||
|
||||
/* make sure that the correct GC is current */
|
||||
currentGC = updatedXtermGC(xw, flags, fg_bg, False);
|
||||
|
||||
drawXtermText(xw, test & DRAWX_MASK, currentGC,
|
||||
CurCursorX(screen, screen->cur_row, screen->cur_col),
|
||||
CursorY(screen, screen->cur_row),
|
||||
curXtermChrSet(xw, screen->cur_row),
|
||||
PAIRED_CHARS(str, str2), len, 0);
|
||||
|
||||
resetXtermGC(xw, flags, False);
|
||||
}
|
||||
}
|
||||
|
||||
ScreenWrite(xw, PAIRED_CHARS(str, str2), flags, fg_bg, len);
|
||||
CursorForward(screen, (int) cells);
|
||||
#if OPT_ZICONBEEP
|
||||
/* Flag icon name with "***" on window output when iconified.
|
||||
*/
|
||||
if (resource.zIconBeep && mapstate == IsUnmapped && !screen->zIconBeep_flagged) {
|
||||
static char *icon_name;
|
||||
static Arg args[] =
|
||||
{
|
||||
{XtNiconName, (XtArgVal) & icon_name}
|
||||
};
|
||||
|
||||
icon_name = NULL;
|
||||
XtGetValues(toplevel, args, XtNumber(args));
|
||||
|
||||
if (icon_name != NULL) {
|
||||
screen->zIconBeep_flagged = True;
|
||||
ChangeIconName(icon_name);
|
||||
}
|
||||
if (resource.zIconBeep > 0) {
|
||||
#if defined(HAVE_XKB_BELL_EXT)
|
||||
XkbBell(XtDisplay(toplevel), VShellWindow, resource.zIconBeep, XkbBI_Info);
|
||||
#else
|
||||
XBell(XtDisplay(toplevel), resource.zIconBeep);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
mapstate = -1;
|
||||
#endif /* OPT_ZICONBEEP */
|
||||
if (temp_str != 0)
|
||||
free(temp_str);
|
||||
if_OPT_WIDE_CHARS(screen, {
|
||||
if (temp_str2 != 0)
|
||||
free(temp_str2);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
#if HANDLE_STRUCT_NOTIFY
|
||||
/* Flag icon name with "***" on window output when iconified.
|
||||
*/
|
||||
@ -5093,6 +4971,8 @@ VTInit(void)
|
||||
TScreen *screen = TScreenOf(term);
|
||||
Widget vtparent = SHELL_OF(term);
|
||||
|
||||
TRACE(("VTInit {{\n"));
|
||||
|
||||
XtRealizeWidget(vtparent);
|
||||
XtOverrideTranslations(vtparent, XtParseTranslationTable(xterm_trans));
|
||||
(void) XSetWMProtocols(XtDisplay(vtparent), XtWindow(vtparent),
|
||||
@ -5102,6 +4982,8 @@ VTInit(void)
|
||||
|
||||
if (screen->allbuf == NULL)
|
||||
VTallocbuf();
|
||||
|
||||
TRACE(("...}} VTInit\n"));
|
||||
return (1);
|
||||
}
|
||||
|
||||
@ -5404,6 +5286,11 @@ VTInitialize(Widget wrequest,
|
||||
*/
|
||||
bzero((char *) &wnew->screen, sizeof(wnew->screen));
|
||||
|
||||
/* DESCO Sys#67660
|
||||
* Zero out the entire "keyboard" component of "wnew" widget.
|
||||
*/
|
||||
bzero((char *) &wnew->keyboard, sizeof(wnew->keyboard));
|
||||
|
||||
/* dummy values so that we don't try to Realize the parent shell with height
|
||||
* or width of 0, which is illegal in X. The real size is computed in the
|
||||
* xtermWidget's Realize proc, but the shell's Realize proc is called first,
|
||||
@ -5569,10 +5456,12 @@ VTInitialize(Widget wrequest,
|
||||
init_Bres(screen.meta_sends_esc);
|
||||
|
||||
init_Bres(screen.allowSendEvent0);
|
||||
init_Bres(screen.allowTitleOp0);
|
||||
init_Bres(screen.allowWindowOp0);
|
||||
|
||||
/* make a copy so that editres cannot change the resource after startup */
|
||||
wnew->screen.allowSendEvents = wnew->screen.allowSendEvent0;
|
||||
wnew->screen.allowTitleOps = wnew->screen.allowTitleOp0;
|
||||
wnew->screen.allowWindowOps = wnew->screen.allowWindowOp0;
|
||||
|
||||
#ifndef NO_ACTIVE_ICON
|
||||
@ -5751,6 +5640,7 @@ VTInitialize(Widget wrequest,
|
||||
#if OPT_HIGHLIGHT_COLOR
|
||||
init_Tres(HIGHLIGHT_BG);
|
||||
init_Tres(HIGHLIGHT_FG);
|
||||
init_Bres(screen.hilite_reverse);
|
||||
#endif
|
||||
|
||||
#if OPT_TEK4014
|
||||
@ -5794,6 +5684,7 @@ VTInitialize(Widget wrequest,
|
||||
}
|
||||
#endif
|
||||
|
||||
init_Ires(screen.utf8_inparse);
|
||||
init_Ires(screen.utf8_mode);
|
||||
init_Ires(screen.max_combining);
|
||||
|
||||
@ -5809,6 +5700,19 @@ VTInitialize(Widget wrequest,
|
||||
init_Bres(misc.mk_width);
|
||||
init_Bres(misc.cjk_width);
|
||||
|
||||
init_Ires(misc.mk_samplesize);
|
||||
init_Ires(misc.mk_samplepass);
|
||||
|
||||
if (wnew->misc.mk_samplesize > 0xffff)
|
||||
wnew->misc.mk_samplesize = 0xffff;
|
||||
if (wnew->misc.mk_samplesize < 0)
|
||||
wnew->misc.mk_samplesize = 0;
|
||||
|
||||
if (wnew->misc.mk_samplepass > wnew->misc.mk_samplesize)
|
||||
wnew->misc.mk_samplepass = wnew->misc.mk_samplesize;
|
||||
if (wnew->misc.mk_samplepass < 0)
|
||||
wnew->misc.mk_samplepass = 0;
|
||||
|
||||
if (request->screen.utf8_mode) {
|
||||
TRACE(("setting wide_chars on\n"));
|
||||
wnew->screen.wide_chars = True;
|
||||
@ -5834,7 +5738,9 @@ VTInitialize(Widget wrequest,
|
||||
|
||||
decode_wcwidth((wnew->misc.cjk_width ? 2 : 0)
|
||||
+ (wnew->misc.mk_width ? 1 : 0)
|
||||
+ 1);
|
||||
+ 1,
|
||||
wnew->misc.mk_samplesize,
|
||||
wnew->misc.mk_samplepass);
|
||||
#endif /* OPT_WIDE_CHARS */
|
||||
|
||||
init_Bres(screen.always_bold_mode);
|
||||
@ -5964,6 +5870,19 @@ releaseWindowGCs(XtermWidget xw, VTwin * win)
|
||||
}
|
||||
}
|
||||
|
||||
#define TRACE_FREE_LEAK(name) \
|
||||
if (name) { \
|
||||
free(name); \
|
||||
name = 0; \
|
||||
TRACE(("freed " #name "\n")); \
|
||||
}
|
||||
|
||||
#define FREE_LEAK(name) \
|
||||
if (name) { \
|
||||
free(name); \
|
||||
name = 0; \
|
||||
}
|
||||
|
||||
static void
|
||||
VTDestroy(Widget w GCC_UNUSED)
|
||||
{
|
||||
@ -5977,33 +5896,13 @@ VTDestroy(Widget w GCC_UNUSED)
|
||||
if (screen->scrollWidget)
|
||||
XtDestroyWidget(screen->scrollWidget);
|
||||
|
||||
if (screen->save_ptr) {
|
||||
free(screen->save_ptr);
|
||||
TRACE(("freed screen->save_ptr\n"));
|
||||
}
|
||||
|
||||
if (screen->sbuf_address) {
|
||||
free(screen->sbuf_address);
|
||||
TRACE(("freed screen->sbuf_address\n"));
|
||||
}
|
||||
if (screen->allbuf) {
|
||||
free(screen->allbuf);
|
||||
TRACE(("freed screen->allbuf\n"));
|
||||
}
|
||||
|
||||
if (screen->abuf_address) {
|
||||
free(screen->abuf_address);
|
||||
TRACE(("freed screen->abuf_address\n"));
|
||||
}
|
||||
if (screen->altbuf) {
|
||||
free(screen->altbuf);
|
||||
TRACE(("freed screen->altbuf\n"));
|
||||
}
|
||||
TRACE_FREE_LEAK(screen->save_ptr);
|
||||
TRACE_FREE_LEAK(screen->sbuf_address);
|
||||
TRACE_FREE_LEAK(screen->allbuf);
|
||||
TRACE_FREE_LEAK(screen->abuf_address);
|
||||
TRACE_FREE_LEAK(screen->altbuf);
|
||||
#if OPT_WIDE_CHARS
|
||||
if (screen->draw_buf) {
|
||||
free(screen->draw_buf);
|
||||
TRACE(("freed screen->draw_buf\n"));
|
||||
}
|
||||
TRACE_FREE_LEAK(screen->draw_buf);
|
||||
#endif
|
||||
#if OPT_INPUT_METHOD
|
||||
if (screen->xim) {
|
||||
@ -6018,6 +5917,7 @@ VTDestroy(Widget w GCC_UNUSED)
|
||||
#endif
|
||||
|
||||
xtermCloseFonts(xw, screen->fnts);
|
||||
noleaks_cachedCgs(xw);
|
||||
|
||||
#if 0 /* some strings may be owned by X libraries */
|
||||
for (n = 0; n <= fontMenu_lastBuiltin; ++n) {
|
||||
@ -6032,13 +5932,11 @@ VTDestroy(Widget w GCC_UNUSED)
|
||||
|
||||
/* free local copies of resource strings */
|
||||
for (n = 0; n < NCOLORS; ++n) {
|
||||
if (screen->Tcolors[n].resource)
|
||||
free(screen->Tcolors[n].resource);
|
||||
FREE_LEAK(screen->Tcolors[n].resource);
|
||||
}
|
||||
#if OPT_SELECT_REGEX
|
||||
for (n = 0; n < NSELECTUNITS; ++n) {
|
||||
if (screen->selectExpr[n])
|
||||
free(screen->selectExpr[n]);
|
||||
FREE_LEAK(screen->selectExpr[n]);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -6046,6 +5944,10 @@ VTDestroy(Widget w GCC_UNUSED)
|
||||
XtFree((char *) (screen->selection_atoms));
|
||||
|
||||
XtFree((char *) (screen->selection_data));
|
||||
|
||||
TRACE_FREE_LEAK(xw->keyboard.extra_translations);
|
||||
TRACE_FREE_LEAK(xw->keyboard.shell_translations);
|
||||
TRACE_FREE_LEAK(xw->keyboard.xterm_translations);
|
||||
#endif /* defined(NO_LEAKS) */
|
||||
}
|
||||
|
||||
@ -6304,6 +6206,12 @@ VTRealize(Widget w,
|
||||
#endif
|
||||
#if OPT_NUM_LOCK
|
||||
VTInitModifiers(xw);
|
||||
#if OPT_EXTRA_PASTE
|
||||
if (xw->keyboard.extra_translations) {
|
||||
XtOverrideTranslations((Widget) xw,
|
||||
XtParseTranslationTable(xw->keyboard.extra_translations));
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
set_cursor_gcs(xw);
|
||||
@ -6710,6 +6618,8 @@ ShowCursor(void)
|
||||
#if OPT_HIGHLIGHT_COLOR
|
||||
Pixel selbg_pix = T_COLOR(screen, HIGHLIGHT_BG);
|
||||
Pixel selfg_pix = T_COLOR(screen, HIGHLIGHT_FG);
|
||||
Boolean use_selbg;
|
||||
Boolean use_selfg;
|
||||
#endif
|
||||
#if OPT_WIDE_CHARS
|
||||
Char chi = 0;
|
||||
@ -6811,6 +6721,10 @@ ShowCursor(void)
|
||||
* outline for the cursor.
|
||||
*/
|
||||
filled = (screen->select || screen->always_highlight);
|
||||
#if OPT_HIGHLIGHT_COLOR
|
||||
use_selbg = isNotForeground(xw, fg_pix, bg_pix, selbg_pix);
|
||||
use_selfg = isNotBackground(xw, fg_pix, bg_pix, selfg_pix);
|
||||
#endif
|
||||
if (filled) {
|
||||
if (reversed) { /* text is reverse video */
|
||||
if (getCgsGC(xw, currentWin, gcVTcursNormal)) {
|
||||
@ -6822,18 +6736,19 @@ ShowCursor(void)
|
||||
setGC(gcNorm);
|
||||
}
|
||||
}
|
||||
EXCHANGE(fg_pix, bg_pix, tmp);
|
||||
#if OPT_HIGHLIGHT_COLOR
|
||||
{
|
||||
Bool use_selbg = isNotForeground(xw, fg_pix, bg_pix, selbg_pix);
|
||||
Bool use_selfg = isNotBackground(xw, fg_pix, bg_pix, selfg_pix);
|
||||
|
||||
if (screen->hilite_reverse) {
|
||||
if (use_selbg && !use_selfg)
|
||||
fg_pix = bg_pix;
|
||||
if (use_selfg && !use_selbg)
|
||||
bg_pix = fg_pix;
|
||||
if (use_selbg)
|
||||
fg_pix = selbg_pix;
|
||||
bg_pix = selbg_pix;
|
||||
if (use_selfg)
|
||||
bg_pix = selfg_pix;
|
||||
fg_pix = selfg_pix;
|
||||
}
|
||||
#endif
|
||||
EXCHANGE(fg_pix, bg_pix, tmp);
|
||||
} else { /* normal video */
|
||||
if (getCgsGC(xw, currentWin, gcVTcursReverse)) {
|
||||
setGC(gcVTcursReverse);
|
||||
@ -6851,25 +6766,43 @@ ShowCursor(void)
|
||||
setCgsFore(xw, currentWin, currentCgs, bg_pix);
|
||||
} else { /* not selected */
|
||||
if (reversed) { /* text is reverse video */
|
||||
#if OPT_HIGHLIGHT_COLOR
|
||||
{
|
||||
Bool use_selbg = isNotForeground(xw, fg_pix, bg_pix, selbg_pix);
|
||||
Bool use_selfg = isNotBackground(xw, fg_pix, bg_pix, selfg_pix);
|
||||
|
||||
if (use_selbg)
|
||||
fg_pix = selbg_pix;
|
||||
if (use_selfg)
|
||||
bg_pix = selfg_pix;
|
||||
}
|
||||
#endif
|
||||
EXCHANGE(fg_pix, bg_pix, tmp);
|
||||
setGC(gcNormReverse);
|
||||
setCgsFore(xw, currentWin, currentCgs, bg_pix);
|
||||
setCgsBack(xw, currentWin, currentCgs, fg_pix);
|
||||
} else { /* normal video */
|
||||
setGC(gcNorm);
|
||||
setCgsFore(xw, currentWin, currentCgs, fg_pix);
|
||||
setCgsBack(xw, currentWin, currentCgs, bg_pix);
|
||||
}
|
||||
#if OPT_HIGHLIGHT_COLOR
|
||||
if (screen->hilite_reverse) {
|
||||
if (in_selection && !reversed) {
|
||||
; /* really INVERSE ... */
|
||||
} else if (in_selection || reversed) {
|
||||
if (use_selbg) {
|
||||
if (use_selfg) {
|
||||
bg_pix = fg_pix;
|
||||
} else {
|
||||
fg_pix = bg_pix;
|
||||
}
|
||||
}
|
||||
if (use_selbg) {
|
||||
bg_pix = selbg_pix;
|
||||
}
|
||||
if (use_selfg) {
|
||||
fg_pix = selfg_pix;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (in_selection) {
|
||||
if (use_selbg) {
|
||||
bg_pix = selbg_pix;
|
||||
}
|
||||
if (use_selfg) {
|
||||
fg_pix = selfg_pix;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
setCgsFore(xw, currentWin, currentCgs, fg_pix);
|
||||
setCgsBack(xw, currentWin, currentCgs, bg_pix);
|
||||
}
|
||||
|
||||
if (screen->cursor_busy == 0
|
||||
@ -6892,11 +6825,12 @@ ShowCursor(void)
|
||||
for (off = OFF_FINAL; off < MAX_PTRS; off += 2) {
|
||||
clo = SCREEN_PTR(screen, screen->cursorp.row, off + 0)[my_col];
|
||||
chi = SCREEN_PTR(screen, screen->cursorp.row, off + 1)[my_col];
|
||||
if (clo || chi)
|
||||
drawXtermText(xw, (flags & DRAWX_MASK) | NOBACKGROUND,
|
||||
currentGC, x, y,
|
||||
curXtermChrSet(xw, screen->cur_row),
|
||||
PAIRED_CHARS(&clo, &chi), 1, iswide(base));
|
||||
if (!(clo || chi))
|
||||
break;
|
||||
drawXtermText(xw, (flags & DRAWX_MASK) | NOBACKGROUND,
|
||||
currentGC, x, y,
|
||||
curXtermChrSet(xw, screen->cur_row),
|
||||
PAIRED_CHARS(&clo, &chi), 1, iswide(base));
|
||||
}
|
||||
});
|
||||
#endif
|
||||
@ -7009,11 +6943,12 @@ HideCursor(void)
|
||||
for (off = OFF_FINAL; off < MAX_PTRS; off += 2) {
|
||||
clo = SCREEN_PTR(screen, screen->cursorp.row, off + 0)[my_col];
|
||||
chi = SCREEN_PTR(screen, screen->cursorp.row, off + 1)[my_col];
|
||||
if (clo || chi)
|
||||
drawXtermText(xw, (flags & DRAWX_MASK) | NOBACKGROUND,
|
||||
currentGC, x, y,
|
||||
curXtermChrSet(xw, screen->cur_row),
|
||||
PAIRED_CHARS(&clo, &chi), 1, iswide(base));
|
||||
if (!(clo || chi))
|
||||
break;
|
||||
drawXtermText(xw, (flags & DRAWX_MASK) | NOBACKGROUND,
|
||||
currentGC, x, y,
|
||||
curXtermChrSet(xw, screen->cur_row),
|
||||
PAIRED_CHARS(&clo, &chi), 1, iswide(base));
|
||||
}
|
||||
});
|
||||
#endif
|
||||
@ -7483,17 +7418,28 @@ DoSetSelectedFont(Widget w,
|
||||
if (!IsXtermWidget(w) || *type != XA_STRING || *format != 8) {
|
||||
Bell(XkbBI_MinorError, 0);
|
||||
} else {
|
||||
Boolean failed = False;
|
||||
XtermWidget xw = (XtermWidget) w;
|
||||
int oldFont = xw->screen.menu_font_number;
|
||||
char *save = xw->screen.MenuFontName(fontMenu_fontsel);
|
||||
char *val = (char *) value;
|
||||
char *val;
|
||||
char *test = 0;
|
||||
char *used = 0;
|
||||
int len = strlen(val);
|
||||
unsigned len = *length;
|
||||
unsigned tst;
|
||||
|
||||
if (len > (int) *length) {
|
||||
len = (int) *length;
|
||||
/*
|
||||
* Some versions of X deliver null-terminated selections, some do not.
|
||||
*/
|
||||
for (tst = 0; tst < len; ++tst) {
|
||||
if (((char *) value)[tst] == '\0') {
|
||||
len = tst;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (len > 0) {
|
||||
|
||||
if (len > 0 && (val = malloc(len + 1)) != 0) {
|
||||
memcpy(val, value, len);
|
||||
val[len] = '\0';
|
||||
used = x_strtrim(val);
|
||||
TRACE(("DoSetSelectedFont(%s)\n", val));
|
||||
@ -7509,17 +7455,23 @@ DoSetSelectedFont(Widget w,
|
||||
xtermFontName(val),
|
||||
True,
|
||||
fontMenu_fontsel)) {
|
||||
Bell(XkbBI_MinorError, 0);
|
||||
failed = True;
|
||||
free(test);
|
||||
xw->screen.MenuFontName(fontMenu_fontsel) = save;
|
||||
} else {
|
||||
free(save);
|
||||
}
|
||||
} else {
|
||||
failed = True;
|
||||
}
|
||||
if (failed) {
|
||||
(void) xtermLoadFont(term,
|
||||
xtermFontName(xw->screen.MenuFontName(oldFont)),
|
||||
True,
|
||||
oldFont);
|
||||
Bell(XkbBI_MinorError, 0);
|
||||
}
|
||||
if (used != val)
|
||||
free(used);
|
||||
free(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
22
app/xterm/config.guess
vendored
22
app/xterm/config.guess
vendored
@ -4,7 +4,7 @@
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
|
||||
# Inc.
|
||||
|
||||
timestamp='2006-12-22'
|
||||
timestamp='2007-05-17'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@ -330,7 +330,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
|
||||
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
i86pc:SunOS:5.*:*)
|
||||
i86pc:SunOS:5.*:* | ix86xen:SunOS:5.*:*)
|
||||
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
sun4*:SunOS:6*:*)
|
||||
@ -791,12 +791,15 @@ EOF
|
||||
i*:PW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-pw32
|
||||
exit ;;
|
||||
x86:Interix*:[3456]*)
|
||||
echo i586-pc-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
EM64T:Interix*:[3456]* | authenticamd:Interix*:[3456]*)
|
||||
echo x86_64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:Interix*:[3456]*)
|
||||
case ${UNAME_MACHINE} in
|
||||
x86)
|
||||
echo i586-pc-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
EM64T | authenticamd)
|
||||
echo x86_64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
esac ;;
|
||||
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
|
||||
echo i${UNAME_MACHINE}-pc-mks
|
||||
exit ;;
|
||||
@ -1218,6 +1221,9 @@ EOF
|
||||
SX-8:SUPER-UX:*:*)
|
||||
echo sx8-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
SX-8R:SUPER-UX:*:*)
|
||||
echo sx8r-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
Power*:Rhapsody:*:*)
|
||||
echo powerpc-apple-rhapsody${UNAME_RELEASE}
|
||||
exit ;;
|
||||
|
17
app/xterm/config.sub
vendored
17
app/xterm/config.sub
vendored
@ -4,7 +4,7 @@
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
|
||||
# Inc.
|
||||
|
||||
timestamp='2006-12-08'
|
||||
timestamp='2007-06-28'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
@ -250,7 +250,7 @@ case $basic_machine in
|
||||
| i370 | i860 | i960 | ia64 \
|
||||
| ip2k | iq2000 \
|
||||
| m32c | m32r | m32rle | m68000 | m68k | m88k \
|
||||
| maxq | mb | microblaze | mcore \
|
||||
| maxq | mb | microblaze | mcore | mep \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64el \
|
||||
@ -475,8 +475,8 @@ case $basic_machine in
|
||||
basic_machine=craynv-cray
|
||||
os=-unicosmp
|
||||
;;
|
||||
cr16c)
|
||||
basic_machine=cr16c-unknown
|
||||
cr16)
|
||||
basic_machine=cr16-unknown
|
||||
os=-elf
|
||||
;;
|
||||
crds | unos)
|
||||
@ -683,6 +683,10 @@ case $basic_machine in
|
||||
basic_machine=i386-pc
|
||||
os=-mingw32
|
||||
;;
|
||||
mingw32ce)
|
||||
basic_machine=arm-unknown
|
||||
os=-mingw32ce
|
||||
;;
|
||||
miniframe)
|
||||
basic_machine=m68000-convergent
|
||||
;;
|
||||
@ -1222,7 +1226,7 @@ case $os in
|
||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
|
||||
| -skyos* | -haiku* | -rdos* | -toppers*)
|
||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
@ -1417,6 +1421,9 @@ case $basic_machine in
|
||||
m68*-cisco)
|
||||
os=-aout
|
||||
;;
|
||||
mep-*)
|
||||
os=-elf
|
||||
;;
|
||||
mips*-cisco)
|
||||
os=-elf
|
||||
;;
|
||||
|
2357
app/xterm/configure
vendored
2357
app/xterm/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
dnl $XTermId: configure.in,v 1.226 2007/03/18 23:37:06 tom Exp $
|
||||
dnl $XTermId: configure.in,v 1.236 2007/07/22 18:51:36 tom Exp $
|
||||
dnl
|
||||
dnl $XFree86: xc/programs/xterm/configure.in,v 3.77 2006/06/19 00:36:51 dickey Exp $
|
||||
dnl
|
||||
@ -121,6 +121,34 @@ no_appsdir=
|
||||
test "$appsdir" = no && no_appsdir="#"
|
||||
AC_SUBST(no_appsdir)
|
||||
|
||||
AC_MSG_CHECKING(for directory to install icons)
|
||||
CF_WITH_PATH(icondir,
|
||||
[ --with-icondir=DIR directory in which to install icons],
|
||||
[icondir],[EPREFIX/share/pixmaps],
|
||||
['\$(exec_prefix)/share/pixmaps'])
|
||||
AC_MSG_RESULT($icondir)
|
||||
AC_SUBST(icondir)
|
||||
|
||||
no_icondir=
|
||||
test "$icondir" = no && no_icondir="#"
|
||||
AC_SUBST(no_icondir)
|
||||
|
||||
# Comment-out the install-desktop rule if the desktop-utils are not found.
|
||||
AC_MSG_CHECKING(if you want to install desktop files)
|
||||
CF_ARG_OPTION(desktop,
|
||||
[ --disable-desktop disable install of xterm desktop files],
|
||||
[enable_desktop=$enableval],
|
||||
[enable_desktop=$enableval],yes)
|
||||
AC_MSG_RESULT($enable_desktop)
|
||||
|
||||
desktop_utils=
|
||||
if test "$enable_desktop" = yes ; then
|
||||
AC_CHECK_PROG(desktop_utils,desktop-file-install,yes,no)
|
||||
fi
|
||||
|
||||
test "$desktop_utils" = yes && desktop_utils= || desktop_utils="#"
|
||||
AC_SUBST(DESKTOP_FLAGS)
|
||||
|
||||
# inherit SINSTALL_OPTS from environment to allow packager to customize it.
|
||||
|
||||
AC_MSG_CHECKING(for install-permissions reference)
|
||||
@ -168,7 +196,7 @@ CF_ARG_DISABLE(setgid,
|
||||
[disable_setgid=yes],
|
||||
[disable_setgid=no],
|
||||
no)
|
||||
AC_MSG_RESULT($disable_setuid)
|
||||
AC_MSG_RESULT($disable_setgid)
|
||||
|
||||
AC_MSG_CHECKING(if you want to run xterm setuid to a given user)
|
||||
AC_ARG_WITH(setuid,
|
||||
@ -217,7 +245,18 @@ AC_MSG_RESULT($use_utempter)
|
||||
|
||||
if test "$use_utempter" = yes ; then
|
||||
CF_UTEMPTER
|
||||
test "$cf_cv_have_utempter" = yes && disable_setuid=yes
|
||||
test "$cf_cv_have_utempter" != yes && use_utempter=no
|
||||
else
|
||||
use_utempter=no
|
||||
fi
|
||||
|
||||
# Some configurations permit (or require) either setuid or setgid mode.
|
||||
# Let the user decide.
|
||||
if test "$use_utempter" = yes ; then
|
||||
if test "${enable_setuid+set}" != set ; then
|
||||
disable_setuid=yes
|
||||
CF_VERBOSE([No --disable-setuid option given, force to yes])
|
||||
fi
|
||||
fi
|
||||
|
||||
### checks for external data
|
||||
@ -234,6 +273,7 @@ CF_X_TOOLKIT
|
||||
AC_CHECK_HEADERS( \
|
||||
X11/DECkeysym.h \
|
||||
X11/Sunkeysym.h \
|
||||
X11/XF86keysym.h \
|
||||
X11/Xpoll.h \
|
||||
)
|
||||
|
||||
@ -852,7 +892,7 @@ AC_MSG_RESULT($with_warnings)
|
||||
if test "$with_warnings" = yes
|
||||
then
|
||||
CF_GCC_ATTRIBUTES
|
||||
CF_GCC_WARNINGS
|
||||
CF_GCC_WARNINGS(Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum)
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
/* $XTermId: cursor.c,v 1.42 2006/07/23 20:23:52 tom Exp $ */
|
||||
/* $XTermId: cursor.c,v 1.43 2007/07/07 12:14:51 tom Exp $ */
|
||||
|
||||
/* $XFree86: xc/programs/xterm/cursor.c,v 3.20 2006/02/13 01:14:58 dickey Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2002-2005,2006 by Thomas E. Dickey
|
||||
* Copyright 2002-2006,2007 by Thomas E. Dickey
|
||||
*
|
||||
* All Rights Reserved
|
||||
*
|
||||
@ -114,8 +114,10 @@ CursorBack(XtermWidget xw, int n)
|
||||
}
|
||||
set_cur_row(screen, i / j);
|
||||
set_cur_col(screen, i % j);
|
||||
} else
|
||||
do_xevents();
|
||||
} else {
|
||||
set_cur_col(screen, 0);
|
||||
}
|
||||
}
|
||||
screen->do_wrap = 0;
|
||||
}
|
||||
@ -235,6 +237,7 @@ CarriageReturn(TScreen * screen)
|
||||
{
|
||||
set_cur_col(screen, 0);
|
||||
screen->do_wrap = 0;
|
||||
do_xevents();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $XTermId: data.c,v 1.84 2007/01/18 23:38:49 tom Exp $ */
|
||||
/* $XTermId: data.c,v 1.86 2007/07/17 21:09:41 tom Exp $ */
|
||||
|
||||
/* $XFree86: xc/programs/xterm/data.c,v 3.34 2006/02/13 01:14:58 dickey Exp $ */
|
||||
|
||||
@ -104,3 +104,11 @@ PtySelect X_mask;
|
||||
PtySelect pty_mask;
|
||||
char *ptydev;
|
||||
char *ttydev;
|
||||
|
||||
#if HANDLE_STRUCT_NOTIFY
|
||||
int mapstate = -1;
|
||||
#endif /* HANDLE_STRUCT_NOTIFY */
|
||||
|
||||
#if OPT_SESSION_MGT
|
||||
int ice_fd = -1;
|
||||
#endif
|
||||
|
@ -1,8 +1,4 @@
|
||||
/* $XTermId: fontutils.c,v 1.246 2007/03/22 00:20:06 tom Exp $ */
|
||||
|
||||
/*
|
||||
* $XFree86: xc/programs/xterm/fontutils.c,v 1.60 2006/04/30 21:55:39 dickey Exp $
|
||||
*/
|
||||
/* $XTermId: fontutils.c,v 1.251 2007/08/05 00:11:55 tom Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
@ -850,7 +846,6 @@ xtermLoadFont(XtermWidget xw,
|
||||
fnts[fWBold] = xtermCloseFont(xw, fnts[fWBold]);
|
||||
}
|
||||
if (fnts[fWBold] == 0) {
|
||||
free(myfonts.f_wb);
|
||||
myfonts.f_wb = myfonts.f_w;
|
||||
fnts[fWBold] = fnts[fWide];
|
||||
TRACE(("...cannot load wide-bold, use wide %s\n", NonNull(myfonts.f_w)));
|
||||
@ -1349,16 +1344,16 @@ xtermOpenXft(Display * dpy, XftPattern * pat, const char *tag GCC_UNUSED)
|
||||
* Don't make a dependency on the math library for a single function.
|
||||
* (Newton Raphson).
|
||||
*/
|
||||
static float
|
||||
mySquareRoot(float value)
|
||||
static double
|
||||
mySquareRoot(double value)
|
||||
{
|
||||
float result = 0.0;
|
||||
double result = 0.0;
|
||||
if (value > 0.0) {
|
||||
int n;
|
||||
float older = value;
|
||||
double older = value;
|
||||
for (n = 0; n < 10; ++n) {
|
||||
float delta = (older * older - value) / (2.0 * older);
|
||||
float newer = older - delta;
|
||||
double delta = (older * older - value) / (2.0 * older);
|
||||
double newer = older - delta;
|
||||
older = newer;
|
||||
result = newer;
|
||||
if (delta > -0.001 && delta < 0.001)
|
||||
@ -1477,7 +1472,7 @@ xtermComputeFontInfo(XtermWidget xw,
|
||||
if (fontnum == fontMenu_default) {
|
||||
face_size = 14.0;
|
||||
} else {
|
||||
float ratio;
|
||||
double ratio;
|
||||
int num = screen->menu_font_sizes[fontnum];
|
||||
int den = screen->menu_font_sizes[0];
|
||||
|
||||
@ -1517,26 +1512,42 @@ xtermComputeFontInfo(XtermWidget xw,
|
||||
xw->misc.face_size[fontnum] = face_size;
|
||||
}
|
||||
|
||||
/*
|
||||
* By observation (there is no documentation), XftPatternBuild is
|
||||
* cumulative. Build the bold- and italic-patterns on top of the
|
||||
* normal pattern.
|
||||
*/
|
||||
#define NormXftPattern \
|
||||
XFT_FAMILY, XftTypeString, "mono", \
|
||||
XFT_SIZE, XftTypeDouble, face_size, \
|
||||
XFT_SPACING, XftTypeInteger, XFT_MONO
|
||||
|
||||
#define BoldXftPattern(norm) \
|
||||
XFT_WEIGHT, XftTypeInteger, XFT_WEIGHT_BOLD, \
|
||||
XFT_CHAR_WIDTH, XftTypeInteger, norm->max_advance_width
|
||||
|
||||
#define ItalXftPattern(norm) \
|
||||
XFT_SLANT, XftTypeInteger, XFT_SLANT_ITALIC, \
|
||||
XFT_CHAR_WIDTH, XftTypeInteger, norm->max_advance_width
|
||||
|
||||
if ((pat = XftNameParse(xw->misc.face_name)) != 0) {
|
||||
XftPatternBuild(pat,
|
||||
XFT_FAMILY, XftTypeString, "mono",
|
||||
XFT_SIZE, XftTypeDouble, face_size,
|
||||
XFT_SPACING, XftTypeInteger, XFT_MONO,
|
||||
NormXftPattern,
|
||||
(void *) 0);
|
||||
norm = xtermOpenXft(dpy, pat, "normal");
|
||||
|
||||
if (norm != 0) {
|
||||
XftPatternBuild(pat,
|
||||
XFT_WEIGHT, XftTypeInteger, XFT_WEIGHT_BOLD,
|
||||
XFT_CHAR_WIDTH, XftTypeInteger, norm->max_advance_width,
|
||||
BoldXftPattern(norm),
|
||||
(void *) 0);
|
||||
bold = xtermOpenXft(dpy, pat, "bold");
|
||||
|
||||
#if OPT_ISO_COLORS
|
||||
if (screen->italicULMode) {
|
||||
if (screen->italicULMode
|
||||
&& (pat = XftNameParse(xw->misc.face_name)) != 0) {
|
||||
XftPatternBuild(pat,
|
||||
XFT_SLANT, XftTypeInteger, XFT_SLANT_ITALIC,
|
||||
XFT_CHAR_WIDTH, XftTypeInteger, norm->max_advance_width,
|
||||
NormXftPattern,
|
||||
ItalXftPattern(norm),
|
||||
(void *) 0);
|
||||
ital = xtermOpenXft(dpy, pat, "italic");
|
||||
}
|
||||
@ -1574,33 +1585,31 @@ xtermComputeFontInfo(XtermWidget xw,
|
||||
face_name,
|
||||
char_width));
|
||||
|
||||
#define WideXftPattern \
|
||||
XFT_FAMILY, XftTypeString, "mono", \
|
||||
XFT_SIZE, XftTypeDouble, face_size, \
|
||||
XFT_SPACING, XftTypeInteger, XFT_MONO
|
||||
|
||||
if ((pat = XftNameParse(face_name)) != 0) {
|
||||
XftPatternBuild(pat,
|
||||
XFT_FAMILY, XftTypeString, "mono",
|
||||
XFT_SIZE, XftTypeDouble, face_size,
|
||||
XFT_SPACING, XftTypeInteger, XFT_MONO,
|
||||
WideXftPattern,
|
||||
XFT_CHAR_WIDTH, XftTypeInteger, char_width,
|
||||
(void *) 0);
|
||||
wnorm = xtermOpenXft(dpy, pat, "wide");
|
||||
|
||||
if (wnorm != 0) {
|
||||
XftPatternBuild(pat,
|
||||
XFT_FAMILY, XftTypeString, face_name,
|
||||
XFT_SIZE, XftTypeDouble, face_size,
|
||||
XFT_SPACING, XftTypeInteger, XFT_MONO,
|
||||
XFT_CHAR_WIDTH, XftTypeInteger, char_width,
|
||||
XFT_WEIGHT, XftTypeInteger, XFT_WEIGHT_BOLD,
|
||||
WideXftPattern,
|
||||
BoldXftPattern(wnorm),
|
||||
(void *) 0);
|
||||
wbold = xtermOpenXft(dpy, pat, "wide-bold");
|
||||
|
||||
#if OPT_ISO_COLORS
|
||||
if (screen->italicULMode) {
|
||||
if (screen->italicULMode
|
||||
&& (pat = XftNameParse(face_name)) != 0) {
|
||||
XftPatternBuild(pat,
|
||||
XFT_FAMILY, XftTypeString, face_name,
|
||||
XFT_SIZE, XftTypeDouble, face_size,
|
||||
XFT_SPACING, XftTypeInteger, XFT_MONO,
|
||||
XFT_CHAR_WIDTH, XftTypeInteger, char_width,
|
||||
XFT_SLANT, XftTypeInteger, XFT_SLANT_ITALIC,
|
||||
WideXftPattern,
|
||||
ItalXftPattern(wnorm),
|
||||
(void *) 0);
|
||||
wital = xtermOpenXft(dpy, pat, "wide-italic");
|
||||
}
|
||||
@ -2535,6 +2544,8 @@ SetVTFont(XtermWidget xw,
|
||||
FindFontSelection(xw, myfonts.f_n, False);
|
||||
return;
|
||||
} else {
|
||||
int oldFont = screen->menu_font_number;
|
||||
|
||||
#define USE_CACHED(field, name) \
|
||||
if (myfonts.field == 0) { \
|
||||
myfonts.field = screen->menu_font_names[which][name]; \
|
||||
@ -2553,6 +2564,10 @@ SetVTFont(XtermWidget xw,
|
||||
&myfonts,
|
||||
doresize, which)) {
|
||||
return;
|
||||
} else {
|
||||
xtermLoadFont(xw,
|
||||
xtermFontName(screen->MenuFontName(oldFont)),
|
||||
doresize, oldFont);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,98 +1,320 @@
|
||||
#! /usr/bin/perl -w
|
||||
# Author: Thomas E. Dickey
|
||||
# $XTermId: gen-pc-fkeys.pl,v 1.5 2005/04/03 16:58:29 tom Exp $
|
||||
# $XFree86: xc/programs/xterm/gen-pc-fkeys.pl,v 1.2 2005/03/29 04:00:32 tsi Exp $
|
||||
# $XTermId: gen-pc-fkeys.pl,v 1.16 2007/06/10 23:36:09 tom Exp $
|
||||
#
|
||||
# Construct a list of function-key definitions corresponding to xterm's
|
||||
# Sun/PC keyboard. This uses infocmp to obtain the strings to modify (and
|
||||
# verify).
|
||||
use strict;
|
||||
|
||||
my(@old_keys);
|
||||
my($min_fkeys,$max_fkeys,$max_modifier,$modify_opt,$terminfo);
|
||||
my($max_modifier, $terminfo);
|
||||
my(@old_fkeys, $opt_fkeys, $min_fkeys, $max_fkeys);
|
||||
my(%old_ckeys, $opt_ckeys, $min_ckeys, $max_ckeys);
|
||||
my(%old_ekeys, $opt_ekeys, $min_ekeys, $max_ekeys);
|
||||
|
||||
my(@ckey_names);
|
||||
@ckey_names = (
|
||||
'kcud1', 'kcub1', 'kcuf1', 'kcuu1', # 1 = no modifiers
|
||||
'kDN', 'kLFT', 'kRIT', 'kUP', # 2 = shift
|
||||
# repeat the second row with the modifier code appended to each name
|
||||
'kDN3', 'kLFT3', 'kRIT3', 'kUP3', # 3 = alt
|
||||
'kDN4', 'kLFT4', 'kRIT4', 'kUP4', # 4 = shift + alt
|
||||
'kDN5', 'kLFT5', 'kRIT5', 'kUP5', # 5 = control
|
||||
'kDN6', 'kLFT6', 'kRIT6', 'kUP6', # 6 = shift + control
|
||||
'kDN7', 'kLFT7', 'kRIT7', 'kUP7', # 7 = alt + control
|
||||
);
|
||||
my(@ckey_known);
|
||||
@ckey_known = (
|
||||
'kind', 'kLFT', 'kRIT', 'kri', # 2 = shift (standard)
|
||||
);
|
||||
|
||||
my(@ekey_names);
|
||||
@ekey_names = (
|
||||
# 'khome', 'kend', 'knp', 'kpp', 'kdch1', 'kich1', # 1 = no modifiers
|
||||
# 'kHOM', 'kEND', 'kNXT', 'kPRV', 'kDC', 'kIC', # 2 = shift
|
||||
'khome', 'kend', # 1 = no modifiers
|
||||
'kHOM', 'kEND', # 2 = shift
|
||||
);
|
||||
my %ekey_names;
|
||||
|
||||
$min_fkeys=12; # the number of "real" function keys on your keyboard
|
||||
$max_fkeys=64; # the number of function-keys terminfo can support
|
||||
$max_modifier=8; # modifier 1 + (1=shift, 2=alt, 4=control 8=meta)
|
||||
$modify_opt=2; # xterm's modifyCursorKeys resource
|
||||
|
||||
$min_ckeys=4; # the number of "real" cursor keys on your keyboard
|
||||
$max_ckeys=($min_ckeys * $max_modifier);
|
||||
|
||||
$min_ekeys=2; # the number of "real" editing keys on your keyboard
|
||||
$max_ekeys=($min_ekeys * $max_modifier);
|
||||
|
||||
$opt_ckeys=2; # xterm's modifyCursorKeys resource
|
||||
$opt_ekeys=2; # xterm's modifyCursorKeys resource
|
||||
$opt_fkeys=2; # xterm's modifyFunctionKeys resource
|
||||
$terminfo="xterm-new"; # the terminfo entry to use
|
||||
|
||||
my($cur_modifier, $cur_fkey);
|
||||
|
||||
# apply the given modifier to the terminfo string, return the result
|
||||
sub modify_it {
|
||||
sub modify_fkey($$$) {
|
||||
my $code = $_[0];
|
||||
my $text = $_[1];
|
||||
if ($code != 1) {
|
||||
my $opts = $_[2];
|
||||
if (not defined($text)) {
|
||||
$text = "";
|
||||
} elsif ($code != 1) {
|
||||
$text =~ s/\\EO/\\E\[/ if ($opts >= 1);
|
||||
|
||||
my $piece = substr $text, 0, length ($text) - 1;
|
||||
my $final = substr $text, length ($text) - 1;
|
||||
my $check = substr $piece, length ($piece) - 1;
|
||||
if ($check =~ /[0-9]/) {
|
||||
$code = ";" . $code;
|
||||
} elsif ( $check =~ /\[/ and $opts >= 2) {
|
||||
$code = "1;" . $code;
|
||||
}
|
||||
if ( $opts >= 3 ) {
|
||||
$code = ">" . $code;
|
||||
}
|
||||
$text = $piece . $code . $final;
|
||||
$text =~ s/([\d;]+)>/>$1/;
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
|
||||
# compute the next modifier value
|
||||
# compute the next modifier value -
|
||||
# Cycling through the modifiers is not just like counting. Users prefer
|
||||
# pressing one modifier (even if using Emacs). So first we cycle through
|
||||
# the individual modifiers, then for completeness two, three, etc.
|
||||
sub next_modifier {
|
||||
my $code = $_[0];
|
||||
my $mask = $code - 1;
|
||||
if ($mask == 0) {
|
||||
$mask = 1;
|
||||
$mask = 1; # shift
|
||||
} elsif ($mask == 1) {
|
||||
$mask = 4;
|
||||
$mask = 4; # control
|
||||
} elsif ($mask == 2) {
|
||||
$mask = 3; # FIXME
|
||||
$mask = 3; # shift+alt
|
||||
} elsif ($mask == 4) {
|
||||
$mask = 5;
|
||||
$mask = 5; # shift+control
|
||||
} elsif ($mask == 5) {
|
||||
$mask = 2;
|
||||
$mask = 2; # alt
|
||||
}
|
||||
# printf ("# next_modifier(%d) = %d\n", $code, $mask + 1);
|
||||
return $mask + 1;
|
||||
}
|
||||
|
||||
# Read the terminfo entry's list of function keys $old_keys[].
|
||||
# We could handle $old_keys[0], but choose to start numbering from 1.
|
||||
sub readterm() {
|
||||
my($key,$n,$str);
|
||||
my(@list) = `infocmp -1 $terminfo`;
|
||||
sub make_ekey_names() {
|
||||
my ($j, $k);
|
||||
my $min = $min_ekeys * 2;
|
||||
my $max = $max_ekeys - 1;
|
||||
|
||||
# printf "# make_ekey_names\n";
|
||||
for $j ($min..$max) {
|
||||
$k = substr($j / $min_ekeys, 0, 1);
|
||||
$ekey_names[$j] = $ekey_names[$min_ekeys + ($j % $min_ekeys)] . $k;
|
||||
# printf "# make %d:%s\n", $j, $ekey_names[$j];
|
||||
}
|
||||
for $j (0..$#ekey_names) {
|
||||
# printf "# %d:%s\n", $j, $ekey_names[$j];
|
||||
$ekey_names{$ekey_names[$j]} = $j;
|
||||
}
|
||||
}
|
||||
|
||||
# Read the terminfo entry's list of function keys $old_fkeys[].
|
||||
# We could handle $old_fkeys[0], but choose to start numbering from 1.
|
||||
sub readterm($) {
|
||||
my $term = $_[0];
|
||||
my($key, $n, $str);
|
||||
my(@list) = `infocmp -1 $term`;
|
||||
|
||||
for $n (0..$#list) {
|
||||
chop $list[$n];
|
||||
$list[$n] =~ s/^[[:space:]]//;
|
||||
|
||||
$key = $list[$n];
|
||||
$key =~ s/=.*//;
|
||||
|
||||
$str = $list[$n];
|
||||
$str =~ s/^[^=]+=//;
|
||||
$str =~ s/,$//;
|
||||
|
||||
if ( $list[$n] =~ /^kf[[:digit:]]+=/ ) {
|
||||
$key = $list[$n];
|
||||
$key =~ s/^kf//;
|
||||
$key =~ s/=.*//;
|
||||
$str = $list[$n];
|
||||
$str =~ s/^kf[[:digit:]]+=//;
|
||||
$str =~ s/,[[:space:]]*$//;
|
||||
# printf "$n:%s(%d)(%s)\n", $list[$n], $key, $str;
|
||||
$old_keys[$key] = $str;
|
||||
# printf "# $n:%s(%d)(%s)\n", $list[$n], $key, $str;
|
||||
$old_fkeys[$key] = $str;
|
||||
} elsif ( $key =~ /^kc[[:alpha:]]+1/
|
||||
or $key =~ /^k(LFT|RIT|UP|DN)\d?/) {
|
||||
# printf "# $n:%s(%d)(%s)\n", $list[$n], $key, $str;
|
||||
$old_ckeys{$key} = $str;
|
||||
} elsif ( defined $ekey_names{$key} ) {
|
||||
# printf "# $n:%s(%s)(%s)\n", $list[$n], $key, $str;
|
||||
$old_ekeys{$key} = $str;
|
||||
}
|
||||
}
|
||||
# printf ("last index:%d\n", $#old_keys);
|
||||
# printf ("last index:%d\n", $#old_fkeys);
|
||||
}
|
||||
|
||||
readterm();
|
||||
# read the whole terminfo to ensure we get the non-modified stuff, then read
|
||||
# the part that contains modifiers.
|
||||
sub read_part($) {
|
||||
my $part = $_[0];
|
||||
|
||||
# Cycling through the modifiers is not just like counting. Users prefer
|
||||
# pressing one modifier (even if using Emacs). So first we cycle through
|
||||
# the individual modifiers, then for completeness two, three, etc.
|
||||
printf "xterm+pcfkeys|fragment for PC-style keys, \n";
|
||||
for ($cur_fkey = 1, $cur_modifier = 1; $cur_fkey < $max_fkeys; ++$cur_fkey) {
|
||||
my $index = (($cur_fkey - 1) % $min_fkeys);
|
||||
if ($index == 0 && $cur_fkey != 1) {
|
||||
$cur_modifier = next_modifier($cur_modifier);
|
||||
%old_ckeys = ();
|
||||
@old_fkeys = ();
|
||||
readterm($terminfo);
|
||||
readterm($part);
|
||||
}
|
||||
|
||||
sub nameof_ckeys($) {
|
||||
my $opts = $_[0];
|
||||
my $optname = "xterm+pcc" . ($opts >= 0 ? $opts : "n");
|
||||
return $optname;
|
||||
}
|
||||
|
||||
sub generate_ckeys($) {
|
||||
my $opts = $_[0];
|
||||
my($modifier, $cur_ckey, $index);
|
||||
|
||||
printf "%s|fragment with modifyCursorKeys:%s,\n",
|
||||
nameof_ckeys($opts), $opts;
|
||||
|
||||
# show the standard cursor definitions
|
||||
$modifier = 1;
|
||||
for ($index = 0; $index < $min_ckeys; ++$index) {
|
||||
$cur_ckey = $index + ($modifier * $min_ckeys);
|
||||
my $name = $ckey_known[$index];
|
||||
my $input = $old_ckeys{$ckey_names[$index]};
|
||||
my $result = modify_fkey($modifier + 1, $input, $opts);
|
||||
printf "\t%s=%s,\n", $name, $result;
|
||||
if (defined $old_ckeys{$name}) {
|
||||
if ($old_ckeys{$name} ne $result) {
|
||||
printf "# found %s=%s\n", $name, $old_ckeys{$name};
|
||||
}
|
||||
}
|
||||
}
|
||||
my $input = $old_keys[$index + 1];
|
||||
my $result = modify_it($cur_modifier,$input);
|
||||
printf "\tkf%d=%s, \n", $cur_fkey, $result;
|
||||
if (defined $old_keys[$cur_fkey]) {
|
||||
if ($old_keys[$cur_fkey] ne $result) {
|
||||
printf "# diff %s\n", $old_keys[$cur_fkey];
|
||||
|
||||
# show the extended cursor definitions
|
||||
for ($index = 0; $index < $min_ckeys; ++$index) {
|
||||
for ($modifier = 1; $modifier < $max_modifier; ++$modifier) {
|
||||
$cur_ckey = $index + ($modifier * $min_ckeys);
|
||||
if (defined $ckey_names[$cur_ckey] and
|
||||
$ckey_names[$cur_ckey] ne "kLFT" and
|
||||
$ckey_names[$cur_ckey] ne "kRIT" ) {
|
||||
my $name = $ckey_names[$cur_ckey];
|
||||
my $input = $old_ckeys{$ckey_names[$index]};
|
||||
my $result = modify_fkey($modifier + 1, $input, $opts);
|
||||
printf "\t%s=%s,\n", $name, $result;
|
||||
if (defined $old_ckeys{$name}) {
|
||||
if ($old_ckeys{$name} ne $result) {
|
||||
printf "# found %s=%s\n", $name, $old_ckeys{$name};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub nameof_ekeys($) {
|
||||
my $opts = $_[0];
|
||||
my $optname = "xterm+pce" . ($opts >= 0 ? $opts : "n");
|
||||
return $optname;
|
||||
}
|
||||
|
||||
sub generate_ekeys($) {
|
||||
my $opts = $_[0];
|
||||
my($modifier, $cur_ekey, $index);
|
||||
|
||||
printf "%s|fragment with modifyCursorKeys:%s,\n",
|
||||
nameof_ekeys($opts), $opts;
|
||||
|
||||
for ($index = 0; $index < $min_ekeys; ++$index) {
|
||||
for ($modifier = 1; $modifier < $max_modifier; ++$modifier) {
|
||||
$cur_ekey = $index + ($modifier * $min_ekeys);
|
||||
if (defined $ekey_names[$cur_ekey] ) {
|
||||
my $name = $ekey_names[$cur_ekey];
|
||||
my $input = $old_ekeys{$ekey_names[$index]};
|
||||
my $result = modify_fkey($modifier + 1, $input, $opts);
|
||||
printf "\t%s=%s,\n", $name, $result;
|
||||
if (defined $old_ekeys{$name}) {
|
||||
if ($old_ekeys{$name} ne $result) {
|
||||
printf "# found %s=%s\n", $name, $old_ekeys{$name};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub nameof_fkeys($) {
|
||||
my $opts = $_[0];
|
||||
my $optname = "xterm+pcf" . ($opts >= 0 ? $opts : "n");
|
||||
return $optname;
|
||||
}
|
||||
|
||||
sub generate_fkeys($) {
|
||||
my $opts = $_[0];
|
||||
my($modifier, $cur_fkey);
|
||||
|
||||
printf "%s|fragment with modifyFunctionKeys:%s and ctrlFKeys:10,\n",
|
||||
nameof_fkeys($opts), $opts;
|
||||
|
||||
for ($cur_fkey = 1, $modifier = 1; $cur_fkey < $max_fkeys; ++$cur_fkey) {
|
||||
my $index = (($cur_fkey - 1) % $min_fkeys);
|
||||
if ($index == 0 && $cur_fkey != 1) {
|
||||
$modifier = next_modifier($modifier);
|
||||
}
|
||||
if (defined $old_fkeys[$index + 1]) {
|
||||
my $input = $old_fkeys[$index + 1];
|
||||
my $result = modify_fkey($modifier, $input, $opts);
|
||||
printf "\tkf%d=%s,\n", $cur_fkey, $result;
|
||||
if (defined $old_fkeys[$cur_fkey]) {
|
||||
if ($old_fkeys[$cur_fkey] ne $result) {
|
||||
printf "# found kf%d=%s\n", $cur_fkey, $old_fkeys[$cur_fkey];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub show_default() {
|
||||
readterm($terminfo);
|
||||
|
||||
printf "xterm+pcfkeys|fragment for PC-style keys,\n";
|
||||
printf "\tuse=%s,\n", nameof_ckeys($opt_ckeys);
|
||||
printf "\tuse=%s,\n", nameof_ekeys($opt_ekeys);
|
||||
printf "\tuse=%s,\n", nameof_fkeys($opt_fkeys);
|
||||
|
||||
generate_ckeys($opt_ckeys);
|
||||
generate_ekeys($opt_ekeys);
|
||||
generate_fkeys($opt_fkeys);
|
||||
}
|
||||
|
||||
sub show_nondefault()
|
||||
{
|
||||
my $opts;
|
||||
|
||||
for ($opts = 0; $opts <= 3; ++$opts) {
|
||||
if ($opts != $opt_ckeys) {
|
||||
read_part(nameof_ckeys($opts));
|
||||
generate_ckeys($opts);
|
||||
}
|
||||
}
|
||||
|
||||
for ($opts = 0; $opts <= 3; ++$opts) {
|
||||
if ($opts != $opt_ekeys) {
|
||||
read_part(nameof_ekeys($opts));
|
||||
generate_ekeys($opts);
|
||||
}
|
||||
}
|
||||
|
||||
for ($opts = 0; $opts <= 3; ++$opts) {
|
||||
if ($opts != $opt_fkeys) {
|
||||
read_part(nameof_fkeys($opts));
|
||||
generate_fkeys($opts);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
make_ekey_names();
|
||||
|
||||
printf "# gen-pc-fkeys.pl\n";
|
||||
show_default();
|
||||
show_nondefault();
|
||||
|
BIN
app/xterm/icons/xterm-color_32x32.xcf
Normal file
BIN
app/xterm/icons/xterm-color_32x32.xcf
Normal file
Binary file not shown.
46
app/xterm/icons/xterm-color_32x32.xpm
Normal file
46
app/xterm/icons/xterm-color_32x32.xpm
Normal file
@ -0,0 +1,46 @@
|
||||
/* XPM */
|
||||
static char * xterm_color_32x32_xpm[] = {
|
||||
"32 32 11 1",
|
||||
" c None",
|
||||
". c #555500",
|
||||
"+ c #000000",
|
||||
"@ c #FFFFFF",
|
||||
"# c #FF0000",
|
||||
"$ c #980000",
|
||||
"% c #FF5E00",
|
||||
"& c #49FF00",
|
||||
"* c #2FA300",
|
||||
"= c #60B7FF",
|
||||
"- c #3A709B",
|
||||
"................................",
|
||||
".....+++++++++++++++++++++++....",
|
||||
"....+@@+++++++++++++++++++@@++..",
|
||||
"....+@+++++++++++++++++++++@+@+.",
|
||||
"....+++++++++++++++++++++++++@@+",
|
||||
"....+++#$+$#+++++++++++++++++@@+",
|
||||
"....++++$#$++++++++++++++++++@@+",
|
||||
"....++++$#+++++++++++++++++++@@+",
|
||||
"....++++$#$++++++++++++++++++@@+",
|
||||
"....+++#$+$#+++++++++++++++++@@+",
|
||||
"....+++++++++++++++++++++++++@@+",
|
||||
"....+++++++++++++++++++++++++@@+",
|
||||
"....+++++++++++++++++++++++++@@+",
|
||||
"....+++@@@@+%%%+&&&*+=++=++++@@+",
|
||||
"....+++++@++%+++&+&*+=-==++++@@+",
|
||||
"....+++++@++%%%+&&&*+==-=++++@@+",
|
||||
"....+++++@++%+++&+&++=++=++++@@+",
|
||||
"....+++++@++%%%+&+*&+=++=++++@@+",
|
||||
"....+++++++++++++++++++++++++@+.",
|
||||
"....+++++++++++++++++++++++++@+.",
|
||||
"....+@+++++++++++++++++++++@++..",
|
||||
"....+@@+++++++++++++++++++@@+...",
|
||||
".....+++++++++++++++++++++++....",
|
||||
"................................",
|
||||
".....++++++++++++++++++++++++...",
|
||||
"....+@@@@@@@@@@@@@@@@@@@@@@@+...",
|
||||
"...+@@@@@@@@@@@@@@@@@@@@@@@+....",
|
||||
"...+@@++@@++@++@@++@@+@@++@+....",
|
||||
"..+@++@@++@@+@@++@@++@++@@@+....",
|
||||
"..+@@@@@@@@@@@@@@@@@@@@@@@+.+...",
|
||||
".+@@@@@@@@@@@@@@@@@@@@@@@+......",
|
||||
".++++++++++++++++++++++++++....."};
|
BIN
app/xterm/icons/xterm-color_48x48.xcf
Normal file
BIN
app/xterm/icons/xterm-color_48x48.xcf
Normal file
Binary file not shown.
61
app/xterm/icons/xterm-color_48x48.xpm
Normal file
61
app/xterm/icons/xterm-color_48x48.xpm
Normal file
@ -0,0 +1,61 @@
|
||||
/* XPM */
|
||||
static char * xterm_color_48x48_xpm[] = {
|
||||
"48 48 10 1",
|
||||
" c None",
|
||||
". c #555500",
|
||||
"+ c #000000",
|
||||
"@ c #FFFFFF",
|
||||
"# c #FF0000",
|
||||
"$ c #070700",
|
||||
"% c #0B0B00",
|
||||
"& c #FF8400",
|
||||
"* c #49FF00",
|
||||
"= c #60B7FF",
|
||||
"................................................",
|
||||
"......++++++++++++++++++++++++++++++++++........",
|
||||
".....+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@++......",
|
||||
".....+@@@++++++++++++++++++++++++++++@@@+@+.....",
|
||||
".....+@@++++++++++++++++++++++++++++++@@+@@+....",
|
||||
".....+@++++++++++++++++++++++++++++++++@+@@@+...",
|
||||
".....+@++###++++###++++++++++++++++++++@+@@@@+..",
|
||||
".....+@+++##++++##+++++++++++++++++++++@+@@@@+..",
|
||||
".....+@++++##++##++++++++++++++++++++++@+@@@@+..",
|
||||
".....+@++++##++##++++++++++++++++++++++@+@@@@+..",
|
||||
".....+@+++++####+++++++++++++++++++++++@+@@@@+..",
|
||||
".....+@+++++####+++++++++++++++++++++++@+@@@@+..",
|
||||
".....+@++++++##++++++++++++++++++++++++@+@@@@+..",
|
||||
".....+@+++++####+++++++++++++++++++++++@+@@@@+..",
|
||||
".....+@+++++####+++++++++++++++++++++++@+@@@@+..",
|
||||
".....+@++++##++##++++++++++++++++++++++@+@@@@+..",
|
||||
".....+@++++##++##++++++++++++++++++++++@+@@@@+..",
|
||||
".....+@+++##++++##+++++++++++++++++++++@+@@@@+..",
|
||||
".....+@++###++++###++++++++++++++++++++@+@@@@+..",
|
||||
".....+@++++++++++++++++++++++++++++++++@+@@@@+..",
|
||||
".....+@$+++++++++++++++++++++++++++++++@+@@@@+..",
|
||||
".....+@%@@@@@@@+&&&&&++****+++==+++==++@+@@@@+..",
|
||||
".....+@++++@++++&++++++*+++*++==+++==++@+@@@@+..",
|
||||
".....+@++++@++++&++++++*+++*++=+=+=+=++@+@@@@+..",
|
||||
".....+@++++@++++&&&&+++****+++=+=+=+=++@+@@@@+..",
|
||||
".....+@++++@++++&++++++*+*++++=++=++=++@+@@@+...",
|
||||
".....+@++++@++++&++++++*++*+++=++=++=++@+@@@+...",
|
||||
".....+@++++@++++&&&&&++*+++*++=+++++=++@+@@+....",
|
||||
".....+@++++++++++++++++++++++++++++++++@+@@+....",
|
||||
".....+@++++++++++++++++++++++++++++++++@+@+.....",
|
||||
".....+@@++++++++++++++++++++++++++++++@@+@+.....",
|
||||
".....+@@@++++++++++++++++++++++++++++@@@++......",
|
||||
".....+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@++......",
|
||||
"......++++++++++++++++++++++++++++++++++........",
|
||||
"................................................",
|
||||
"................................................",
|
||||
"......++++++++++++++++++++++++++++++++++++......",
|
||||
".....+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@++......",
|
||||
".....+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@@++......",
|
||||
"....+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+@+......",
|
||||
"....+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@@+@+......",
|
||||
"...+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+@@+......",
|
||||
"...+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@@+@@+......",
|
||||
"..+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+@@+.......",
|
||||
"..+@++@++++++++++++++++++++++++++@++@+@+........",
|
||||
".+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+@+.........",
|
||||
".+++++++++++++++++++++++++++++++++++++..........",
|
||||
"................................................"};
|
BIN
app/xterm/icons/xterm_32x32.xcf
Normal file
BIN
app/xterm/icons/xterm_32x32.xcf
Normal file
Binary file not shown.
95
app/xterm/icons/xterm_32x32.xpm
Normal file
95
app/xterm/icons/xterm_32x32.xpm
Normal file
@ -0,0 +1,95 @@
|
||||
/* XPM */
|
||||
static char * xterm_32x32_xpm[] = {
|
||||
"32 32 60 1",
|
||||
" c None",
|
||||
". c #FFFFFF",
|
||||
"+ c #000000",
|
||||
"@ c #EFEFEF",
|
||||
"# c #FEFEFE",
|
||||
"$ c #FBFBFB",
|
||||
"% c #F3F3F3",
|
||||
"& c #ADADAD",
|
||||
"* c #909090",
|
||||
"= c #737373",
|
||||
"- c #D2D2D2",
|
||||
"; c #646464",
|
||||
"> c #9A9A9A",
|
||||
", c #8D8D8D",
|
||||
"' c #D3D3D3",
|
||||
") c #0E0E0E",
|
||||
"! c #F6F6F6",
|
||||
"~ c #5E5E5E",
|
||||
"{ c #B1B1B1",
|
||||
"] c #777777",
|
||||
"^ c #949494",
|
||||
"/ c #757575",
|
||||
"( c #C4C4C4",
|
||||
"_ c #E7E7E7",
|
||||
": c #F1F1F1",
|
||||
"< c #F8F8F8",
|
||||
"[ c #EEEEEE",
|
||||
"} c #F0F0F0",
|
||||
"| c #FAFAFA",
|
||||
"1 c #7B7B7B",
|
||||
"2 c #3D3D3D",
|
||||
"3 c #868686",
|
||||
"4 c #4F4F4F",
|
||||
"5 c #ABABAB",
|
||||
"6 c #545454",
|
||||
"7 c #5B5B5B",
|
||||
"8 c #AFAFAF",
|
||||
"9 c #292929",
|
||||
"0 c #181818",
|
||||
"a c #C7C7C7",
|
||||
"b c #CFCFCF",
|
||||
"c c #7F7F7F",
|
||||
"d c #A3A3A3",
|
||||
"e c #4D4D4D",
|
||||
"f c #6A6A6A",
|
||||
"g c #A1A1A1",
|
||||
"h c #8E8E8E",
|
||||
"i c #696969",
|
||||
"j c #474747",
|
||||
"k c #5A5A5A",
|
||||
"l c #959595",
|
||||
"m c #767676",
|
||||
"n c #8B8B8B",
|
||||
"o c #BCBCBC",
|
||||
"p c #BFBFBF",
|
||||
"q c #D7D7D7",
|
||||
"r c #404040",
|
||||
"s c #636363",
|
||||
"t c #989898",
|
||||
"u c #8A8A8A",
|
||||
"................................",
|
||||
".....+++++++++++++++++++++++....",
|
||||
"....+..+++++++++++++++++++..++..",
|
||||
"....+.+...................+.+.+.",
|
||||
"....++.@#.$%................+..+",
|
||||
"....++.&*.=-................+..+",
|
||||
"....++..;>,.................+..+",
|
||||
"....++..')!.................+..+",
|
||||
"....++.#~{].................+..+",
|
||||
"....++.^{./(................+..+",
|
||||
"....++......................+..+",
|
||||
"....++......................+..+",
|
||||
"....++.____:___<_[..<}..[|..+..+",
|
||||
"....++.1;21341156]7.89$:0a..+..+",
|
||||
"....++..bc.8^__8d.e.8fghia..+..+",
|
||||
"....++..bc.84115jkl.887mna..+..+",
|
||||
"....++..bc.8d..8dof.88pqna..+..+",
|
||||
"....++..bc.8rss5d.tu88..na..+...",
|
||||
"....++......................+.+.",
|
||||
"....++......................+.+.",
|
||||
"....+.+...................+.++..",
|
||||
"....+..+++++++++++++++++++..+...",
|
||||
".....+++++++++++++++++++++++....",
|
||||
"................................",
|
||||
".....++++++++++++++++++++++++...",
|
||||
"....+.......................+...",
|
||||
"...+.......................+....",
|
||||
"...+..++..++.++..++..+..++.+....",
|
||||
"....++..++..+..++..++.++........",
|
||||
"..+.......................+.+...",
|
||||
".+.......................+......",
|
||||
".++++++++++++++++++++++++++....."};
|
BIN
app/xterm/icons/xterm_48x48.xcf
Normal file
BIN
app/xterm/icons/xterm_48x48.xcf
Normal file
Binary file not shown.
53
app/xterm/icons/xterm_48x48.xpm
Normal file
53
app/xterm/icons/xterm_48x48.xpm
Normal file
@ -0,0 +1,53 @@
|
||||
/* XPM */
|
||||
static char * xterm_48x48_xpm[] = {
|
||||
"48 48 2 1",
|
||||
" c #000000",
|
||||
". c #FFFFFF",
|
||||
"................................................",
|
||||
"...... ........",
|
||||
"..... .................................. ......",
|
||||
"..... ... ... . .....",
|
||||
"..... .. ............................ .. .. ....",
|
||||
"..... . .............................. . ... ...",
|
||||
"..... . . .... ................... . .... ..",
|
||||
"..... . .. .... .................... . .... ..",
|
||||
"..... . ... .. ..................... . .... ..",
|
||||
"..... . ... .. ..................... . .... ..",
|
||||
"..... . .... ...................... . .... ..",
|
||||
"..... . .... ...................... . .... ..",
|
||||
"..... . ..... ....................... . .... ..",
|
||||
"..... . .... ...................... . .... ..",
|
||||
"..... . .... ...................... . .... ..",
|
||||
"..... . ... .. ..................... . .... ..",
|
||||
"..... . ... .. ..................... . .... ..",
|
||||
"..... . .. .... .................... . .... ..",
|
||||
"..... . . .... ................... . .... ..",
|
||||
"..... . .............................. . .... ..",
|
||||
"..... . .............................. . .... ..",
|
||||
"..... . . . .. ... ... . . .... ..",
|
||||
"..... . ... .... ...... ... .. ... . . .... ..",
|
||||
"..... . ... .... ...... ... .. . . . . . .... ..",
|
||||
"..... . ... .... ... ... . . . . . .... ..",
|
||||
"..... . ... .... ...... . .... .. .. . . ... ...",
|
||||
"..... . ... .... ...... .. ... .. .. . . ... ...",
|
||||
"..... . ... .... .. ... .. ..... . . .. ....",
|
||||
"..... . .............................. . .. ....",
|
||||
"..... . .............................. . . .....",
|
||||
"..... .. ............................ .. . .....",
|
||||
"..... ... ... ......",
|
||||
"..... .................................. ......",
|
||||
"...... ........",
|
||||
"................................................",
|
||||
"................................................",
|
||||
"...... ......",
|
||||
"..... .................................. ......",
|
||||
"..... . . . . . . . . . . . . . . . . .. ......",
|
||||
".... .................................. . ......",
|
||||
".... . . . . . . . . . . . . . . . . .. . ......",
|
||||
"... .................................. .. ......",
|
||||
"... . . . . . . . . . . . . . . . . .. .. ......",
|
||||
".. .................................. .. .......",
|
||||
".. . . . . . ........",
|
||||
". .................................. . .........",
|
||||
". ..........",
|
||||
"................................................"};
|
@ -1,6 +1,4 @@
|
||||
/* $XTermId: input.c,v 1.283 2007/03/19 23:58:54 tom Exp $ */
|
||||
|
||||
/* $XFree86: xc/programs/xterm/input.c,v 3.76 2006/06/19 00:36:51 dickey Exp $ */
|
||||
/* $XTermId: input.c,v 1.291 2007/07/22 20:34:04 tom Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1999-2006,2007 by Thomas E. Dickey
|
||||
@ -72,6 +70,10 @@
|
||||
#include <X11/Sunkeysym.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_X11_XF86KEYSYM_H
|
||||
#include <X11/XF86keysym.h>
|
||||
#endif
|
||||
|
||||
#include <X11/Xutil.h>
|
||||
#include <ctype.h>
|
||||
|
||||
@ -107,6 +109,7 @@
|
||||
&& (keysym == XK_BackSpace))
|
||||
|
||||
#define MAP(from, to) case from: result = to; break
|
||||
#define Masked(value,mask) ((value) & (unsigned) (~(mask)))
|
||||
|
||||
#define KEYSYM_FMT "0x%04lX" /* simplify matching <X11/keysymdef.h> */
|
||||
|
||||
@ -348,7 +351,7 @@ allowModifierParm(XtermWidget xw, KEY_DATA * kd)
|
||||
#define MODIFIER_NAME(parm, name) (((parm - UNMOD) & name) ? " "#name : "")
|
||||
|
||||
static short
|
||||
computeModifierParm(XtermWidget xw, int state)
|
||||
computeModifierParm(XtermWidget xw, unsigned state)
|
||||
{
|
||||
short modify_parm = UNMOD;
|
||||
|
||||
@ -383,9 +386,12 @@ computeModifierParm(XtermWidget xw, int state)
|
||||
return modify_parm;
|
||||
}
|
||||
|
||||
#define computeMaskedModifier(xw, state, mask) \
|
||||
computeModifierParm(xw, Masked(state, mask))
|
||||
|
||||
#if OPT_NUM_LOCK
|
||||
static unsigned
|
||||
filterAltMeta(unsigned result, unsigned mask, Boolean enable, KEY_DATA * kd)
|
||||
filterAltMeta(unsigned result, unsigned mask, Bool enable, KEY_DATA * kd)
|
||||
{
|
||||
if ((result & mask) != 0) {
|
||||
/*
|
||||
@ -445,7 +451,7 @@ allowedCharModifiers(XtermWidget xw, unsigned state, KEY_DATA * kd)
|
||||
*/
|
||||
if (xw->keyboard.modify_now.other_keys <= 1) {
|
||||
if (IsControlInput(kd)
|
||||
&& (result & ~ControlMask) == 0) {
|
||||
&& Masked(result, ControlMask) == 0) {
|
||||
/* These keys are already associated with the control-key */
|
||||
if (xw->keyboard.modify_now.other_keys == 0) {
|
||||
result &= ~ControlMask;
|
||||
@ -454,7 +460,7 @@ allowedCharModifiers(XtermWidget xw, unsigned state, KEY_DATA * kd)
|
||||
;
|
||||
} else if (IsControlAlias(kd)) {
|
||||
/* Things like "^_" work here... */
|
||||
if ((result & ~(ControlMask | ShiftMask)) == 0) {
|
||||
if (Masked(result, (ControlMask | ShiftMask)) == 0) {
|
||||
result = 0;
|
||||
}
|
||||
} else if (!IsControlOutput(kd) && !IsPredefinedKey(kd->keysym)) {
|
||||
@ -530,7 +536,7 @@ ModifyOtherKeys(XtermWidget xw,
|
||||
break;
|
||||
#ifdef XK_ISO_Left_Tab
|
||||
case XK_ISO_Left_Tab:
|
||||
if (computeModifierParm(xw, state & ~ShiftMask) > 1)
|
||||
if (computeMaskedModifier(xw, state, ShiftMask) > 1)
|
||||
result = True;
|
||||
break;
|
||||
#endif
|
||||
@ -548,8 +554,7 @@ ModifyOtherKeys(XtermWidget xw,
|
||||
} else if (IsControlAlias(kd)) {
|
||||
if (state == ShiftMask)
|
||||
result = False;
|
||||
else if (computeModifierParm(xw,
|
||||
(state & ~ControlMask))
|
||||
else if (computeMaskedModifier(xw, state, ControlMask)
|
||||
> 1) {
|
||||
result = True;
|
||||
}
|
||||
@ -563,7 +568,7 @@ ModifyOtherKeys(XtermWidget xw,
|
||||
switch (kd->keysym) {
|
||||
case XK_BackSpace:
|
||||
/* strip ControlMask as per IsBackarrowToggle() */
|
||||
if (computeModifierParm(xw, state & ~ControlMask) > 1)
|
||||
if (computeMaskedModifier(xw, state, ControlMask) > 1)
|
||||
result = True;
|
||||
break;
|
||||
case XK_Delete:
|
||||
@ -571,7 +576,7 @@ ModifyOtherKeys(XtermWidget xw,
|
||||
break;
|
||||
#ifdef XK_ISO_Left_Tab
|
||||
case XK_ISO_Left_Tab:
|
||||
if (computeModifierParm(xw, state & ~ShiftMask) > 1)
|
||||
if (computeMaskedModifier(xw, state, ShiftMask) > 1)
|
||||
result = True;
|
||||
break;
|
||||
#endif
|
||||
@ -584,7 +589,7 @@ ModifyOtherKeys(XtermWidget xw,
|
||||
result = True;
|
||||
} else if (state == ShiftMask) {
|
||||
result = (kd->keysym == ' ' || kd->keysym == XK_Return);
|
||||
} else if (computeModifierParm(xw, state & ~ShiftMask) > 1) {
|
||||
} else if (computeMaskedModifier(xw, state, ShiftMask) > 1) {
|
||||
result = True;
|
||||
}
|
||||
break;
|
||||
@ -837,7 +842,10 @@ Input(XtermWidget xw,
|
||||
", %d:'%s'%s" FMT_MODIFIER_NAMES "%s%s%s%s%s%s\n",
|
||||
kd.keysym,
|
||||
kd.nbytes,
|
||||
visibleChars(PAIRED_CHARS((Char *) kd.strbuf, 0), kd.nbytes),
|
||||
visibleChars(PAIRED_CHARS((Char *) kd.strbuf, 0),
|
||||
((kd.nbytes > 0)
|
||||
? (unsigned) kd.nbytes
|
||||
: 0)),
|
||||
ARG_MODIFIER_NAMES(evt_state),
|
||||
eightbit ? " 8bit" : " 7bit",
|
||||
IsKeypadKey(kd.keysym) ? " KeypadKey" : "",
|
||||
@ -1024,7 +1032,7 @@ Input(XtermWidget xw,
|
||||
break;
|
||||
case keyboardIsTermcap:
|
||||
#if OPT_TCAP_FKEYS
|
||||
if (xtermcapString(xw, kd.keysym, evt_state))
|
||||
if (xtermcapString(xw, (int) kd.keysym, evt_state))
|
||||
return;
|
||||
#endif
|
||||
break;
|
||||
@ -1093,7 +1101,7 @@ Input(XtermWidget xw,
|
||||
reply.a_final = 'Z';
|
||||
#if OPT_MOD_FKEYS
|
||||
if (keyboard->modify_now.other_keys > 1
|
||||
&& computeModifierParm(xw, evt_state & ~ShiftMask) > 1)
|
||||
&& computeMaskedModifier(xw, evt_state, ShiftMask) > 1)
|
||||
modifyOtherKey(&reply, '\t', modify_parm);
|
||||
#endif
|
||||
} else
|
||||
@ -1624,17 +1632,73 @@ sunfuncvalue(ANSI * reply, KEY_DATA * kd)
|
||||
}
|
||||
|
||||
#if OPT_NUM_LOCK
|
||||
#define isName(c) ((c) == '_' || isalnum(CharOf(c)))
|
||||
|
||||
/*
|
||||
* Note that this can only retrieve translations that are given as resource
|
||||
* values; the default translations in charproc.c for example are not
|
||||
* retrievable by any interface to X.
|
||||
* Strip unneeded whitespace from a translations resource, lowercasing and
|
||||
* returning a malloc'd copy of the result.
|
||||
*/
|
||||
static char *
|
||||
stripTranslations(const char *s)
|
||||
{
|
||||
char *dst = 0;
|
||||
|
||||
if (s != 0) {
|
||||
dst = malloc(strlen(s) + 1);
|
||||
|
||||
if (dst != 0) {
|
||||
int state = 0;
|
||||
int ch = 0;
|
||||
int prv = 0;
|
||||
char *d = dst;
|
||||
|
||||
TRACE(("stripping:\n%s\n", s));
|
||||
while (*s != '\0') {
|
||||
ch = *s++;
|
||||
if (ch == '\n') {
|
||||
if (d != dst)
|
||||
*d++ = ch;
|
||||
state = 0;
|
||||
} else if (strchr(":!#", ch) != 0) {
|
||||
while (d != dst && isspace(CharOf(d[-1])))
|
||||
--d;
|
||||
state = -1;
|
||||
} else if (state >= 0) {
|
||||
if (isspace(CharOf(ch))) {
|
||||
if (state == 0 || strchr("<>~ \t", prv))
|
||||
continue;
|
||||
} else if (strchr("<>~", ch)) {
|
||||
while (d != dst && isspace(CharOf(d[-1])))
|
||||
--d;
|
||||
}
|
||||
*d++ = char2lower(ch);
|
||||
++state;
|
||||
}
|
||||
prv = ch;
|
||||
}
|
||||
*d = '\0';
|
||||
TRACE(("...result:\n%s\n", dst));
|
||||
}
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make a simple check to see if a given translations keyword appears in
|
||||
* xterm's translations resource. It does not attempt to parse the strings,
|
||||
* just makes a case-independent check and ensures that the ends of the match
|
||||
* are on token-boundaries.
|
||||
*
|
||||
* That this can only retrieve translations that are given as resource values;
|
||||
* the default translations in charproc.c for example are not retrievable by
|
||||
* any interface to X.
|
||||
*
|
||||
* Also: We can retrieve only the most-specified translation resource. For
|
||||
* example, if the resource file specifies both "*translations" and
|
||||
* "XTerm*translations", we see only the latter.
|
||||
*/
|
||||
static Bool
|
||||
TranslationsUseKeyword(Widget w, const char *keyword)
|
||||
TranslationsUseKeyword(Widget w, char **cache, const char *keyword)
|
||||
{
|
||||
static String data;
|
||||
static XtResource key_resources[] =
|
||||
@ -1643,49 +1707,95 @@ TranslationsUseKeyword(Widget w, const char *keyword)
|
||||
sizeof(data), 0, XtRString, (XtPointer) NULL}
|
||||
};
|
||||
Bool result = False;
|
||||
char *copy;
|
||||
char *test;
|
||||
|
||||
XtGetSubresources(w,
|
||||
(XtPointer) &data,
|
||||
"vt100",
|
||||
"VT100",
|
||||
key_resources,
|
||||
XtNumber(key_resources),
|
||||
NULL,
|
||||
(Cardinal) 0);
|
||||
if ((test = stripTranslations(keyword)) != 0) {
|
||||
if (*cache == 0) {
|
||||
XtGetSubresources(w,
|
||||
(XtPointer) &data,
|
||||
"vt100",
|
||||
"VT100",
|
||||
key_resources,
|
||||
XtNumber(key_resources),
|
||||
NULL,
|
||||
(Cardinal) 0);
|
||||
if (data != 0 && (copy = stripTranslations(data)) != 0) {
|
||||
*cache = copy;
|
||||
}
|
||||
}
|
||||
|
||||
if (data != 0) {
|
||||
char *p = data;
|
||||
int state = 0;
|
||||
int now = ' ', prv;
|
||||
TRACE(("TranslationsUseKeyword(%p):%s\n", w, p));
|
||||
while (*p != 0) {
|
||||
prv = now;
|
||||
now = char2lower(*p++);
|
||||
if (now == ':'
|
||||
|| now == '!') {
|
||||
state = -1;
|
||||
} else if (now == '\n') {
|
||||
state = 0;
|
||||
} else if (state >= 0) {
|
||||
if (isgraph(now)
|
||||
&& now == keyword[state]) {
|
||||
if ((state != 0
|
||||
|| !isalnum(prv))
|
||||
&& ((keyword[++state] == 0)
|
||||
&& !isalnum(CharOf(*p)))) {
|
||||
result = True;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (*cache != 0) {
|
||||
char *p = *cache;
|
||||
int state = 0;
|
||||
int now = ' ', prv;
|
||||
|
||||
while (*p != 0) {
|
||||
prv = now;
|
||||
now = *p++;
|
||||
if (now == ':'
|
||||
|| now == '!') {
|
||||
state = -1;
|
||||
} else if (now == '\n') {
|
||||
state = 0;
|
||||
} else if (state >= 0) {
|
||||
if (now == test[state]) {
|
||||
if ((state != 0
|
||||
|| !isName(prv))
|
||||
&& ((test[++state] == 0)
|
||||
&& !isName(*p))) {
|
||||
result = True;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
state = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
free(test);
|
||||
}
|
||||
TRACE(("TranslationsUseKeyword(%p, %s) = %d\n", w, keyword, result));
|
||||
return result;
|
||||
}
|
||||
|
||||
static Bool
|
||||
xtermHasTranslation(XtermWidget xw, const char *keyword)
|
||||
{
|
||||
return (TranslationsUseKeyword(SHELL_OF(xw),
|
||||
&(xw->keyboard.shell_translations),
|
||||
keyword)
|
||||
|| TranslationsUseKeyword((Widget) xw,
|
||||
&(xw->keyboard.xterm_translations),
|
||||
keyword));
|
||||
}
|
||||
|
||||
#if OPT_EXTRA_PASTE
|
||||
static void
|
||||
addTranslation(XtermWidget xw, char *fromString, char *toString)
|
||||
{
|
||||
unsigned have = (xw->keyboard.extra_translations
|
||||
? strlen(xw->keyboard.extra_translations)
|
||||
: 0);
|
||||
unsigned need = (((have != 0) ? (have + 4) : 0)
|
||||
+ strlen(fromString)
|
||||
+ strlen(toString)
|
||||
+ 6);
|
||||
|
||||
if (!xtermHasTranslation(xw, fromString)) {
|
||||
if ((xw->keyboard.extra_translations
|
||||
= realloc(xw->keyboard.extra_translations, need)) != 0) {
|
||||
TRACE(("adding %s: %s\n", fromString, toString));
|
||||
if (have)
|
||||
strcat(xw->keyboard.extra_translations, " \\n\\");
|
||||
sprintf(xw->keyboard.extra_translations, "%s: %s",
|
||||
fromString, toString);
|
||||
TRACE(("...{%s}\n", xw->keyboard.extra_translations));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#define SaveMask(name) xw->misc.name |= mask;\
|
||||
TRACE(("SaveMask(%s) %#lx (%#lx is%s modifier)\n", \
|
||||
#name, \
|
||||
@ -1702,9 +1812,10 @@ TranslationsUseKeyword(Widget w, const char *keyword)
|
||||
void
|
||||
VTInitModifiers(XtermWidget xw)
|
||||
{
|
||||
int i, j, k;
|
||||
Display *dpy = XtDisplay(xw);
|
||||
XModifierKeymap *keymap = XGetModifierMapping(dpy);
|
||||
int i, j, k, l;
|
||||
KeySym keysym;
|
||||
unsigned long mask;
|
||||
int min_keycode, max_keycode, keysyms_per_keycode = 0;
|
||||
|
||||
@ -1722,17 +1833,45 @@ VTInitModifiers(XtermWidget xw)
|
||||
&keysyms_per_keycode);
|
||||
|
||||
if (theMap != 0) {
|
||||
|
||||
#if OPT_EXTRA_PASTE
|
||||
/*
|
||||
* Assume that if we can find the paste keysym in the X keyboard
|
||||
* mapping that the server allows the corresponding translations
|
||||
* resource.
|
||||
*/
|
||||
int limit = (max_keycode - min_keycode) * keysyms_per_keycode;
|
||||
for (i = 0; i < limit; ++i) {
|
||||
#ifdef XF86XK_Paste
|
||||
if (theMap[i] == XF86XK_Paste) {
|
||||
TRACE(("keyboard has XF86XK_Paste\n"));
|
||||
addTranslation(xw,
|
||||
"<KeyPress> XF86Paste",
|
||||
"insert-selection(SELECT, CUT_BUFFER0)");
|
||||
}
|
||||
#endif
|
||||
#ifdef SunXK_Paste
|
||||
if (theMap[i] == SunXK_Paste) {
|
||||
TRACE(("keyboard has SunXK_Paste\n"));
|
||||
addTranslation(xw,
|
||||
"<KeyPress> SunPaste",
|
||||
"insert-selection(SELECT, CUT_BUFFER0)");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif /* OPT_EXTRA_PASTE */
|
||||
|
||||
for (i = k = 0, mask = 1; i < 8; i++, mask <<= 1) {
|
||||
for (j = 0; j < keymap->max_keypermod; j++) {
|
||||
KeyCode code = keymap->modifiermap[k];
|
||||
if (code != 0) {
|
||||
KeySym keysym;
|
||||
int l = 0;
|
||||
do {
|
||||
keysym = XKeycodeToKeysym(dpy, code, l);
|
||||
l++;
|
||||
} while (!keysym && l < keysyms_per_keycode);
|
||||
if (keysym == XK_Num_Lock) {
|
||||
KeyCode code = keymap->modifiermap[k++];
|
||||
if (code == 0)
|
||||
continue;
|
||||
|
||||
for (l = 0; l < keysyms_per_keycode; ++l) {
|
||||
keysym = XKeycodeToKeysym(dpy, code, l);
|
||||
if (keysym == NoSymbol) {
|
||||
;
|
||||
} else if (keysym == XK_Num_Lock) {
|
||||
SaveMask(num_lock);
|
||||
} else if (keysym == XK_Alt_L || keysym == XK_Alt_R) {
|
||||
SaveMask(alt_mods);
|
||||
@ -1757,7 +1896,6 @@ VTInitModifiers(XtermWidget xw)
|
||||
SaveMask(other_mods);
|
||||
}
|
||||
}
|
||||
k++;
|
||||
}
|
||||
}
|
||||
XFree(theMap);
|
||||
@ -1770,8 +1908,7 @@ VTInitModifiers(XtermWidget xw)
|
||||
* use it to modify function-keys when NumLock is active.
|
||||
*/
|
||||
if ((xw->misc.alt_mods != 0)
|
||||
&& (TranslationsUseKeyword(toplevel, "alt")
|
||||
|| TranslationsUseKeyword((Widget) xw, "alt"))) {
|
||||
&& xtermHasTranslation(xw, "alt")) {
|
||||
TRACE(("ALT is used as a modifier in translations (ignore mask)\n"));
|
||||
xw->misc.alt_mods = 0;
|
||||
}
|
||||
@ -1781,8 +1918,7 @@ VTInitModifiers(XtermWidget xw)
|
||||
* use it to modify function-keys.
|
||||
*/
|
||||
if ((xw->misc.meta_mods != 0)
|
||||
&& (TranslationsUseKeyword(toplevel, "meta")
|
||||
|| TranslationsUseKeyword((Widget) xw, "meta"))) {
|
||||
&& xtermHasTranslation(xw, "meta")) {
|
||||
TRACE(("META is used as a modifier in translations\n"));
|
||||
xw->misc.meta_mods = 0;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $XFree86: xc/programs/xterm/keysym2ucs.c,v 1.5 2001/06/18 19:09:26 dickey Exp $
|
||||
/* $XTermId: keysym2ucs.c,v 1.15 2007/06/13 00:16:56 tom Exp $
|
||||
* This module converts keysym values into the corresponding ISO 10646
|
||||
* (UCS, Unicode) values.
|
||||
*
|
||||
@ -286,6 +286,7 @@ static struct codepair {
|
||||
{ 0x06aa, 0x045a }, /* Cyrillic_nje њ CYRILLIC SMALL LETTER NJE */
|
||||
{ 0x06ab, 0x045b }, /* Serbian_tshe ћ CYRILLIC SMALL LETTER TSHE */
|
||||
{ 0x06ac, 0x045c }, /* Macedonia_kje ќ CYRILLIC SMALL LETTER KJE */
|
||||
{ 0x06ad, 0x0491 }, /* Ukrainian_ghe_with_upturn ґ CYRILLIC SMALL LETTER GHE WITH UPTURN */
|
||||
{ 0x06ae, 0x045e }, /* Byelorussian_shortu ў CYRILLIC SMALL LETTER SHORT U */
|
||||
{ 0x06af, 0x045f }, /* Cyrillic_dzhe џ CYRILLIC SMALL LETTER DZHE */
|
||||
{ 0x06b0, 0x2116 }, /* numerosign № NUMERO SIGN */
|
||||
@ -301,6 +302,7 @@ static struct codepair {
|
||||
{ 0x06ba, 0x040a }, /* Cyrillic_NJE Њ CYRILLIC CAPITAL LETTER NJE */
|
||||
{ 0x06bb, 0x040b }, /* Serbian_TSHE Ћ CYRILLIC CAPITAL LETTER TSHE */
|
||||
{ 0x06bc, 0x040c }, /* Macedonia_KJE Ќ CYRILLIC CAPITAL LETTER KJE */
|
||||
{ 0x06bd, 0x0490 }, /* Ukrainian_GHE_WITH_UPTURN Ґ CYRILLIC CAPITAL LETTER GHE WITH UPTURN */
|
||||
{ 0x06be, 0x040e }, /* Byelorussian_SHORTU Ў CYRILLIC CAPITAL LETTER SHORT U */
|
||||
{ 0x06bf, 0x040f }, /* Cyrillic_DZHE Џ CYRILLIC CAPITAL LETTER DZHE */
|
||||
{ 0x06c0, 0x044e }, /* Cyrillic_yu ю CYRILLIC SMALL LETTER YU */
|
||||
@ -438,22 +440,22 @@ static struct codepair {
|
||||
{ 0x07f7, 0x03c7 }, /* Greek_chi χ GREEK SMALL LETTER CHI */
|
||||
{ 0x07f8, 0x03c8 }, /* Greek_psi ψ GREEK SMALL LETTER PSI */
|
||||
{ 0x07f9, 0x03c9 }, /* Greek_omega ω GREEK SMALL LETTER OMEGA */
|
||||
{ 0x08a1, 0x23b7 }, /* leftradical ⎷ ??? */
|
||||
{ 0x08a1, 0x23b7 }, /* leftradical ⎷ RADICAL SYMBOL BOTTOM */
|
||||
{ 0x08a2, 0x250c }, /* topleftradical ┌ BOX DRAWINGS LIGHT DOWN AND RIGHT */
|
||||
{ 0x08a3, 0x2500 }, /* horizconnector ─ BOX DRAWINGS LIGHT HORIZONTAL */
|
||||
{ 0x08a4, 0x2320 }, /* topintegral ⌠ TOP HALF INTEGRAL */
|
||||
{ 0x08a5, 0x2321 }, /* botintegral ⌡ BOTTOM HALF INTEGRAL */
|
||||
{ 0x08a6, 0x2502 }, /* vertconnector │ BOX DRAWINGS LIGHT VERTICAL */
|
||||
{ 0x08a7, 0x23a1 }, /* topleftsqbracket ⎡ ??? */
|
||||
{ 0x08a8, 0x23a3 }, /* botleftsqbracket ⎣ ??? */
|
||||
{ 0x08a9, 0x23a4 }, /* toprightsqbracket ⎤ ??? */
|
||||
{ 0x08aa, 0x23a6 }, /* botrightsqbracket ⎦ ??? */
|
||||
{ 0x08ab, 0x239b }, /* topleftparens ⎛ ??? */
|
||||
{ 0x08ac, 0x239d }, /* botleftparens ⎝ ??? */
|
||||
{ 0x08ad, 0x239e }, /* toprightparens ⎞ ??? */
|
||||
{ 0x08ae, 0x23a0 }, /* botrightparens ⎠ ??? */
|
||||
{ 0x08af, 0x23a8 }, /* leftmiddlecurlybrace ⎨ ??? */
|
||||
{ 0x08b0, 0x23ac }, /* rightmiddlecurlybrace ⎬ ??? */
|
||||
{ 0x08a7, 0x23a1 }, /* topleftsqbracket ⎡ LEFT SQUARE BRACKET UPPER CORNER */
|
||||
{ 0x08a8, 0x23a3 }, /* botleftsqbracket ⎣ LEFT SQUARE BRACKET LOWER CORNER */
|
||||
{ 0x08a9, 0x23a4 }, /* toprightsqbracket ⎤ RIGHT SQUARE BRACKET UPPER CORNER */
|
||||
{ 0x08aa, 0x23a6 }, /* botrightsqbracket ⎦ RIGHT SQUARE BRACKET LOWER CORNER */
|
||||
{ 0x08ab, 0x239b }, /* topleftparens ⎛ LEFT PARENTHESIS UPPER HOOK */
|
||||
{ 0x08ac, 0x239d }, /* botleftparens ⎝ LEFT PARENTHESIS LOWER HOOK */
|
||||
{ 0x08ad, 0x239e }, /* toprightparens ⎞ RIGHT PARENTHESIS UPPER HOOK */
|
||||
{ 0x08ae, 0x23a0 }, /* botrightparens ⎠ RIGHT PARENTHESIS LOWER HOOK */
|
||||
{ 0x08af, 0x23a8 }, /* leftmiddlecurlybrace ⎨ LEFT CURLY BRACKET MIDDLE PIECE */
|
||||
{ 0x08b0, 0x23ac }, /* rightmiddlecurlybrace ⎬ RIGHT CURLY BRACKET MIDDLE PIECE */
|
||||
/* 0x08b1 topleftsummation ? ??? */
|
||||
/* 0x08b2 botleftsummation ? ??? */
|
||||
/* 0x08b3 topvertsummationconnector ? ??? */
|
||||
@ -487,7 +489,7 @@ static struct codepair {
|
||||
{ 0x08fc, 0x2191 }, /* uparrow ↑ UPWARDS ARROW */
|
||||
{ 0x08fd, 0x2192 }, /* rightarrow → RIGHTWARDS ARROW */
|
||||
{ 0x08fe, 0x2193 }, /* downarrow ↓ DOWNWARDS ARROW */
|
||||
/* 0x09df blank ? ??? */
|
||||
{ 0x09df, 0x2422 }, /* blank ␢ BLANK SYMBOL */
|
||||
{ 0x09e0, 0x25c6 }, /* soliddiamond ◆ BLACK DIAMOND */
|
||||
{ 0x09e1, 0x2592 }, /* checkerboard ▒ MEDIUM SHADE */
|
||||
{ 0x09e2, 0x2409 }, /* ht ␉ SYMBOL FOR HORIZONTAL TABULATION */
|
||||
@ -501,11 +503,11 @@ static struct codepair {
|
||||
{ 0x09ec, 0x250c }, /* upleftcorner ┌ BOX DRAWINGS LIGHT DOWN AND RIGHT */
|
||||
{ 0x09ed, 0x2514 }, /* lowleftcorner └ BOX DRAWINGS LIGHT UP AND RIGHT */
|
||||
{ 0x09ee, 0x253c }, /* crossinglines ┼ BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL */
|
||||
{ 0x09ef, 0x23ba }, /* horizlinescan1 ⎺ HORIZONTAL SCAN LINE-1 (Unicode 3.2 draft) */
|
||||
{ 0x09f0, 0x23bb }, /* horizlinescan3 ⎻ HORIZONTAL SCAN LINE-3 (Unicode 3.2 draft) */
|
||||
{ 0x09ef, 0x23ba }, /* horizlinescan1 ⎺ HORIZONTAL SCAN LINE-1 */
|
||||
{ 0x09f0, 0x23bb }, /* horizlinescan3 ⎻ HORIZONTAL SCAN LINE-3 */
|
||||
{ 0x09f1, 0x2500 }, /* horizlinescan5 ─ BOX DRAWINGS LIGHT HORIZONTAL */
|
||||
{ 0x09f2, 0x23bc }, /* horizlinescan7 ⎼ HORIZONTAL SCAN LINE-7 (Unicode 3.2 draft) */
|
||||
{ 0x09f3, 0x23bd }, /* horizlinescan9 ⎽ HORIZONTAL SCAN LINE-9 (Unicode 3.2 draft) */
|
||||
{ 0x09f2, 0x23bc }, /* horizlinescan7 ⎼ HORIZONTAL SCAN LINE-7 */
|
||||
{ 0x09f3, 0x23bd }, /* horizlinescan9 ⎽ HORIZONTAL SCAN LINE-9 */
|
||||
{ 0x09f4, 0x251c }, /* leftt ├ BOX DRAWINGS LIGHT VERTICAL AND RIGHT */
|
||||
{ 0x09f5, 0x2524 }, /* rightt ┤ BOX DRAWINGS LIGHT VERTICAL AND LEFT */
|
||||
{ 0x09f6, 0x2534 }, /* bott ┴ BOX DRAWINGS LIGHT UP AND HORIZONTAL */
|
||||
@ -521,7 +523,7 @@ static struct codepair {
|
||||
{ 0x0aa8, 0x200a }, /* hairspace HAIR SPACE */
|
||||
{ 0x0aa9, 0x2014 }, /* emdash — EM DASH */
|
||||
{ 0x0aaa, 0x2013 }, /* endash – EN DASH */
|
||||
/* 0x0aac signifblank ? ??? */
|
||||
{ 0x0aac, 0x2423 }, /* signifblank ␣ OPEN BOX */
|
||||
{ 0x0aae, 0x2026 }, /* ellipsis … HORIZONTAL ELLIPSIS */
|
||||
{ 0x0aaf, 0x2025 }, /* doubbaselinedot ‥ TWO DOT LEADER */
|
||||
{ 0x0ab0, 0x2153 }, /* onethird ⅓ VULGAR FRACTION ONE THIRD */
|
||||
@ -535,7 +537,7 @@ static struct codepair {
|
||||
{ 0x0ab8, 0x2105 }, /* careof ℅ CARE OF */
|
||||
{ 0x0abb, 0x2012 }, /* figdash ‒ FIGURE DASH */
|
||||
{ 0x0abc, 0x2329 }, /* leftanglebracket 〈 LEFT-POINTING ANGLE BRACKET */
|
||||
/* 0x0abd decimalpoint ? ??? */
|
||||
{ 0x0abd, 0x002e }, /* decimalpoint . FULL STOP */
|
||||
{ 0x0abe, 0x232a }, /* rightanglebracket 〉 RIGHT-POINTING ANGLE BRACKET */
|
||||
/* 0x0abf marker ? ??? */
|
||||
{ 0x0ac3, 0x215b }, /* oneeighth ⅛ VULGAR FRACTION ONE EIGHTH */
|
||||
@ -699,7 +701,7 @@ static struct codepair {
|
||||
{ 0x0dd8, 0x0e38 }, /* Thai_sarau ุ THAI CHARACTER SARA U */
|
||||
{ 0x0dd9, 0x0e39 }, /* Thai_sarauu ู THAI CHARACTER SARA UU */
|
||||
{ 0x0dda, 0x0e3a }, /* Thai_phinthu ฺ THAI CHARACTER PHINTHU */
|
||||
/* 0x0dde Thai_maihanakat_maitho ? ??? */
|
||||
{ 0x0dde, 0x0e3e }, /* Thai_maihanakat_maitho ??? */
|
||||
{ 0x0ddf, 0x0e3f }, /* Thai_baht ฿ THAI CURRENCY SYMBOL BAHT */
|
||||
{ 0x0de0, 0x0e40 }, /* Thai_sarae เ THAI CHARACTER SARA E */
|
||||
{ 0x0de1, 0x0e41 }, /* Thai_saraae แ THAI CHARACTER SARA AE */
|
||||
@ -820,6 +822,18 @@ static struct codepair {
|
||||
{ 0x13bc, 0x0152 }, /* OE Œ LATIN CAPITAL LIGATURE OE */
|
||||
{ 0x13bd, 0x0153 }, /* oe œ LATIN SMALL LIGATURE OE */
|
||||
{ 0x13be, 0x0178 }, /* Ydiaeresis Ÿ LATIN CAPITAL LETTER Y WITH DIAERESIS */
|
||||
{ 0x20a0, 0x20a0 }, /* EcuSign ₠ EURO-CURRENCY SIGN */
|
||||
{ 0x20a1, 0x20a1 }, /* ColonSign ₡ COLON SIGN */
|
||||
{ 0x20a2, 0x20a2 }, /* CruzeiroSign ₢ CRUZEIRO SIGN */
|
||||
{ 0x20a3, 0x20a3 }, /* FFrancSign ₣ FRENCH FRANC SIGN */
|
||||
{ 0x20a4, 0x20a4 }, /* LiraSign ₤ LIRA SIGN */
|
||||
{ 0x20a5, 0x20a5 }, /* MillSign ₥ MILL SIGN */
|
||||
{ 0x20a6, 0x20a6 }, /* NairaSign ₦ NAIRA SIGN */
|
||||
{ 0x20a7, 0x20a7 }, /* PesetaSign ₧ PESETA SIGN */
|
||||
{ 0x20a8, 0x20a8 }, /* RupeeSign ₨ RUPEE SIGN */
|
||||
{ 0x20a9, 0x20a9 }, /* WonSign ₩ WON SIGN */
|
||||
{ 0x20aa, 0x20aa }, /* NewSheqelSign ₪ NEW SHEQEL SIGN */
|
||||
{ 0x20ab, 0x20ab }, /* DongSign ₫ DONG SIGN */
|
||||
{ 0x20ac, 0x20ac }, /* EuroSign € EURO SIGN */
|
||||
};
|
||||
|
||||
|
@ -1,8 +1,36 @@
|
||||
/* $XTermId: main.h,v 1.33 2006/11/23 01:17:09 tom Exp $ */
|
||||
/* $XTermId: main.h,v 1.35 2007/07/22 17:13:32 tom Exp $ */
|
||||
|
||||
/* $XFree86: xc/programs/xterm/main.h,v 3.15 2006/02/13 01:14:59 dickey Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2000-2006,2007 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.
|
||||
*
|
||||
* Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
|
||||
*
|
||||
* All Rights Reserved
|
||||
@ -91,6 +119,14 @@
|
||||
#define DEF_INITIAL_ERASE False
|
||||
#endif
|
||||
|
||||
#ifndef DEF_PTY_STTY_SIZE
|
||||
#if defined(linux) || defined(__APPLE__)
|
||||
#define DEF_PTY_STTY_SIZE False
|
||||
#else
|
||||
#define DEF_PTY_STTY_SIZE True
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef PROJECTROOT
|
||||
#define PROJECTROOT "/usr/X11R6"
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $XTermId: menu.c,v 1.232 2007/03/18 23:05:54 tom Exp $ */
|
||||
/* $XTermId: menu.c,v 1.237 2007/07/22 20:34:04 tom Exp $ */
|
||||
|
||||
/*
|
||||
|
||||
@ -46,7 +46,6 @@ used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization from The Open Group.
|
||||
|
||||
*/
|
||||
/* $XFree86: xc/programs/xterm/menu.c,v 3.68 2006/04/10 00:34:36 dickey Exp $ */
|
||||
|
||||
#include <xterm.h>
|
||||
#include <data.h>
|
||||
@ -412,7 +411,7 @@ static MenuList tek_shell[NUM_POPUP_MENUS];
|
||||
#endif
|
||||
|
||||
static String
|
||||
setMenuLocale(Boolean before, String substitute)
|
||||
setMenuLocale(Bool before, String substitute)
|
||||
{
|
||||
String result;
|
||||
|
||||
@ -657,7 +656,7 @@ domenu(Widget w,
|
||||
update_selectToClipboard();
|
||||
update_visualbell();
|
||||
update_poponbell();
|
||||
update_marginbell();
|
||||
update_bellIsUrgent();
|
||||
update_cursorblink();
|
||||
update_altscreen();
|
||||
update_titeInhibit();
|
||||
@ -728,12 +727,13 @@ domenu(Widget w,
|
||||
|
||||
#if OPT_TEK4014
|
||||
case tekMenu:
|
||||
if (created) {
|
||||
if (created && tekWidget) {
|
||||
set_tekfont_menu_item(tekWidget->screen.cur.fontsize, True);
|
||||
update_vtshow();
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case noMenu:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1119,7 +1119,7 @@ do_quit(Widget gw GCC_UNUSED,
|
||||
XtPointer closure GCC_UNUSED,
|
||||
XtPointer data GCC_UNUSED)
|
||||
{
|
||||
Cleanup(0);
|
||||
Cleanup(SIGHUP);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1,8 +1,8 @@
|
||||
#!/bin/sh
|
||||
# $XFree86: xc/programs/xterm/minstall.sh,v 1.5 2006/04/10 00:34:37 dickey Exp $
|
||||
# $XTermId: minstall.sh,v 1.12 2007/08/12 15:29:02 tom Exp $
|
||||
#
|
||||
# Install manpages, substituting a reasonable section value since XFree86 4.x
|
||||
# doesn't use constants...
|
||||
# and derived imakes do not use constants...
|
||||
#
|
||||
# Parameters:
|
||||
# $1 = program to invoke as "install"
|
||||
@ -11,18 +11,32 @@
|
||||
# $4 = app-defaults directory
|
||||
#
|
||||
|
||||
# override locale...
|
||||
LANG=C; export LANG
|
||||
LANGUAGE=C; export LANGUAGE
|
||||
LC_ALL=C; export LC_ALL
|
||||
LC_CTYPE=C; export LC_CTYPE
|
||||
|
||||
# get parameters
|
||||
MINSTALL="$1"
|
||||
OLD_FILE="$2"
|
||||
END_FILE="$3"
|
||||
APPS_DIR="$4"
|
||||
|
||||
suffix=`echo "$END_FILE" | sed -e 's%^[^.]*.%%'`
|
||||
suffix=`echo "$END_FILE" | sed -e 's%^.*\.%%'`
|
||||
NEW_FILE=temp$$
|
||||
|
||||
MY_MANSECT=$suffix
|
||||
|
||||
# "X" is usually in the miscellaneous section, along with "undocumented".
|
||||
# Use that to guess an appropriate section.
|
||||
X_MANSECT=`man X 2>&1 | tr '\012' '\020' | sed -e 's/^[^0123456789]*\([^) ][^) ]*\).*/\1/'`
|
||||
test -z "$X_MANSECT" && X_MANSECT=$suffix
|
||||
|
||||
sed -e 's%__vendorversion__%"X Window System"%' \
|
||||
-e s%__apploaddir__%$APPS_DIR% \
|
||||
-e s%__mansuffix__%$suffix%g \
|
||||
-e s%__miscmansuffix__%$suffix%g \
|
||||
-e s%__mansuffix__%$MY_MANSECT%g \
|
||||
-e s%__miscmansuffix__%$X_MANSECT%g \
|
||||
$OLD_FILE >$NEW_FILE
|
||||
|
||||
echo "$MINSTALL $OLD_FILE $END_FILE"
|
||||
|
283
app/xterm/misc.c
283
app/xterm/misc.c
@ -1,6 +1,4 @@
|
||||
/* $XTermId: misc.c,v 1.359 2007/03/21 22:13:32 tom Exp $ */
|
||||
|
||||
/* $XFree86: xc/programs/xterm/misc.c,v 3.107 2006/06/19 00:36:51 dickey Exp $ */
|
||||
/* $XTermId: misc.c,v 1.370 2007/07/22 20:34:04 tom Exp $ */
|
||||
|
||||
/*
|
||||
*
|
||||
@ -67,6 +65,7 @@
|
||||
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/cursorfont.h>
|
||||
#include <X11/Xlocale.h>
|
||||
|
||||
#include <X11/Xmu/Error.h>
|
||||
#include <X11/Xmu/SysUtil.h>
|
||||
@ -125,7 +124,7 @@ static char *
|
||||
Readlink(const char *filename)
|
||||
{
|
||||
char *buf = NULL;
|
||||
int size = 100;
|
||||
unsigned size = 100;
|
||||
int n;
|
||||
|
||||
for (;;) {
|
||||
@ -138,7 +137,7 @@ Readlink(const char *filename)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (n < size) {
|
||||
if ((unsigned) n < size) {
|
||||
return buf;
|
||||
}
|
||||
|
||||
@ -246,7 +245,7 @@ DoSpecialLeaveNotify(XtermWidget xw, XEnterWindowEvent * ev)
|
||||
#endif
|
||||
|
||||
static void
|
||||
setXUrgency(TScreen * screen, Boolean enable)
|
||||
setXUrgency(TScreen * screen, Bool enable)
|
||||
{
|
||||
if (screen->bellIsUrgent) {
|
||||
XWMHints *h = XGetWMHints(screen->display, VShellWindow);
|
||||
@ -497,23 +496,19 @@ HandleSpawnTerminal(Widget w GCC_UNUSED,
|
||||
|| setgid(screen->gid) == -1) {
|
||||
fprintf(stderr, "Cannot reset uid/gid\n");
|
||||
} else {
|
||||
if (nparams != 0) {
|
||||
int myargc = *nparams + 1;
|
||||
char **myargv = TypeMallocN(char *, myargc + 1);
|
||||
if (myargv != 0) {
|
||||
int n = 0;
|
||||
myargv[n++] = child_exe;
|
||||
while (n <= myargc) {
|
||||
myargv[n] = params[n - 1];
|
||||
++n;
|
||||
}
|
||||
myargv[n] = 0;
|
||||
execv(child_exe, myargv);
|
||||
}
|
||||
} else {
|
||||
execl(child_exe, child_exe, NULL);
|
||||
int myargc = *nparams + 1;
|
||||
char **myargv = TypeMallocN(char *, myargc + 1);
|
||||
int n = 0;
|
||||
|
||||
myargv[n++] = child_exe;
|
||||
|
||||
while (n < myargc) {
|
||||
myargv[n++] = *params++;
|
||||
}
|
||||
|
||||
myargv[n] = 0;
|
||||
execv(child_exe, myargv);
|
||||
|
||||
/* If we get here, we've failed */
|
||||
fprintf(stderr, "exec of '%s': %s\n", child_exe, SysErrorMsg(errno));
|
||||
}
|
||||
@ -1435,7 +1430,7 @@ StartLog(TScreen * screen)
|
||||
close(ConnectionNumber(screen->display));
|
||||
close(screen->respond);
|
||||
|
||||
if ((((cp = getenv("SHELL")) == NULL || *cp == 0)
|
||||
if ((((cp = x_getenv("SHELL")) == NULL)
|
||||
&& ((pw = getpwuid(screen->uid)) == NULL
|
||||
|| *(cp = pw->pw_shell) == 0))
|
||||
|| (shell = CastMallocN(char, strlen(cp))) == 0) {
|
||||
@ -1874,13 +1869,11 @@ xtermIsPrintable(TScreen * screen, Char ** bufp, Char * last)
|
||||
#if OPT_WIDE_CHARS
|
||||
if (xtermEnvUTF8() && screen->utf8_title) {
|
||||
PtyData data;
|
||||
Boolean controls = True;
|
||||
|
||||
if (decodeUtf8(fakePtyData(&data, cp, last))) {
|
||||
if (data.utf_data != UCS_REPL
|
||||
&& (data.utf_data >= 128 ||
|
||||
ansi_table[data.utf_data] == CASE_PRINT)) {
|
||||
controls = False;
|
||||
next += (data.utf_size - 1);
|
||||
result = True;
|
||||
} else {
|
||||
@ -2140,7 +2133,7 @@ do_osc(XtermWidget xw, Char * oscbuf, unsigned len GCC_UNUSED, int final)
|
||||
{
|
||||
TScreen *screen = &(xw->screen);
|
||||
int mode;
|
||||
Char *cp, *c2;
|
||||
Char *cp;
|
||||
int state = 0;
|
||||
char *buf = 0;
|
||||
|
||||
@ -2178,7 +2171,6 @@ do_osc(XtermWidget xw, Char * oscbuf, unsigned len GCC_UNUSED, int final)
|
||||
state = 3;
|
||||
/* FALLTHRU */
|
||||
default:
|
||||
c2 = cp;
|
||||
if (!xtermIsPrintable(screen, &cp, oscbuf + len)) {
|
||||
switch (mode) {
|
||||
case 0:
|
||||
@ -2792,7 +2784,8 @@ ChangeGroup(String attribute, char *value)
|
||||
|
||||
TRACE(("ChangeGroup(attribute=%s, value=%s)\n", attribute, name));
|
||||
|
||||
(void) screen;
|
||||
if (!screen->allowTitleOps)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Ignore titles that are too long to be plausible requests.
|
||||
@ -2803,7 +2796,7 @@ ChangeGroup(String attribute, char *value)
|
||||
for (cp = c1; *cp != 0; ++cp) {
|
||||
Char *c2 = cp;
|
||||
if (!xtermIsPrintable(screen, &cp, c1 + limit)) {
|
||||
memset(c2, '?', cp + 1 - c2);
|
||||
memset(c2, '?', (unsigned) (cp + 1 - c2));
|
||||
}
|
||||
}
|
||||
|
||||
@ -3017,90 +3010,91 @@ Panic(char *s GCC_UNUSED, int a GCC_UNUSED)
|
||||
#endif /* DEBUG */
|
||||
}
|
||||
|
||||
char *
|
||||
SysErrorMsg(int n)
|
||||
const char *
|
||||
SysErrorMsg(int code)
|
||||
{
|
||||
static char unknown[] = "unknown error";
|
||||
char *s = strerror(n);
|
||||
char *s = strerror(code);
|
||||
return s ? s : unknown;
|
||||
}
|
||||
|
||||
void
|
||||
SysError(int i)
|
||||
const char *
|
||||
SysReasonMsg(int code)
|
||||
{
|
||||
static const char *table[] =
|
||||
{
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
,"main: ioctl() failed on FIONBIO" /* 11 */
|
||||
,"main: ioctl() failed on F_GETFL" /* 12 */
|
||||
,"main: ioctl() failed on F_SETFL" /* 13 */
|
||||
,"spawn: open() failed on /dev/tty" /* 14 */
|
||||
,"spawn: ioctl() failed on TIOCGETP" /* 15 */
|
||||
,0
|
||||
,"spawn: ptsname() failed" /* 17 */
|
||||
,"spawn: open() failed on ptsname" /* 18 */
|
||||
,"spawn: ioctl() failed on I_PUSH/\"ptem\"" /* 19 */
|
||||
,"spawn: ioctl() failed on I_PUSH/\"consem\"" /* 20 */
|
||||
,"spawn: ioctl() failed on I_PUSH/\"ldterm\"" /* 21 */
|
||||
,"spawn: ioctl() failed on I_PUSH/\"ttcompat\"" /* 22 */
|
||||
,"spawn: ioctl() failed on TIOCSETP" /* 23 */
|
||||
,"spawn: ioctl() failed on TIOCSETC" /* 24 */
|
||||
,"spawn: ioctl() failed on TIOCSETD" /* 25 */
|
||||
,"spawn: ioctl() failed on TIOCSLTC" /* 26 */
|
||||
,"spawn: ioctl() failed on TIOCLSET" /* 27 */
|
||||
,"spawn: initgroups() failed" /* 28 */
|
||||
,"spawn: fork() failed" /* 29 */
|
||||
,"spawn: exec() failed" /* 30 */
|
||||
,0
|
||||
,"get_pty: not enough ptys" /* 32 */
|
||||
,0
|
||||
,"waiting for initial map" /* 34 */
|
||||
,"spawn: setuid() failed" /* 35 */
|
||||
,"spawn: can't initialize window" /* 36 */
|
||||
,0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
,"spawn: ioctl() failed on TIOCKSET" /* 46 */
|
||||
,"spawn: ioctl() failed on TIOCKSETC" /* 47 */
|
||||
,"spawn: realloc of ttydev failed" /* 48 */
|
||||
,"luit: command-line malloc failed" /* 49 */
|
||||
,"in_put: select() failed" /* 50 */
|
||||
,0, 0, 0
|
||||
,"VTInit: can't initialize window" /* 54 */
|
||||
,0, 0
|
||||
,"HandleKeymapChange: malloc failed" /* 57 */
|
||||
,0, 0
|
||||
,"Tinput: select() failed" /* 60 */
|
||||
,0, 0, 0
|
||||
,"TekInit: can't initialize window" /* 64 */
|
||||
,0, 0, 0, 0, 0, 0
|
||||
,"SaltTextAway: malloc() failed" /* 71 */
|
||||
,0, 0, 0, 0, 0, 0, 0, 0
|
||||
,"StartLog: exec() failed" /* 80 */
|
||||
,0, 0
|
||||
,"xerror: XError event" /* 83 */
|
||||
,"xioerror: X I/O error" /* 84 */
|
||||
,0, 0, 0, 0, 0
|
||||
,"Alloc: calloc() failed on base" /* 90 */
|
||||
,"Alloc: calloc() failed on rows" /* 91 */
|
||||
,"ScreenResize: realloc() failed on alt base" /* 92 */
|
||||
,0, 0, 0
|
||||
,"ScreenResize: malloc() or realloc() failed" /* 96 */
|
||||
,0, 0, 0, 0, 0
|
||||
,"ScrnPointers: malloc/realloc() failed" /* 102 */
|
||||
,0, 0, 0, 0, 0, 0, 0
|
||||
,"ScrollBarOn: realloc() failed on base" /* 110 */
|
||||
,"ScrollBarOn: realloc() failed on rows" /* 111 */
|
||||
,0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
,"my_memmove: malloc/realloc failed" /* 121 */
|
||||
/* *INDENT-OFF* */
|
||||
static const struct {
|
||||
int code;
|
||||
const char *name;
|
||||
} table[] = {
|
||||
{ ERROR_FIONBIO, "main: ioctl() failed on FIONBIO" },
|
||||
{ ERROR_F_GETFL, "main: ioctl() failed on F_GETFL" },
|
||||
{ ERROR_F_SETFL, "main: ioctl() failed on F_SETFL", },
|
||||
{ ERROR_OPDEVTTY, "spawn: open() failed on /dev/tty", },
|
||||
{ ERROR_TIOCGETP, "spawn: ioctl() failed on TIOCGETP", },
|
||||
{ ERROR_PTSNAME, "spawn: ptsname() failed", },
|
||||
{ ERROR_OPPTSNAME, "spawn: open() failed on ptsname", },
|
||||
{ ERROR_PTEM, "spawn: ioctl() failed on I_PUSH/\"ptem\"" },
|
||||
{ ERROR_CONSEM, "spawn: ioctl() failed on I_PUSH/\"consem\"" },
|
||||
{ ERROR_LDTERM, "spawn: ioctl() failed on I_PUSH/\"ldterm\"" },
|
||||
{ ERROR_TTCOMPAT, "spawn: ioctl() failed on I_PUSH/\"ttcompat\"" },
|
||||
{ ERROR_TIOCSETP, "spawn: ioctl() failed on TIOCSETP" },
|
||||
{ ERROR_TIOCSETC, "spawn: ioctl() failed on TIOCSETC" },
|
||||
{ ERROR_TIOCSETD, "spawn: ioctl() failed on TIOCSETD" },
|
||||
{ ERROR_TIOCSLTC, "spawn: ioctl() failed on TIOCSLTC" },
|
||||
{ ERROR_TIOCLSET, "spawn: ioctl() failed on TIOCLSET" },
|
||||
{ ERROR_INIGROUPS, "spawn: initgroups() failed" },
|
||||
{ ERROR_FORK, "spawn: fork() failed" },
|
||||
{ ERROR_EXEC, "spawn: exec() failed" },
|
||||
{ ERROR_PTYS, "get_pty: not enough ptys" },
|
||||
{ ERROR_PTY_EXEC, "waiting for initial map" },
|
||||
{ ERROR_SETUID, "spawn: setuid() failed" },
|
||||
{ ERROR_INIT, "spawn: can't initialize window" },
|
||||
{ ERROR_TIOCKSET, "spawn: ioctl() failed on TIOCKSET" },
|
||||
{ ERROR_TIOCKSETC, "spawn: ioctl() failed on TIOCKSETC" },
|
||||
{ ERROR_SPREALLOC, "spawn: realloc of ttydev failed" },
|
||||
{ ERROR_LUMALLOC, "luit: command-line malloc failed" },
|
||||
{ ERROR_SELECT, "in_put: select() failed" },
|
||||
{ ERROR_VINIT, "VTInit: can't initialize window" },
|
||||
{ ERROR_KMMALLOC1, "HandleKeymapChange: malloc failed" },
|
||||
{ ERROR_TSELECT, "Tinput: select() failed" },
|
||||
{ ERROR_TINIT, "TekInit: can't initialize window" },
|
||||
{ ERROR_BMALLOC2, "SaltTextAway: malloc() failed" },
|
||||
{ ERROR_LOGEXEC, "StartLog: exec() failed" },
|
||||
{ ERROR_XERROR, "xerror: XError event" },
|
||||
{ ERROR_XIOERROR, "xioerror: X I/O error" },
|
||||
{ ERROR_SCALLOC, "Alloc: calloc() failed on base" },
|
||||
{ ERROR_SCALLOC2, "Alloc: calloc() failed on rows" },
|
||||
{ ERROR_SREALLOC, "ScreenResize: realloc() failed on alt base" },
|
||||
{ ERROR_RESIZE, "ScreenResize: malloc() or realloc() failed" },
|
||||
{ ERROR_SAVE_PTR, "ScrnPointers: malloc/realloc() failed" },
|
||||
{ ERROR_SBRALLOC, "ScrollBarOn: realloc() failed on base" },
|
||||
{ ERROR_SBRALLOC2, "ScrollBarOn: realloc() failed on rows" },
|
||||
{ ERROR_MMALLOC, "my_memmove: malloc/realloc failed" },
|
||||
};
|
||||
int oerrno;
|
||||
/* *INDENT-ON* */
|
||||
|
||||
oerrno = errno;
|
||||
fprintf(stderr, "%s: Error %d, errno %d: ", xterm_name, i, oerrno);
|
||||
fprintf(stderr, "%s\n", SysErrorMsg(oerrno));
|
||||
if ((Cardinal) i < XtNumber(table) && table[i] != 0) {
|
||||
fprintf(stderr, "Reason: %s\n", table[i]);
|
||||
Cardinal n;
|
||||
const char *result = "?";
|
||||
|
||||
for (n = 0; n < XtNumber(table); ++n) {
|
||||
if (code == table[n].code) {
|
||||
result = table[n].name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
Cleanup(i);
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
SysError(int code)
|
||||
{
|
||||
int oerrno = errno;
|
||||
|
||||
fprintf(stderr, "%s: Error %d, errno %d: ", xterm_name, code, oerrno);
|
||||
fprintf(stderr, "%s\n", SysErrorMsg(oerrno));
|
||||
fprintf(stderr, "Reason: %s\n", SysReasonMsg(code));
|
||||
|
||||
Cleanup(code);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -3160,7 +3154,7 @@ xtermFindShell(char *leaf, Bool warning)
|
||||
TRACE(("xtermFindShell(%s)\n", leaf));
|
||||
if (*result != '\0' && strchr("+/-", *result) == 0) {
|
||||
/* find it in $PATH */
|
||||
if ((s = getenv("PATH")) != 0) {
|
||||
if ((s = x_getenv("PATH")) != 0) {
|
||||
if ((tmp = TypeMallocN(char, strlen(leaf) + strlen(s) + 1)) != 0) {
|
||||
Bool found = False;
|
||||
while (*s != '\0') {
|
||||
@ -3203,6 +3197,26 @@ xtermFindShell(char *leaf, Bool warning)
|
||||
}
|
||||
#endif /* VMS */
|
||||
|
||||
#define ENV_HUNK(n) ((((n) + 1) | 31) + 1)
|
||||
|
||||
/*
|
||||
* copy the environment before Setenv'ing.
|
||||
*/
|
||||
void
|
||||
xtermCopyEnv(char **oldenv)
|
||||
{
|
||||
unsigned size;
|
||||
char **newenv;
|
||||
|
||||
for (size = 0; oldenv[size] != NULL; size++) {
|
||||
;
|
||||
}
|
||||
|
||||
newenv = TypeCallocN(char *, ENV_HUNK(size));
|
||||
memmove(newenv, oldenv, size * sizeof(char *));
|
||||
environ = newenv;
|
||||
}
|
||||
|
||||
/*
|
||||
* sets the value of var to be arg in the Unix 4.2 BSD environment env.
|
||||
* Var should end with '=' (bindings are of the form "var=value").
|
||||
@ -3214,28 +3228,48 @@ void
|
||||
xtermSetenv(char *var, char *value)
|
||||
{
|
||||
if (value != 0) {
|
||||
char *test;
|
||||
int envindex = 0;
|
||||
size_t len = strlen(var);
|
||||
int found = -1;
|
||||
|
||||
TRACE(("xtermSetenv(var=%s, value=%s)\n", var, value));
|
||||
TRACE(("xtermSetenv(%s=%s)\n", var, value));
|
||||
|
||||
while (environ[envindex] != NULL) {
|
||||
if (strncmp(environ[envindex], var, len) == 0) {
|
||||
/* found it */
|
||||
environ[envindex] = CastMallocN(char, len + strlen(value));
|
||||
strcpy(environ[envindex], var);
|
||||
strcat(environ[envindex], value);
|
||||
return;
|
||||
while ((test = environ[envindex]) != NULL) {
|
||||
if (strncmp(test, var, len) == 0 && test[len] == '=') {
|
||||
found = envindex;
|
||||
break;
|
||||
}
|
||||
envindex++;
|
||||
}
|
||||
|
||||
TRACE(("...expanding env to %d\n", envindex + 1));
|
||||
if (found < 0) {
|
||||
unsigned need = ENV_HUNK(envindex + 1);
|
||||
unsigned have = ENV_HUNK(envindex);
|
||||
|
||||
environ[envindex] = CastMallocN(char, len + strlen(value));
|
||||
(void) strcpy(environ[envindex], var);
|
||||
strcat(environ[envindex], value);
|
||||
environ[++envindex] = NULL;
|
||||
if (need > have) {
|
||||
char **newenv;
|
||||
newenv = TypeMallocN(char *, need);
|
||||
if (newenv == 0) {
|
||||
fprintf(stderr, "Cannot increase environment\n");
|
||||
return;
|
||||
}
|
||||
memmove(newenv, environ, have * sizeof(*newenv));
|
||||
free(environ);
|
||||
environ = newenv;
|
||||
}
|
||||
|
||||
found = envindex;
|
||||
environ[found + 1] = NULL;
|
||||
environ = environ;
|
||||
}
|
||||
|
||||
environ[found] = CastMallocN(char, 1 + len + strlen(value));
|
||||
if (environ[found] == 0) {
|
||||
fprintf(stderr, "Cannot allocate environment %s\n", var);
|
||||
return;
|
||||
}
|
||||
sprintf(environ[found], "%s=%s", var, value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3267,14 +3301,12 @@ xioerror(Display * dpy)
|
||||
void
|
||||
xt_error(String message)
|
||||
{
|
||||
char *ptr;
|
||||
|
||||
(void) fprintf(stderr, "%s Xt error: %s\n", ProgramName, message);
|
||||
|
||||
/*
|
||||
* Check for the obvious - Xt does a poor job of reporting this.
|
||||
*/
|
||||
if ((ptr = getenv("DISPLAY")) == 0 || *x_strtrim(ptr) == '\0') {
|
||||
if (x_getenv("DISPLAY") == 0) {
|
||||
fprintf(stderr, "%s: DISPLAY is not set\n", ProgramName);
|
||||
}
|
||||
exit(1);
|
||||
@ -3577,7 +3609,7 @@ sortedOpts(OptionHelp * options, XrmOptionDescRec * descs, Cardinal numDescs)
|
||||
}
|
||||
|
||||
/*
|
||||
* Report the locale that xterm was started in.
|
||||
* Report the character-type locale that xterm was started in.
|
||||
*/
|
||||
char *
|
||||
xtermEnvLocale(void)
|
||||
@ -3585,10 +3617,9 @@ xtermEnvLocale(void)
|
||||
static char *result;
|
||||
|
||||
if (result == 0) {
|
||||
if ((result = getenv("LC_ALL")) == 0 || *result == '\0')
|
||||
if ((result = getenv("LC_CTYPE")) == 0 || *result == '\0')
|
||||
if ((result = getenv("LANG")) == 0 || *result == '\0')
|
||||
result = "";
|
||||
if ((result = x_nonempty(setlocale(LC_CTYPE, 0))) == 0) {
|
||||
result = "C";
|
||||
}
|
||||
TRACE(("xtermEnvLocale ->%s\n", result));
|
||||
}
|
||||
return result;
|
||||
@ -3604,7 +3635,7 @@ xtermEnvEncoding(void)
|
||||
result = nl_langinfo(CODESET);
|
||||
#else
|
||||
char *locale = xtermEnvLocale();
|
||||
if (*locale == 0 || !strcmp(locale, "C") || !strcmp(locale, "POSIX")) {
|
||||
if (!strcmp(locale, "C") || !strcmp(locale, "POSIX")) {
|
||||
result = "ASCII";
|
||||
} else {
|
||||
result = "ISO-8859-1";
|
||||
|
@ -1,10 +1,12 @@
|
||||
#! /bin/sh
|
||||
# $Id: mkdirs.sh,v 1.1.1.2 2007/08/25 18:54:02 matthieu Exp $
|
||||
# -----------------------------------------------------------------------------
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
# Created: 1993-05-16
|
||||
# Last modified: 1994-03-25
|
||||
# Public domain
|
||||
#
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
errstatus=0
|
||||
umask 022
|
||||
@ -24,8 +26,19 @@ for file in ${1+"$@"} ; do
|
||||
echo "mkdir $pathcomp" 1>&2
|
||||
case "$pathcomp" in
|
||||
[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]: )
|
||||
;; # DOSISH systems
|
||||
* ) mkdir "$pathcomp" || errstatus=$? ;;
|
||||
;; # DOSISH systems
|
||||
* )
|
||||
mkdir "$pathcomp"
|
||||
errstatus=$?
|
||||
if test $errstatus != 0
|
||||
then
|
||||
# may have failed if invoked in a parallel "make -j# install"
|
||||
if test -d "$pathcomp"
|
||||
then
|
||||
errstatus=0
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $XTermId: os2main.c,v 1.247 2007/03/19 23:48:32 tom Exp $ */
|
||||
/* $XTermId: os2main.c,v 1.251 2007/07/10 20:22:05 tom Exp $ */
|
||||
|
||||
/* removed all foreign stuff to get the code more clear (hv)
|
||||
* and did some rewrite for the obscure OS/2 environment
|
||||
@ -127,7 +127,7 @@ ttyname(int fd)
|
||||
|
||||
static SIGNAL_T reapchild(int n);
|
||||
static int spawnXTerm(XtermWidget /* xw */ );
|
||||
static void resize_termcap(XTermWidget xw, char *oldtc, char *newtc);
|
||||
static void resize_termcap(XtermWidget xw, char *newtc);
|
||||
static void set_owner(char *device, uid_t uid, gid_t gid, mode_t mode);
|
||||
|
||||
static Bool added_utmp_entry = False;
|
||||
@ -192,6 +192,8 @@ static struct termio d_tio;
|
||||
#define CWERASE CONTROL('W')
|
||||
#endif
|
||||
|
||||
#define TERMIO_STRUCT struct termio
|
||||
|
||||
/*
|
||||
* SYSV has the termio.c_cc[V] and ltchars; BSD has tchars and ltchars;
|
||||
* SVR4 has only termio.c_cc, but it includes everything from ltchars.
|
||||
@ -295,13 +297,13 @@ static XtResource application_resources[] =
|
||||
Bres("ptyInitialErase", "PtyInitialErase", ptyInitialErase, DEF_INITIAL_ERASE),
|
||||
Bres("backarrowKeyIsErase", "BackarrowKeyIsErase", backarrow_is_erase, DEF_BACKARO_ERASE),
|
||||
#endif
|
||||
Bres("waitForMap", "WaitForMap", wait_for_map, False),
|
||||
Bres("useInsertMode", "UseInsertMode", useInsertMode, False),
|
||||
#if OPT_ZICONBEEP
|
||||
Ires("zIconBeep", "ZIconBeep", zIconBeep, 0),
|
||||
#endif
|
||||
#if OPT_PTY_HANDSHAKE
|
||||
Bres("ptyHandshake", "PtyHandshake", ptyHandshake, True),
|
||||
Bres("waitForMap", "WaitForMap", wait_for_map, False),
|
||||
Bres("ptyHandshake", "PtyHandshake", ptyHandshake, DEF_PTY_HANDSHAKE),
|
||||
#endif
|
||||
#if OPT_SAME_NAME
|
||||
Bres("sameName", "SameName", sameName, True),
|
||||
@ -1447,6 +1449,7 @@ hungtty(int i GCC_UNUSED)
|
||||
SIGNAL_RETURN;
|
||||
}
|
||||
|
||||
#if OPT_PTY_HANDSHAKE
|
||||
struct {
|
||||
int rows;
|
||||
int cols;
|
||||
@ -1458,11 +1461,14 @@ struct {
|
||||
void
|
||||
first_map_occurred(void)
|
||||
{
|
||||
TScreen *screen = TScreenOf(term);
|
||||
handshake.rows = screen->max_row;
|
||||
handshake.cols = screen->max_col;
|
||||
resource.wait_for_map = False;
|
||||
if (resource.wait_for_map) {
|
||||
TScreen *screen = TScreenOf(term);
|
||||
handshake.rows = screen->max_row;
|
||||
handshake.cols = screen->max_col;
|
||||
resource.wait_for_map = False;
|
||||
}
|
||||
}
|
||||
#endif /* OPT_PTY_HANDSHAKE else !OPT_PTY_HANDSHAKE */
|
||||
|
||||
static void
|
||||
set_owner(char *device, uid_t uid, gid_t gid, mode_t mode)
|
||||
@ -1474,26 +1480,10 @@ set_owner(char *device, uid_t uid, gid_t gid, mode_t mode)
|
||||
if (why != ENOENT
|
||||
&& save_ruid == 0) {
|
||||
fprintf(stderr, "Cannot chown %s to %ld,%ld: %s\n",
|
||||
device, (long) uid, (long) gid, strerror(why));
|
||||
device, (long) uid, (long) gid,
|
||||
strerror(why));
|
||||
}
|
||||
}
|
||||
#ifndef __EMX__
|
||||
/* EMX can chmod files only, not devices */
|
||||
if (chmod(device, mode) < 0) {
|
||||
why = errno;
|
||||
if (why != ENOENT) {
|
||||
struct stat sb;
|
||||
if (stat(device, &sb) < 0) {
|
||||
fprintf(stderr, "Cannot chmod %s to %03o: %s\n",
|
||||
device, mode, strerror(why));
|
||||
} else {
|
||||
fprintf(stderr,
|
||||
"Cannot chmod %s to %03o currently %03o: %s\n",
|
||||
device, mode, (sb.st_mode & S_IFMT), strerror(why));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#define THE_PARENT 1
|
||||
@ -1538,13 +1528,14 @@ spawnXTerm(XtermWidget xw)
|
||||
int Xsocket = ConnectionNumber(screen->display);
|
||||
|
||||
int ttyfd = -1;
|
||||
struct termio tio;
|
||||
TERMIO_STRUCT tio;
|
||||
int status;
|
||||
Bool ok_termcap;
|
||||
char *newtc;
|
||||
|
||||
char newtc[TERMCAP_SIZE];
|
||||
char *TermName = NULL;
|
||||
char *ptr, *shname, buf[64];
|
||||
int i, no_dev_tty = False, envsize;
|
||||
int i, no_dev_tty = False;
|
||||
char *dev_tty_name = (char *) 0;
|
||||
TTYSIZE_STRUCT ts;
|
||||
int pgrp = getpid();
|
||||
@ -1641,12 +1632,12 @@ spawnXTerm(XtermWidget xw)
|
||||
#if OPT_TEK4014
|
||||
if (TEK4014_ACTIVE(xw)) {
|
||||
envnew = tekterm;
|
||||
ptr = TekScreenOf(tekWidget)->tcapbuf;
|
||||
newtc = TekScreenOf(tekWidget)->tcapbuf;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
envnew = vtterm;
|
||||
ptr = screen->tcapbuf;
|
||||
newtc = screen->tcapbuf;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1656,13 +1647,13 @@ spawnXTerm(XtermWidget xw)
|
||||
* entry is not found.
|
||||
*/
|
||||
ok_termcap = True;
|
||||
if (!get_termcap(TermName = resource.term_name, ptr)) {
|
||||
if (!get_termcap(TermName = resource.term_name, newtc)) {
|
||||
char *last = NULL;
|
||||
TermName = *envnew;
|
||||
ok_termcap = False;
|
||||
while (*envnew != NULL) {
|
||||
if ((last == NULL || strcmp(last, *envnew))
|
||||
&& get_termcap(*envnew, ptr)) {
|
||||
&& get_termcap(*envnew, newtc)) {
|
||||
TermName = *envnew;
|
||||
ok_termcap = True;
|
||||
break;
|
||||
@ -1672,7 +1663,7 @@ spawnXTerm(XtermWidget xw)
|
||||
}
|
||||
}
|
||||
if (ok_termcap) {
|
||||
resize_termcap(xw, ptr, newtc);
|
||||
resize_termcap(xw, newtc);
|
||||
}
|
||||
|
||||
/* tell tty how big window is */
|
||||
@ -1754,7 +1745,7 @@ opencons();*/
|
||||
* not have a line discipline structure
|
||||
*/
|
||||
{
|
||||
struct termio t, t1;
|
||||
TERMIO_STRUCT t, t1;
|
||||
if (ptioctl(ttyfd, TCGETA, (char *) &t) < 0)
|
||||
t = d_tio;
|
||||
|
||||
@ -1769,7 +1760,8 @@ opencons();*/
|
||||
if (Console) {
|
||||
int on = 1;
|
||||
if (ioctl(ttyfd, TIOCCONS, (char *) &on) == -1)
|
||||
fprintf(stderr, "%s: cannot open console\n", xterm_name);
|
||||
fprintf(stderr, "%s: cannot open console: %s\n",
|
||||
xterm_name, strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1781,29 +1773,20 @@ opencons();*/
|
||||
signal(SIGQUIT, SIG_DFL);
|
||||
signal(SIGTERM, SIG_DFL);
|
||||
|
||||
/* copy the environment before Setenv'ing */
|
||||
for (i = 0; gblenvp[i] != NULL; i++) ;
|
||||
xtermCopyEnv(gblenvp);
|
||||
|
||||
/* compute number of xtermSetenv() calls below */
|
||||
envsize = 1; /* (NULL terminating entry) */
|
||||
envsize += 5; /* TERM, WINDOWID, DISPLAY, _SHELL, _VERSION */
|
||||
envsize += 2; /* COLUMNS, LINES */
|
||||
|
||||
envnew = TypeCallocN(char *, (unsigned) i + envsize);
|
||||
memmove((char *) envnew, (char *) gblenvp, i * sizeof(char *));
|
||||
gblenvp = envnew;
|
||||
xtermSetenv("TERM=", TermName);
|
||||
xtermSetenv("TERM", TermName);
|
||||
if (!TermName)
|
||||
*newtc = 0;
|
||||
|
||||
sprintf(buf, "%lu",
|
||||
((unsigned long) XtWindow(SHELL_OF(CURRENT_EMU()))));
|
||||
xtermSetenv("WINDOWID=", buf);
|
||||
xtermSetenv("WINDOWID", buf);
|
||||
|
||||
/* put the display into the environment of the shell */
|
||||
xtermSetenv("DISPLAY=", XDisplayString(screen->display));
|
||||
xtermSetenv("DISPLAY", XDisplayString(screen->display));
|
||||
|
||||
xtermSetenv("XTERM_VERSION=", xtermVersion());
|
||||
xtermSetenv("XTERM_VERSION", xtermVersion());
|
||||
|
||||
signal(SIGTERM, SIG_DFL);
|
||||
|
||||
@ -1833,12 +1816,11 @@ opencons();*/
|
||||
}
|
||||
|
||||
sprintf(numbuf, "%d", MaxCols(screen));
|
||||
xtermSetenv("COLUMNS=", numbuf);
|
||||
xtermSetenv("COLUMNS", numbuf);
|
||||
sprintf(numbuf, "%d", MaxRows(screen));
|
||||
xtermSetenv("LINES=", numbuf);
|
||||
xtermSetenv("LINES", numbuf);
|
||||
|
||||
/* reconstruct dead environ variable */
|
||||
environ = gblenvp;
|
||||
gblenvp = environ;
|
||||
|
||||
/* need to reset after all the ioctl bashing we did above */
|
||||
ptioctl(0, TIOCSWINSZ, (char *) &ts);
|
||||
@ -1862,7 +1844,7 @@ opencons();*/
|
||||
* to command that the user gave anyway.
|
||||
*/
|
||||
if (command_to_exec_with_luit) {
|
||||
xtermSetenv("XTERM_SHELL=",
|
||||
xtermSetenv("XTERM_SHELL",
|
||||
xtermFindShell(*command_to_exec_with_luit, False));
|
||||
TRACE(("spawning command \"%s\"\n", *command_to_exec_with_luit));
|
||||
execvp(*command_to_exec_with_luit, command_to_exec_with_luit);
|
||||
@ -1874,7 +1856,7 @@ opencons();*/
|
||||
}
|
||||
#endif
|
||||
if (command_to_exec) {
|
||||
xtermSetenv("XTERM_SHELL=",
|
||||
xtermSetenv("XTERM_SHELL",
|
||||
xtermFindShell(*command_to_exec, False));
|
||||
TRACE(("spawning command \"%s\"\n", *command_to_exec));
|
||||
execvpe(*command_to_exec, command_to_exec, gblenvp);
|
||||
@ -1885,14 +1867,14 @@ opencons();*/
|
||||
}
|
||||
|
||||
/* use a layered mechanism to find a shell */
|
||||
ptr = getenv("X11SHELL");
|
||||
ptr = x_getenv("X11SHELL");
|
||||
if (!ptr)
|
||||
ptr = getenv("SHELL");
|
||||
ptr = x_getenv("SHELL");
|
||||
if (!ptr)
|
||||
ptr = getenv("OS2_SHELL");
|
||||
ptr = x_getenv("OS2_SHELL");
|
||||
if (!ptr)
|
||||
ptr = "SORRY_NO_SHELL_FOUND";
|
||||
xtermSetenv("XTERM_SHELL=", ptr);
|
||||
xtermSetenv("XTERM_SHELL", ptr);
|
||||
|
||||
shname = x_basename(ptr);
|
||||
if (command_to_exec) {
|
||||
@ -1968,7 +1950,7 @@ Exit(int n)
|
||||
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
resize_termcap(XTermWidget xw, TScreen * screen, char *oldtc, char *newtc)
|
||||
resize_termcap(XtermWidget xw, char *newtc)
|
||||
{
|
||||
}
|
||||
|
||||
@ -2032,13 +2014,17 @@ parse_tty_modes(char *s, struct _xttymodes *modelist)
|
||||
|
||||
TRACE(("parse_tty_modes\n"));
|
||||
while (1) {
|
||||
size_t len;
|
||||
|
||||
while (*s && isascii(CharOf(*s)) && isspace(CharOf(*s)))
|
||||
s++;
|
||||
if (!*s)
|
||||
return count;
|
||||
|
||||
for (len = 0; isalnum(CharOf(s[len])); ++len) ;
|
||||
for (mp = modelist; mp->name; mp++) {
|
||||
if (strncmp(s, mp->name, mp->len) == 0)
|
||||
if (len == mp->len
|
||||
&& strncmp(s, mp->name, mp->len) == 0)
|
||||
break;
|
||||
}
|
||||
if (!mp->name)
|
||||
@ -2082,7 +2068,7 @@ ptioctl(int fd, int func, void *data)
|
||||
APIRET rc;
|
||||
ULONG len;
|
||||
struct pt_termios pt;
|
||||
struct termio *t;
|
||||
TERMIO_STRUCT *t;
|
||||
int i;
|
||||
|
||||
switch (func) {
|
||||
@ -2092,7 +2078,7 @@ ptioctl(int fd, int func, void *data)
|
||||
(ULONG *) & pt, sizeof(struct pt_termios), &len);
|
||||
if (rc)
|
||||
return -1;
|
||||
t = (struct termio *) data;
|
||||
t = (TERMIO_STRUCT *) data;
|
||||
t->c_iflag = pt.c_iflag;
|
||||
t->c_oflag = pt.c_oflag;
|
||||
t->c_cflag = pt.c_cflag;
|
||||
@ -2103,7 +2089,7 @@ ptioctl(int fd, int func, void *data)
|
||||
case TCSETA:
|
||||
case TCSETAW:
|
||||
case TCSETAF:
|
||||
t = (struct termio *) data;
|
||||
t = (TERMIO_STRUCT *) data;
|
||||
pt.c_iflag = t->c_iflag;
|
||||
pt.c_oflag = t->c_oflag;
|
||||
pt.c_cflag = t->c_cflag;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $XTermId: ptydata.c,v 1.77 2007/03/12 23:42:49 tom Exp $ */
|
||||
/* $XTermId: ptydata.c,v 1.78 2007/04/15 20:37:16 tom Exp $ */
|
||||
|
||||
/*
|
||||
* $XFree86: xc/programs/xterm/ptydata.c,v 1.25 2006/02/13 01:14:59 dickey Exp $
|
||||
@ -121,7 +121,7 @@ decodeUtf8(PtyData * data)
|
||||
if ((utf_char >= 0xd800 &&
|
||||
utf_char <= 0xdfff) ||
|
||||
(utf_char == 0xfffe) ||
|
||||
(utf_char == 0xffff)) {
|
||||
(utf_char == HIDDEN_CHAR)) {
|
||||
utf_char = UCS_REPL;
|
||||
}
|
||||
utf_count--;
|
||||
|
@ -1,9 +1,7 @@
|
||||
/* $XTermId: resize.c,v 1.101 2007/03/19 23:39:10 tom Exp $ */
|
||||
|
||||
/* $XFree86: xc/programs/xterm/resize.c,v 3.62 2006/02/13 01:14:59 dickey Exp $ */
|
||||
/* $XTermId: resize.c,v 1.104 2007/07/22 20:34:04 tom Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2003-2005,2006 by Thomas E. Dickey
|
||||
* Copyright 2003-2006,2007 by Thomas E. Dickey
|
||||
*
|
||||
* All Rights Reserved
|
||||
*
|
||||
@ -227,7 +225,10 @@ print_termcap(const char *termcap)
|
||||
int
|
||||
main(int argc, char **argv ENVP_ARG)
|
||||
{
|
||||
register char *ptr, *env;
|
||||
#ifdef USE_TERMCAP
|
||||
register char *env;
|
||||
#endif
|
||||
register char *ptr;
|
||||
register int emu = VT100;
|
||||
char *shell;
|
||||
struct passwd *pw;
|
||||
@ -279,7 +280,7 @@ main(int argc, char **argv ENVP_ARG)
|
||||
/* Find out what kind of shell this user is running.
|
||||
* This is the same algorithm that xterm uses.
|
||||
*/
|
||||
if (((ptr = getenv("SHELL")) == NULL || *ptr == 0) &&
|
||||
if (((ptr = x_getenv("SHELL")) == NULL) &&
|
||||
(((pw = getpwuid(getuid())) == NULL) ||
|
||||
*(ptr = pw->pw_shell) == 0))
|
||||
/* this is the same default that xterm uses */
|
||||
@ -318,24 +319,23 @@ main(int argc, char **argv ENVP_ARG)
|
||||
}
|
||||
tty = fileno(ttyfp);
|
||||
#ifdef USE_TERMCAP
|
||||
if (!(env = getenv("TERM")) || !*env) {
|
||||
if ((env = x_getenv("TERM")) == 0) {
|
||||
env = DFT_TERMTYPE;
|
||||
if (SHELL_BOURNE == shell_type)
|
||||
setname = "TERM=xterm;\nexport TERM;\n";
|
||||
setname = "TERM=" DFT_TERMTYPE ";\nexport TERM;\n";
|
||||
else
|
||||
setname = "setenv TERM xterm;\n";
|
||||
setname = "setenv TERM " DFT_TERMTYPE ";\n";
|
||||
}
|
||||
termcap[0] = 0; /* ...just in case we've accidentally gotten terminfo */
|
||||
if (tgetent(termcap, env) <= 0 || termcap[0] == 0)
|
||||
ok_tcap = 0;
|
||||
#endif /* USE_TERMCAP */
|
||||
#ifdef USE_TERMINFO
|
||||
if (!(env = getenv("TERM")) || !*env) {
|
||||
env = DFT_TERMTYPE;
|
||||
if (x_getenv("TERM") == 0) {
|
||||
if (SHELL_BOURNE == shell_type)
|
||||
setname = "TERM=xterm;\nexport TERM;\n";
|
||||
setname = "TERM=" DFT_TERMTYPE ";\nexport TERM;\n";
|
||||
else
|
||||
setname = "setenv TERM xterm;\n";
|
||||
setname = "setenv TERM " DFT_TERMTYPE ";\n";
|
||||
}
|
||||
#endif /* USE_TERMINFO */
|
||||
|
||||
@ -373,8 +373,17 @@ main(int argc, char **argv ENVP_ARG)
|
||||
#endif /* USE_ANY_SYSV_TERMIO/USE_TERMIOS */
|
||||
|
||||
if (argc == 2) {
|
||||
sprintf(buf, setsize[emu], argv[0], argv[1]);
|
||||
write(tty, buf, strlen(buf));
|
||||
char *tmpbuf = malloc(strlen(setsize[emu]) +
|
||||
strlen(argv[0]) +
|
||||
strlen(argv[1]) +
|
||||
1);
|
||||
if (tmpbuf == 0) {
|
||||
fprintf(stderr, "%s: Cannot query size\n", myname);
|
||||
onintr(0);
|
||||
}
|
||||
sprintf(tmpbuf, setsize[emu], argv[0], argv[1]);
|
||||
write(tty, tmpbuf, strlen(tmpbuf));
|
||||
free(tmpbuf);
|
||||
}
|
||||
write(tty, getsize[emu], strlen(getsize[emu]));
|
||||
readstring(ttyfp, buf, size[emu]);
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $XTermId: resize.man,v 1.15 2006/02/13 01:14:59 tom Exp $
|
||||
.\" $XTermId: resize.man,v 1.16 2007/05/24 21:44:06 tom Exp $
|
||||
.\"
|
||||
.\" updated by Thomas E. Dickey for XFree86, 1998-2002.
|
||||
.\"
|
||||
@ -73,7 +73,7 @@ for the base termcap entry to modify.
|
||||
~/.cshrc
|
||||
user's alias for the command.
|
||||
.SH "SEE ALSO"
|
||||
csh(1), tset(1), xterm(1)
|
||||
csh(1), tset(1), xterm(__mansuffix__)
|
||||
.SH AUTHORS
|
||||
Mark Vandevoorde (MIT-Athena), Edward Moy (Berkeley)
|
||||
.br
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
# $XTermId: run-tic.sh,v 1.1 2006/08/10 21:42:07 tom Exp $
|
||||
# $XTermId: run-tic.sh,v 1.3 2007/06/17 15:30:03 tom Exp $
|
||||
#
|
||||
# Run tic, either using ncurses' extension feature or filtering out harmless
|
||||
# messages for the extensions which are otherwise ignored by other versions of
|
||||
@ -19,7 +19,9 @@ echo "** tic $OPT" "$@"
|
||||
tic $OPT "$@" 2>$TMP
|
||||
RET=$?
|
||||
|
||||
fgrep -v 'Unknown Capability' $TMP >&2
|
||||
fgrep -v 'Unknown Capability' $TMP | \
|
||||
fgrep -v 'Capability is not recognized:' | \
|
||||
fgrep -v 'tic: Warning near line ' >&2
|
||||
rm -f $TMP
|
||||
|
||||
exit $RET
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $XTermId: screen.c,v 1.210 2006/11/26 19:12:44 tom Exp $ */
|
||||
/* $XTermId: screen.c,v 1.223 2007/07/22 20:37:55 tom Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1999-2005,2006 by Thomas E. Dickey
|
||||
@ -52,8 +52,6 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $XFree86: xc/programs/xterm/screen.c,v 3.77 2006/06/19 00:36:51 dickey Exp $ */
|
||||
|
||||
/* screen.c */
|
||||
|
||||
#include <stdio.h>
|
||||
@ -382,6 +380,65 @@ ChangeToWide(XtermWidget xw)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Clear cells, no side-effects.
|
||||
*/
|
||||
void
|
||||
ClearCells(XtermWidget xw, int flags, unsigned len, int row, int col)
|
||||
{
|
||||
if (len != 0) {
|
||||
TScreen *screen = &(xw->screen);
|
||||
flags |= TERM_COLOR_FLAGS(xw);
|
||||
|
||||
memset(SCRN_BUF_CHARS(screen, row) + col, ' ', len);
|
||||
memset(SCRN_BUF_ATTRS(screen, row) + col, flags, len);
|
||||
|
||||
if_OPT_EXT_COLORS(screen, {
|
||||
memset(SCRN_BUF_FGRND(screen, row) + col,
|
||||
xw->sgr_foreground, len);
|
||||
memset(SCRN_BUF_BGRND(screen, row) + col,
|
||||
xw->cur_background, len);
|
||||
});
|
||||
if_OPT_ISO_TRADITIONAL_COLORS(screen, {
|
||||
memset(SCRN_BUF_COLOR(screen, row) + col,
|
||||
(int) xtermColorPair(xw), len);
|
||||
});
|
||||
if_OPT_DEC_CHRSET({
|
||||
memset(SCRN_BUF_CSETS(screen, row) + col,
|
||||
curXtermChrSet(xw, screen->cur_row), len);
|
||||
});
|
||||
if_OPT_WIDE_CHARS(screen, {
|
||||
int off;
|
||||
for (off = OFF_WIDEC; off < MAX_PTRS; ++off) {
|
||||
memset(SCREEN_PTR(screen, row, off) + col, 0, len);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Clear data in the screen-structure (no I/O).
|
||||
* Check for wide-character damage as well, clearing the damaged cells.
|
||||
*/
|
||||
void
|
||||
ScrnClearCells(XtermWidget xw, int row, int col, unsigned len)
|
||||
{
|
||||
#if OPT_WIDE_CHARS
|
||||
TScreen *screen = &(xw->screen);
|
||||
#endif
|
||||
int flags = 0;
|
||||
|
||||
if_OPT_WIDE_CHARS(screen, {
|
||||
int kl;
|
||||
int kr;
|
||||
if (DamagedCells(screen, len, &kl, &kr, INX2ROW(screen, row), col)
|
||||
&& kr >= kl) {
|
||||
ClearCells(xw, flags, (unsigned) (kr - kl + 1), row, kl);
|
||||
}
|
||||
});
|
||||
ClearCells(xw, flags, len, row, col);
|
||||
}
|
||||
|
||||
/*
|
||||
* Disown the selection and repaint the area that is highlighted so it is no
|
||||
* longer highlighted.
|
||||
@ -399,11 +456,11 @@ ScrnDisownSelection(XtermWidget xw)
|
||||
* to match flags.
|
||||
*/
|
||||
void
|
||||
ScreenWrite(XtermWidget xw,
|
||||
PAIRED_CHARS(Char * str, Char * str2),
|
||||
unsigned flags,
|
||||
unsigned cur_fg_bg,
|
||||
unsigned length)
|
||||
ScrnWriteText(XtermWidget xw,
|
||||
PAIRED_CHARS(Char * str, Char * str2),
|
||||
unsigned flags,
|
||||
unsigned cur_fg_bg,
|
||||
unsigned length)
|
||||
{
|
||||
TScreen *screen = &(xw->screen);
|
||||
#if OPT_ISO_COLORS
|
||||
@ -420,7 +477,6 @@ ScreenWrite(XtermWidget xw,
|
||||
Char *attrs;
|
||||
int avail = MaxCols(screen) - screen->cur_col;
|
||||
Char *chars;
|
||||
int wrappedbit;
|
||||
#if OPT_WIDE_CHARS
|
||||
Char starcol1, starcol2;
|
||||
#endif
|
||||
@ -449,8 +505,6 @@ ScreenWrite(XtermWidget xw,
|
||||
cb = SCRN_BUF_CSETS(screen, screen->cur_row) + screen->cur_col;
|
||||
});
|
||||
|
||||
wrappedbit = ScrnTstWrapped(screen, screen->cur_row);
|
||||
|
||||
#if OPT_WIDE_CHARS
|
||||
starcol1 = *chars;
|
||||
starcol2 = chars[length - 1];
|
||||
@ -521,9 +575,7 @@ ScreenWrite(XtermWidget xw,
|
||||
}
|
||||
/* if we are overwriting the left hand half of a
|
||||
wide character, make the other half vanish */
|
||||
}
|
||||
|
||||
else {
|
||||
} else {
|
||||
|
||||
if ((char2 = SCRN_BUF_WIDEC(screen, screen->cur_row)) != 0) {
|
||||
char2 += screen->cur_col;
|
||||
@ -563,8 +615,8 @@ ScreenWrite(XtermWidget xw,
|
||||
}
|
||||
});
|
||||
if_OPT_EXT_COLORS(screen, {
|
||||
memset(fbf, (Char) (cur_fg_bg >> 8), real_width);
|
||||
memset(fbb, (Char) (cur_fg_bg & 0xff), real_width);
|
||||
memset(fbf, (int) ExtractForeground(cur_fg_bg), real_width);
|
||||
memset(fbb, (int) ExtractBackground(cur_fg_bg), real_width);
|
||||
});
|
||||
if_OPT_ISO_TRADITIONAL_COLORS(screen, {
|
||||
memset(fb, (int) cur_fg_bg, real_width);
|
||||
@ -573,11 +625,6 @@ ScreenWrite(XtermWidget xw,
|
||||
memset(cb, curXtermChrSet(xw, screen->cur_row), real_width);
|
||||
});
|
||||
|
||||
if (wrappedbit)
|
||||
ScrnSetWrapped(screen, screen->cur_row);
|
||||
else
|
||||
ScrnClrWrapped(screen, screen->cur_row);
|
||||
|
||||
if_OPT_WIDE_CHARS(screen, {
|
||||
screen->last_written_col = screen->cur_col + real_width - 1;
|
||||
screen->last_written_row = screen->cur_row;
|
||||
@ -740,19 +787,18 @@ ScrnDeleteLine(XtermWidget xw, ScrnBuf sb, int last, int where,
|
||||
void
|
||||
ScrnInsertChar(XtermWidget xw, unsigned n)
|
||||
{
|
||||
#define Target (data + col + n)
|
||||
#define Source (data + col)
|
||||
|
||||
TScreen *screen = &(xw->screen);
|
||||
ScrnBuf sb = screen->visbuf;
|
||||
unsigned last = MaxCols(screen);
|
||||
int last = MaxCols(screen);
|
||||
int row = screen->cur_row;
|
||||
unsigned col = screen->cur_col;
|
||||
unsigned i;
|
||||
Char *ptr = BUF_CHARS(sb, row);
|
||||
Char *attrs = BUF_ATTRS(sb, row);
|
||||
int wrappedbit = ScrnTstWrapped(screen, row);
|
||||
int flags = CHARDRAWN | TERM_COLOR_FLAGS(xw);
|
||||
int col = screen->cur_col;
|
||||
Char *data;
|
||||
size_t nbytes;
|
||||
|
||||
if (last <= (col + n)) {
|
||||
if (last <= (int) (col + n)) {
|
||||
if (last <= col)
|
||||
return;
|
||||
n = last - col;
|
||||
@ -762,51 +808,52 @@ ScrnInsertChar(XtermWidget xw, unsigned n)
|
||||
assert(screen->cur_col >= 0);
|
||||
assert(screen->cur_row >= 0);
|
||||
assert(n > 0);
|
||||
assert(last > n);
|
||||
assert(last > (int) n);
|
||||
|
||||
ScrnClrWrapped(screen, row); /* make sure the bit isn't moved */
|
||||
for (i = last - 1; i >= col + n; i--) {
|
||||
unsigned j = i - n;
|
||||
assert(i >= n);
|
||||
ptr[i] = ptr[j];
|
||||
attrs[i] = attrs[j];
|
||||
}
|
||||
if_OPT_WIDE_CHARS(screen, {
|
||||
int xx = INX2ROW(screen, screen->cur_row);
|
||||
int kl;
|
||||
int kr = screen->cur_col;
|
||||
if (DamagedCells(screen, n, &kl, (int *) 0, xx, kr) && kr > kl) {
|
||||
ClearCells(xw, 0, (unsigned) (kr - kl + 1), row, kl);
|
||||
}
|
||||
kr = screen->max_col - n + 1;
|
||||
if (DamagedCells(screen, n, &kl, (int *) 0, xx, kr) && kr > kl) {
|
||||
ClearCells(xw, 0, (unsigned) (kr - kl + 1), row, kl);
|
||||
}
|
||||
});
|
||||
|
||||
data = BUF_CHARS(sb, row);
|
||||
memmove(Target, Source, nbytes);
|
||||
|
||||
data = BUF_ATTRS(sb, row);
|
||||
memmove(Target, Source, nbytes);
|
||||
|
||||
for (i = col; i < col + n; i++)
|
||||
ptr[i] = ' ';
|
||||
for (i = col; i < col + n; i++)
|
||||
attrs[i] = flags;
|
||||
if_OPT_EXT_COLORS(screen, {
|
||||
ptr = BUF_FGRND(sb, row);
|
||||
memmove(ptr + col + n, ptr + col, nbytes);
|
||||
memset(ptr + col, xw->sgr_foreground, n);
|
||||
ptr = BUF_BGRND(sb, row);
|
||||
memmove(ptr + col + n, ptr + col, nbytes);
|
||||
memset(ptr + col, xw->cur_background, n);
|
||||
data = BUF_FGRND(sb, row);
|
||||
memmove(Target, Source, nbytes);
|
||||
data = BUF_BGRND(sb, row);
|
||||
memmove(Target, Source, nbytes);
|
||||
});
|
||||
if_OPT_ISO_TRADITIONAL_COLORS(screen, {
|
||||
ptr = BUF_COLOR(sb, row);
|
||||
memmove(ptr + col + n, ptr + col, nbytes);
|
||||
memset(ptr + col, (int) xtermColorPair(xw), n);
|
||||
data = BUF_COLOR(sb, row);
|
||||
memmove(Target, Source, nbytes);
|
||||
});
|
||||
if_OPT_DEC_CHRSET({
|
||||
ptr = BUF_CSETS(sb, row);
|
||||
memmove(ptr + col + n, ptr + col, nbytes);
|
||||
memset(ptr + col, curXtermChrSet(xw, row), n);
|
||||
data = BUF_CSETS(sb, row);
|
||||
memmove(Target, Source, nbytes);
|
||||
});
|
||||
if_OPT_WIDE_CHARS(screen, {
|
||||
int off;
|
||||
for (off = OFF_WIDEC; off < MAX_PTRS; ++off) {
|
||||
ptr = BUFFER_PTR(sb, row, off);
|
||||
memmove(ptr + col + n, ptr + col, nbytes);
|
||||
memset(ptr + col, 0, n);
|
||||
data = BUFFER_PTR(sb, row, off);
|
||||
memmove(Target, Source, nbytes);
|
||||
}
|
||||
});
|
||||
ClearCells(xw, CHARDRAWN, n, row, col);
|
||||
|
||||
if (wrappedbit)
|
||||
ScrnSetWrapped(screen, row);
|
||||
else
|
||||
ScrnClrWrapped(screen, row);
|
||||
#undef Source
|
||||
#undef Target
|
||||
}
|
||||
|
||||
/*
|
||||
@ -815,16 +862,18 @@ ScrnInsertChar(XtermWidget xw, unsigned n)
|
||||
void
|
||||
ScrnDeleteChar(XtermWidget xw, unsigned n)
|
||||
{
|
||||
#define Target (data + col)
|
||||
#define Source (data + col + n)
|
||||
|
||||
TScreen *screen = &(xw->screen);
|
||||
ScrnBuf sb = screen->visbuf;
|
||||
unsigned last = MaxCols(screen);
|
||||
unsigned row = screen->cur_row;
|
||||
unsigned col = screen->cur_col;
|
||||
Char *ptr = BUF_CHARS(sb, row);
|
||||
Char *attrs = BUF_ATTRS(sb, row);
|
||||
int last = MaxCols(screen);
|
||||
int row = screen->cur_row;
|
||||
int col = screen->cur_col;
|
||||
Char *data;
|
||||
size_t nbytes;
|
||||
|
||||
if (last <= (col + n)) {
|
||||
if (last <= (int) (col + n)) {
|
||||
if (last <= col)
|
||||
return;
|
||||
n = last - col;
|
||||
@ -834,40 +883,49 @@ ScrnDeleteChar(XtermWidget xw, unsigned n)
|
||||
assert(screen->cur_col >= 0);
|
||||
assert(screen->cur_row >= 0);
|
||||
assert(n > 0);
|
||||
assert(last > n);
|
||||
assert(last > (int) n);
|
||||
|
||||
memmove(ptr + col, ptr + col + n, nbytes);
|
||||
memmove(attrs + col, attrs + col + n, nbytes);
|
||||
bzero(ptr + last - n, n);
|
||||
memset(attrs + last - n, (Char) (TERM_COLOR_FLAGS(xw)), n);
|
||||
if_OPT_WIDE_CHARS(screen, {
|
||||
int kl;
|
||||
int kr;
|
||||
if (DamagedCells(screen, n, &kl, &kr,
|
||||
INX2ROW(screen, screen->cur_row),
|
||||
screen->cur_col))
|
||||
ClearCells(xw, 0, (unsigned) (kr - kl + 1), row, kl);
|
||||
});
|
||||
|
||||
data = BUF_CHARS(sb, row);
|
||||
memmove(Target, Source, nbytes);
|
||||
|
||||
data = BUF_ATTRS(sb, row);
|
||||
memmove(Target, Source, nbytes);
|
||||
|
||||
if_OPT_EXT_COLORS(screen, {
|
||||
ptr = BUF_FGRND(sb, row);
|
||||
memmove(ptr + col, ptr + col + n, nbytes);
|
||||
memset(ptr + last - n, xw->sgr_foreground, n);
|
||||
ptr = BUF_BGRND(sb, row);
|
||||
memmove(ptr + col, ptr + col + n, nbytes);
|
||||
memset(ptr + last - n, xw->cur_background, n);
|
||||
data = BUF_FGRND(sb, row);
|
||||
memmove(Target, Source, nbytes);
|
||||
data = BUF_BGRND(sb, row);
|
||||
memmove(Target, Source, nbytes);
|
||||
});
|
||||
if_OPT_ISO_TRADITIONAL_COLORS(screen, {
|
||||
ptr = BUF_COLOR(sb, row);
|
||||
memmove(ptr + col, ptr + col + n, nbytes);
|
||||
memset(ptr + last - n, (int) xtermColorPair(xw), n);
|
||||
data = BUF_COLOR(sb, row);
|
||||
memmove(Target, Source, nbytes);
|
||||
});
|
||||
if_OPT_DEC_CHRSET({
|
||||
ptr = BUF_CSETS(sb, row);
|
||||
memmove(ptr + col, ptr + col + n, nbytes);
|
||||
memset(ptr + last - n, curXtermChrSet(xw, row), n);
|
||||
data = BUF_CSETS(sb, row);
|
||||
memmove(Target, Source, nbytes);
|
||||
});
|
||||
if_OPT_WIDE_CHARS(screen, {
|
||||
int off;
|
||||
for (off = OFF_WIDEC; off < MAX_PTRS; ++off) {
|
||||
ptr = BUFFER_PTR(sb, row, off);
|
||||
memmove(ptr + col, ptr + col + n, nbytes);
|
||||
memset(ptr + last - n, 0, n);
|
||||
data = BUFFER_PTR(sb, row, off);
|
||||
memmove(Target, Source, nbytes);
|
||||
}
|
||||
});
|
||||
ClearCells(xw, 0, n, row, (int) (last - n));
|
||||
ScrnClrWrapped(screen, row);
|
||||
|
||||
#undef Source
|
||||
#undef Target
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1319,32 +1377,13 @@ ClearBufRows(XtermWidget xw,
|
||||
int last)
|
||||
{
|
||||
TScreen *screen = &(xw->screen);
|
||||
ScrnBuf buf = screen->visbuf;
|
||||
unsigned len = MaxCols(screen);
|
||||
int row;
|
||||
int flags = TERM_COLOR_FLAGS(xw);
|
||||
|
||||
TRACE(("ClearBufRows %d..%d\n", first, last));
|
||||
for (row = first; row <= last; row++) {
|
||||
ScrnClrWrapped(screen, row);
|
||||
bzero(BUF_CHARS(buf, row), len);
|
||||
memset(BUF_ATTRS(buf, row), flags, len);
|
||||
if_OPT_EXT_COLORS(screen, {
|
||||
memset(BUF_FGRND(buf, row), xw->sgr_foreground, len);
|
||||
memset(BUF_BGRND(buf, row), xw->cur_background, len);
|
||||
});
|
||||
if_OPT_ISO_TRADITIONAL_COLORS(screen, {
|
||||
memset(BUF_COLOR(buf, row), (int) xtermColorPair(xw), len);
|
||||
});
|
||||
if_OPT_DEC_CHRSET({
|
||||
memset(BUF_CSETS(buf, row), 0, len);
|
||||
});
|
||||
if_OPT_WIDE_CHARS(screen, {
|
||||
int off;
|
||||
for (off = OFF_WIDEC; off < MAX_PTRS; ++off) {
|
||||
memset(BUFFER_PTR(buf, row, off), 0, len);
|
||||
}
|
||||
});
|
||||
ClearCells(xw, 0, len, row, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1859,6 +1898,7 @@ ScrnWipeRectangle(XtermWidget xw,
|
||||
for (col = left; col <= right; ++col) {
|
||||
if (!((screen->protected_mode == DEC_PROTECT)
|
||||
&& (SCRN_BUF_ATTRS(screen, row)[col] & PROTECTED))) {
|
||||
/* FIXME - use ClearCells */
|
||||
SCRN_BUF_ATTRS(screen, row)[col] |= CHARDRAWN;
|
||||
SCRN_BUF_CHARS(screen, row)[col] = ' ';
|
||||
if_OPT_WIDE_CHARS(screen, {
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $XTermId: terminfo,v 1.145 2006/10/01 22:18:13 tom Exp $
|
||||
# $XTermId: terminfo,v 1.146 2007/06/10 13:31:21 tom Exp $
|
||||
#
|
||||
# $XFree86: xc/programs/xterm/terminfo,v 3.59 2006/02/13 01:14:59 dickey Exp $
|
||||
#
|
||||
@ -374,10 +374,72 @@ xterm+pcf0|fragment with modifyFunctionKeys:0,
|
||||
kf8=\E[19~,
|
||||
kf9=\E[20~,
|
||||
|
||||
# This is the same as xterm+pcf2 because the unmodified keys all happen to
|
||||
# have a pattern that forces the modifier to the same position.
|
||||
# This is almost the same as xterm+pcf2 because the unmodified keys all happen
|
||||
# to have a pattern that forces the modifier to the same position.
|
||||
xterm+pcf1|fragment with modifyFunctionKeys:1,
|
||||
use=xterm+pcf2,
|
||||
kf1=\EOP,
|
||||
kf10=\E[21~,
|
||||
kf11=\E[23~,
|
||||
kf12=\E[24~,
|
||||
kf13=\E[2P,
|
||||
kf14=\E[2Q,
|
||||
kf15=\E[2R,
|
||||
kf16=\E[2S,
|
||||
kf17=\E[15;2~,
|
||||
kf18=\E[17;2~,
|
||||
kf19=\E[18;2~,
|
||||
kf2=\EOQ,
|
||||
kf20=\E[19;2~,
|
||||
kf21=\E[20;2~,
|
||||
kf22=\E[21;2~,
|
||||
kf23=\E[23;2~,
|
||||
kf24=\E[24;2~,
|
||||
kf25=\E[5P,
|
||||
kf26=\E[5Q,
|
||||
kf27=\E[5R,
|
||||
kf28=\E[5S,
|
||||
kf29=\E[15;5~,
|
||||
kf3=\EOR,
|
||||
kf30=\E[17;5~,
|
||||
kf31=\E[18;5~,
|
||||
kf32=\E[19;5~,
|
||||
kf33=\E[20;5~,
|
||||
kf34=\E[21;5~,
|
||||
kf35=\E[23;5~,
|
||||
kf36=\E[24;5~,
|
||||
kf37=\E[6P,
|
||||
kf38=\E[6Q,
|
||||
kf39=\E[6R,
|
||||
kf4=\EOS,
|
||||
kf40=\E[6S,
|
||||
kf41=\E[15;6~,
|
||||
kf42=\E[17;6~,
|
||||
kf43=\E[18;6~,
|
||||
kf44=\E[19;6~,
|
||||
kf45=\E[20;6~,
|
||||
kf46=\E[21;6~,
|
||||
kf47=\E[23;6~,
|
||||
kf48=\E[24;6~,
|
||||
kf49=\E[3P,
|
||||
kf5=\E[15~,
|
||||
kf50=\E[3Q,
|
||||
kf51=\E[3R,
|
||||
kf52=\E[3S,
|
||||
kf53=\E[15;3~,
|
||||
kf54=\E[17;3~,
|
||||
kf55=\E[18;3~,
|
||||
kf56=\E[19;3~,
|
||||
kf57=\E[20;3~,
|
||||
kf58=\E[21;3~,
|
||||
kf59=\E[23;3~,
|
||||
kf6=\E[17~,
|
||||
kf60=\E[24;3~,
|
||||
kf61=\E[4P,
|
||||
kf62=\E[4Q,
|
||||
kf63=\E[4R,
|
||||
kf7=\E[18~,
|
||||
kf8=\E[19~,
|
||||
kf9=\E[20~,
|
||||
|
||||
xterm+pcf2|fragment with modifyFunctionKeys:2,
|
||||
kf1=\EOP,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $XTermId: trace.c,v 1.72 2007/03/17 15:45:12 tom Exp $ */
|
||||
/* $XTermId: trace.c,v 1.81 2007/07/22 16:27:25 tom Exp $ */
|
||||
|
||||
/*
|
||||
* $XFree86: xc/programs/xterm/trace.c,v 3.23 2005/09/18 23:48:13 dickey Exp $
|
||||
@ -43,6 +43,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef HAVE_X11_TRANSLATEI_H
|
||||
#include <X11/TranslateI.h>
|
||||
@ -130,6 +131,34 @@ TraceIds(const char *fname, int lnum)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
formatAscii(char *dst, unsigned value)
|
||||
{
|
||||
switch (value) {
|
||||
case '\\':
|
||||
sprintf(dst, "\\\\");
|
||||
break;
|
||||
case '\b':
|
||||
sprintf(dst, "\\b");
|
||||
break;
|
||||
case '\n':
|
||||
sprintf(dst, "\\n");
|
||||
break;
|
||||
case '\r':
|
||||
sprintf(dst, "\\r");
|
||||
break;
|
||||
case '\t':
|
||||
sprintf(dst, "\\t");
|
||||
break;
|
||||
default:
|
||||
if (E2A(value) < 32 || (E2A(value) >= 127 && E2A(value) < 160))
|
||||
sprintf(dst, "\\%03o", value);
|
||||
else
|
||||
sprintf(dst, "%c", CharOf(value));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
char *
|
||||
visibleChars(PAIRED_CHARS(Char * buf, Char * buf2), unsigned len)
|
||||
{
|
||||
@ -155,10 +184,7 @@ visibleChars(PAIRED_CHARS(Char * buf, Char * buf2), unsigned len)
|
||||
sprintf(dst, "\\u+%04X", value);
|
||||
else
|
||||
#endif
|
||||
if (E2A(value) < 32 || (E2A(value) >= 127 && E2A(value) < 160))
|
||||
sprintf(dst, "\\%03o", value);
|
||||
else
|
||||
sprintf(dst, "%c", CharOf(value));
|
||||
formatAscii(dst, value);
|
||||
dst += strlen(dst);
|
||||
}
|
||||
return result;
|
||||
@ -184,10 +210,7 @@ visibleIChar(IChar * buf, unsigned len)
|
||||
sprintf(dst, "\\u+%04X", value);
|
||||
else
|
||||
#endif
|
||||
if (E2A(value) < 32 || (E2A(value) >= 127 && E2A(value) < 160))
|
||||
sprintf(dst, "\\%03o", value);
|
||||
else
|
||||
sprintf(dst, "%c", CharOf(value));
|
||||
formatAscii(dst, value);
|
||||
dst += strlen(dst);
|
||||
}
|
||||
return result;
|
||||
@ -285,6 +308,98 @@ visibleXError(int code)
|
||||
return result;
|
||||
}
|
||||
|
||||
#if OPT_TRACE_FLAGS
|
||||
#define isScrnFlag(flag) ((flag) == LINEWRAPPED)
|
||||
|
||||
static char *
|
||||
ScrnText(TScreen * screen, int row)
|
||||
{
|
||||
Char *chars = SCRN_BUF_CHARS(screen, row);
|
||||
#if OPT_WIDE_CHARS
|
||||
Char *widec = 0;
|
||||
#endif
|
||||
|
||||
if_OPT_WIDE_CHARS(screen, {
|
||||
widec = SCRN_BUF_WIDEC(screen, row);
|
||||
});
|
||||
return visibleChars(PAIRED_CHARS(chars, widec), screen->max_col + 1);
|
||||
}
|
||||
|
||||
#if OPT_TRACE_FLAGS > 1
|
||||
#define DETAILED_FLAGS(name) \
|
||||
Trace("TEST " #name " %d [%d..%d] top %d chars %p (%d)\n", \
|
||||
row, \
|
||||
-screen->savedlines, \
|
||||
screen->max_row, \
|
||||
screen->topline, \
|
||||
SCRN_BUF_CHARS(screen, row), \
|
||||
(&(SCRN_BUF_FLAGS(screen, row)) - screen->visbuf) / MAX_PTRS)
|
||||
#else
|
||||
#define DETAILED_FLAGS(name) /* nothing */
|
||||
#endif
|
||||
|
||||
#define SHOW_BAD_ROW(name, screen, row) \
|
||||
Trace("OOPS " #name " bad row %d [%d..%d]\n", \
|
||||
row, -(screen->savedlines), screen->max_row)
|
||||
|
||||
#define SHOW_SCRN_FLAG(name,code) \
|
||||
Trace(#name " {%d, top=%d, saved=%d}%05d%s:%s\n", \
|
||||
row, screen->topline, screen->savedlines, \
|
||||
ROW2ABS(screen, row), \
|
||||
code ? "*" : "", \
|
||||
ScrnText(screen, row))
|
||||
|
||||
void
|
||||
ScrnClrFlag(TScreen * screen, int row, int flag)
|
||||
{
|
||||
DETAILED_FLAGS(ScrnClrFlag);
|
||||
if (!okScrnRow(screen, row)) {
|
||||
SHOW_BAD_ROW(ScrnClrFlag, screen, row);
|
||||
assert(0);
|
||||
} else if (isScrnFlag(flag)) {
|
||||
SHOW_SCRN_FLAG(ScrnClrFlag, 0);
|
||||
}
|
||||
|
||||
SCRN_BUF_FLAGS(screen, row) =
|
||||
(Char *) ((long) SCRN_BUF_FLAGS(screen, row) & ~(flag));
|
||||
}
|
||||
|
||||
void
|
||||
ScrnSetFlag(TScreen * screen, int row, int flag)
|
||||
{
|
||||
DETAILED_FLAGS(ScrnSetFlag);
|
||||
if (!okScrnRow(screen, row)) {
|
||||
SHOW_BAD_ROW(ScrnSetFlag, screen, row);
|
||||
assert(0);
|
||||
} else if (isScrnFlag(flag)) {
|
||||
SHOW_SCRN_FLAG(ScrnSetFlag, 1);
|
||||
}
|
||||
|
||||
SCRN_BUF_FLAGS(screen, row) =
|
||||
(Char *) (((long) SCRN_BUF_FLAGS(screen, row) | (flag)));
|
||||
}
|
||||
|
||||
int
|
||||
ScrnTstFlag(TScreen * screen, int row, int flag)
|
||||
{
|
||||
int code = 0;
|
||||
if (!okScrnRow(screen, row)) {
|
||||
SHOW_BAD_ROW(ScrnTstFlag, screen, row);
|
||||
} else {
|
||||
code = ((long) SCRN_BUF_FLAGS(screen, row) & (flag)) != 0;
|
||||
|
||||
DETAILED_FLAGS(ScrnTstFlag);
|
||||
if (!okScrnRow(screen, row)) {
|
||||
SHOW_BAD_ROW(ScrnSetFlag, screen, row);
|
||||
assert(0);
|
||||
} else if (isScrnFlag(flag)) {
|
||||
SHOW_SCRN_FLAG(ScrnTstFlag, code);
|
||||
}
|
||||
}
|
||||
return code;
|
||||
}
|
||||
#endif /* OPT_TRACE_FLAGS */
|
||||
|
||||
void
|
||||
TraceSizeHints(XSizeHints * hints)
|
||||
{
|
||||
@ -395,13 +510,14 @@ TraceXtermResources(void)
|
||||
XRES_B(ptyInitialErase);
|
||||
XRES_B(backarrow_is_erase);
|
||||
#endif
|
||||
XRES_B(wait_for_map);
|
||||
XRES_B(useInsertMode);
|
||||
#if OPT_ZICONBEEP
|
||||
XRES_I(zIconBeep);
|
||||
#endif
|
||||
#if OPT_PTY_HANDSHAKE
|
||||
XRES_B(wait_for_map);
|
||||
XRES_B(ptyHandshake);
|
||||
XRES_B(ptySttySize);
|
||||
#endif
|
||||
#if OPT_SAME_NAME
|
||||
XRES_B(sameName);
|
||||
@ -564,6 +680,11 @@ TraceOptions(OptionHelp * options, XrmOptionDescRec * resources, Cardinal res_co
|
||||
case XrmoptionSkipLine:
|
||||
TRACE((" %-28s {remainder of line}\n", res_array[j].option));
|
||||
break;
|
||||
case XrmoptionIsArg:
|
||||
case XrmoptionNoArg:
|
||||
case XrmoptionResArg:
|
||||
case XrmoptionSepArg:
|
||||
case XrmoptionStickyArg:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1,8 +1,22 @@
|
||||
#!/usr/bin/perl
|
||||
#!/usr/bin/perl -w
|
||||
# $XTermId: convmap.pl,v 1.13 2007/06/11 23:30:44 tom Exp $
|
||||
#
|
||||
# Generate keysym2ucs.c file
|
||||
#
|
||||
# See also:
|
||||
# http://mail.nl.linux.org/linux-utf8/2001-04/msg00248.html
|
||||
#
|
||||
# $XFree86: xc/programs/xterm/unicode/convmap.pl,v 1.5 2000/01/24 22:22:05 dawes Exp $
|
||||
|
||||
use strict;
|
||||
|
||||
our $keysym;
|
||||
our %name;
|
||||
our %keysym_to_ucs;
|
||||
our %keysym_to_keysymname;
|
||||
|
||||
sub utf8 ($);
|
||||
|
||||
sub utf8 ($) {
|
||||
my $c = shift(@_);
|
||||
|
||||
@ -42,7 +56,7 @@ sub utf8 ($) {
|
||||
}
|
||||
}
|
||||
|
||||
$unicodedata = "UnicodeData-Latest.txt";
|
||||
my $unicodedata = "UnicodeData-Latest.txt";
|
||||
|
||||
# read list of all Unicode names
|
||||
if (!open(UDATA, $unicodedata) && !open(UDATA, "$unicodedata")) {
|
||||
@ -51,7 +65,7 @@ if (!open(UDATA, $unicodedata) && !open(UDATA, "$unicodedata")) {
|
||||
"ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData-Latest.txt\n");
|
||||
}
|
||||
while (<UDATA>) {
|
||||
if (/^([0-9,A-F]{4});([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*)$/) {
|
||||
if (/^([0-9,A-F]{4,6});([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*)$/) {
|
||||
$name{hex($1)} = $2;
|
||||
} else {
|
||||
die("Syntax error in line '$_' in file '$unicodedata'");
|
||||
@ -63,9 +77,12 @@ close(UDATA);
|
||||
open(LIST, "<keysym.map") || die ("Can't open map file:\n$!\n");
|
||||
while (<LIST>) {
|
||||
if (/^0x([0-9a-f]{4})\s+U([0-9a-f]{4})\s*(\#.*)?$/){
|
||||
$keysym = hex($1);
|
||||
$ucs = hex($2);
|
||||
my $keysym = hex($1);
|
||||
my $ucs = hex($2);
|
||||
my $comment = $3;
|
||||
$comment =~ s/^#\s*//;
|
||||
$keysym_to_ucs{$keysym} = $ucs;
|
||||
$keysym_to_keysymname{$keysym} = $comment;
|
||||
} elsif (/^\s*\#/ || /^\s*$/) {
|
||||
} else {
|
||||
die("Syntax error in 'list' in line\n$_\n");
|
||||
@ -78,16 +95,16 @@ open(LIST, "</usr/include/X11/keysymdef.h") || die ("Can't open keysymdef.h:\n$!
|
||||
while (<LIST>) {
|
||||
if (/^\#define\s+XK_([A-Za-z_0-9]+)\s+0x([0-9a-fA-F]+)\s*(\/.*)?$/) {
|
||||
next if /\/\* deprecated \*\//;
|
||||
$keysymname = $1;
|
||||
$keysym = hex($2);
|
||||
my $keysymname = $1;
|
||||
my $keysym = hex($2);
|
||||
$keysym_to_keysymname{$keysym} = $keysymname;
|
||||
}
|
||||
}
|
||||
close(LIST);
|
||||
|
||||
print <<EOT;
|
||||
/* \$XFree86\$
|
||||
* This module converts keysym values into the corresponding ISO 10646-1
|
||||
/* \$XTermId\$
|
||||
* This module converts keysym values into the corresponding ISO 10646
|
||||
* (UCS, Unicode) values.
|
||||
*
|
||||
* The array keysymtab[] contains pairs of X11 keysym values for graphical
|
||||
@ -99,36 +116,47 @@ print <<EOT;
|
||||
* by Xlib via XmbLookupString() and should ideally not have to be
|
||||
* done in X applications. But we are not there yet.
|
||||
*
|
||||
* We allow to represent any UCS character in the range U+00000000 to
|
||||
* U+00FFFFFF by a keysym value in the range 0x01000000 to 0x01ffffff.
|
||||
* We allow to represent any UCS character in the range U-00000000 to
|
||||
* U-00FFFFFF by a keysym value in the range 0x01000000 to 0x01ffffff.
|
||||
* This admittedly does not cover the entire 31-bit space of UCS, but
|
||||
* it does cover all of the characters up to U+10FFFF, which can be
|
||||
* it does cover all of the characters up to U-10FFFF, which can be
|
||||
* represented by UTF-16, and more, and it is very unlikely that higher
|
||||
* UCS codes will ever be assigned by ISO. So to get Unicode character
|
||||
* U+ABCD you can directly use keysym 0x1000abcd.
|
||||
* U+ABCD you can directly use keysym 0x0100abcd.
|
||||
*
|
||||
* NOTE: The comments in the table below contain the actual character
|
||||
* encoded in UTF-8, so for viewing and editing best use an editor in
|
||||
* UTF-8 mode.
|
||||
*
|
||||
* Author: Markus G. Kuhn <mkuhn\@acm.org>, University of Cambridge, June 1999
|
||||
* Author: Markus G. Kuhn <mkuhn\@acm.org>, University of Cambridge, April 2001
|
||||
*
|
||||
* Special thanks to Richard Verhoeven <river\@win.tue.nl> for preparing
|
||||
* an initial draft of the mapping table.
|
||||
*
|
||||
* This software is in the public domain. Share and enjoy!
|
||||
*
|
||||
* AUTOMATICALLY GENERATED FILE, DO NOT EDIT !!! (unicode/convmap.pl)
|
||||
*/
|
||||
|
||||
#include <keysym2ucs.h>
|
||||
#ifndef KEYSYM2UCS_INCLUDED
|
||||
|
||||
#include "keysym2ucs.h"
|
||||
#define VISIBLE /* */
|
||||
|
||||
struct codepair {
|
||||
#else
|
||||
|
||||
#define VISIBLE static
|
||||
|
||||
#endif
|
||||
|
||||
static struct codepair {
|
||||
unsigned short keysym;
|
||||
unsigned short ucs;
|
||||
} keysymtab[] = {
|
||||
EOT
|
||||
|
||||
for $keysym (sort {$a <=> $b} keys(%keysym_to_keysymname)) {
|
||||
$ucs = $keysym_to_ucs{$keysym};
|
||||
my $ucs = $keysym_to_ucs{$keysym};
|
||||
next if $keysym >= 0xf000 || $keysym < 0x100;
|
||||
if ($ucs) {
|
||||
printf(" { 0x%04x, 0x%04x }, /*%28s %s %s */\n",
|
||||
@ -143,6 +171,7 @@ for $keysym (sort {$a <=> $b} keys(%keysym_to_keysymname)) {
|
||||
print <<EOT;
|
||||
};
|
||||
|
||||
VISIBLE
|
||||
long keysym2ucs(KeySym keysym)
|
||||
{
|
||||
int min = 0;
|
||||
|
File diff suppressed because it is too large
Load Diff
784
app/xterm/util.c
784
app/xterm/util.c
File diff suppressed because it is too large
Load Diff
10
app/xterm/uxterm.desktop
Normal file
10
app/xterm/uxterm.desktop
Normal file
@ -0,0 +1,10 @@
|
||||
# $XTermId: uxterm.desktop,v 1.5 2007/06/17 00:54:49 tom Exp $
|
||||
[Desktop Entry]
|
||||
Name=UXTerm
|
||||
Comment=standard terminal emulator for the X window system
|
||||
Exec=uxterm
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Encoding=UTF-8
|
||||
Icon=xterm-color_48x48.xpm
|
||||
Categories=System;
|
@ -1,17 +1,40 @@
|
||||
#!/usr/bin/perl
|
||||
# Author: Todd Larason <jtl@molehill.org>
|
||||
# $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.2 2002/03/26 01:46:43 dickey Exp $
|
||||
|
||||
# $XTermId: 256colors2.pl,v 1.8 2007/07/17 00:44:54 tom Exp $
|
||||
# Authors: Todd Larason <jtl@molehill.org>
|
||||
# Thomas E Dickey
|
||||
#
|
||||
# use the resources for colors 0-15 - usually more-or-less a
|
||||
# reproduction of the standard ANSI colors, but possibly more
|
||||
# pleasing shades
|
||||
|
||||
use strict;
|
||||
|
||||
use Getopt::Std;
|
||||
|
||||
our ($opt_r);
|
||||
&getopts('r') || die("Usage: $0 [-r]");
|
||||
|
||||
our ($red, $green, $blue);
|
||||
our ($gray, $level, $color);
|
||||
|
||||
sub map_cube($) {
|
||||
my $value = $_[0];
|
||||
$value = (5 - $value) if defined($opt_r);
|
||||
return $value;
|
||||
}
|
||||
|
||||
sub map_gray($) {
|
||||
my $value = $_[0];
|
||||
$value = (23 - $value) if defined($opt_r);
|
||||
return $value;
|
||||
}
|
||||
|
||||
# colors 16-231 are a 6x6x6 color cube
|
||||
for ($red = 0; $red < 6; $red++) {
|
||||
for ($green = 0; $green < 6; $green++) {
|
||||
for ($blue = 0; $blue < 6; $blue++) {
|
||||
printf("\x1b]4;%d;rgb:%2.2x/%2.2x/%2.2x\x1b\\",
|
||||
16 + ($red * 36) + ($green * 6) + $blue,
|
||||
16 + (map_cube($red) * 36) + (map_cube($green) * 6) + map_cube($blue),
|
||||
($red ? ($red * 40 + 55) : 0),
|
||||
($green ? ($green * 40 + 55) : 0),
|
||||
($blue ? ($blue * 40 + 55) : 0));
|
||||
@ -22,7 +45,7 @@ for ($red = 0; $red < 6; $red++) {
|
||||
# colors 232-255 are a grayscale ramp, intentionally leaving out
|
||||
# black and white
|
||||
for ($gray = 0; $gray < 24; $gray++) {
|
||||
$level = ($gray * 10) + 8;
|
||||
$level = (map_gray($gray) * 10) + 8;
|
||||
printf("\x1b]4;%d;rgb:%2.2x/%2.2x/%2.2x\x1b\\",
|
||||
232 + $gray, $level, $level, $level);
|
||||
}
|
||||
|
@ -1,19 +1,44 @@
|
||||
#!/usr/bin/perl
|
||||
# Author: Steve Wall <swall@redcom.com>
|
||||
# $XFree86: xc/programs/xterm/vttests/88colors2.pl,v 1.1 1999/09/25 14:38:51 dawes Exp $
|
||||
# Made from 256colors2.pl
|
||||
# $XTermId: 88colors2.pl,v 1.5 2007/07/17 00:42:15 tom Exp $
|
||||
# Authors: Steve Wall <swall@redcom.com>
|
||||
# Thomas E Dickey
|
||||
#
|
||||
# Adapted from 256colors2.pl
|
||||
|
||||
# use the resources for colors 0-15 - usually more-or-less a
|
||||
# reproduction of the standard ANSI colors, but possibly more
|
||||
# pleasing shades
|
||||
|
||||
use strict;
|
||||
|
||||
use Getopt::Std;
|
||||
|
||||
our ($opt_r);
|
||||
&getopts('r') || die("Usage: $0 [-r]");
|
||||
|
||||
our (@steps);
|
||||
our ($red, $green, $blue);
|
||||
our ($gray, $level, $color);
|
||||
|
||||
sub map_cube($) {
|
||||
my $value = $_[0];
|
||||
$value = (3 - $value) if defined($opt_r);
|
||||
return $value;
|
||||
}
|
||||
|
||||
sub map_gray($) {
|
||||
my $value = $_[0];
|
||||
$value = (7 - $value) if defined($opt_r);
|
||||
return $value;
|
||||
}
|
||||
|
||||
# colors 16-79 are a 4x4x4 color cube
|
||||
@steps=(0,139,205,255);
|
||||
for ($red = 0; $red < 4; $red++) {
|
||||
for ($green = 0; $green < 4; $green++) {
|
||||
for ($blue = 0; $blue < 4; $blue++) {
|
||||
printf("\x1b]4;%d;rgb:%2.2x/%2.2x/%2.2x\x1b\\",
|
||||
16 + ($red * 16) + ($green * 4) + $blue,
|
||||
16 + (map_cube($red) * 16) + (map_cube($green) * 4) + map_cube($blue),
|
||||
int (@steps[$red]),
|
||||
int (@steps[$green]),
|
||||
int (@steps[$blue]));
|
||||
@ -24,7 +49,7 @@ for ($red = 0; $red < 4; $red++) {
|
||||
# colors 80-87 are a grayscale ramp, intentionally leaving out
|
||||
# black and white
|
||||
for ($gray = 0; $gray < 8; $gray++) {
|
||||
$level = ($gray * 23.18181818) + 46.36363636;
|
||||
$level = (map_gray($gray) * 23.18181818) + 46.36363636;
|
||||
if( $gray > 0 ) { $level += 23.18181818; }
|
||||
printf("\x1b]4;%d;rgb:%2.2x/%2.2x/%2.2x\x1b\\",
|
||||
80 + $gray, int($level), int($level), int($level));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $XTermId: wcwidth.c,v 1.19 2006/06/19 00:36:52 tom Exp $ */
|
||||
/* $XTermId: wcwidth.c,v 1.21 2007/06/13 00:14:29 tom Exp $ */
|
||||
|
||||
/* $XFree86: xc/programs/xterm/wcwidth.c,v 1.9 2006/06/19 00:36:52 dickey Exp $ */
|
||||
|
||||
@ -54,7 +54,7 @@
|
||||
*
|
||||
* http://www.unicode.org/unicode/reports/tr11/
|
||||
*
|
||||
* Markus Kuhn -- 2003-05-20 (Unicode 4.0)
|
||||
* Markus Kuhn -- 2007-05-25 (Unicode 5.0)
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software
|
||||
* for any purpose and without fee is hereby granted. The author
|
||||
@ -128,15 +128,17 @@ int mk_wcwidth(wchar_t ucs)
|
||||
unsigned long cmp = (unsigned long) ucs;
|
||||
|
||||
/* sorted list of non-overlapping intervals of non-spacing characters */
|
||||
/* generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c" */
|
||||
/* generated by
|
||||
* uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c
|
||||
*/
|
||||
static const struct interval combining[] = {
|
||||
{ 0x0300, 0x036F }, { 0x0483, 0x0486 }, { 0x0488, 0x0489 },
|
||||
{ 0x0591, 0x05B9 }, { 0x05BB, 0x05BD }, { 0x05BF, 0x05BF },
|
||||
{ 0x05C1, 0x05C2 }, { 0x05C4, 0x05C5 }, { 0x05C7, 0x05C7 },
|
||||
{ 0x0600, 0x0603 }, { 0x0610, 0x0615 }, { 0x064B, 0x065E },
|
||||
{ 0x0670, 0x0670 }, { 0x06D6, 0x06E4 }, { 0x06E7, 0x06E8 },
|
||||
{ 0x06EA, 0x06ED }, { 0x070F, 0x070F }, { 0x0711, 0x0711 },
|
||||
{ 0x0730, 0x074A }, { 0x07A6, 0x07B0 }, { 0x0901, 0x0902 },
|
||||
{ 0x0591, 0x05BD }, { 0x05BF, 0x05BF }, { 0x05C1, 0x05C2 },
|
||||
{ 0x05C4, 0x05C5 }, { 0x05C7, 0x05C7 }, { 0x0600, 0x0603 },
|
||||
{ 0x0610, 0x0615 }, { 0x064B, 0x065E }, { 0x0670, 0x0670 },
|
||||
{ 0x06D6, 0x06E4 }, { 0x06E7, 0x06E8 }, { 0x06EA, 0x06ED },
|
||||
{ 0x070F, 0x070F }, { 0x0711, 0x0711 }, { 0x0730, 0x074A },
|
||||
{ 0x07A6, 0x07B0 }, { 0x07EB, 0x07F3 }, { 0x0901, 0x0902 },
|
||||
{ 0x093C, 0x093C }, { 0x0941, 0x0948 }, { 0x094D, 0x094D },
|
||||
{ 0x0951, 0x0954 }, { 0x0962, 0x0963 }, { 0x0981, 0x0981 },
|
||||
{ 0x09BC, 0x09BC }, { 0x09C1, 0x09C4 }, { 0x09CD, 0x09CD },
|
||||
@ -150,31 +152,34 @@ int mk_wcwidth(wchar_t ucs)
|
||||
{ 0x0BCD, 0x0BCD }, { 0x0C3E, 0x0C40 }, { 0x0C46, 0x0C48 },
|
||||
{ 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, { 0x0CBC, 0x0CBC },
|
||||
{ 0x0CBF, 0x0CBF }, { 0x0CC6, 0x0CC6 }, { 0x0CCC, 0x0CCD },
|
||||
{ 0x0D41, 0x0D43 }, { 0x0D4D, 0x0D4D }, { 0x0DCA, 0x0DCA },
|
||||
{ 0x0DD2, 0x0DD4 }, { 0x0DD6, 0x0DD6 }, { 0x0E31, 0x0E31 },
|
||||
{ 0x0E34, 0x0E3A }, { 0x0E47, 0x0E4E }, { 0x0EB1, 0x0EB1 },
|
||||
{ 0x0EB4, 0x0EB9 }, { 0x0EBB, 0x0EBC }, { 0x0EC8, 0x0ECD },
|
||||
{ 0x0F18, 0x0F19 }, { 0x0F35, 0x0F35 }, { 0x0F37, 0x0F37 },
|
||||
{ 0x0F39, 0x0F39 }, { 0x0F71, 0x0F7E }, { 0x0F80, 0x0F84 },
|
||||
{ 0x0F86, 0x0F87 }, { 0x0F90, 0x0F97 }, { 0x0F99, 0x0FBC },
|
||||
{ 0x0FC6, 0x0FC6 }, { 0x102D, 0x1030 }, { 0x1032, 0x1032 },
|
||||
{ 0x1036, 0x1037 }, { 0x1039, 0x1039 }, { 0x1058, 0x1059 },
|
||||
{ 0x1160, 0x11FF }, { 0x135F, 0x135F }, { 0x1712, 0x1714 },
|
||||
{ 0x1732, 0x1734 }, { 0x1752, 0x1753 }, { 0x1772, 0x1773 },
|
||||
{ 0x17B4, 0x17B5 }, { 0x17B7, 0x17BD }, { 0x17C6, 0x17C6 },
|
||||
{ 0x17C9, 0x17D3 }, { 0x17DD, 0x17DD }, { 0x180B, 0x180D },
|
||||
{ 0x18A9, 0x18A9 }, { 0x1920, 0x1922 }, { 0x1927, 0x1928 },
|
||||
{ 0x1932, 0x1932 }, { 0x1939, 0x193B }, { 0x1A17, 0x1A18 },
|
||||
{ 0x1DC0, 0x1DC3 }, { 0x200B, 0x200F }, { 0x202A, 0x202E },
|
||||
{ 0x2060, 0x2063 }, { 0x206A, 0x206F }, { 0x20D0, 0x20EB },
|
||||
{ 0x302A, 0x302F }, { 0x3099, 0x309A }, { 0xA806, 0xA806 },
|
||||
{ 0xA80B, 0xA80B }, { 0xA825, 0xA826 }, { 0xFB1E, 0xFB1E },
|
||||
{ 0xFE00, 0xFE0F }, { 0xFE20, 0xFE23 }, { 0xFEFF, 0xFEFF },
|
||||
{ 0xFFF9, 0xFFFB }, { 0x10A01, 0x10A03 }, { 0x10A05, 0x10A06 },
|
||||
{ 0x10A0C, 0x10A0F }, { 0x10A38, 0x10A3A }, { 0x10A3F, 0x10A3F },
|
||||
{ 0x1D167, 0x1D169 }, { 0x1D173, 0x1D182 }, { 0x1D185, 0x1D18B },
|
||||
{ 0x1D1AA, 0x1D1AD }, { 0x1D242, 0x1D244 }, { 0xE0001, 0xE0001 },
|
||||
{ 0xE0020, 0xE007F }, { 0xE0100, 0xE01EF }
|
||||
{ 0x0CE2, 0x0CE3 }, { 0x0D41, 0x0D43 }, { 0x0D4D, 0x0D4D },
|
||||
{ 0x0DCA, 0x0DCA }, { 0x0DD2, 0x0DD4 }, { 0x0DD6, 0x0DD6 },
|
||||
{ 0x0E31, 0x0E31 }, { 0x0E34, 0x0E3A }, { 0x0E47, 0x0E4E },
|
||||
{ 0x0EB1, 0x0EB1 }, { 0x0EB4, 0x0EB9 }, { 0x0EBB, 0x0EBC },
|
||||
{ 0x0EC8, 0x0ECD }, { 0x0F18, 0x0F19 }, { 0x0F35, 0x0F35 },
|
||||
{ 0x0F37, 0x0F37 }, { 0x0F39, 0x0F39 }, { 0x0F71, 0x0F7E },
|
||||
{ 0x0F80, 0x0F84 }, { 0x0F86, 0x0F87 }, { 0x0F90, 0x0F97 },
|
||||
{ 0x0F99, 0x0FBC }, { 0x0FC6, 0x0FC6 }, { 0x102D, 0x1030 },
|
||||
{ 0x1032, 0x1032 }, { 0x1036, 0x1037 }, { 0x1039, 0x1039 },
|
||||
{ 0x1058, 0x1059 }, { 0x1160, 0x11FF }, { 0x135F, 0x135F },
|
||||
{ 0x1712, 0x1714 }, { 0x1732, 0x1734 }, { 0x1752, 0x1753 },
|
||||
{ 0x1772, 0x1773 }, { 0x17B4, 0x17B5 }, { 0x17B7, 0x17BD },
|
||||
{ 0x17C6, 0x17C6 }, { 0x17C9, 0x17D3 }, { 0x17DD, 0x17DD },
|
||||
{ 0x180B, 0x180D }, { 0x18A9, 0x18A9 }, { 0x1920, 0x1922 },
|
||||
{ 0x1927, 0x1928 }, { 0x1932, 0x1932 }, { 0x1939, 0x193B },
|
||||
{ 0x1A17, 0x1A18 }, { 0x1B00, 0x1B03 }, { 0x1B34, 0x1B34 },
|
||||
{ 0x1B36, 0x1B3A }, { 0x1B3C, 0x1B3C }, { 0x1B42, 0x1B42 },
|
||||
{ 0x1B6B, 0x1B73 }, { 0x1DC0, 0x1DCA }, { 0x1DFE, 0x1DFF },
|
||||
{ 0x200B, 0x200F }, { 0x202A, 0x202E }, { 0x2060, 0x2063 },
|
||||
{ 0x206A, 0x206F }, { 0x20D0, 0x20EF }, { 0x302A, 0x302F },
|
||||
{ 0x3099, 0x309A }, { 0xA806, 0xA806 }, { 0xA80B, 0xA80B },
|
||||
{ 0xA825, 0xA826 }, { 0xFB1E, 0xFB1E }, { 0xFE00, 0xFE0F },
|
||||
{ 0xFE20, 0xFE23 }, { 0xFEFF, 0xFEFF }, { 0xFFF9, 0xFFFB },
|
||||
{ 0x10A01, 0x10A03 }, { 0x10A05, 0x10A06 }, { 0x10A0C, 0x10A0F },
|
||||
{ 0x10A38, 0x10A3A }, { 0x10A3F, 0x10A3F }, { 0x1D167, 0x1D169 },
|
||||
{ 0x1D173, 0x1D182 }, { 0x1D185, 0x1D18B }, { 0x1D1AA, 0x1D1AD },
|
||||
{ 0x1D242, 0x1D244 }, { 0xE0001, 0xE0001 }, { 0xE0020, 0xE007F },
|
||||
{ 0xE0100, 0xE01EF }
|
||||
};
|
||||
|
||||
/* test for 8-bit control characters */
|
||||
@ -198,6 +203,7 @@ int mk_wcwidth(wchar_t ucs)
|
||||
cmp != 0x303f) || /* CJK ... Yi */
|
||||
(cmp >= 0xac00 && cmp <= 0xd7a3) || /* Hangul Syllables */
|
||||
(cmp >= 0xf900 && cmp <= 0xfaff) || /* CJK Compatibility Ideographs */
|
||||
(cmp >= 0xfe10 && cmp <= 0xfe19) || /* Vertical forms */
|
||||
(cmp >= 0xfe30 && cmp <= 0xfe6f) || /* CJK Compatibility Forms */
|
||||
(cmp >= 0xff00 && cmp <= 0xff60) || /* Fullwidth Forms */
|
||||
(cmp >= 0xffe0 && cmp <= 0xffe6) ||
|
||||
@ -232,7 +238,21 @@ int mk_wcswidth(const wchar_t *pwcs, size_t n)
|
||||
int mk_wcwidth_cjk(wchar_t ucs)
|
||||
{
|
||||
/* sorted list of non-overlapping intervals of East Asian Ambiguous
|
||||
* characters, generated by "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c" */
|
||||
* characters, generated by
|
||||
*
|
||||
* uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf \
|
||||
* +E000..F8FF \
|
||||
* +F0000..FFFFD \
|
||||
* +100000..10FFFD c
|
||||
*
|
||||
* "WIDTH-A" is a file extracted from EastAsianWidth.txt by selecting
|
||||
* only those with width "A", and omitting:
|
||||
*
|
||||
* 0xAD
|
||||
* all lines with "COMBINING"
|
||||
*
|
||||
* (uniset does not recognize the range expressions in WIDTH-A).
|
||||
*/
|
||||
static const struct interval ambiguous[] = {
|
||||
{ 0x00A1, 0x00A1 }, { 0x00A4, 0x00A4 }, { 0x00A7, 0x00A8 },
|
||||
{ 0x00AA, 0x00AA }, { 0x00AE, 0x00AE }, { 0x00B0, 0x00B4 },
|
||||
|
@ -1,10 +1,10 @@
|
||||
/* $XTermId: xstrings.c,v 1.25 2006/02/13 01:14:59 tom Exp $ */
|
||||
/* $XTermId: xstrings.c,v 1.26 2007/06/09 13:43:00 tom Exp $ */
|
||||
|
||||
/* $XFree86: xc/programs/xterm/xstrings.c,v 1.10 2006/02/13 01:14:59 dickey Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 2000-2005,2006 by Thomas E. Dickey
|
||||
Copyright 2000-2006,2007 by Thomas E. Dickey
|
||||
|
||||
All Rights Reserved
|
||||
|
||||
@ -55,6 +55,31 @@ x_basename(char *name)
|
||||
return (cp ? cp + 1 : name);
|
||||
}
|
||||
|
||||
char *
|
||||
x_getenv(const char *name)
|
||||
{
|
||||
return x_nonempty(getenv(name));
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if the given string is nonnull/nonempty. If so, return a pointer
|
||||
* to the beginning of its content, otherwise return null.
|
||||
*/
|
||||
char *
|
||||
x_nonempty(char *s)
|
||||
{
|
||||
if (s != 0) {
|
||||
if (*s == '\0') {
|
||||
s = 0;
|
||||
} else {
|
||||
s = x_skip_blanks(s);
|
||||
if (*s == '\0')
|
||||
s = 0;
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
char *
|
||||
x_skip_blanks(char *s)
|
||||
{
|
||||
|
@ -1,10 +1,10 @@
|
||||
/* $XTermId: xstrings.h,v 1.11 2006/02/13 01:14:59 tom Exp $ */
|
||||
/* $XTermId: xstrings.h,v 1.12 2007/06/09 13:35:28 tom Exp $ */
|
||||
|
||||
/* $XFree86: xc/programs/xterm/xstrings.h,v 1.5 2006/02/13 01:14:59 dickey Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 2000-2002,2005 by Thomas E. Dickey
|
||||
Copyright 2000-2006,2007 by Thomas E. Dickey
|
||||
|
||||
All Rights Reserved
|
||||
|
||||
@ -37,13 +37,15 @@ authorization.
|
||||
#ifndef included_xstrings_h
|
||||
#define included_xstrings_h 1
|
||||
|
||||
extern char *x_basename(char *name);
|
||||
extern char *x_skip_blanks(char *s);
|
||||
extern char *x_skip_nonblanks(char *s);
|
||||
extern char *x_strdup(const char *s);
|
||||
extern char *x_strindex(char *s1, char *s2);
|
||||
extern char *x_strtrim(char *s);
|
||||
extern int x_strcasecmp(const char *s1, const char *s2);
|
||||
extern int x_strncasecmp(const char *s1, const char *s2, unsigned n);
|
||||
extern char *x_basename(char * /* name */);
|
||||
extern char *x_getenv(const char * /* name */);
|
||||
extern char *x_nonempty(char * /* s */);
|
||||
extern char *x_skip_blanks(char * /* s */);
|
||||
extern char *x_skip_nonblanks(char * /* s */);
|
||||
extern char *x_strdup(const char * /* s */);
|
||||
extern char *x_strindex(char * /* s1 */, char * /* s2 */);
|
||||
extern char *x_strtrim(char * /* s */);
|
||||
extern int x_strcasecmp(const char * /* s1 */, const char * /* s2 */);
|
||||
extern int x_strncasecmp(const char * /* s1 */, const char * /* s2 */, unsigned /* n */);
|
||||
|
||||
#endif /* included_xstrings_h */
|
||||
|
10
app/xterm/xterm.desktop
Normal file
10
app/xterm/xterm.desktop
Normal file
@ -0,0 +1,10 @@
|
||||
# $XTermId: xterm.desktop,v 1.6 2007/06/17 00:55:01 tom Exp $
|
||||
[Desktop Entry]
|
||||
Name=XTerm
|
||||
Comment=standard terminal emulator for the X window system
|
||||
Exec=xterm
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Encoding=UTF-8
|
||||
Icon=xterm-color_48x48.xpm
|
||||
Categories=System;
|
@ -20,8 +20,7 @@
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF *
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
|
||||
*****************************************************************************
|
||||
$XTermId: xterm.log.html,v 1.545 2007/03/24 00:15:59 tom Exp $
|
||||
$XFree86: xc/programs/xterm/xterm.log.html,v 1.151 2006/06/20 00:42:38 dickey Exp $
|
||||
$XTermId: xterm.log.html,v 1.600 2007/08/12 17:32:04 tom Exp $
|
||||
-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
@ -46,6 +45,10 @@ Most of these are summarized in the XFree86 CHANGELOG
|
||||
is the latest version of this file.
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="#xterm_229">Patch #229 - 2008/8/12</A>
|
||||
<LI><A HREF="#xterm_228">Patch #228 - 2007/7/22</A>
|
||||
<LI><A HREF="#xterm_227">Patch #227 - 2007/6/27</A>
|
||||
<LI><A HREF="#xterm_226">Patch #226 - 2007/6/17</A>
|
||||
<LI><A HREF="#xterm_225">Patch #225 - 2007/3/24</A>
|
||||
<LI><A HREF="#xterm_224">Patch #224 - 2007/2/11</A>
|
||||
<LI><A HREF="#xterm_223">Patch #223 - 2006/11/30</A>
|
||||
@ -274,6 +277,210 @@ is the latest version of this file.
|
||||
<LI><A HREF="#xterm_01">Patch #1 - 1996/1/6</A>
|
||||
</UL>
|
||||
|
||||
<H1><A NAME="xterm_229">Patch #229 - 2008/8/12</A></H1>
|
||||
<ul>
|
||||
<li>override locale in minstall.sh;
|
||||
change in <a href="#xterm_226">patch #226</a>
|
||||
does not work in UTF-8 locale (report by Zdenek Sekera).
|
||||
|
||||
<li>undo an incorrect fix for a memory leak
|
||||
in <a href="#xterm_209">patch #209</a> (Debian #435858).
|
||||
</ul>
|
||||
|
||||
<H1><A NAME="xterm_228">Patch #228 - 2007/7/22</A></H1>
|
||||
<ul>
|
||||
<li>modify configure script to permit combining
|
||||
<code>--with-utempter</code>
|
||||
and <code>--enable-setuid</code>, e.g., for using xterm with
|
||||
the utempter library on FreeBSD (report by Andriy Gapon).
|
||||
|
||||
<li>modify "Quit" menu entry to override the <code>-hold</code>
|
||||
command-line option.
|
||||
|
||||
<li>add a check in the startup error-reporting to avoid writing to
|
||||
pipe when it has not been opened. In that case, report errors
|
||||
directly to the standard error.
|
||||
|
||||
<li>add OPT_READLINE definition to xtermcfg.hin, overlooked in
|
||||
<a href="#xterm_205">patch #205</a>
|
||||
(report by Kalle Olavi Niemitalo).
|
||||
|
||||
<li>modify <code>88colors2.pl</code> and <code>256colors2.pl</code>,
|
||||
adding <code>-r</code>
|
||||
option to reverse the palettes for the extended colors.
|
||||
|
||||
<li>check for partial overwrite or deletion of multi-column characters
|
||||
in several cases, e.g., insert-character, delete-character,
|
||||
etc.,
|
||||
and fill the remainder of the cells used by the multi-column
|
||||
characters affected with blanks.
|
||||
|
||||
<li>correct character-class codes in wide-character mode for characters
|
||||
215, 247 (see also <a href="#xterm_165">patch #165</a>).
|
||||
|
||||
<li>fix missing assignment for UTF-8 parsing in widget initialization
|
||||
(Debian #403360).
|
||||
|
||||
<li>correct index expression used to set line-wrapping flag, making
|
||||
selection from scrollback work consistently (Debian #430121,
|
||||
report by Vincent Lefevre).
|
||||
|
||||
<li>amend changes to handshake in
|
||||
<a href="#xterm_226">patch #226</a>
|
||||
to accommodate Solaris, which relies on the extra setting of
|
||||
the terminal size after I/O initialization.
|
||||
Do this by adding new resource <code>ptySttySize</code>,
|
||||
which is false for Linux and MacOS X, i.e., true for
|
||||
for Solaris and other SVR4 platforms, as well as FreeBSD
|
||||
(reports by David Wood, Renato Botelho).
|
||||
|
||||
<li>check for X events after cursor-left, and carriage return,
|
||||
consistent with indexing operations
|
||||
(comments by Vegard Nossum and Ingo Molnar on a mailing-list).
|
||||
|
||||
<li>initialize the <code>.keyboard</code> structure,
|
||||
needed for some platforms (such as Solaris) after
|
||||
<a href="#xterm_227">patch #227</a> fixes for keysyms
|
||||
(patch by David Wood).
|
||||
|
||||
<li>update config.guess, config.sub
|
||||
</ul>
|
||||
|
||||
<H1><A NAME="xterm_227">Patch #227 - 2007/6/27</A></H1>
|
||||
<ul>
|
||||
<li>exclude the Intel compiler from the extra gcc warning options
|
||||
added in
|
||||
<a href="#xterm_226">patch #226</a>.
|
||||
|
||||
<li>modify change for Debian #422521
|
||||
from <a href="#xterm_226">patch #226</a>
|
||||
to work with configurations where the X server does not
|
||||
recognize
|
||||
the <code>XF86Paste</code>
|
||||
or <code>SunPaste</code> keysyms (report by Paolo Pumilia).
|
||||
|
||||
<li>fix incorrect free in fix for "Selection" menu entry in
|
||||
<a href="#xterm_226">patch #226</a>.
|
||||
</ul>
|
||||
|
||||
<H1><A NAME="xterm_226">Patch #226 - 2007/6/17</A></H1>
|
||||
<ul>
|
||||
<li>add configure check to use <code>-Wno-unknown-pragmas</code> for
|
||||
Solaris, and a few other new gcc warning options to address
|
||||
regressions in its warning options.
|
||||
|
||||
<li>add sample desktop and icon files, along with configure options for
|
||||
manipulating them.
|
||||
|
||||
<li>fix an infinite loop when showing a 2-column character in a
|
||||
1-column screen (Debian #426863).
|
||||
|
||||
<li>add <code>XF86Paste</code> and <code>SunPaste</code> to the
|
||||
default translations (Debian #422521, patch by Bernhard R Link).
|
||||
|
||||
<li>update wcwidth.c (partly based on/prompted by mailing list
|
||||
comment).
|
||||
|
||||
<li>update/improve keysym2ucs.c based on Unicode 5.0.1d3 and Xorg
|
||||
7.1 keysymdef.h file.
|
||||
|
||||
<li>improve <code>gen-pc-fkeys.pl</code>, making it show all of the
|
||||
building-block terminfo entries used by xterm.
|
||||
|
||||
<li>correct strings used for modifiers applied to F1-F4 in xterm+pcf1
|
||||
terminfo entry.
|
||||
|
||||
<li>improve session management by adding the ICE connection number
|
||||
to the <code>select</code> call rather than waking up once per
|
||||
second (patch by Miroslav Lichvar).
|
||||
|
||||
<li>add environment variable <code>$XTERM_LOCALE</code> to help
|
||||
with shell initialization, e.g., to set a specific locale for
|
||||
xterm on systems where a global locale is set in the shell
|
||||
startup scripts.
|
||||
|
||||
<li>add resource settings <code>mkSampleSize</code> and
|
||||
<code>mkSamplePass</code>
|
||||
to modify the <code>mkWidth</code> added
|
||||
in <a href="#xterm_201">patch #201</a>.
|
||||
In <a href="#xterm_202">patch #202</a>,
|
||||
xterm would also check if the system's
|
||||
<code>wcwidth</code> matched its built-in tables
|
||||
"well enough" to be used when <code>mkWidth</code> was false,
|
||||
and if not would use the built-in tables anyway.
|
||||
These resources allow the user to customize the decision
|
||||
(prompted by comments by Emanuele Giaquinta)
|
||||
|
||||
<li>modify logic which resets/updates the screensize on the child
|
||||
process side of the pseudo-terminal to do this only if a
|
||||
successful handshake was received, e.g., as determined by
|
||||
the <code>waitForMap</code> resource (prompted by reports
|
||||
by Emanuele Giaquinta and Bernhard R Link, but see also
|
||||
<a href="#xterm_177">patch #177</a> and
|
||||
<a href="#xterm_159">patch #159</a>.
|
||||
|
||||
<li>improve permissions logic when closing pseudo-terminal
|
||||
(Debian #12261,
|
||||
patch by Nathanael Nerode,
|
||||
analysis by Richard Braakman).
|
||||
|
||||
<li>add resource <code>highlightReverse</code> which controls whether
|
||||
xterm will allow selection highlighting to hide reverse-video
|
||||
or use the older behavior which inverts the foreground and
|
||||
background colors when selected text with reverse-video attribute
|
||||
(report by Adam M Costello, comments by Victor Vaile).
|
||||
|
||||
<li>restore a special case for cursor-color in
|
||||
<code>ReverseVideo()</code>
|
||||
lost in rewrite for <a href="#xterm_224">patch #224</a>
|
||||
(report by Adam Sulmicki).
|
||||
|
||||
<li>correct initialization for menu entry for <code>bellIsUrgent</code>
|
||||
(patch by Emanuele Giaquinta).
|
||||
|
||||
<li>correct length of underlining for double-width Xft fonts
|
||||
(report by Shidai Liu "Leo").
|
||||
|
||||
<li>correct clipping for double-width Xft fonts
|
||||
(report by Shidai Liu "Leo").
|
||||
|
||||
<li>modify initialization for <code>italicULMode</code> to avoid
|
||||
<code>XftPatternBuild</code> reusing bold attributes
|
||||
(report by Shidai Liu "Leo").
|
||||
|
||||
<li>add a check in case someone tries to call the
|
||||
<code>popup-menu()</code> action on a menu which is not initialized
|
||||
(Debian #426364).
|
||||
|
||||
<li>improve CF_IMAKE_CFLAGS to work with Solaris sed (report by Peter
|
||||
Bray).
|
||||
|
||||
<li>improve guess for X's manpage section in <code>minstall.sh</code>,
|
||||
(prompted by comment by Miroslav Lichvar).
|
||||
|
||||
<li>modify <code>minstall.sh</code> to handle manpage patch with more
|
||||
than one dot (patch by Miroslav Lichvar).
|
||||
|
||||
<li>fix configure message for --disable-setgid option (patch by
|
||||
Miroslav Lichvar).
|
||||
|
||||
<li>add <code>allowTitleOps</code> resource to allow users to prevent
|
||||
the title- and icon-names from changing (request by John Bashinski).
|
||||
|
||||
<li>fix "spawn-new-terminal" action, for the case where no parameter
|
||||
is passed to the action (patch by Daniel Colascione).
|
||||
|
||||
<li>fix error-checking on internal font switching for "Selection"
|
||||
menu entry (Debian #421523).
|
||||
|
||||
<li>amend select/paste change from
|
||||
<a href="#xterm_225">patch #225</a>
|
||||
by limiting it to non-UTF-8/non-KOI8-R encoding (Debian #420974).
|
||||
|
||||
<li>add workaround for groff ".URL" codes which are not present in
|
||||
some commonly-used bitmap fonts (Debian #418324).
|
||||
</ul>
|
||||
|
||||
<H1><A NAME="xterm_225">Patch #225 - 2007/3/24</A></H1>
|
||||
<ul>
|
||||
<li>add <code>useClipping</code> resource to allow clipping to be
|
||||
@ -314,7 +521,7 @@ is the latest version of this file.
|
||||
<li>add "spawn-new-terminal" action, which can be assigned to key
|
||||
translation, allowing one to spawn a new copy of xterm using
|
||||
the current process' working directory (adapted from patch
|
||||
by Daniel Colascio).
|
||||
by Daniel Colascione).
|
||||
|
||||
<li>improve select/paste between UTF-8 and Latin1 xterms by adapting
|
||||
the translations from <a href="#xterm_185">patch #185</a>.
|
||||
@ -1337,7 +1544,8 @@ is the latest version of this file.
|
||||
<li>rename <code>$CMD</code> variable in <code>plink.sh</code> because
|
||||
it is a reserved symbol in bash 3.00.16 (report by Ted Taylor).
|
||||
|
||||
<li>add environment variables $XTERM_SHELL and $XTERM_VERSION
|
||||
<li>add environment variables <code>$XTERM_SHELL</code> and
|
||||
<code>$XTERM_VERSION</code>
|
||||
(request by Zdenek Sekera).
|
||||
|
||||
<li>corrected workaround for background color of menubar, which gave
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $XTermId: xtermcfg.hin,v 1.163 2007/03/21 22:05:18 tom Exp $ */
|
||||
/* $XTermId: xtermcfg.hin,v 1.166 2007/07/19 21:43:21 tom Exp $ */
|
||||
|
||||
/*
|
||||
* $XFree86: xc/programs/xterm/xtermcfg.hin,v 3.61 2006/06/19 00:36:52 dickey Exp $
|
||||
@ -80,6 +80,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#undef HAVE_WCWIDTH /* AC_CHECK_FUNCS(wcwidth) */
|
||||
#undef HAVE_X11_DECKEYSYM_H /* AC_CHECK_HEADERS(X11/DECkeysym.h) */
|
||||
#undef HAVE_X11_SUNKEYSYM_H /* AC_CHECK_HEADERS(X11/Sunkeysym.h) */
|
||||
#undef HAVE_X11_XF86KEYSYM_H /* AC_CHECK_HEADERS(X11/XF86keysym.h) */
|
||||
#undef HAVE_X11_XPOLL_H /* AC_CHECK_HEADERS(X11/Xpoll.h) */
|
||||
#undef HAVE_XFTDRAWSETCLIP /* CF_X_FREETYPE */
|
||||
#undef HAVE_XFTDRAWSETCLIPRECTANGLES /* CF_X_FREETYPE */
|
||||
@ -116,6 +117,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#undef OPT_PASTE64 /* CF_ARG_ENABLE(past64) */
|
||||
#undef OPT_PC_COLORS /* CF_ARG_DISABLE(pc-color) */
|
||||
#undef OPT_PTY_HANDSHAKE /* CF_ARG_ENABLE(pty-handshake) */
|
||||
#undef OPT_READLINE /* CF_ARG_ENABLE(readline-mouse) */
|
||||
#undef OPT_SAME_NAME /* CF_ARG_DISABLE(samename) */
|
||||
#undef OPT_SCO_FUNC_KEYS /* CF_ARG_ENABLE(sco-fkeys) */
|
||||
#undef OPT_SELECT_REGEX /* CF_ARG_DISABLE(regex) */
|
||||
@ -168,6 +170,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
#ifndef OPT_TRACE
|
||||
#undef OPT_TRACE /* CF_ARG_ENABLE(trace) */
|
||||
#undef OPT_TRACE_FLAGS /* ...no option */
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user