]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.1 - patch 20181208
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 9 Dec 2018 02:29:47 +0000 (02:29 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 9 Dec 2018 02:29:47 +0000 (02:29 +0000)
+ modify wbkgd() and wbkgrnd() to improve compatibility with SVr4
  curses, changing the way the window rendition is updated when the
  background character is modified (report by Valery Ushakov).

31 files changed:
NEWS
VERSION
dist.mk
doc/html/man/adacurses6-config.1.html
doc/html/man/captoinfo.1m.html
doc/html/man/clear.1.html
doc/html/man/curs_bkgd.3x.html
doc/html/man/curs_bkgrnd.3x.html
doc/html/man/form.3x.html
doc/html/man/infocmp.1m.html
doc/html/man/infotocap.1m.html
doc/html/man/menu.3x.html
doc/html/man/ncurses.3x.html
doc/html/man/ncurses6-config.1.html
doc/html/man/panel.3x.html
doc/html/man/tabs.1.html
doc/html/man/terminfo.5.html
doc/html/man/tic.1m.html
doc/html/man/toe.1m.html
doc/html/man/tput.1.html
doc/html/man/tset.1.html
man/curs_bkgd.3x
man/curs_bkgrnd.3x
ncurses/base/lib_bkgd.c
package/debian-mingw/changelog
package/debian-mingw64/changelog
package/debian/changelog
package/mingw-ncurses.nsi
package/mingw-ncurses.spec
package/ncurses.spec
package/ncursest.spec

diff --git a/NEWS b/NEWS
index 27e2f56a70d00f059be5a8ac62d210c82a2c1132..06392ce054ee8afa3606d4e65d8dcd0582d095ab 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.3225 2018/12/01 20:59:08 tom Exp $
+-- $Id: NEWS,v 1.3227 2018/12/08 23:02:39 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,11 @@ 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.
 
+20181208
+       + modify wbkgd() and wbkgrnd() to improve compatibility with SVr4
+         curses, changing the way the window rendition is updated when the
+         background character is modified (report by Valery Ushakov).
+
 20181201
        + add midnightbsd to CF_XOPEN_SOURCE macro (patch by Urs Jansen).
        + add "@" command to test/ncurses F-test, to allow rapid jump to
diff --git a/VERSION b/VERSION
index 1cdeb4749d1bd65ad6a842e87867de87a816fdcc..ef14eb0266b98995b68c61248f747fa6b6b1df79 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:10 6.1     20181201
+5:0:10 6.1     20181208
diff --git a/dist.mk b/dist.mk
index fba98a8bb9d163e96a9139263e81b1ff4a832051..cf868befe6f5af4d3c1353a3fd0ce0dc363bc953 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.1254 2018/11/30 23:49:03 tom Exp $
+# $Id: dist.mk,v 1.1255 2018/12/08 16:21:26 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 = 1
-NCURSES_PATCH = 20181201
+NCURSES_PATCH = 20181208
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 2e1cde2b942ab08d3b639b800b551b93533e1992..235e07f308d110dd1efb4f064b6db97fa0af97c4 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180901).
+       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181208).
 
 
 
index 9f09568a341b5057fc05d7435f30604ed51333dc..59a0bb0067e73e03188607db5874b615970ef628 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180901).
+       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181208).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index b4de683bb0b239c9d340cc668a49ba0d6fc70977..54b8157dbd3de17ffdb6cc5a6d6bf0ec5f98faf5 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="tput.1.html">tput(1)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180901).
+       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181208).
 
 
 
index b5637820dcdf809674ddd1caa0a456e83d82209f..a96929f4707c02b0f4e91e96ece6a4dd55652c18 100644 (file)
@@ -26,7 +26,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_bkgd.3x,v 1.26 2018/07/28 21:34:06 tom Exp @
+  * @Id: curs_bkgd.3x,v 1.28 2018/12/09 00:45:05 tom Exp @
 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
 <HTML>
 </PRE><H3><a name="h3-bkgd">bkgd</a></H3><PRE>
        The <STRONG>bkgd</STRONG> and <STRONG>wbkgd</STRONG> functions set the background property of the current
        or  specified  window  and  then  apply this setting to every character
