]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.9 - patch 20130105
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 6 Jan 2013 01:29:15 +0000 (01:29 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 6 Jan 2013 01:29:15 +0000 (01:29 +0000)
+ add "-s" option to test/view.c to allow it to start in single-step
  mode, reducing size of trace files when it is used for debugging
  MinGW changes.
+ revert part of 20121222 change to tinfo_driver.c
+ add experimental logic in win_driver.c to improve optimization of
  screen updates.  This does not yet work with double-width characters,
  so it is ifdef'd out for the moment (prompted by report by Erwin
  Waterlander regarding screen flicker).

NEWS
dist.mk
ncurses/tinfo/tinfo_driver.c
ncurses/win32con/win_driver.c
package/debian/changelog
package/ncurses.spec
test/view.c

diff --git a/NEWS b/NEWS
index f84b3fef09eaf97e6cfbcfaa4baf9ff8012ecaee..f154f7730b8e3d929f66ee1fd247be9e051958fe 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,5 @@
 -------------------------------------------------------------------------------
--- Copyright (c) 1998-2011,2012 Free Software Foundation, Inc.               --
+-- Copyright (c) 1998-2012,2013 Free Software Foundation, Inc.               --
 --                                                                           --
 -- Permission is hereby granted, free of charge, to any person obtaining a   --
 -- copy of this software and associated documentation files (the             --
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.2006 2012/12/29 22:37:28 tom Exp $
+-- $Id: NEWS,v 1.2008 2013/01/05 23:28:30 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,16 @@ See the AUTHORS file for the corresponding full names.
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
+20130105
+       + add "-s" option to test/view.c to allow it to start in single-step
+         mode, reducing size of trace files when it is used for debugging
+         MinGW changes.
+       + revert part of 20121222 change to tinfo_driver.c
+       + add experimental logic in win_driver.c to improve optimization of
+         screen updates.  This does not yet work with double-width characters,
+         so it is ifdef'd out for the moment (prompted by report by Erwin
+         Waterlander regarding screen flicker).
+
 20121229
        + fix coverity warnings regarding copying into fixed-size buffers.
        + add throw-declarations in the c++ binding per Coverity warning.
diff --git a/dist.mk b/dist.mk
index e3b7cab9aa017a22ed31727048260d1d28e5ad66..d59b724276bef1e6f27ad002e7481d03ee166273 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.907 2012/12/29 16:59:31 tom Exp $
+# $Id: dist.mk,v 1.908 2013/01/05 14:08:17 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
@@ -37,7 +37,7 @@ SHELL = /bin/sh
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 5
 NCURSES_MINOR = 9
-NCURSES_PATCH = 20121229
+NCURSES_PATCH = 20130105
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 5f2051b5b2eec7c119496745fe91e0c4b281d2bb..0a463082667d7e544a13d8076e1c135a132f924b 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2008-2011,2012 Free Software Foundation, Inc.              *
+ * Copyright (c) 2008-2012,2013 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -50,7 +50,7 @@
 # endif
 #endif
 
-MODULE_ID("$Id: tinfo_driver.c,v 1.25 2012/12/22 21:44:10 tom Exp $")
+MODULE_ID("$Id: tinfo_driver.c,v 1.26 2013/01/05 23:25:36 tom Exp $")
 
 /*
  * SCO defines TIOCGSIZE and the corresponding struct.  Other systems (SunOS,
@@ -1150,8 +1150,7 @@ _nc_cookie_init(SCREEN *sp)
 
     /* initialize normal acs before wide, since we use mapping in the latter */
 #if !USE_WIDEC_SUPPORT
-    sp->_screen_unicode = _nc_unicode_locale();
-    if (sp->screen_unicode && _nc_locale_breaks_acs(sp->_term)) {
+    if (_nc_unicode_locale() && _nc_locale_breaks_acs(sp->_term)) {
        acs_chars = NULL;
        ena_acs = NULL;
        enter_alt_charset_mode = NULL;
index 03313270cea079d8d3f673808f85c1c6a1940fe9..9b7a752ecc411a5f3d1eafd50dacdcde19775e30 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
 #include <curses.priv.h>
 #define CUR my_term.type.
 
-MODULE_ID("$Id: win_driver.c,v 1.15 2012/12/15 19:39:49 tom Exp $")
+MODULE_ID("$Id: win_driver.c,v 1.16 2013/01/05 23:16:54 tom Exp $")
 
 #define WINMAGIC NCDRV_MAGIC(NCDRV_WINCONSOLE)
 
+#define EXP_OPTIMIZE 0
+
 #define AssertTCB() assert(TCB!=0 && TCB->magic==WINMAGIC)
 #define SetSP() assert(TCB->csp!=0); sp = TCB->csp; (void) sp
 
@@ -242,6 +244,81 @@ con_write8(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, chtype *str, int n)
 #define con_write(tcb, y, x, str, n) con_write8(tcb, y, x, str, n)
 #endif
 
+#if EXP_OPTIMIZE
+/*
+ * Comparing new/current screens, determine the last column-index for a change
+ * beginning on the given row,col position.  Unlike a serial terminal, there is
+ * no cost for "moving" the "cursor" on the line as we update it.
+ */
+static int
+find_end_of_change(SCREEN *sp, int row, int col)
+{
+    int result = col;
+    struct ldat *curdat = CurScreen(sp)->_line + row;
+    struct ldat *newdat = NewScreen(sp)->_line + row;
+
+    while (col <= newdat->lastchar) {
+#if USE_WIDEC_SUPPORT
+       if (isWidecExt(curdat->text[col]) || isWidecExt(newdat->text[col])) {
+           result = col;
+       } else if (memcmp(&curdat->text[col],
+                         &newdat->text[col],
+                         sizeof(curdat->text[0]))) {
+           result = col;
+       } else {
+           break;
+       }
+#else
+       if (curdat->text[col] != newdat->text[col]) {
+           result = col;
+       } else {
+           break;
+       }
+#endif
+       ++col;
+    }
+    return result;
+}
+
+/*
+ * Given a row,col position at the end of a change-chunk, look for the
+ * beginning of the next change-chunk.
+ */
+static int
+find_next_change(SCREEN *sp, int row, int col)
+{
+    struct ldat *curdat = CurScreen(sp)->_line + row;
+    struct ldat *newdat = NewScreen(sp)->_line + row;
+    int result = newdat->lastchar + 1;
+
+    while (++col <= newdat->lastchar) {
+#if USE_WIDEC_SUPPORT
+       if (isWidecExt(curdat->text[col]) != isWidecExt(newdat->text[col])) {
+           result = col;
+           break;
+       } else if (memcmp(&curdat->text[col],
+                         &newdat->text[col],
+                         sizeof(curdat->text[0]))) {
+           result = col;
+           break;
+       }
+#else
+       if (curdat->text[col] != newdat->text[col]) {
+           result = col;
+           break;
+       }
+#endif
+    }
+    return result;
+}
+
+#define EndChange(first) \
+       find_end_of_change(sp, y, first)
+#define NextChange(last) \
+       find_next_change(sp, y, last)
+
+#endif /* EXP_OPTIMIZE */
+
 #define MARK_NOCHANGE(win,row) \
                win->_line[row].firstchar = _NOCHANGE; \
                win->_line[row].lastchar  = _NOCHANGE
@@ -291,6 +368,32 @@ drv_doupdate(TERMINAL_CONTROL_BLOCK * TCB)
     for (y = 0; y < nonempty; y++) {
        x0 = NewScreen(sp)->_line[y].firstchar;
        if (x0 != _NOCHANGE) {
+#if EXP_OPTIMIZE
+           int x2;
+           int limit = NewScreen(sp)->_line[y].lastchar;
+           while ((x1 = EndChange(x0)) <= limit) {
+               while ((x2 = NextChange(x1)) <= limit && x2 <= (x1 + 2)) {
+                   x1 = x2;
+               }
+               n = x1 - x0 + 1;
+               memcpy(&CurScreen(sp)->_line[y].text[x0],
+                      &NewScreen(sp)->_line[y].text[x0],
+                      n * sizeof(CurScreen(sp)->_line[y].text[x0]));
+               con_write(TCB,
+                         y,
+                         x0,
+                         &CurScreen(sp)->_line[y].text[x0], n);
+               x0 = NextChange(x1);
+           }
+
+           /* mark line changed successfully */
+           if (y <= NewScreen(sp)->_maxy) {
+               MARK_NOCHANGE(NewScreen(sp), y);
+           }
+           if (y <= CurScreen(sp)->_maxy) {
+               MARK_NOCHANGE(CurScreen(sp), y);
+           }
+#else
            x1 = NewScreen(sp)->_line[y].lastchar;
            n = x1 - x0 + 1;
            if (n > 0) {
@@ -310,6 +413,7 @@ drv_doupdate(TERMINAL_CONTROL_BLOCK * TCB)
                    MARK_NOCHANGE(CurScreen(sp), y);
                }
            }
+#endif
        }
     }
 
index c4a7623da0e59f5995d55072aadbf49d4f4dd420..6d8b7350a8ec2bae698b1342d01004dcb0bad3a6 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (5.9-20121229) unstable; urgency=low
+ncurses6 (5.9-20130105) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 29 Dec 2012 12:00:04 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 05 Jan 2013 10:15:33 -0500
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index 270a686205e76b2e0399369f9bd1719a0eadf33e..9f472cfa3dded825db0754901968a3b653b42151 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Release: 5.9
-Version: 20121229
+Version: 20130105
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{release}-%{version}.tgz
index 76a88a3096aeea8ac99f8b4721e3198048f724ae..cf11cbf04cfbddbec443453891c38acfb7fe1390 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -50,7 +50,7 @@
  * scroll operation worked, and the refresh() code only had to do a
  * partial repaint.
  *
- * $Id: view.c,v 1.89 2012/12/29 22:38:28 tom Exp $
+ * $Id: view.c,v 1.90 2013/01/05 23:18:13 tom Exp $
  */
 
 #include <test.priv.h>
@@ -82,6 +82,9 @@
 #include <sys/ptem.h>
 #endif
 
+#undef CTRL
+#define CTRL(x)        ((x) & 0x1f)
+
 static RETSIGTYPE finish(int sig) GCC_NORETURN;
 static void show_all(const char *tag);
 
@@ -121,6 +124,7 @@ usage(void)
 #if defined(KEY_RESIZE)
        ," -r       use old-style sigwinch handler rather than KEY_RESIZE"
 #endif
+       ," -s       start in single-step mode, waiting for input"
 #ifdef TRACE
        ," -t       trace screen updates"
        ," -T NUM   specify trace mask"
@@ -229,6 +233,7 @@ main(int argc, char *argv[])
     int value = 0;
     bool done = FALSE;
     bool got_number = FALSE;
+    bool single_step = TRUE;
 #if CAN_RESIZE
     bool nonposix_resize = FALSE;
 #endif
@@ -244,7 +249,7 @@ main(int argc, char *argv[])
     (void) signal(SIGINT, finish);     /* arrange interrupts to terminate */
 #endif
 
-    while ((i = getopt(argc, argv, "cin:rtT:")) != -1) {
+    while ((i = getopt(argc, argv, "cin:rstT:")) != -1) {
        switch (i) {
        case 'c':
            try_color = TRUE;
@@ -262,6 +267,9 @@ main(int argc, char *argv[])
            nonposix_resize = TRUE;
            break;
 #endif
+       case 's':
+           single_step = TRUE;
+           break;
 #ifdef TRACE
        case 'T':
            {
@@ -357,7 +365,8 @@ main(int argc, char *argv[])
     (void) nonl();             /* tell curses not to do NL->CR/NL on output */
     (void) cbreak();           /* take input chars one at a time, no wait for \n */
     (void) noecho();           /* don't echo input */
-    nodelay(stdscr, TRUE);
+    if (!single_step)
+       nodelay(stdscr, TRUE);
     idlok(stdscr, TRUE);       /* allow use of insert/delete line */
 
     if (try_color) {
@@ -478,6 +487,9 @@ main(int argc, char *argv[])
            nodelay(stdscr, TRUE);
            my_delay = 0;
            break;
+       case CTRL('L'):
+           redrawwin(stdscr);
+           break;
        case ERR:
            if (!my_delay)
                napms(50);