]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.0 - patch 20161217
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 18 Dec 2016 01:43:10 +0000 (01:43 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 18 Dec 2016 01:43:10 +0000 (01:43 +0000)
+ add tput-colorcube demo script.
+ add -r and -s options to tput-initc demo, to match usage in xterm.
+ flush the standard output in _nc_flush for the case where SP is zero,
  e.g., when called via putp.  This fixes a scenario where "tput flash"
  did not work after changes in 20130112.

13 files changed:
MANIFEST
NEWS
VERSION
dist.mk
ncurses/tinfo/lib_tputs.c
package/debian-mingw/changelog
package/debian-mingw64/changelog
package/debian/changelog
package/mingw-ncurses.nsi
package/mingw-ncurses.spec
package/ncurses.spec
test/tput-colorcube [new file with mode: 0644]
test/tput-initc

index 17299185b32b3cfd67b591c2b69751b5934757b2..656325d60b24849e193f369851034bd2d46e305e 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
 ./test/testaddch.c
 ./test/testcurs.c
 ./test/testscanw.c
+./test/tput-colorcube
 ./test/tput-initc
 ./test/tracemunch
 ./test/view.c
diff --git a/NEWS b/NEWS
index 61ed600ac6d559bf36d2ab15785f0ab6f1d6c221..8cdb035af9c56f5e2f58b8bad757bf7778c85ba4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.2708 2016/12/11 00:24:06 tom Exp $
+-- $Id: NEWS,v 1.2711 2016/12/17 23:41:02 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,13 @@ 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.
 
+20161217
+       + add tput-colorcube demo script.
+       + add -r and -s options to tput-initc demo, to match usage in xterm.
+       + flush the standard output in _nc_flush for the case where SP is zero,
+         e.g., when called via putp.  This fixes a scenario where "tput flash"
+         did not work after changes in 20130112.
+
 20161210
        + add configure script option --disable-wattr-macros for use in cases
          where one wants to use the same headers for ncurses5/ncurses6
diff --git a/VERSION b/VERSION
index d797ee92604009073a087e67a9ac36e7aa9c9d06..1e6ab1682ada24d06e59cd19d6ada861361a438f 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:9  6.0     20161210
+5:0:9  6.0     20161217
diff --git a/dist.mk b/dist.mk
index c0b5a9ab9f355b7310a6cccca145b8b915a7a4c6..e39e58529253799b3cb7c4dc48b9f8f5c0b994ee 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.1136 2016/12/10 12:47:46 tom Exp $
+# $Id: dist.mk,v 1.1137 2016/12/17 16:05:02 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 = 6
 NCURSES_MINOR = 0
-NCURSES_PATCH = 20161210
+NCURSES_PATCH = 20161217
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 39a4832b86969b039f29af3a44772363c636fe4a..0d5cb5c654f119e3c4614886b10e788a296558b3 100644 (file)
@@ -51,7 +51,7 @@
 #include <termcap.h>           /* ospeed */
 #include <tic.h>
 
-MODULE_ID("$Id: lib_tputs.c,v 1.98 2016/05/28 21:58:45 tom Exp $")
+MODULE_ID("$Id: lib_tputs.c,v 1.99 2016/12/17 20:47:21 tom Exp $")
 
 NCURSES_EXPORT_VAR(char) PC = 0;              /* used by termcap library */
 NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0;        /* used by termcap library */
@@ -141,6 +141,8 @@ NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_DCL0)
                }
            }
        }
+    } else {
+       fflush(stdout);
     }
 }
 
index c6f2ab9e7b74ede43ca741c159a05242b47361b6..89c49fe0e1adc978ef38056268fae28875c1a9b2 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20161210) unstable; urgency=low
+ncurses6 (6.0+20161217) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 10 Dec 2016 07:47:46 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 17 Dec 2016 11:05:02 -0500
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index c6f2ab9e7b74ede43ca741c159a05242b47361b6..89c49fe0e1adc978ef38056268fae28875c1a9b2 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20161210) unstable; urgency=low
+ncurses6 (6.0+20161217) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 10 Dec 2016 07:47:46 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 17 Dec 2016 11:05:02 -0500
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index 1370e2e77a8e02c953498da8d0ee41152420f2df..64e5920717ff1bd01e93a3fca30cfb28ef3fb572 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20161210) unstable; urgency=low
+ncurses6 (6.0+20161217) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 10 Dec 2016 07:47:46 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 17 Dec 2016 11:05:02 -0500
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index 735618ec9848b6eb6b43b45ab89aa9170d430df1..5b10c37faec4b631fff41d1a46443c6b7544d6b8 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.188 2016/12/10 12:47:46 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.189 2016/12/17 16:05:02 tom Exp $\r
 \r
 ; TODO add examples\r
 ; TODO bump ABI to 6\r
@@ -10,7 +10,7 @@
 !define VERSION_MAJOR "6"\r
 !define VERSION_MINOR "0"\r
 !define VERSION_YYYY  "2016"\r
-!define VERSION_MMDD  "1210"\r
+!define VERSION_MMDD  "1217"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index 9ea6f18396516d085596ead0f8575d5db6533d57..89ae453fb61433cd7eeaa798f2cd6b0470c2b730 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.0
-Release: 20161210
+Release: 20161217
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 9728c9c70a3c2ba047189b02a4866dece5fa497a..3847651b709b289181119d54b1ce578a06f9ccd0 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.0
-Release: 20161210
+Release: 20161217
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
diff --git a/test/tput-colorcube b/test/tput-colorcube
new file mode 100644 (file)
index 0000000..480ff92
--- /dev/null
@@ -0,0 +1,130 @@
+#!/bin/sh
+##############################################################################
+# Copyright (c) 2016 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 "Software"), #
+# to deal in the Software without restriction, including without limitation  #
+# the rights to use, copy, modify, merge, publish, distribute, distribute    #
+# with modifications, sublicense, and/or sell copies of the Software, and to #
+# permit persons to whom the Software is furnished to do so, subject to the  #
+# following conditions:                                                      #
+#                                                                            #
+# The above copyright notice and this permission notice shall be included in #
+# all copies or substantial portions of the Software.                        #
+#                                                                            #
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
+# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
+# DEALINGS IN THE SOFTWARE.                                                  #
+#                                                                            #
+# Except as contained in this notice, the name(s) of the above copyright     #
+# holders shall not be used in advertising or otherwise to promote the sale, #
+# use or other dealings in this Software without prior written               #
+# authorization.                                                             #
+##############################################################################
+# $Id: tput-colorcube,v 1.1 2016/12/17 23:37:37 tom Exp $
+# Use this script to print an xterm-style color cube, e.g., as done in
+# the xterm 88colors2.pl and 256colors2.pl scripts.
+
+failed() {
+       printf "?? $*\n" >&2
+       exit 1
+}
+
+newline() {
+       tput op
+       printf "\n"
+}
+
+if [ $# = 1 ]
+then
+       myterm=$1
+elif [ $# = 0 ]
+then
+       myterm=$TERM
+else
+       failed "expected one parameter or none"
+fi
+
+colors=$(tput -T $myterm colors 2>/dev/null)
+if [ ${colors:-0} -le 0 ]
+then
+       myterm=${myterm%%-color}
+       colors=$(tput -T $myterm colors 2>/dev/null)
+fi
+if [ ${colors:-0} -le 0 ]
+then
+       failed "terminal $myterm does not support color"
+fi
+
+printf "System colors:\n"
+
+color=0
+inrow=$colors
+to_do=$colors
+[ $colors -gt 256 ] && colors=256
+[ $inrow  -gt   8 ] && inrow=8
+[ $to_do  -gt  16 ] && to_do=16
+while [ $color -lt $to_do ]
+do
+       [ $color = $inrow ] && newline
+       tput setab $color
+       printf '  '
+       color=$(expr $color + 1)
+done
+newline
+
+[ $colors -le 16 ] && exit
+
+if [ $colors = 256 ]
+then
+       cube=6
+       ramp=232
+elif [ $colors -ge 88 ]
+then
+       cube=4
+       ramp=80
+else
+       exit
+fi
+
+printf "\n"
+printf "Color cube, ${cube}x${cube}x${cube}:\n"
+g=0
+cube2=$(expr $cube \* $cube)
+while [ $g -lt $cube ]
+do
+       r=0
+       while [ $r -lt $cube ]
+       do
+               b=0
+               while [ $b -lt $cube ]
+               do
+                       color=$(expr 16 + \( $r \* $cube2 \) + \( $g \* $cube \) + $b)
+                       tput setab $color
+                       printf '  '
+                       b=$(expr $b + 1)
+               done
+               tput op
+               printf ' '
+               r=$(expr $r + 1)
+       done
+       newline
+       g=$(expr $g + 1)
+done
+
+printf "\n"
+printf "Grayscale ramp:\n"
+color=$ramp
+while [ $color -lt $colors ]
+do
+       tput setab $color
+       printf '  '
+       color=$(expr $color + 1)
+done
+newline
+# vi:ts=4 sw=4
index 3382ee5ad818ea479a4c51cd85c7566fa45c3667..d4dfddc0afdc7f2ca538686c927fca47287d5457 100644 (file)
@@ -26,7 +26,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: tput-initc,v 1.1 2016/12/10 23:35:46 tom Exp $
+# $Id: tput-initc,v 1.5 2016/12/17 22:35:05 tom Exp $
 # Some of the ".dat" files in ncurses' test-directory give r/g/b numbers for
 # default palettes of xterm and Linux console.  This script reads the numbers
 # and (assuming the same or compatible terminal) uses tput to (re)initialize
@@ -37,6 +37,40 @@ failed() {
        exit 1
 }
 
+usage() {
+       cat >&2 <<-EOF
+       usage: $0 [-r] [-s] [palette-data]
+
+       Use this script with a palette data-file to (re)initialize colors with
+       tput.  This script assumes arrangements for 16-, 88- and 256-colors
+       like the xterm 88colors2.pl and 256colors2.pl scripts.
+
+       Options:
+        -r     reverse palette
+        -s     reverse system colors (first 16 if more than 16 colors)
+EOF
+       exit 1
+}
+
+opt_r=no
+opt_s=no
+
+while getopts "rs" option "$@"
+do
+       case $option in
+       (r)
+               opt_r=yes
+               ;;
+       (s)
+               opt_s=yes
+               ;;
+       (*)
+               usage
+               ;;
+       esac
+done
+shift $(expr $OPTIND - 1)
+
 if [ $# = 1 ]
 then
        file=$1
@@ -70,8 +104,20 @@ then
 fi
 
 cat $file |\
-awk -v myterm=$myterm '
-BEGIN { limit=1000; }
+awk    -v opt_r=$opt_r \
+       -v opt_s=$opt_s \
+       -v colors=$colors \
+       -v myterm=$myterm '
+BEGIN {
+       limit = 1000;
+       range = -1;
+       cramp = -1;
+       if ( colors == 88 ) {
+               cramp = 80;
+       } else if ( colors = 256 ) {
+               cramp = 232;
+       }
+}
 function scaled(n) {
        return (n * 1000)/limit;
 }
@@ -83,5 +129,27 @@ function scaled(n) {
 
 /^[0-9]+:/{
        sub(":","",$1);
-       printf "tput -T%s initc %d %d %d %d\n", myterm, $1,scaled($2),scaled($3),scaled($4);
-}' |sh -
+       item = $1 + 0;
+       if (range < item) {
+               range = item;
+       }
+       params[$1] = sprintf ("%d %d %d", scaled($2),scaled($3),scaled($4));
+}
+END {
+       for (n = 0; n <= range; ++n) {
+               m = n;
+               if ( opt_r == "yes" ) {
+                       if ( colors <= 16 ) {
+                               m = range - n;
+                       } else if ( ( opt_s == "yes" ) && ( n < 16 ) ) {
+                               m = 15 - n;
+                       } else if ( n >= cramp ) {
+                               m = cramp + colors - 1 - n;
+                       } else {
+                               m = 16 + cramp - 1 - n;
+                       }
+               }
+               printf "tput -T%s initc %d %s\n", myterm, m, params[n];
+       }
+}
+' |sh -