-       position in that window:
+       position in that window.  According to  X/Open  Curses,  it  should  do
+       this:
 
-       <STRONG>o</STRONG>   The rendition of every character on the screen is  changed  to  the
+       <STRONG>o</STRONG>   The  rendition  of  every character on the screen is changed to the
            new background rendition.
 
-       <STRONG>o</STRONG>   Wherever  the former background character appears, it is changed to
+       <STRONG>o</STRONG>   Wherever the former background character appears, it is changed  to
            the new background character.
 
+       Neither  X/Open Curses nor the SVr4 manual pages give details about the
+       way the rendition of characters on the screen is updated when  <STRONG>bkgd</STRONG>  or
+       <STRONG>wbkgd</STRONG> is used to change the background character.
+
+       This  implementation,  like  SVr4 curses, does not store the background
+       and window attribute contributions to each cell separately.  It updates
+       the rendition by comparing the character, non-color attributes and col-
+       ors contained in the background.  For each cell in the window,  whether
+       or not it is blank:
+
+       <STRONG>o</STRONG>   The  library  first  compares  the <EM>character</EM>, and if it matches the
+           current character part of the background, it replaces that with the
+           new background character.
+
+       <STRONG>o</STRONG>   The  library  then  checks  if the cell uses color, i.e., its color
+           pair value is nonzero.  If not, it simply replaces  the  attributes
+           and color pair in the cell with those from the new background char-
+           acter.
+
+       <STRONG>o</STRONG>   If the cell uses color, and that matches the color in  the  current
+           background, the library removes attributes which may have come from
+           the current background and adds attributes from the new background.
+           It finishes by setting the cell to use the color from the new back-
+           ground.
+
+       <STRONG>o</STRONG>   If the cell uses color, and that does not match the  color  in  the
+           current   background,   the  library  updates  only  the  non-color
+           attributes, first removing those which may have come from the  cur-
+           rent  background,  and  then  adding  attributes from the new back-
+           ground.
+
 
 </PRE><H3><a name="h3-getbkgd">getbkgd</a></H3><PRE>
        The <STRONG>getbkgd</STRONG> function returns  the  given  window's  current  background
 
 
 </PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
-       The  routines  <STRONG>bkgd</STRONG> and <STRONG>wbkgd</STRONG> return the integer <STRONG>OK</STRONG>.  The SVr4.0 manual
-       says "or a non-negative integer if <STRONG>immedok</STRONG> is set", but this appears to
-       be an error.
+       These  functions are described in the XSI Curses standard, Issue 4.  It
+       specifies that <STRONG>bkgd</STRONG> and <STRONG>wbkgd</STRONG> return <STRONG>ERR</STRONG> on failure, but gives no fail-
+       ure conditions.
+
+       The  routines  <STRONG>bkgd</STRONG> and <STRONG>wbkgd</STRONG> return the integer <STRONG>OK</STRONG>, unless the library
+       has not been initialized.
+
+       In contrast, the SVr4.0 manual says <STRONG>bkgd</STRONG> and <STRONG>wbkgd</STRONG> may return <STRONG>OK</STRONG> "or  a
+       non-negative  integer  if  <STRONG>immedok</STRONG>  is set", which refers to the return
+       value from <STRONG>wrefresh</STRONG> (used to implement the immediate repainting).   The
+       SVr4  curses  <STRONG>wrefresh</STRONG>  returns the number of characters written to the
+       screen during the refresh.  This implementation does not do that.
 
 
 </PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
        Note that <STRONG>bkgdset</STRONG> and <STRONG>bkgd</STRONG> may be macros.
 
+       X/Open Curses mentions that the character part of the  background  must
+       be  a  single-byte  value.   This  implementation, like SVr4, checks to
+       ensure that, and will reuse the old background character if  the  check
+       fails.
+
 
 </PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
