MANIFEST       |    3 
 Tekproc.c      |   22 ++-
 VTPrsTbl.c     |  340 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 VTparse.def    |    5 
 VTparse.h      |    6 
 button.c       |  375 ++++++++++++++++++++++++++++++++++++---------------------
 charproc.c     |  250 +++++++++++++++++++++++++-------------
 ctlseqs.ms     |  210 ++++++++++++++++++++++---------
 ctlseqs.txt    |  153 +++++++++++++++--------
 fontutils.c    |   66 +++++-----
 fontutils.h    |    4 
 misc.c         |  363 +++++++++++++++++++++++++++++++++++++++++++++++++++----
 ptyx.h         |   17 +-
 screen.c       |   36 +++++
 trace.h        |   47 ++++++-
 util.c         |   45 +++++-
 version.h      |    4 
 vms.c          |    5 
 vms.h          |    2 
 xcharmouse.h   |    5 
 xterm.h        |   15 +-
 xterm.log.html |   93 +++++++++++++-
 xterm.man      |  370 ++++++++++++++++++++++++++++----------------------------
 xutf8.h        |    8 -
 24 files changed, 1828 insertions(+), 616 deletions(-)

New commits:
commit 7c49776bdc523ca345d765ef91020b9726346e71
Author: Cyril Brulebois <k...@debian.org>
Date:   Fri Oct 22 21:05:11 2010 +0200

    Import xterm 265

diff --git a/MANIFEST b/MANIFEST
index 5f04908..fb673de 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,4 +1,4 @@
-MANIFEST for xterm-264, version xterm-264
+MANIFEST for xterm-265, version xterm-265
 
--------------------------------------------------------------------------------
 MANIFEST                        this file
 256colres.h                     resource-definitions for 256-color mode
diff --git a/button.c b/button.c
index abaa880..9693186 100644
--- a/button.c
+++ b/button.c
@@ -1,4 +1,4 @@
-/* $XTermId: button.c,v 1.389 2010/10/13 09:37:08 tom Exp $ */
+/* $XTermId: button.c,v 1.390 2010/10/22 00:53:57 tom Exp $ */
 
 /*
  * Copyright 1999-2009,2010 by Thomas E. Dickey
@@ -180,9 +180,10 @@ EmitMousePosition(TScreen * screen, Char line[], unsigned 
count, int value)
                       ? EXT_MOUSE_LIMIT
                       : MOUSE_LIMIT);
 
-    /* Add pointer position to key sequence
-
-     * In extended mode we encode large positions as two-byte UTF-8 
+    /*
+     * Add pointer position to key sequence
+     *
+     * In extended mode we encode large positions as two-byte UTF-8.
      *
      * NOTE: historically, it was possible to emit 256, which became
      * zero by truncation to 8 bits. While this was arguably a bug,
@@ -211,29 +212,30 @@ SendMousePosition(XtermWidget xw, XEvent * event)
     switch (screen->send_mouse_pos) {
     case MOUSE_OFF:
        /* If send_mouse_pos mode isn't on, we shouldn't be here */
-       return False;
+       break;
 
     case BTN_EVENT_MOUSE:
     case ANY_EVENT_MOUSE:
-       /* xterm extension for motion reporting. June 1998 */
-       /* EditorButton() will distinguish between the modes */
-       switch (event->type) {
-       case MotionNotify:
-           my_event->button = 0;
-           /* FALLTHRU */
-       case ButtonPress:
-           /* FALLTHRU */
-       case ButtonRelease:
-           EditorButton(xw, my_event);
-           result = True;
-           break;
+       if (KeyModifiers(event) == 0 || KeyModifiers(event) == ControlMask) {
+           /* xterm extension for motion reporting. June 1998 */
+           /* EditorButton() will distinguish between the modes */
+           switch (event->type) {
+           case MotionNotify:
+               my_event->button = 0;
+               /* FALLTHRU */
+           case ButtonPress:
+               /* FALLTHRU */
+           case ButtonRelease:
+               EditorButton(xw, my_event);
+               result = True;
+               break;
+           }
        }
        break;
 
     default:
        /* Make sure the event is an appropriate type */
        if (IsBtnEvent(event)) {
-
            switch (screen->send_mouse_pos) {
            case X10_MOUSE:     /* X10 compatibility sequences */
 
@@ -315,7 +317,6 @@ SendLocatorPosition(XtermWidget xw, XButtonEvent * event)
 
     /* Make sure the event is an appropriate type */
     if ((!IsBtnEvent(event) &&
-
         !screen->loc_filter) ||
        (BtnModifiers(event) != 0 && BtnModifiers(event) != ControlMask))
        return (False);
diff --git a/fontutils.c b/fontutils.c
index 34c6498..2fce86a 100644
--- a/fontutils.c
+++ b/fontutils.c
@@ -1,4 +1,4 @@
-/* $XTermId: fontutils.c,v 1.350 2010/10/14 09:27:25 tom Exp $ */
+/* $XTermId: fontutils.c,v 1.351 2010/10/22 09:02:10 tom Exp $ */
 
 /************************************************************
 
@@ -235,7 +235,7 @@ check_fontname(const char *name)
 {
     Boolean result = True;
 
-    if (name == 0) {
+    if (IsEmpty(name)) {
        TRACE(("fontname missing\n"));
        result = False;
     } else if (strlen(name) >= MAX_FONTNAME - 1) {
@@ -1238,7 +1238,7 @@ typedef struct {
 } SubResourceRec;
 
 #define MERGE_SUBFONT(src,dst,name) \
-       if (dst.name == 0) { \
+       if (IsEmpty(dst.name)) { \
            TRACE(("MERGE_SUBFONT " #dst "." #name " merge %s\n", 
NonNull(src.name))); \
            dst.name = src.name; \
        } else { \
@@ -1294,7 +1294,7 @@ xtermLoadVTFonts(XtermWidget xw, String myName, String 
myClass)
        COPY_MENU_FONTS(xw->screen, original);
     }
 
-    if (myName == 0 || *myName == 0) {
+    if (IsEmpty(myName)) {
        TRACE(("xtermLoadVTFonts restoring original\n"));
        xw->misc.default_font = original.default_font;
        COPY_MENU_FONTS(original, xw->screen);
diff --git a/version.h b/version.h
index b3f1260..a234208 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
 /*
- * $XTermId: version.h,v 1.322 2010/10/14 08:33:49 tom Exp $
+ * $XTermId: version.h,v 1.323 2010/10/22 00:54:53 tom Exp $
  * ----------------------------------------------------------------------------
  * this file is part of xterm
  *
@@ -39,7 +39,7 @@
  * version of X to which this version of xterm has been built.  The number in
  * parentheses is my patch number (Thomas E. Dickey).
  */
-#define XTERM_PATCH   264
+#define XTERM_PATCH   265
 
 #ifndef __vendorversion__
 #define __vendorversion__ "XTerm"
diff --git a/xterm.log.html b/xterm.log.html
index 8f33190..32a554f 100644
--- a/xterm.log.html
+++ b/xterm.log.html
@@ -31,7 +31,7 @@
  * sale, use or other dealings in this Software without prior written        *
  * authorization.                                                            *
  *****************************************************************************
-  $XTermId: xterm.log.html,v 1.977 2010/10/14 08:53:32 tom Exp $
+  $XTermId: xterm.log.html,v 1.980 2010/10/22 09:54:49 tom Exp $
   -->
 <HTML>
 <HEAD>
@@ -56,6 +56,7 @@ Most of these are summarized in the XFree86 CHANGELOG
 is the latest version of this file.
 
 <UL>
+<LI><A HREF="#xterm_265">Patch #265 - 2010/10/22</A>
 <LI><A HREF="#xterm_264">Patch #264 - 2010/10/14</A>
 <LI><A HREF="#xterm_263">Patch #263 - 2010/10/13</A>
 <LI><A HREF="#xterm_262">Patch #262 - 2010/8/30</A>
@@ -323,6 +324,18 @@ is the latest version of this file.
 <LI><A HREF="#xterm_01">Patch #1 - 1996/1/6</A>
 </UL>
 
+<H1><A NAME="xterm_265">Patch #265 - 2010/10/22</A></H1>
+<ul>
+       <li>fix a regression in fontname logic from 
+           <a href="#xterm_263">patch #263</a> changes
+           (Debian #600707, reported by Vincent Lefevre).
+
+       <li>revert modification of any-event/any-button protocol from
+           <a href="#xterm_263">patch #263</a> changes.
+           It interferes with selection using a
+           shifted mouse button (reports by Neil Bird, Bram Moolenaar).
+</ul>
+
 <H1><A NAME="xterm_264">Patch #264 - 2010/10/14</A></H1>
 <ul>
        <li>replace a null-pointer check with check for empty string in

commit 53211c86b585e9586d68fafc83be7ae98da7a569
Author: Cyril Brulebois <k...@debian.org>
Date:   Thu Oct 14 20:46:56 2010 +0200

    Import xterm 264

diff --git a/MANIFEST b/MANIFEST
index 19c0128..5f04908 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,4 +1,4 @@
-MANIFEST for xterm-263, version xterm-263
+MANIFEST for xterm-264, version xterm-264
 
--------------------------------------------------------------------------------
 MANIFEST                        this file
 256colres.h                     resource-definitions for 256-color mode
diff --git a/Tekproc.c b/Tekproc.c
index f6d8aef..a7bcf8f 100644
--- a/Tekproc.c
+++ b/Tekproc.c
@@ -1,4 +1,4 @@
-/* $XTermId: Tekproc.c,v 1.183 2010/10/13 22:36:12 tom Exp $ */
+/* $XTermId: Tekproc.c,v 1.184 2010/10/14 08:07:03 tom Exp $ */
 
 /*
  *
@@ -1396,9 +1396,10 @@ TekInitialize(Widget wrequest,
 
     init_Sres(tek.initial_font);
     init_Sres(tek.gin_terminator_str);
+#if OPT_TOOLBAR
     init_Ires(tek.tb_info.menu_height);
-
     wnew->tek.tb_info.menu_bar = request->tek.tb_info.menu_bar;
+#endif
 }
 
 static void
diff --git a/fontutils.c b/fontutils.c
index ae75ddd..34c6498 100644
--- a/fontutils.c
+++ b/fontutils.c
@@ -1,4 +1,4 @@
-/* $XTermId: fontutils.c,v 1.348 2010/10/11 08:26:24 tom Exp $ */
+/* $XTermId: fontutils.c,v 1.350 2010/10/14 09:27:25 tom Exp $ */
 
 /************************************************************
 
@@ -745,7 +745,7 @@ xtermOpenFont(XtermWidget xw,
     Bool code = False;
     TScreen *screen = TScreenOf(xw);
 
-    if (name != 0) {
+    if (!IsEmpty(name)) {
        if ((result->fs = XLoadQueryFont(screen->display, name)) != 0) {
            code = True;
            if (EmptyFont(result->fs)) {
@@ -761,7 +761,7 @@ xtermOpenFont(XtermWidget xw,
 #endif
                ) {
                TRACE(("OOPS: cannot load font %s\n", name));
-               fprintf(stderr, "%s: cannot load font %s\n", ProgramName, name);
+               fprintf(stderr, "%s: cannot load font '%s'\n", ProgramName, 
name);
 #if OPT_RENDERFONT
                /*
                 * Do a sanity check in case someone's mixed up xterm with
@@ -774,7 +774,7 @@ xtermOpenFont(XtermWidget xw,
                }
 #endif
            } else {
-               TRACE(("xtermOpenFont: cannot load font %s\n", name));
+               TRACE(("xtermOpenFont: cannot load font '%s'\n", name));
            }
            if (force) {
                code = xtermOpenFont(xw, DEFFONT, result, fwAlways, True);
@@ -932,7 +932,7 @@ xtermLoadFont(XtermWidget xw,
                myfonts.f_b = bold_font_name(fp, -1);
                xtermOpenFont(xw, myfonts.f_b, &fnts[fBold], fwAlways, False);
            }
-           TRACE(("...derived bold %s\n", NonNull(myfonts.f_b)));
+           TRACE(("...derived bold '%s'\n", NonNull(myfonts.f_b)));
        }
        if (fp == 0 || fnts[fBold].fs == 0) {
            xtermCopyFontInfo(&fnts[fBold], &fnts[fNorm]);
@@ -949,7 +949,7 @@ xtermLoadFont(XtermWidget xw,
     } else if (!xtermOpenFont(xw, myfonts.f_b, &fnts[fBold], warn[fBold], 
False)) {
        xtermCopyFontInfo(&fnts[fBold], &fnts[fNorm]);
        warn[fBold] = fwAlways;
-       TRACE(("...cannot load bold font %s\n", NonNull(myfonts.f_b)));
+       TRACE(("...cannot load bold font '%s'\n", NonNull(myfonts.f_b)));
     } else {
        cache_menu_font_name(screen, fontnum, fBold, myfonts.f_b);
     }
diff --git a/version.h b/version.h
index 09b5ddd..b3f1260 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
 /*
- * $XTermId: version.h,v 1.321 2010/08/31 09:28:23 tom Exp $
+ * $XTermId: version.h,v 1.322 2010/10/14 08:33:49 tom Exp $
  * ----------------------------------------------------------------------------
  * this file is part of xterm
  *
@@ -39,7 +39,7 @@
  * version of X to which this version of xterm has been built.  The number in
  * parentheses is my patch number (Thomas E. Dickey).
  */
-#define XTERM_PATCH   263
+#define XTERM_PATCH   264
 
 #ifndef __vendorversion__
 #define __vendorversion__ "XTerm"
diff --git a/xterm.log.html b/xterm.log.html
index 40af947..8f33190 100644
--- a/xterm.log.html
+++ b/xterm.log.html
@@ -31,7 +31,7 @@
  * sale, use or other dealings in this Software without prior written        *
  * authorization.                                                            *
  *****************************************************************************
-  $XTermId: xterm.log.html,v 1.972 2010/10/14 00:56:43 tom Exp $
+  $XTermId: xterm.log.html,v 1.977 2010/10/14 08:53:32 tom Exp $
   -->
 <HTML>
 <HEAD>
@@ -56,6 +56,7 @@ Most of these are summarized in the XFree86 CHANGELOG
 is the latest version of this file.
 
 <UL>
+<LI><A HREF="#xterm_264">Patch #264 - 2010/10/14</A>
 <LI><A HREF="#xterm_263">Patch #263 - 2010/10/13</A>
 <LI><A HREF="#xterm_262">Patch #262 - 2010/8/30</A>
 <LI><A HREF="#xterm_261">Patch #261 - 2010/6/28</A>
@@ -322,6 +323,20 @@ is the latest version of this file.
 <LI><A HREF="#xterm_01">Patch #1 - 1996/1/6</A>
 </UL>
 
+<H1><A NAME="xterm_264">Patch #264 - 2010/10/14</A></H1>
+<ul>
+       <li>replace a null-pointer check with check for empty string in
+           <code>xtermOpenFont</code>,
+           to eliminate a warning message from
+           <a href="#xterm_263">patch #263</a> changes.
+
+       <li>build-fix for <a href="#xterm_263">patch #263</a> when toolbar
+           is not configured
+           (patch by Chris Clayton)
+           (reports by Robby Workman,
+           David Wood).
+</ul>
+
 <H1><A NAME="xterm_263">Patch #263 - 2010/10/13</A></H1>
 <ul>
        <li>corrected initialization of "misc" resource values, to ensure that

commit 8c1068177b9bdc4c888b2754f12d8436a86120c1
Author: Cyril Brulebois <k...@debian.org>
Date:   Thu Oct 14 20:46:39 2010 +0200

    Import xterm 263

diff --git a/MANIFEST b/MANIFEST
index 5667149..19c0128 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,4 +1,4 @@
-MANIFEST for xterm-262, version xterm-262
+MANIFEST for xterm-263, version xterm-263
 
--------------------------------------------------------------------------------
 MANIFEST                        this file
 256colres.h                     resource-definitions for 256-color mode
diff --git a/Tekproc.c b/Tekproc.c
index 920d1c3..f6d8aef 100644
--- a/Tekproc.c
+++ b/Tekproc.c
@@ -1,4 +1,4 @@
-/* $XTermId: Tekproc.c,v 1.182 2010/06/20 21:34:37 tom Exp $ */
+/* $XTermId: Tekproc.c,v 1.183 2010/10/13 22:36:12 tom Exp $ */
 
 /*
  *
@@ -108,6 +108,7 @@
 #include <data.h>
 #include <error.h>
 #include <menu.h>
+#include <xstrings.h>
 
 #define DefaultGCID XGContextFromGC(DefaultGC(XtDisplay(tw), 
DefaultScreen(XtDisplay(tw))))
 
@@ -1358,15 +1359,18 @@ static unsigned char *dashes[TEKNUMLINES] =
  */
 
 static void
-TekInitialize(Widget request GCC_UNUSED,
-             Widget wnew GCC_UNUSED,
+TekInitialize(Widget wrequest,
+             Widget new_arg,
              ArgList args GCC_UNUSED,
              Cardinal *num_args GCC_UNUSED)
 {
+    TekWidget request = (TekWidget) wrequest;
+    TekWidget wnew = (TekWidget) new_arg;
     Widget tekparent = SHELL_OF(wnew);
 #ifndef NO_ACTIVE_ICON
     TekScreen *screen = TekScreenOf((TekWidget) wnew);
 #endif
+    int n;
 
     TRACE(("TekInitialize\n"));
 
@@ -1379,13 +1383,22 @@ TekInitialize(Widget request GCC_UNUSED,
                      HandleLeaveWindow, (Opaque) 0);
     XtAddEventHandler(tekparent, FocusChangeMask, False,
                      HandleFocusChange, (Opaque) 0);
-    XtAddEventHandler(wnew, PropertyChangeMask, False,
+    XtAddEventHandler(new_arg, PropertyChangeMask, False,
                      HandleBellPropertyChange, (Opaque) 0);
 
 #ifndef NO_ACTIVE_ICON
     screen->whichTwin = &(screen->fullTwin);
 #endif /* NO_ACTIVE_ICON */
 
+    for (n = 0; n < TEKNUMFONTS; ++n) {
+       wnew->tek.Tfont[n] = request->tek.Tfont[n];
+    }
+
+    init_Sres(tek.initial_font);
+    init_Sres(tek.gin_terminator_str);
+    init_Ires(tek.tb_info.menu_height);
+
+    wnew->tek.tb_info.menu_bar = request->tek.tb_info.menu_bar;
 }
 
 static void
diff --git a/button.c b/button.c
index 8d476d0..abaa880 100644
--- a/button.c
+++ b/button.c
@@ -1,4 +1,4 @@
-/* $XTermId: button.c,v 1.381 2010/08/23 23:25:57 tom Exp $ */
+/* $XTermId: button.c,v 1.389 2010/10/13 09:37:08 tom Exp $ */
 
 /*
  * Copyright 1999-2009,2010 by Thomas E. Dickey
@@ -115,7 +115,10 @@ button.c   Handles button events in the terminal emulator.
 #define AllModifiers (ShiftMask | LockMask | ControlMask | Mod1Mask | \
                      Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask)
 
-#define KeyModifiers (event->xbutton.state & OurModifiers)
+#define BtnModifiers(event) (event->state & OurModifiers)
+#define KeyModifiers(event) (event->xbutton.state & OurModifiers)
+
+#define IsBtnEvent(event) ((event)->type == ButtonPress || (event)->type == 
ButtonRelease)
 
 #define KeyState(x) (((int) ((x) & (ShiftMask|ControlMask))) \
                          + (((x) & Mod1Mask) ? 2 : 0))
@@ -130,8 +133,8 @@ static const CELL zeroCELL =
 {0, 0};
 
 #if OPT_DEC_LOCATOR
-static Bool SendLocatorPosition(XtermWidget xw, XEvent * event);
-static void CheckLocatorPosition(XtermWidget xw, XEvent * event);
+static Bool SendLocatorPosition(XtermWidget xw, XButtonEvent * event);
+static void CheckLocatorPosition(XtermWidget xw, XButtonEvent * event);
 #endif /* OPT_DEC_LOCATOR */
 
 /* Multi-click handling */
@@ -202,65 +205,75 @@ Bool
 SendMousePosition(XtermWidget xw, XEvent * event)
 {
     TScreen *screen = TScreenOf(xw);
+    XButtonEvent *my_event = (XButtonEvent *) event;
+    Bool result = False;
 
-    /* If send_mouse_pos mode isn't on, we shouldn't be here */
-    if (screen->send_mouse_pos == MOUSE_OFF)
+    switch (screen->send_mouse_pos) {
+    case MOUSE_OFF:
+       /* If send_mouse_pos mode isn't on, we shouldn't be here */
        return False;
 
-#if OPT_DEC_LOCATOR
-    if (screen->send_mouse_pos == DEC_LOCATOR) {
-       return (SendLocatorPosition(xw, event));
-    }
-#endif /* OPT_DEC_LOCATOR */
+    case BTN_EVENT_MOUSE:
+    case ANY_EVENT_MOUSE:
+       /* xterm extension for motion reporting. June 1998 */
+       /* EditorButton() will distinguish between the modes */
+       switch (event->type) {
+       case MotionNotify:
+           my_event->button = 0;
+           /* FALLTHRU */
+       case ButtonPress:
+           /* FALLTHRU */
+       case ButtonRelease:
+           EditorButton(xw, my_event);
+           result = True;
+           break;
+       }
+       break;
 
-    /* Make sure the event is an appropriate type */
-    if ((screen->send_mouse_pos != BTN_EVENT_MOUSE)
-       && (screen->send_mouse_pos != ANY_EVENT_MOUSE)
-       && event->type != ButtonPress
-       && event->type != ButtonRelease)
-       return False;
+    default:
+       /* Make sure the event is an appropriate type */
+       if (IsBtnEvent(event)) {
 
-    switch (screen->send_mouse_pos) {
-    case X10_MOUSE:            /* X10 compatibility sequences */
+           switch (screen->send_mouse_pos) {
+           case X10_MOUSE:     /* X10 compatibility sequences */
 
-       if (KeyModifiers == 0) {
-           if (event->type == ButtonPress)
-               EditorButton(xw, (XButtonEvent *) event);
-           return True;
-       }
-       return False;
+               if (BtnModifiers(my_event) == 0) {
+                   if (my_event->type == ButtonPress)
+                       EditorButton(xw, my_event);
+                   result = True;
+               }
+               break;
 
-    case VT200_HIGHLIGHT_MOUSE:        /* DEC vt200 hilite tracking */
-       if (event->type == ButtonPress &&
-           KeyModifiers == 0 &&
-           event->xbutton.button == Button1) {
-           TrackDown(xw, (XButtonEvent *) event);
-           return True;
-       }
-       if (KeyModifiers == 0 || KeyModifiers == ControlMask) {
-           EditorButton(xw, (XButtonEvent *) event);
-           return True;
-       }
-       return False;
+           case VT200_HIGHLIGHT_MOUSE: /* DEC vt200 hilite tracking */
+               if (my_event->type == ButtonPress &&
+                   BtnModifiers(my_event) == 0 &&
+                   my_event->button == Button1) {
+                   TrackDown(xw, my_event);
+                   result = True;
+               } else if (BtnModifiers(my_event) == 0
+                          || BtnModifiers(my_event) == ControlMask) {
+                   EditorButton(xw, my_event);
+                   result = True;
+               }
+               break;
 
-    case VT200_MOUSE:          /* DEC vt200 compatible */
+           case VT200_MOUSE:   /* DEC vt200 compatible */
+               if (BtnModifiers(my_event) == 0
+                   || BtnModifiers(my_event) == ControlMask) {
+                   EditorButton(xw, my_event);
+                   result = True;
+               }
+               break;
 
-       /* xterm extension for motion reporting. June 1998 */
-       /* EditorButton() will distinguish between the modes */
-    case BTN_EVENT_MOUSE:
-    case ANY_EVENT_MOUSE:
-       if (KeyModifiers == 0 || KeyModifiers == ControlMask) {
-           if (event->type == MotionNotify) {
-               ((XButtonEvent *) event)->button = 0;
+#if OPT_DEC_LOCATOR
+           case DEC_LOCATOR:
+               result = SendLocatorPosition(xw, my_event);
+               break;
+#endif /* OPT_DEC_LOCATOR */
            }
-           EditorButton(xw, (XButtonEvent *) event);
-           return True;
        }
-       return False;
-
-    default:
-       return False;
     }
+    return result;
 }
 
 #if OPT_DEC_LOCATOR
@@ -291,7 +304,7 @@ SendMousePosition(XtermWidget xw, XEvent * event)
     }
 
 static Bool
-SendLocatorPosition(XtermWidget xw, XEvent * event)
+SendLocatorPosition(XtermWidget xw, XButtonEvent * event)
 {
     ANSI reply;
     TScreen *screen = TScreenOf(xw);
@@ -301,10 +314,10 @@ SendLocatorPosition(XtermWidget xw, XEvent * event)
     unsigned state;
 
     /* Make sure the event is an appropriate type */
-    if ((event->type != ButtonPress &&
-        event->type != ButtonRelease &&
+    if ((!IsBtnEvent(event) &&
+
         !screen->loc_filter) ||
-       (KeyModifiers != 0 && KeyModifiers != ControlMask))
+       (BtnModifiers(event) != 0 && BtnModifiers(event) != ControlMask))
        return (False);
 
     if ((event->type == ButtonPress &&
@@ -319,9 +332,9 @@ SendLocatorPosition(XtermWidget xw, XEvent * event)
     }
 
     /* get button # */
-    button = (int) event->xbutton.button - 1;
+    button = (int) event->button - 1;
 
-    LocatorCoords(row, col, event->xbutton.x, event->xbutton.y, oor);
+    LocatorCoords(row, col, event->x, event->y, oor);
 
     /*
      * DECterm mouse:
@@ -377,7 +390,7 @@ SendLocatorPosition(XtermWidget xw, XEvent * event)
      * Also, mask should be the state after the button press/release,
      * X provides the state not including the button press/release.
      */
-    state = (event->xbutton.state
+    state = (event->state
             & (Button1Mask | Button2Mask | Button3Mask | Button4Mask)) >> 8;
     /* update mask to "after" state */
     state ^= ((unsigned) (1 << button));
@@ -613,7 +626,7 @@ InitLocatorFilter(XtermWidget xw)
 }
 
 static void
-CheckLocatorPosition(XtermWidget xw, XEvent * event)
+CheckLocatorPosition(XtermWidget xw, XButtonEvent * event)
 {
     ANSI reply;
     TScreen *screen = TScreenOf(xw);
@@ -621,7 +634,7 @@ CheckLocatorPosition(XtermWidget xw, XEvent * event)
     Bool oor;
     int state;
 
-    LocatorCoords(row, col, event->xbutton.x, event->xbutton.y, oor);
+    LocatorCoords(row, col, event->x, event->y, oor);
 
     /*
      * Send report if the pointer left the filter rectangle, if
@@ -643,7 +656,7 @@ CheckLocatorPosition(XtermWidget xw, XEvent * event)
            reply.a_nparam = 1;
            reply.a_param[0] = 0;       /* Event - 0 = locator unavailable */
        } else {
-           ButtonState(state, event->xbutton.state);
+           ButtonState(state, event->state);
 
            reply.a_nparam = 4;
            reply.a_param[0] = 10;      /* Event - 10 = locator outside filter 
*/
@@ -666,13 +679,13 @@ CheckLocatorPosition(XtermWidget xw, XEvent * event)
 
 #if OPT_READLINE
 static int
-isClick1_clean(TScreen * screen, XEvent * event)
+isClick1_clean(TScreen * screen, XButtonEvent * event)
 {
     int delta;
 
-    if (!(event->type == ButtonPress || event->type == ButtonRelease)
+    if (!IsBtnEvent(event)
     /* Disable on Shift-Click-1, including the application-mouse modes */
-       || (KeyModifiers & ShiftMask)
+       || (BtnModifiers(event) & ShiftMask)
        || (screen->send_mouse_pos != MOUSE_OFF)        /* Kinda duplicate... */
        ||ExtendingSelection)   /* Was moved */
        return 0;
@@ -683,25 +696,25 @@ isClick1_clean(TScreen * screen, XEvent * event)
     if (lastButtonDownTime == (Time) 0) {
        /* first time or once in a blue moon */
        delta = screen->multiClickTime + 1;
-    } else if (event->xbutton.time > lastButtonDownTime) {
+    } else if (event->time > lastButtonDownTime) {
        /* most of the time */
-       delta = (int) (event->xbutton.time - lastButtonDownTime);
+       delta = (int) (event->time - lastButtonDownTime);
     } else {
        /* time has rolled over since lastButtonUpTime */
-       delta = (int) ((((Time) ~ 0) - lastButtonDownTime) + 
event->xbutton.time);
+       delta = (int) ((((Time) ~ 0) - lastButtonDownTime) + event->time);
     }
 
     return delta <= screen->multiClickTime;
 }
 
 static int
-isDoubleClick3(TScreen * screen, XEvent * event)
+isDoubleClick3(TScreen * screen, XButtonEvent * event)
 {
     int delta;
 
     if (event->type != ButtonRelease
-       || (KeyModifiers & ShiftMask)
-       || event->xbutton.button != Button3) {
+       || (BtnModifiers(event) & ShiftMask)
+       || event->button != Button3) {
        lastButton3UpTime = 0;  /* Disable the cached info */
        return 0;
     }
@@ -709,27 +722,27 @@ isDoubleClick3(TScreen * screen, XEvent * event)
     if (lastButton3DoubleDownTime == (Time) 0) {
        /* No previous click or once in a blue moon */
        delta = screen->multiClickTime + 1;
-    } else if (event->xbutton.time > lastButton3DoubleDownTime) {
+    } else if (event->time > lastButton3DoubleDownTime) {
        /* most of the time */
-       delta = (int) (event->xbutton.time - lastButton3DoubleDownTime);
+       delta = (int) (event->time - lastButton3DoubleDownTime);
     } else {
        /* time has rolled over since lastButton3DoubleDownTime */
-       delta = (int) ((((Time) ~ 0) - lastButton3DoubleDownTime) + 
event->xbutton.time);
+       delta = (int) ((((Time) ~ 0) - lastButton3DoubleDownTime) + 
event->time);
     }
     if (delta <= screen->multiClickTime) {
        /* Double click */
        CELL cell;
 
        /* Cannot check ExtendingSelection, since mouse-3 always sets it */
-       PointToCELL(screen, event->xbutton.y, event->xbutton.x, &cell);
+       PointToCELL(screen, event->y, event->x, &cell);
        if (isSameCELL(&cell, &lastButton3)) {
            lastButton3DoubleDownTime = 0;      /* Disable the third click */
            return 1;
        }
     }
     /* Not a double click, memorize for future check. */
-    lastButton3UpTime = event->xbutton.time;
-    PointToCELL(screen, event->xbutton.y, event->xbutton.x, &lastButton3);
+    lastButton3UpTime = event->time;
+    PointToCELL(screen, event->y, event->x, &lastButton3);
     return 0;
 }
 
@@ -739,7 +752,7 @@ CheckSecondPress3(TScreen * screen, XEvent * event)
     int delta;
 
     if (event->type != ButtonPress
-       || (KeyModifiers & ShiftMask)
+       || (KeyModifiers(event) & ShiftMask)
        || event->xbutton.button != Button3) {
        lastButton3DoubleDownTime = 0;  /* Disable the cached info */
        return 0;
@@ -848,9 +861,32 @@ ReadLineDelete(TScreen * screen, CELL * cell1, CELL * 
cell2)
     if (del <= 0)              /* Just in case... */
        return 0;
     while (del--)
-       v_write(screen->respond, (Char *) "\177", 1);
+       v_write(screen->respond, (const Char *) "\177", 1);
     return 1;
 }
+
+static void
+readlineExtend(TScreen * screen, XEvent * event)
+{
+    int ldelta1, ldelta2;
+
+    if (IsBtnEvent(event)) {
+       XButtonEvent *my_event = (XButtonEvent *) event;
+       if (isClick1_clean(screen, my_event)
+           && SCREEN_FLAG(screen, click1_moves)
+           && rowOnCurrentLine(screen, eventRow(screen, event), &ldelta1)) {
+           ReadLineMovePoint(screen, eventColBetween(screen, event), ldelta1);
+       }
+       if (isDoubleClick3(screen, my_event)
+           && SCREEN_FLAG(screen, dclick3_deletes)
+           && rowOnCurrentLine(screen, screen->startSel.row, &ldelta1)
+           && rowOnCurrentLine(screen, screen->endSel.row, &ldelta2)) {
+           ReadLineMovePoint(screen, screen->endSel.col, ldelta2);
+           ReadLineDelete(screen, &screen->startSel, &(screen->endSel));
+       }
+    }
+}
+
 #endif /* OPT_READLINE */
 
 /* ^XM-G<line+' '><col+' '> */
@@ -867,7 +903,7 @@ DiredButton(Widget w,
        Char Line[6];
        unsigned line, col;
 
-       if ((event->type == ButtonPress || event->type == ButtonRelease)
+       if (IsBtnEvent(event)
            && (event->xbutton.y >= screen->border)
            && (event->xbutton.x >= OriginX(screen))) {
            line = (unsigned) ((event->xbutton.y - screen->border)
@@ -898,7 +934,7 @@ ReadLineButton(Widget w,
        Char Line[6];
        int line, col, ldelta = 0;
 
-       if (!(event->type == ButtonPress || event->type == ButtonRelease)
+       if (!IsBtnEvent(event)
            || (screen->send_mouse_pos != MOUSE_OFF) || ExtendingSelection)
            goto finish;
        if (event->type == ButtonRelease) {
@@ -956,7 +992,7 @@ ViButton(Widget w,
        Char Line[6];
        int line;
 
-       if (event->type == ButtonPress || event->type == ButtonRelease) {
+       if (IsBtnEvent(event)) {
 
            line = screen->cur_row -
                ((event->xbutton.y - screen->border) / FontHeight(screen));
@@ -1036,9 +1072,6 @@ do_select_end(XtermWidget xw,
              Cardinal *num_params,
              Bool use_cursor_loc)
 {
-#if OPT_READLINE
-    int ldelta1, ldelta2;
-#endif
     TScreen *screen = TScreenOf(xw);
 
     screen->selection_time = event->xbutton.time;
@@ -1050,18 +1083,7 @@ do_select_end(XtermWidget xw,
     case RIGHTEXTENSION:
        EndExtend(xw, event, params, *num_params, use_cursor_loc);
 #if OPT_READLINE
-       if (isClick1_clean(screen, event)
-           && SCREEN_FLAG(screen, click1_moves)
-           && rowOnCurrentLine(screen, eventRow(screen, event), &ldelta1)) {
-           ReadLineMovePoint(screen, eventColBetween(screen, event), ldelta1);
-       }
-       if (isDoubleClick3(screen, event)
-           && SCREEN_FLAG(screen, dclick3_deletes)
-           && rowOnCurrentLine(screen, screen->startSel.row, &ldelta1)
-           && rowOnCurrentLine(screen, screen->endSel.row, &ldelta2)) {
-           ReadLineMovePoint(screen, screen->endSel.col, ldelta2);
-           ReadLineDelete(screen, &screen->startSel, &(screen->endSel));
-       }
+       readlineExtend(screen, event);
 #endif /* OPT_READLINE */
        break;
     }
@@ -1093,6 +1115,58 @@ HandleKeyboardSelectEnd(Widget w,
     }
 }
 
+/*
+ * Like "select-end" (optionally copies the selection to the given targets),
+ * but also sets the modes so that releasing the mouse button or moving the
+ * mouse does not alter the selection.
+ */
+static void
+do_select_stop(XtermWidget xw,
+              XEvent * event,  /* must be XButtonEvent */
+              String * params, /* selections */
+              Cardinal *num_params,
+              Bool use_cursor_loc)
+{
+    TScreen *screen = TScreenOf(xw);
+
+    screen->selection_time = event->xbutton.time;
+    switch (screen->eventMode) {
+    case NORMAL:
+       (void) SendMousePosition(xw, event);
+       break;
+    case LEFTEXTENSION:
+    case RIGHTEXTENSION:
+       EndExtend(xw, event, params, *num_params, use_cursor_loc);
+       break;
+    }
+}
+
+void
+HandleSelectStop(Widget w,
+                XEvent * event,        /* must be XButtonEvent */
+                String * params,       /* selections */
+                Cardinal *num_params)
+{
+    XtermWidget xw;
+
+    if ((xw = getXtermWidget(w)) != 0) {
+       do_select_stop(xw, event, params, num_params, False);
+    }
+}
+
+void
+HandleKeyboardSelectStop(Widget w,
+                        XEvent * event,        /* must be XButtonEvent */
+                        String * params,       /* selections */
+                        Cardinal *num_params)
+{
+    XtermWidget xw;
+
+    if ((xw = getXtermWidget(w)) != 0) {
+       do_select_stop(xw, event, params, num_params, True);
+    }
+}
+
 struct _SelectionList {
     String *params;
     Cardinal count;
@@ -1136,7 +1210,7 @@ UTF8toLatin1(TScreen * screen, Char * s, unsigned long 
len, unsigned long *resul
 
     Cardinal offset = 0;
 
-    Char *p;
+    const Char *p;
 
     if (len != 0) {
        PtyData data;
@@ -1172,7 +1246,7 @@ UTF8toLatin1(TScreen * screen, Char * s, unsigned long 
len, unsigned long *resul
             * whatever the user wants).
             */
            if (fails) {
-               for (p = (Char *) screen->default_string; *p != '\0'; ++p) {
+               for (p = (const Char *) screen->default_string; *p != '\0'; 
++p) {
                    AddChar(&buffer, &used, offset, *p);
                }
            }
@@ -1292,7 +1366,7 @@ overrideTargets(Widget w, String value, Atom ** resultp)
        TScreen *screen = TScreenOf(xw);
 
        if (!IsEmpty(value)) {
-           String copied = x_strdup(value);
+           char *copied = x_strdup(value);
            if (copied != 0) {
                Atom *result = 0;
                Cardinal count = 1;
@@ -1715,7 +1789,7 @@ base64_flush(TScreen * screen)
     }
     if (screen->base64_pad & 3)
        tty_vwrite(screen->respond,
-                  (Char *) "===",
+                  (const Char *) "===",
                   (unsigned) (4 - (screen->base64_pad & 3)));
     screen->base64_count = 0;
     screen->base64_accu = 0;
@@ -1772,7 +1846,7 @@ _qWriteSelectionData(TScreen * screen, Char * lag, 
unsigned length)
 #if OPT_READLINE
     if (SCREEN_FLAG(screen, paste_quotes)) {
        while (length--) {
-           tty_vwrite(screen->respond, (Char *) "\026", 1);    /* Control-V */
+           tty_vwrite(screen->respond, (const Char *) "\026", 1);      /* 
Control-V */
            tty_vwrite(screen->respond, lag++, 1);
        }
     } else
@@ -1830,11 +1904,11 @@ _WriteSelectionData(TScreen * screen, Char * line, 
size_t length)
 
 #if OPT_READLINE
 static void
-_WriteKey(TScreen * screen, Char * in)
+_WriteKey(TScreen * screen, const Char * in)
 {
     Char line[16];
     unsigned count = 0;
-    size_t length = strlen((char *) in);
+    size_t length = strlen((const char *) in);
 
     if (screen->control_eight_bits) {
        line[count++] = ANSI_CSI;
@@ -1950,7 +2024,7 @@ SelectionReceived(Widget w,
 #endif
 #if OPT_READLINE
        if (SCREEN_FLAG(screen, paste_brackets)) {
-           _WriteKey(screen, (Char *) "200");
+           _WriteKey(screen, (const Char *) "200");
        }
 #endif
        for (i = 0; i < text_list_count; i++) {
@@ -1964,7 +2038,7 @@ SelectionReceived(Widget w,
 #endif
 #if OPT_READLINE
        if (SCREEN_FLAG(screen, paste_brackets)) {
-           _WriteKey(screen, (Char *) "201");
+           _WriteKey(screen, (const Char *) "201");
        }
 #endif
        XFreeStringList(text_list);
@@ -2005,9 +2079,9 @@ HandleInsertSelection(Widget w,


-- 
To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/e1pb3c8-0001gv...@alioth.debian.org

Reply via email to