Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[xsrc/trunk]: xsrc/external/mit/xterm merge xterm 367.



details:   https://anonhg.NetBSD.org/xsrc/rev/336fb088afc4
branches:  trunk
changeset: 10693:336fb088afc4
user:      mrg <mrg%NetBSD.org@localhost>
date:      Tue Apr 27 01:58:18 2021 +0000

description:
merge xterm 367.

diffstat:

 external/mit/xterm/dist/fontutils.c   |   24 ++-
 external/mit/xterm/dist/linedata.c    |    6 +-
 external/mit/xterm/dist/misc.c        |  206 +++++++++++++++++++++++---
 external/mit/xterm/dist/ptyx.h        |   17 +-
 external/mit/xterm/dist/resize.c      |   13 +-
 external/mit/xterm/dist/xterm.h       |   27 ++-
 external/mit/xterm/dist/xterm.man     |  261 +++++++++++++++++++++++++--------
 external/mit/xterm/include/xtermcfg.h |    6 +-
 8 files changed, 442 insertions(+), 118 deletions(-)

diffs (truncated from 1096 to 300 lines):

diff -r a1d9d19e2829 -r 336fb088afc4 external/mit/xterm/dist/fontutils.c
--- a/external/mit/xterm/dist/fontutils.c       Tue Apr 27 01:57:00 2021 +0000
+++ b/external/mit/xterm/dist/fontutils.c       Tue Apr 27 01:58:18 2021 +0000
@@ -1,4 +1,4 @@
-/* $XTermId: fontutils.c,v 1.701 2021/02/02 00:40:30 tom Exp $ */
+/* $XTermId: fontutils.c,v 1.703 2021/03/02 00:25:24 tom Exp $ */
 
 /*
  * Copyright 1998-2020,2021 by Thomas E. Dickey
@@ -1020,6 +1020,20 @@
 }
 #endif
 
+XFontStruct *
+xtermLoadQueryFont(XtermWidget xw, const char *name)
+{
+    XFontStruct *result = NULL;
+    size_t have = strlen(name);
+    if (have == 0 || have > MAX_U_STRING) {
+       ;                       /* just ignore it */
+    } else {
+       TScreen *screen = TScreenOf(xw);
+       result = XLoadQueryFont(screen->display, name);
+    }
+    return result;
+}
+
 /*
  * Open the given font and verify that it is non-empty.  Return a null on
  * failure.
@@ -1031,12 +1045,11 @@
              Bool force)
 {
     Bool code = False;
-    TScreen *screen = TScreenOf(xw);
 
     TRACE(("xtermOpenFont %d:%d '%s'\n",
           result->warn, xw->misc.fontWarnings, NonNull(name)));
     if (!IsEmpty(name)) {
-       if ((result->fs = XLoadQueryFont(screen->display, name)) != 0) {
+       if ((result->fs = xtermLoadQueryFont(xw, name)) != 0) {
            code = True;
            if (EmptyFont(result->fs)) {
                xtermCloseFont(xw, result);
@@ -5105,7 +5118,7 @@
                    next[count++] = value;
                    next[count] = 0;
                    *list = next;
-                   TRACE(("... saved %s %s %lu:%s\n",
+                   TRACE(("... saved \"%s\" \"%s\" %lu:\"%s\"\n",
                           whichFontList(xw, target),
                           whichFontList2(xw, *list),
                           (unsigned long) count,
@@ -5163,7 +5176,8 @@
        int pass;
        char **list = 0;
 
-       TRACE(("allocFontList %s %s '%s'\n", whichFontEnum(which), name, blob));
+       TRACE(("allocFontList %s name=\"%s\" source=\"%s\"\n",
+              whichFontEnum(which), name, blob));
 
        for (pass = 0; pass < 2; ++pass) {
            unsigned count = 0;
diff -r a1d9d19e2829 -r 336fb088afc4 external/mit/xterm/dist/linedata.c
--- a/external/mit/xterm/dist/linedata.c        Tue Apr 27 01:57:00 2021 +0000
+++ b/external/mit/xterm/dist/linedata.c        Tue Apr 27 01:58:18 2021 +0000
@@ -1,7 +1,7 @@
-/* $XTermId: linedata.c,v 1.97 2019/06/30 19:10:53 tom Exp $ */
+/* $XTermId: linedata.c,v 1.99 2021/03/08 00:24:12 tom Exp $ */
 
 /*
- * Copyright 2009-2018,2019 by Thomas E. Dickey
+ * Copyright 2009-2019,2021 by Thomas E. Dickey
  *
  *                         All Rights Reserved
  *
@@ -251,7 +251,7 @@
                              && (limits == NULL
                                  || (column + 1) >= limits->right)));
            if (blank) {
-               item->charData = (Char) ' ';
+               item->charData = (CharData) ' ';
            }
            item->combSize = blank ? 0 : ld->combSize;
            for_each_combData(off, item) {
diff -r a1d9d19e2829 -r 336fb088afc4 external/mit/xterm/dist/misc.c
--- a/external/mit/xterm/dist/misc.c    Tue Apr 27 01:57:00 2021 +0000
+++ b/external/mit/xterm/dist/misc.c    Tue Apr 27 01:58:18 2021 +0000
@@ -1,4 +1,4 @@
-/* $XTermId: misc.c,v 1.968 2021/02/10 00:50:59 tom Exp $ */
+/* $XTermId: misc.c,v 1.979 2021/03/24 00:27:48 tom Exp $ */
 
 /*
  * Copyright 1999-2020,2021 by Thomas E. Dickey
@@ -67,7 +67,6 @@
 
 #include <X11/keysym.h>
 #include <X11/Xatom.h>
-#include <X11/cursorfont.h>
 
 #include <X11/Xmu/Error.h>
 #include <X11/Xmu/SysUtil.h>
@@ -220,7 +219,7 @@
 
     if (screen->hide_pointer && screen->pointer_mode < pFocused) {
        screen->hide_pointer = False;
-       xtermDisplayCursor(xw);
+       xtermDisplayPointer(xw);
     }
 
     screen->select &= ~flag;
@@ -314,16 +313,16 @@
 }
 
 void
-xtermDisplayCursor(XtermWidget xw)
+xtermDisplayPointer(XtermWidget xw)
 {
     TScreen *screen = TScreenOf(xw);
 
     if (screen->Vshow) {
        if (screen->hide_pointer) {
-           TRACE(("Display hidden_cursor\n"));
+           TRACE(("Display text pointer (hidden)\n"));
            XDefineCursor(screen->display, VWindow(screen), screen->hidden_cursor);
        } else {
-           TRACE(("Display pointer_cursor\n"));
+           TRACE(("Display text pointer (visible)\n"));
            recolor_cursor(screen,
                           screen->pointer_cursor,
                           T_COLOR(screen, MOUSE_FG),
@@ -366,7 +365,7 @@
     if (enable) {
        if (screen->hide_pointer) {
            screen->hide_pointer = False;
-           xtermDisplayCursor(xw);
+           xtermDisplayPointer(xw);
            switch (screen->send_mouse_pos) {
            case ANY_EVENT_MOUSE:
                break;
@@ -384,7 +383,7 @@
        } else {
            tried = 0;
            screen->hide_pointer = True;
-           xtermDisplayCursor(xw);
+           xtermDisplayPointer(xw);
            MotionOn(screen, xw);
        }
     }
@@ -717,9 +716,9 @@
      * server insists on drawing _something_.
      */
     TRACE(("Ask for nil2 font\n"));
