Source-Changes-HG archive

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

[src/trunk]: src/lib/libcurses Don't replace background character with null c...



details:   https://anonhg.NetBSD.org/src/rev/ecdd052e5d6a
branches:  trunk
changeset: 485091:ecdd052e5d6a
user:      jdc <jdc%NetBSD.org@localhost>
date:      Tue Apr 18 22:44:21 2000 +0000

description:
Don't replace background character with null character.
Set new background character and attributes in wbkgd().

diffstat:

 lib/libcurses/background.c |  20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diffs (49 lines):

diff -r 4a3883a011b9 -r ecdd052e5d6a lib/libcurses/background.c
--- a/lib/libcurses/background.c        Tue Apr 18 22:43:25 2000 +0000
+++ b/lib/libcurses/background.c        Tue Apr 18 22:44:21 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: background.c,v 1.4 2000/04/16 09:52:49 jdc Exp $       */
+/*     $NetBSD: background.c,v 1.5 2000/04/18 22:44:21 jdc Exp $       */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -66,10 +66,12 @@
 void
 wbkgdset(WINDOW *win, chtype ch)
 {
-       win->bchar = (wchar_t) ch & A_CHARTEXT;
-       win->battr = (attr_t) ch & A_ATTRIBUTES;
+       if (ch & __CHARTEXT)
+               win->bch = (wchar_t) ch & __CHARTEXT;
+       win->battr = (attr_t) ch & __ATTRIBUTES;
 #ifdef DEBUG
-       __CTRACE("wbkgdset: %08x, %08x\n", win->bchar, win->battr);
+       __CTRACE("wbkgdset: (%0.2o), '%s', %08x\n",
+           win, unctrl(win->bch), win->battr);
 #endif
 }
 
@@ -80,7 +82,15 @@
 int
 wbkgd(WINDOW *win, chtype ch)
 {
+       int     y, x;
+
        wbkgdset(win, ch);
+       for (y = 0; y < win->maxy; y++)
+               for (x = 0; x < win->maxx; x++) {
+                       if (ch & A_CHARTEXT)
+                               win->lines[y]->line[x].bch = ch & __CHARTEXT;
+                       win->lines[y]->line[x].battr = ch & __ATTRIBUTES;
+               }
        __touchwin(win);
        return(OK);
 }
@@ -92,6 +102,6 @@
 chtype
 getbkgd(WINDOW *win)
 {
-       return ((chtype) ((win->bchar & A_CHARTEXT) |
+       return ((chtype) ((win->bch & A_CHARTEXT) |
            (win->battr & A_ATTRIBUTES)));
 }



Home | Main Index | Thread Index | Old Index