256colres.h                 |    2 
 256colres.pl                |    9 
 88colres.h                  |    2 
 88colres.pl                 |   10 
 INSTALL                     |   31 
 MANIFEST                    |   13 
 Makefile.in                 |   31 
 README                      |    4 
 Tekproc.c                   |   89 -
 aclocal.m4                  |   19 
 button.c                    |   15 
 cachedGCs.c                 |   45 
 charproc.c                  |  160 ++-
 configure                   | 2343 +++++++++++++++++++++++---------------------
 configure.in                |   35 
 data.c                      |    6 
 data.h                      |    4 
 fontutils.c                 |   80 -
 gen-pc-fkeys.pl             |  308 ++++-
 icons/xterm-color_32x32.xcf |binary
 icons/xterm-color_32x32.xpm |   46 
 icons/xterm-color_48x48.xcf |binary
 icons/xterm-color_48x48.xpm |   61 +
 icons/xterm_32x32.xcf       |binary
 icons/xterm_32x32.xpm       |   95 +
 icons/xterm_48x48.xcf       |binary
 icons/xterm_48x48.xpm       |   53 
 input.c                     |   32 
 keysym2ucs.c                |   54 -
 main.c                      |  126 +-
 menu.c                      |    7 
 minstall.sh                 |   17 
 misc.c                      |  126 +-
 mkdirs.sh                   |   19 
 os2main.c                   |  100 -
 ptydata.c                   |    4 
 ptyx.h                      |   19 
 resize.c                    |   23 
 resize.man                  |    4 
 run-tic.sh                  |    6 
 terminfo                    |   70 +
 trace.c                     |    7 
 unicode/convmap.pl          |   63 -
 unicode/keysym.map          | 2110 +++++++++++++++++++--------------------
 util.c                      |  236 ++--
 uxterm.desktop              |   10 
 version.h                   |    4 
 wcwidth.c                   |   90 +
 xstrings.c                  |   29 
 xstrings.h                  |   22 
 xterm.desktop               |   10 
 xterm.h                     |   37 
 xterm.log.html              |  126 ++
 xterm.man                   |   82 +
 xtermcfg.hin                |    3 
 55 files changed, 4145 insertions(+), 2752 deletions(-)

New commits:
commit f4b276156792bf4cefdf71406ec0f3935957071a
Author: Julien Cristau <[EMAIL PROTECTED]>
Date:   Sun Jun 17 22:12:37 2007 +0100

    Import xterm 226.

diff --git a/256colres.h b/256colres.h
index a84acd5..4b98391 100644
--- a/256colres.h
+++ b/256colres.h
@@ -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
diff --git a/256colres.pl b/256colres.pl
index a6b995e..a943af5 100755
--- a/256colres.pl
+++ b/256colres.pl
@@ -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
diff --git a/88colres.h b/88colres.h
index 94f428b..fcad714 100644
--- a/88colres.h
+++ b/88colres.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
diff --git a/88colres.pl b/88colres.pl
index 30a1a18..3fc4cd8 100755
--- a/88colres.pl
+++ b/88colres.pl
@@ -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
diff --git a/INSTALL b/INSTALL
index fd93f92..70c89c8 100644
--- a/INSTALL
+++ b/INSTALL
@@ -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.
diff --git a/MANIFEST b/MANIFEST
index 3bd259e..10ed0ba 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,4 +1,4 @@
-MANIFEST for xterm-225, version xterm-225
+MANIFEST for xterm-226, version xterm-226
 
--------------------------------------------------------------------------------
 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
diff --git a/Makefile.in b/Makefile.in
index 4dbca16..1d174bb 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,4 +1,4 @@
-## $XTermId: Makefile.in,v 1.145 2007/03/24 00:09:52 tom Exp $
+## $XTermId: Makefile.in,v 1.148 2007/06/16 18:47:51 tom Exp $
 ##
 ## $XFree86: xc/programs/xterm/Makefile.in,v 3.56 2006/06/19 00:36:50 dickey 
Exp $ ##
 ##
@@ -65,6 +65,7 @@ bindir                = @bindir@
 libdir         = @libdir@
 mandir         = @mandir@/man$(manext)
 appsdir                = @appsdir@
+icondir                = @icondir@
 
 #### End of system configuration section. ####
 