-       These  functions are described in the XSI Curses standard, Issue 4.  It
-       specifies that <STRONG>bkgd</STRONG> and <STRONG>wbkgd</STRONG> return <STRONG>ERR</STRONG> on failure, but gives no fail-
-       ure conditions.
+       These  functions  are  described  in  the  XSI Curses standard, Issue 4
+       (X/Open Curses).
 
 
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
index 4d03fd1b4a5ad50843f8955f98b430c221ef158a..7d952f0c2a2f1ecb064484872ee1f941d54348d5 100644 (file)
@@ -26,7 +26,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_bkgrnd.3x,v 1.9 2018/07/28 21:34:06 tom Exp @
+  * @Id: curs_bkgrnd.3x,v 1.10 2018/12/09 00:50:50 tom Exp @
 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
 <HTML>
 </PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
        Note that <STRONG>bkgrnd</STRONG>, <STRONG>bkgrndset</STRONG>, and <STRONG>getbkgrnd</STRONG> may be macros.
 
+       X/Open Curses does not provide details on how the rendition is changed.
+       This  implementation follows the approach used in SVr4 curses, which is
+       explained in the manual page for <STRONG>wbkgd</STRONG>.
+
 
 </PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
        The <STRONG>bkgrndset</STRONG> and <STRONG>wbkgrndset</STRONG> routines do not return a value.
        <STRONG>o</STRONG>   A null character pointer is treated as an error.
 
 
+</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
+       These  functions  are  described  in  the  XSI Curses standard, Issue 4
+       (X/Open Curses).
+
+
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>
 
 </li>
 <li><a href="#h2-NOTES">NOTES</a></li>
 <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
+<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
 </ul>
 </div>
index 11c5bff9380956099cb7ab1a3572563ed02405c3..2fba6951fd9286c298e97368f937b730e80ad6c2 100644 (file)
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>  and  related  pages  whose names begin "form_" for detailed
        descriptions of the entry points.
 
-       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180901).
+       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181208).
 
 
 
index ae6e07b9ca45a18faf440fd84affabd3f9bc579f..f93f94d47dddcd47131a8e9652436ac3e2897b9a 100644 (file)
 
        https://invisible-island.net/ncurses/tctest.html
 
-       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180901).
+       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181208).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index b81e935721fd2c867937f7c123e60d7fcafcf6ad..971ab4f27e9d0f615683ad4c4fde10ce7e0b259d 100644 (file)
@@ -85,7 +85,7 @@
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180901).
+       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181208).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index cc374e1fa8a4e631a34e0fb910de2924f53808ad..7a54da3c2cedf1792d8409c03af730b3a6386d0c 100644 (file)
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>  and  related  pages  whose names begin "menu_" for detailed
        descriptions of the entry points.
 
-       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180901).
+       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181208).
 
 
 
index ae4f63c789e8622c574e9c2622d65d302caa386b..092c974c9066e936e6d0322668edcb6d3db065c2 100644 (file)
@@ -59,7 +59,7 @@
        method of updating  character  screens  with  reasonable  optimization.
        This  implementation  is  "new  curses"  (ncurses)  and is the approved
        replacement for 4.4BSD classic curses,  which  has  been  discontinued.
-       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180901).
+       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181208).
 
        The  <STRONG>ncurses</STRONG>  library emulates the curses library of System V Release 4
        UNIX, and XPG4 (X/Open Portability Guide) curses  (also  known  as  XSI
index f19bcf16d7bc20ab476c1628305ebe01ba15ac72..2b0cd4e1e6542be05582173a8131501d24a544ca 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180901).
+       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181208).
 
 
 
index 09bc4b9ba0bf75209975cb837e6c3fde7cb730be..57118c0501a2742a4d7486d3d75061eccff7bd50 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>,
 