-    if ((fn = XLoadQueryFont(dpy, "nil2")) == 0) {
+    if ((fn = xtermLoadQueryFont(xw, "nil2")) == 0) {
        TRACE(("...Ask for fixed font\n"));
-       fn = XLoadQueryFont(dpy, DEFFONT);
+       fn = xtermLoadQueryFont(xw, DEFFONT);
     }
 
     if (fn != None) {
@@ -739,10 +738,10 @@
  * default theme.  Testing seems to show that we only have to provide this
  * until the window is initialized.
  */
+#ifdef HAVE_LIB_XCURSOR
 void
 init_colored_cursor(Display *dpy)
 {
-#ifdef HAVE_LIB_XCURSOR
     static const char theme[] = "index.theme";
     static const char pattern[] = "xtermXXXXXX";
     char *env = getenv("XCURSOR_THEME");
@@ -753,7 +752,11 @@
      */
     if (IsEmpty(env)) {
        env = XGetDefault(dpy, "Xcursor", "theme");
-    }
+       TRACE(("XGetDefault Xcursor theme \"%s\"\n", NonNull(env)));
+    } else {
+       TRACE(("getenv(XCURSOR_THEME) \"%s\"\n", NonNull(env)));
+    }
+
     /*
      * If neither found, provide our own default theme.
      */
@@ -762,6 +765,8 @@
        char *filename;
        size_t needed;
 
+       TRACE(("init_colored_cursor will make an empty Xcursor theme\n"));
+
        if ((tmp_dir = getenv("TMPDIR")) == 0) {
            tmp_dir = P_tmpdir;
        }
@@ -790,21 +795,25 @@
 
                strcat(leaf, "/");
                strcat(leaf, theme);
+
                if ((fp = fopen(xterm_cursor_theme, "w")) != 0) {
                    fprintf(fp, "[Icon Theme]\n");
                    fclose(fp);
                    *leaf = '\0';
                    xtermSetenv("XCURSOR_PATH", xterm_cursor_theme);
                    *leaf = '/';
+
+                   TRACE(("...initialized xterm_cursor_theme \"%s\"\n",
+                          xterm_cursor_theme));
+                   atexit(cleanup_colored_cursor);
+               } else {
+                   FreeAndNull(xterm_cursor_theme);
                }
-               atexit(cleanup_colored_cursor);
            }
        }
     }