@@ -73,8 +74,9 @@ BINDIR                = $(DESTDIR)$(bindir)
 LIBDIR         = $(DESTDIR)$(libdir)
 MANDIR         = $(DESTDIR)$(mandir)
 APPSDIR                = $(DESTDIR)$(appsdir)
+ICONDIR                = $(DESTDIR)$(icondir)
 
-INSTALL_DIRS    = $(BINDIR) $(APPSDIR) $(MANDIR)
+INSTALL_DIRS    = $(BINDIR) $(APPSDIR) $(ICONDIR) $(MANDIR)
 
 CLASS          = XTerm
 EXTRAHDR       = @EXTRAHDRS@
@@ -209,6 +211,16 @@ install-full :: $(MANDIR)
 @no_appsdir@   @sed -e s/XTerm/$(CLASS)/ $(srcdir)/UXTerm.ad >XTerm.tmp
 @no_appsdir@   @$(INSTALL_DATA) XTerm.tmp $(APPSDIR)/UXTerm
 @no_appsdir@   @rm -f XTerm.tmp
[EMAIL PROTECTED]@      @echo "... installed app-defaults"
+
[EMAIL PROTECTED]@install \
[EMAIL PROTECTED]@install-icon \
[EMAIL PROTECTED]@install-full :: $(ICONDIR)
[EMAIL PROTECTED]@      @$(INSTALL_DATA) $(srcdir)/icons/xterm-color_32x32.xpm 
$(ICONDIR)
[EMAIL PROTECTED]@      @$(INSTALL_DATA) $(srcdir)/icons/xterm-color_48x48.xpm 
$(ICONDIR)
[EMAIL PROTECTED]@      @$(INSTALL_DATA) $(srcdir)/icons/xterm_32x32.xpm 
$(ICONDIR)
[EMAIL PROTECTED]@      @$(INSTALL_DATA) $(srcdir)/icons/xterm_48x48.xpm 
$(ICONDIR)
[EMAIL PROTECTED]@      @echo "... installed icons"
 
 install ::
        @echo 'Completed installation of executables and documentation.'
@@ -249,6 +261,21 @@ uninstall-full ::
 @no_appsdir@   -$(RM) $(APPSDIR)/$(CLASS)
 @no_appsdir@   -$(RM) $(APPSDIR)/$(CLASS)-color
 @no_appsdir@   -$(RM) $(APPSDIR)/UXTerm
+
[EMAIL PROTECTED]@uninstall \
[EMAIL PROTECTED]@uninstall-icon \
[EMAIL PROTECTED]@uninstall-full ::
[EMAIL PROTECTED]@      -$(RM) $(ICONDIR)/xterm-color_32x32.xpm
[EMAIL PROTECTED]@      -$(RM) $(ICONDIR)/xterm_48x48.xpm
[EMAIL PROTECTED]@      -$(RM) $(ICONDIR)/xterm-color_32x32.xpm
[EMAIL PROTECTED]@      -$(RM) $(ICONDIR)/xterm_48x48.xpm
+################################################################################
+# Desktop-utils does not provide an uninstall, and is not uniformly available.
[EMAIL PROTECTED]@DESKTOP_FLAGS = @DESKTOP_FLAGS@
[EMAIL PROTECTED]@install-desktop \
[EMAIL PROTECTED]@install-full ::
[EMAIL PROTECTED]@      desktop-file-install $(DESKTOP_FLAGS) xterm.desktop
[EMAIL PROTECTED]@      desktop-file-install $(DESKTOP_FLAGS) uxterm.desktop
 
################################################################################
 mostlyclean :
        -$(RM) *$o *.[is] XtermLog.* .pure core *~ *.bak *.BAK *.out *.tmp