-       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180901).
+       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181208).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index 2b8ce2cd3650292942fa0c9abdc5c211f238a90a..7be465a9406558eddff17ddac9147148852264bf 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="tset.1.html">tset(1)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
 
-       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180901).
+       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181208).
 
 
 
index b2659b88c537503b8e9ccb8598db17d6ecce7c1b..ea4a93d77bcf0a3ab00c64947d08caca82b6117d 100644 (file)
@@ -74,7 +74,7 @@
        <EM>Terminfo</EM> describes terminals by giving a set of capabilities which they
        have, by specifying how to perform screen operations, and by specifying
        padding  requirements  and  initialization  sequences.   This describes
-       <STRONG>ncurses</STRONG> version 6.1 (patch 20180901).
+       <STRONG>ncurses</STRONG> version 6.1 (patch 20181208).
 
 
 </PRE><H3><a name="h3-Terminfo-Entry-Syntax">Terminfo Entry Syntax</a></H3><PRE>
index f5a8dd21baa80696bc7ec485733809ed2234c0c2..38270188e5779f0eacfe50a730b9f9ba928c7d12 100644 (file)
        <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>,   <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>,   <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>,   <STRONG><A HREF="toe.1m.html">toe(1m)</A></STRONG>,   <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,
        <STRONG><A HREF="term.5.html">term(5)</A></STRONG>.  <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
 
-       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180901).
+       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181208).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index 13872498218b7875cabb1a4ba999899fd4c9d684..f070559298cafcf148786b9a1424f51f9812d400 100644 (file)
        <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>,  <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>,  <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,  <STRONG>ter-</STRONG>
        <STRONG><A HREF="terminfo.5.html">minfo(5)</A></STRONG>.
 
-       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180901).
+       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181208).
 
 
 
index 65c76c9dca6703f2f736d0c7ef2eae767ac5f46e..afa3be2a2b257d8f91bbdcb2871344b35c0c3007 100644 (file)
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: tput.1,v 1.61 2018/08/25 23:28:12 tom Exp @
+  * @Id: tput.1,v 1.62 2018/09/30 20:31:59 Sven.Joachim Exp @
 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
 <HTML>
 
        <STRONG>o</STRONG>   It  assigns exit code 4 to "invalid operand", which may be the same
            as <EM>unknown</EM> <EM>capability</EM>.  For instance, the source code for  Solaris'
-           xcurses uses the term "invalid' in this case.
+           xcurses uses the term "invalid" in this case.
 
        <STRONG>o</STRONG>   It  assigns  exit code 255 to a numeric variable that is not speci-
            fied in the terminfo database.   That  likely  is  a  documentation
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="clear.1.html">clear(1)</A></STRONG>, <STRONG>stty(1)</STRONG>, <STRONG><A HREF="tabs.1.html">tabs(1)</A></STRONG>, <STRONG><A HREF="tset.1.html">tset(1)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>, <STRONG><A HREF="curs_termcap.3x.html">curs_termcap(3x)</A></STRONG>.
 
-       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180901).
+       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181208).
 
 
 
index 57f348225739dad8b2054436423c93dbeb103ab4..43ab7e464ac40586173aa827d45cdb07302245cf 100644 (file)
        <STRONG>csh(1)</STRONG>,  <STRONG>sh(1)</STRONG>,  <STRONG>stty(1)</STRONG>,   <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG>,   <STRONG>tty(4)</STRONG>,   <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>,
        <STRONG>ttys(5)</STRONG>, <STRONG>environ(7)</STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180901).
+       This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181208).
 
 
 