-#else
-    (void) dpy;
+}
 #endif /* HAVE_LIB_XCURSOR */
-}
 
 /*
  * Once done, discard the file and directory holding it.
@@ -821,9 +830,8 @@
            && (sb.st_mode & S_IFMT) == S_IFDIR) {
            unlink(xterm_cursor_theme);
            rmdir(my_path);
-           free(xterm_cursor_theme);
-           xterm_cursor_theme = 0;
-       }
+       }
+       FreeAndNull(xterm_cursor_theme);
     }
 #endif /* HAVE_LIB_XCURSOR */
 }
@@ -843,7 +851,8 @@
 
        /* adapted from XCreateFontCursor(), which hardcodes the font name */
        TRACE(("loading cursor from alternate cursor font\n"));
-       if ((myFont.fs = XLoadQueryFont(dpy, screen->cursor_font_name)) != 0) {
+       myFont.fs = xtermLoadQueryFont(term, screen->cursor_font_name);
+       if (myFont.fs != NULL) {
            if (!xtermMissingChar(c_index, &myFont)
                && !xtermMissingChar(c_index + 1, &myFont)) {
 #define DATA(c) { 0UL, c, c, c, 0, 0 }
@@ -881,6 +890,148 @@
     return c;
 }
 
+/* adapted from <X11/cursorfont.h> */
+static int
+LookupCursorShape(const char *name)
+{
+#define DATA(name) { XC_##name, #name }
+    static struct {
+       int code;
+       const char name[25];
+    } table[] = {
+       DATA(X_cursor),
+           DATA(arrow),
+           DATA(based_arrow_down),
+           DATA(based_arrow_up),
+           DATA(boat),
+           DATA(bogosity),
+           DATA(bottom_left_corner),
+           DATA(bottom_right_corner),
+           DATA(bottom_side),
+           DATA(bottom_tee),
+           DATA(box_spiral),
+           DATA(center_ptr),
+           DATA(circle),
+           DATA(clock),
+           DATA(coffee_mug),
+           DATA(cross),
+           DATA(cross_reverse),
+           DATA(crosshair),
+           DATA(diamond_cross),
+           DATA(dot),
+           DATA(dotbox),
+           DATA(double_arrow),
+           DATA(draft_large),
+           DATA(draft_small),
+           DATA(draped_box),
+           DATA(exchange),
+           DATA(fleur),
+           DATA(gobbler),
+           DATA(gumby),
+           DATA(hand1),
+           DATA(hand2),
+           DATA(heart),
+           DATA(icon),
+           DATA(iron_cross),
+           DATA(left_ptr),
+           DATA(left_side),
+           DATA(left_tee),
+           DATA(leftbutton),
+           DATA(ll_angle),
+           DATA(lr_angle),



Home | Main Index | Thread Index | Old Index