diff --git a/README b/README
index f098b04..76328f4 100644
--- a/README
+++ b/README
@@ -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
 
 
diff --git a/Tekproc.c b/Tekproc.c
index 674c93c..8d2a97b 100644
--- a/Tekproc.c
+++ b/Tekproc.c
@@ -1,4 +1,4 @@
-/* $XTermId: Tekproc.c,v 1.155 2007/03/19 23:51:52 tom Exp $ */
+/* $XTermId: Tekproc.c,v 1.156 2007/05/28 19:08:33 tom Exp $ */
 
 /*
  * Warning, there be crufty dragons here.
@@ -956,20 +956,22 @@ TekExpose(Widget w,
 void
 TekRefresh(TekWidget tw)
 {
-    TekScreen *tekscr = TekScreenOf(tw);
-    TScreen *screen = TScreenOf(term);
-    static Cursor wait_cursor = None;
-
-    if (wait_cursor == None)
-       wait_cursor = make_colored_cursor(XC_watch,
-                                         T_COLOR(screen, MOUSE_FG),
-                                         T_COLOR(screen, MOUSE_BG));
-    XDefineCursor(XtDisplay(tw), TWindow(tekscr), wait_cursor);
-    XFlush(XtDisplay(tw));
-    if (!setjmp(Tekjump))
-       Tekparse(tw);
-    XDefineCursor(XtDisplay(tw), TWindow(tekscr),
-                 (tekscr->TekGIN && GINcursor) ? GINcursor : tekscr->arrow);
+    if (tw != 0) {
+       TekScreen *tekscr = TekScreenOf(tw);
+       TScreen *screen = TScreenOf(term);
+       static Cursor wait_cursor = None;
+
+       if (wait_cursor == None)
+           wait_cursor = make_colored_cursor(XC_watch,
+                                             T_COLOR(screen, MOUSE_FG),
+                                             T_COLOR(screen, MOUSE_BG));
+       XDefineCursor(XtDisplay(tw), TWindow(tekscr), wait_cursor);
+       XFlush(XtDisplay(tw));
+       if (!setjmp(Tekjump))
+           Tekparse(tw);
+       XDefineCursor(XtDisplay(tw), TWindow(tekscr),
+                     (tekscr->TekGIN && GINcursor) ? GINcursor : 
tekscr->arrow);
+    }
 }
 
 void
@@ -1843,38 +1845,41 @@ TekSimulatePageButton(TekWidget tw, Bool reset)
 void
 TekCopy(TekWidget tw)
 {
-    TekScreen *tekscr = TekScreenOf(tw);
-    TScreen *screen = TScreenOf(term);
+    if (tw != 0) {
+       TekScreen *tekscr = TekScreenOf(tw);
+       TScreen *screen = TScreenOf(term);
 
-    TekLink *Tp;
-    char buf[32];
-    char initbuf[5];
-    int tekcopyfd;
+       TekLink *Tp;
+       char buf[32];
+       char initbuf[5];
+       int tekcopyfd;
 
-    timestamp_filename(buf, "COPY");
-    if (access(buf, F_OK) >= 0
-       && access(buf, W_OK) < 0) {
-       Bell(XkbBI_MinorError, 0);
-       return;
-    }
+       timestamp_filename(buf, "COPY");
+       if (access(buf, F_OK) >= 0
+           && access(buf, W_OK) < 0) {
+           Bell(XkbBI_MinorError, 0);
+           return;
+       }
 #ifndef VMS
-    if (access(".", W_OK) < 0) {       /* can't write in directory */
-       Bell(XkbBI_MinorError, 0);
-       return;
-    }
+       if (access(".", W_OK) < 0) {    /* can't write in directory */
+           Bell(XkbBI_MinorError, 0);
+           return;
+       }
 #endif
 
-    if ((tekcopyfd = open_userfile(screen->uid, screen->gid, buf, False)) >= 
0) {
-       sprintf(initbuf, "%c%c%c%c",
-               ANSI_ESC, (char) (tekscr->page.fontsize + '8'),
-               ANSI_ESC, (char) (tekscr->page.linetype + '`'));
-       write(tekcopyfd, initbuf, 4);
-       Tp = &Tek0;
-       do {
-           write(tekcopyfd, Tp->data, Tp->count);
-           Tp = Tp->next;
-       } while (Tp);
-       close(tekcopyfd);
+       tekcopyfd = open_userfile(screen->uid, screen->gid, buf, False);
+       if (tekcopyfd >= 0) {
+           sprintf(initbuf, "%c%c%c%c",
+                   ANSI_ESC, (char) (tekscr->page.fontsize + '8'),
+                   ANSI_ESC, (char) (tekscr->page.linetype + '`'));
+           write(tekcopyfd, initbuf, 4);
+           Tp = &Tek0;
+           do {
+               write(tekcopyfd, Tp->data, Tp->count);
+               Tp = Tp->next;
+           } while (Tp);
+           close(tekcopyfd);
+       }
     }
 }
 
diff --git a/aclocal.m4 b/aclocal.m4
index 9ea6d3e..9931f12 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -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.244 2007/05/25 00:58:44 tom Exp $
 dnl
 dnl $XFree86: xc/programs/xterm/aclocal.m4,v 3.65 2006/06/19 00:36:50 dickey 
Exp $
 dnl
@@ -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
diff --git a/button.c b/button.c
index 8fe65e3..9f469bc 100644
--- a/button.c
+++ b/button.c
@@ -1,4 +1,4 @@
-/* $XTermId: button.c,v 1.272 2007/03/19 23:42:48 tom Exp $ */
+/* $XTermId: button.c,v 1.274 2007/06/17 12:55:47 tom Exp $ */
 
 /*
  * Copyright 1999-2006,2007 by Thomas E. Dickey
@@ -1039,8 +1039,8 @@ struct _SelectionList {
     Time time;
 };
 
-static int
-DECtoASCII(int ch)
+static unsigned
+DECtoASCII(unsigned ch)
 {
     if (ch < 32) {
        ch = "###########+++++##-##++++|######"[ch];
@@ -1087,7 +1087,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 +1611,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) {
@@ -3492,7 +3493,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 +3508,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)
diff --git a/cachedGCs.c b/cachedGCs.c
index ca699fb..720b884 100644
--- a/cachedGCs.c
+++ b/cachedGCs.c
@@ -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
diff --git a/charproc.c b/charproc.c
index 1fba22b..1f22734 100644
--- a/charproc.c
+++ b/charproc.c
@@ -1,4 +1,4 @@
-/* $XTermId: charproc.c,v 1.784 2007/03/20 23:59:25 tom Exp $ */
+/* $XTermId: charproc.c,v 1.797 2007/06/17 12:52:35 tom Exp $ */
 
 /* $XFree86: xc/programs/xterm/charproc.c,v 3.185 2006/06/20 00:42:38 dickey 
Exp $ */
 
@@ -116,6 +116,14 @@ in this Software without prior written authorization from 
The Open Group.
 #include <X11/Xlocale.h>
 #endif
 
+#if HAVE_X11_SUNKEYSYM_H
+#include <X11/Sunkeysym.h>
+#endif
+
+#if HAVE_X11_XF86KEYSYM_H
+#include <X11/XF86keysym.h>
+#endif
+
 #include <stdio.h>
 #include <ctype.h>
 
@@ -220,6 +228,18 @@ static char defaultTranslations[] =
          Shift <KeyPress> Select:select-cursor-start() 
select-cursor-end(SELECT, CUT_BUFFER0) \n\
          Shift <KeyPress> Insert:insert-selection(SELECT, CUT_BUFFER0) \n\
 "
+#if OPT_EXTRA_PASTE
+#ifdef XF86XK_Paste
+"\
+            <KeyPress> XF86Paste:insert-selection(SELECT, CUT_BUFFER0) \n\
+"
+#endif
+#ifdef SunXK_Paste
+"\
+             <KeyPress> SunPaste:insert-selection(SELECT, CUT_BUFFER0) \n\
+"
+#endif
+#endif                         /* OPT_EXTRA_PASTE */
 #if OPT_SHIFT_FONTS
 "\
     Shift~Ctrl <KeyPress> KP_Add:larger-vt-font() \n\
@@ -399,6 +419,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 +571,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 +678,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),
@@ -1214,7 +1238,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)) {
@@ -3266,13 +3290,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)
@@ -3409,6 +3428,8 @@ 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))
@@ -3438,8 +3459,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 +3469,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;
@@ -5569,10 +5592,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 +5776,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
@@ -5809,6 +5835,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 +5873,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);
@@ -6018,6 +6059,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) {
@@ -6710,6 +6752,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 +6855,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 +6870,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 +6900,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
@@ -7483,17 +7550,20 @@ 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 = strlen((char *) value);
 
-       if (len > (int) *length) {
-           len = (int) *length;
+       if (len > (unsigned) *length) {
+           len = (unsigned) *length;
        }
-       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 +7579,25 @@ 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);
        }
     }
 }
diff --git a/configure b/configure
index 01807e1..d097bde 100755
--- a/configure
+++ b/configure
@@ -684,6 +684,8 @@ Optional Packages:
 Compile/Install Options:
   --disable-full-tgetent  disable check for full tgetent function
   --with-app-defaults=DIR directory in which to install resource files 
(default: EPREFIX/lib/X11/app-defaults)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to