index 2dc21e6a9c062025cd1e3cd2d9888752bbad4b3b..d93bbd4a995e1b5e197033f2c6814db266e68d4c 100644 (file)
@@ -26,7 +26,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_bkgd.3x,v 1.26 2018/07/28 21:34:06 tom Exp $
+.\" $Id: curs_bkgd.3x,v 1.28 2018/12/09 00:45:05 tom Exp $
 .de bP
 .ie n  .IP \(bu 4
 .el    .IP \(bu 2
@@ -57,8 +57,7 @@ The window background is a \fBchtype\fR consisting of
 any combination of attributes (i.e., rendition) and a character.
 The attribute part of the background is combined (OR'ed) with all non-blank
 characters that are written into the window with \fBwaddch\fR.
-Both
-the character and attribute parts of the background are combined with
+Both the character and attribute parts of the background are combined with
 the blank characters.
 The background becomes a property of the
 character and moves with the character through any scrolling and
@@ -71,7 +70,8 @@ as the graphic rendition of the character put on the screen.
 .PP
 The \fBbkgd\fR and \fBwbkgd\fR functions
 set the background property of the current or specified window
-and then apply this setting to every character position in that window:
+and then apply this setting to every character position in that window.
+According to X/Open Curses, it should do this:
 .PP
 .bP
 The rendition of every character on the screen is changed to
@@ -79,23 +79,72 @@ the new background rendition.
 .bP
 Wherever the former background character
 appears, it is changed to the new background character.
+.PP
+Neither X/Open Curses nor the SVr4 manual pages give details about
+the way the rendition of characters on the screen is updated when
+\fBbkgd\fP or \fBwbkgd\fP is used to change the background character.
+.PP
+This implementation, like SVr4 curses, does not store the background
+and window attribute contributions to each cell separately.
+It updates the rendition by comparing the character, non-color attributes and
+colors contained in the background.
+For each cell in the window, whether or not it is blank:
+.bP
+The library first compares the \fIcharacter\fP,
+and if it matches the current character part of the background,
+it replaces that with the new background character.
+.bP
+The library then checks if the cell uses color,
+i.e., its color pair value is nonzero.
+If not, it simply replaces the attributes and color pair in the
+cell with those from the new background character.
+.bP
+If the cell uses color,
+and that matches the color in the current background,
+the library removes attributes
+which may have come from the current background 
+and adds attributes from the new background.
+It finishes by setting the cell
+to use the color from the new background.
+.bP
+If the cell uses color,
+and that does not match the color in the current background,
+the library updates only the non-color attributes,
+first removing those which may have come from the current background,
+and then adding attributes from the new background.
 .SS getbkgd
 .PP
 The \fBgetbkgd\fR function returns the given window's current background
 character/attribute pair.
 .SH RETURN VALUE
 .PP
-The routines \fBbkgd\fR and \fBwbkgd\fR return the integer \fBOK\fR.
-The SVr4.0 manual says "or a non-negative integer if \fBimmedok\fR is set",
-but this appears to be an error.
+These functions are described in the XSI Curses standard, Issue 4.
+It specifies that \fBbkgd\fR and \fBwbkgd\fR return \fBERR\fR on failure,
+but gives no failure conditions.
+.PP
+The routines \fBbkgd\fR and \fBwbkgd\fR return the integer \fBOK\fR,
+unless the library has not been initialized.
+.PP
+In contrast,
+the SVr4.0 manual says \fBbkgd\fR and \fBwbkgd\fR may return \fBOK\fP
+"or a non-negative integer if \fBimmedok\fR is set",
+which refers to the return value from \fBwrefresh\fP
+(used to implement the immediate repainting).
+The SVr4 curses \fBwrefresh\fP returns the number of characters
+written to the screen during the refresh.
+This implementation does not do that.
 .SH NOTES
 .PP
 Note that \fBbkgdset\fR and \fBbkgd\fR may be macros.
+.PP
+X/Open Curses mentions that the character part of the background must
+be a single-byte value.
+This implementation, like SVr4, checks to ensure that,
+and will reuse the old background character if the check fails.
 .SH PORTABILITY
 .PP
-These functions are described in the XSI Curses standard, Issue 4.
-It specifies that \fBbkgd\fR and \fBwbkgd\fR return \fBERR\fR on failure,
-but gives no failure conditions.
+These functions are described in the XSI Curses standard, Issue 4
+(X/Open Curses).
 .SH SEE ALSO
 .na
 .PP
index 8a0920221eab6c307523bd96a0c5956dc49e2ee1..78ee92e18e32a7145d64fb8f59923fd62c4d119a 100644 (file)
@@ -26,7 +26,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_bkgrnd.3x,v 1.9 2018/07/28 21:34:06 tom Exp $
+.\" $Id: curs_bkgrnd.3x,v 1.10 2018/12/09 00:50:50 tom Exp $
 .de bP
 .ie n  .IP \(bu 4
 .el    .IP \(bu 2
@@ -97,6 +97,10 @@ Note that
 \fBbkgrndset\fR, and
 \fBgetbkgrnd\fR
 may be macros.
+.PP
+X/Open Curses does not provide details on how the rendition is changed.
+This implementation follows the approach used in SVr4 curses,
+which is explained in the manual page for \fBwbkgd\fP.
 .SH RETURN VALUE
 .PP
 The \fBbkgrndset\fR and \fBwbkgrndset\fR routines do not return a value.
@@ -107,6 +111,10 @@ Otherwise, they return \fBERR\fR:
 A null window pointer is treated as an error.
 .bP
 A null character pointer is treated as an error.
+.SH PORTABILITY
+.PP
+These functions are described in the XSI Curses standard, Issue 4
+(X/Open Curses).
 .SH SEE ALSO
 \fBcurses\fR(3X),
 \fBcurs_bkgd\fR(3X)
index 5dfe5c6d1dcde536b48625b5b90cdb8874cc6e57..d0d39d845364fcbb396ad6fc43ac5db76dd56897 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2014,2016 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2016,2018 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            *
@@ -36,7 +36,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_bkgd.c,v 1.50 2016/05/28 23:11:26 tom Exp $")
+MODULE_ID("$Id: lib_bkgd.c,v 1.52 2018/12/09 00:09:17 tom Exp $")
 
 /*
  * Set the window's background information.
@@ -117,31 +117,86 @@ static NCURSES_INLINE int
 #endif
 wbkgrnd(WINDOW *win, const ARG_CH_T ch)
 {
+#undef  SP_PARM
+#define SP_PARM SP             /* to use Charable() */
     int code = ERR;
 
     T((T_CALLED("wbkgd(%p,%s)"), (void *) win, _tracech_t(ch)));
 
-    if (win) {
+    if (SP == 0) {
+       ;
+    } else if (win) {
        NCURSES_CH_T new_bkgd = CHDEREF(ch);
-       NCURSES_CH_T old_bkgrnd;
+       NCURSES_CH_T old_bkgd;
        int y;
+       NCURSES_CH_T old_char;
+       attr_t old_attr;
+       int old_pair;
+       NCURSES_CH_T new_char;
+       attr_t new_attr;
+       int new_pair;
+
+       /* SVr4 trims color info if non-color terminal */
+       if (!SP->_pair_limit) {
+           RemAttr(new_bkgd, A_COLOR);
+           SetPair(new_bkgd, 0);
+       }
 
-       memset(&old_bkgrnd, 0, sizeof(old_bkgrnd));
-       (void) wgetbkgrnd(win, &old_bkgrnd);
+       memset(&old_bkgd, 0, sizeof(old_bkgd));
+       (void) wgetbkgrnd(win, &old_bkgd);
+
+       old_char = old_bkgd;
+       RemAttr(old_char, ~A_CHARTEXT);
+       old_attr = AttrOf(old_bkgd);
+       old_pair = GetPair(old_bkgd);
+
+       if (!(old_attr & A_COLOR)) {
+           old_pair = 0;
+       }
+
+       new_char = new_bkgd;
+       RemAttr(new_char, ~A_CHARTEXT);
+       new_attr = AttrOf(new_bkgd);
+       new_pair = GetPair(new_bkgd);
+
+       /* SVr4 limits background character to printable 7-bits */
+       if (!Charable(new_bkgd)) {
+           new_char = old_char;
+       }
 
        (void) wbkgrndset(win, CHREF(new_bkgd));
-       (void) wattrset(win, (int) AttrOf(win->_nc_bkgd));
+
+       /* SVr4 updates color pair if old/new match, otherwise just attrs */
+       if ((new_pair != 0) && (new_pair == old_pair)) {
+           SetAttr(win->_nc_bkgd, new_attr);
+           SetPair(win->_nc_bkgd, new_pair);
+       } else {
+           SetAttr(win->_nc_bkgd, new_attr);
+       }
 
        for (y = 0; y <= win->_maxy; y++) {
            int x;
 
            for (x = 0; x <= win->_maxx; x++) {
-               if (CharEq(win->_line[y].text[x], old_bkgrnd)) {
-                   win->_line[y].text[x] = win->_nc_bkgd;
+               NCURSES_CH_T *cp = &(win->_line[y].text[x]);
+               int tmp_pair = GetPair(*cp);
+               attr_t tmp_attr = AttrOf(*cp);
+
+               if (CharEq(*cp, old_bkgd)) {
+                   SetChar2(*cp, CharOf(new_char));
+               }
+               if (tmp_pair != 0) {
+                   if (tmp_pair == old_pair) {
+                       SetAttr(*cp, (tmp_attr & ~old_attr) | new_attr);
+                       SetPair(*cp, new_pair);
+                   } else {
+                       SetAttr(*cp,
+                               (tmp_attr & (~old_attr | A_COLOR))
+                               | (new_attr & ALL_BUT_COLOR));
+                   }
                } else {
-                   NCURSES_CH_T wch = win->_line[y].text[x];
-                   RemAttr(wch, (~(A_ALTCHARSET | A_CHARTEXT)));
-                   win->_line[y].text[x] = _nc_render(win, wch);
+                   SetAttr(*cp, new_attr);
+                   SetPair(*cp, new_pair);
                }
            }
        }
index 3ca5cb2ce62fcdf144f142dac9a425bc5391ea72..d1ac98738ce343aa2261f34d1dc6bbf001bea54d 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20181201) unstable; urgency=low
+ncurses6 (6.1+20181208) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Fri, 30 Nov 2018 18:49:03 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 08 Dec 2018 11:21:26 -0500
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index 3ca5cb2ce62fcdf144f142dac9a425bc5391ea72..d1ac98738ce343aa2261f34d1dc6bbf001bea54d 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20181201) unstable; urgency=low
+ncurses6 (6.1+20181208) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Fri, 30 Nov 2018 18:49:03 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 08 Dec 2018 11:21:26 -0500
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index 6c78595b7b77815049770fd1b457b3172f9b1176..02851aecce9cad21b4aae0feee0a26c12c35d1e8 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20181201) unstable; urgency=low
+ncurses6 (6.1+20181208) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Fri, 30 Nov 2018 18:49:03 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 08 Dec 2018 11:21:26 -0500
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index fa6af3869118aa7c5a0c1c9e14134cd868c2cbb3..0974dd66b6c27b6b1046a6850dda4181eeae5d30 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.301 2018/11/30 23:49:03 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.302 2018/12/08 16:21:26 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 "1"\r
 !define VERSION_YYYY  "2018"\r
-!define VERSION_MMDD  "1201"\r
+!define VERSION_MMDD  "1208"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index 5d1a5b68602a4874050eb48607f2f4e647c40d23..b247b2b4deaebf1e36567a9820cf4d5441179b9d 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.1
-Release: 20181201
+Release: 20181208
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index f8c4fbed9261a97b9429235fb476caab97ccf219..7c438cc43fb07578338806240b459b8660d8befd 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.1
-Release: 20181201
+Release: 20181208
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 6188b7028a38809d9eb9b6ce9ceb35bd9b725425..505974c2055eb5bcd3dab67702767d3178ab2ce8 100644 (file)
@@ -1,7 +1,7 @@
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.1
-Release: 20181201
+Release: 20181208
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz