Source-Changes-HG archive

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

[src/trunk]: src/lib/libcurses Set background character and attributes for ad...



details:   https://anonhg.NetBSD.org/src/rev/0a97887c89dd
branches:  trunk
changeset: 485092:0a97887c89dd
user:      jdc <jdc%NetBSD.org@localhost>
date:      Tue Apr 18 22:45:23 2000 +0000

description:
Set background character and attributes for added characters.

diffstat:

 lib/libcurses/addbytes.c |  10 +++++++---
 lib/libcurses/border.c   |  18 +++++++++++++++++-
 lib/libcurses/clrtobot.c |   9 ++++++---
 lib/libcurses/clrtoeol.c |   9 ++++++---
 lib/libcurses/delch.c    |   6 ++++--
 lib/libcurses/erase.c    |   9 ++++++---
 lib/libcurses/insch.c    |  10 +++++++---
 lib/libcurses/insdelln.c |   6 +++++-
 lib/libcurses/newwin.c   |   8 +++++---
 9 files changed, 63 insertions(+), 22 deletions(-)

diffs (truncated from 333 to 300 lines):

diff -r ecdd052e5d6a -r 0a97887c89dd lib/libcurses/addbytes.c
--- a/lib/libcurses/addbytes.c  Tue Apr 18 22:44:21 2000 +0000
+++ b/lib/libcurses/addbytes.c  Tue Apr 18 22:45:23 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: addbytes.c,v 1.18 2000/04/15 22:53:05 jdc Exp $        */
+/*     $NetBSD: addbytes.c,v 1.19 2000/04/18 22:45:23 jdc Exp $        */
 
 /*
  * Copyright (c) 1987, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)addbytes.c 8.4 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: addbytes.c,v 1.18 2000/04/15 22:53:05 jdc Exp $");
+__RCSID("$NetBSD: addbytes.c,v 1.19 2000/04/18 22:45:23 jdc Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -177,7 +177,9 @@
                            *win->lines[y]->lastchp);
 #endif
                        if (lp->line[x].ch != c ||
-                           lp->line[x].attr != attributes) {
+                           lp->line[x].attr != attributes ||
+                           lp->line[x].bch != win->bch ||
+                           lp->line[x].battr != win->battr) {
                                newx = x + win->ch_off;
                                if (!(lp->flags & __ISDIRTY))
                                        lp->flags |= __ISDIRTY;
@@ -197,6 +199,7 @@
 #endif
                        }
                        lp->line[x].ch = c;
+                       lp->line[x].bch = win->bch;
                        if (attributes & __STANDOUT)
                                lp->line[x].attr |= __STANDOUT;
                        else
@@ -238,6 +241,7 @@
                                lp->line[x].attr |= attributes & __COLOR;
                        } else
                                lp->line[x].attr &= ~__COLOR;
+                       lp->line[x].battr = win->battr;
                        if (x == win->maxx - 1)
                                lp->flags |= __ISPASTEOL;
                        else
diff -r ecdd052e5d6a -r 0a97887c89dd lib/libcurses/border.c
--- a/lib/libcurses/border.c    Tue Apr 18 22:44:21 2000 +0000
+++ b/lib/libcurses/border.c    Tue Apr 18 22:45:23 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: border.c,v 1.4 2000/04/15 13:17:03 blymn Exp $ */
+/*     $NetBSD: border.c,v 1.5 2000/04/18 22:45:24 jdc Exp $   */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -114,28 +114,44 @@
        /* Sides */
        for (i = 1; i < endy; i++) {
                win->lines[i]->line[0].ch = (wchar_t) left & __CHARTEXT;
+               win->lines[i]->line[0].bch = win->bch;
                win->lines[i]->line[0].attr = (attr_t) left & __ATTRIBUTES;
+               win->lines[i]->line[0].battr = win->battr;
                win->lines[i]->line[endx].ch = (wchar_t) right & __CHARTEXT;
+               win->lines[i]->line[endx].bch = win->bch;
                win->lines[i]->line[endx].attr = (attr_t) right & __ATTRIBUTES;
+               win->lines[i]->line[endx].battr = win->battr;
        }
        for (i = 1; i < endx; i++) {
                fp[i].ch = (wchar_t) top & __CHARTEXT;
+               fp[i].bch = win->bch;
                fp[i].attr = (attr_t) top & __ATTRIBUTES;
+               fp[i].battr = win->battr;
                lp[i].ch = (wchar_t) bottom & __CHARTEXT;
+               lp[i].bch = win->bch;
                lp[i].attr = (attr_t) bottom & __ATTRIBUTES;
+               lp[i].battr = win->battr;
        }
 
        /* Corners */
        if (!(win->maxx == LINES && win->maxy == COLS &&
            (win->flags & __SCROLLOK) && (win->flags & __SCROLLWIN))) {
                fp[0].ch = (wchar_t) topleft & __CHARTEXT;
+               fp[0].bch = win->bch;
                fp[0].attr = (attr_t) topleft & __ATTRIBUTES;
+               fp[0].battr = win->battr;
                fp[endx].ch = (wchar_t) topright & __CHARTEXT;
+               fp[endx].bch = win->bch;
                fp[endx].attr = (attr_t) topright & __ATTRIBUTES;
+               fp[endx].battr = win->battr;
                lp[0].ch = (wchar_t) botleft & __CHARTEXT;
+               lp[0].bch = win->bch;
                lp[0].attr = (attr_t) botleft & __ATTRIBUTES;
+               lp[0].battr = win->battr;
                lp[endx].ch = (wchar_t) botright & __CHARTEXT;
+               lp[endx].bch = win->bch;
                lp[endx].attr = (attr_t) botright & __ATTRIBUTES;
+               lp[endx].battr = win->battr;
        }
        __touchwin(win);
        return (OK);
diff -r ecdd052e5d6a -r 0a97887c89dd lib/libcurses/clrtobot.c
--- a/lib/libcurses/clrtobot.c  Tue Apr 18 22:44:21 2000 +0000
+++ b/lib/libcurses/clrtobot.c  Tue Apr 18 22:45:23 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clrtobot.c,v 1.12 2000/04/15 13:17:03 blymn Exp $      */
+/*     $NetBSD: clrtobot.c,v 1.13 2000/04/18 22:45:24 jdc Exp $        */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)clrtobot.c 8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: clrtobot.c,v 1.12 2000/04/15 13:17:03 blymn Exp $");
+__RCSID("$NetBSD: clrtobot.c,v 1.13 2000/04/18 22:45:24 jdc Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -83,12 +83,15 @@
                minx = -1;
                end = &win->lines[y]->line[win->maxx];
                for (sp = &win->lines[y]->line[startx]; sp < end; sp++)
-                       if (sp->ch != ' ' || sp->attr != 0) {
+                       if (sp->ch != ' ' || sp->attr != 0 ||
+                           sp->bch != win->bch || sp->battr != win->battr) {
                                maxx = sp;
                                if (minx == -1)
                                        minx = sp - win->lines[y]->line;
                                sp->ch = ' ';
+                               sp->bch = win->bch;
                                sp->attr = 0;
+                               sp->battr = win->battr;
                        }
                if (minx != -1)
                        __touchline(win, y, minx, maxx - win->lines[y]->line,
diff -r ecdd052e5d6a -r 0a97887c89dd lib/libcurses/clrtoeol.c
--- a/lib/libcurses/clrtoeol.c  Tue Apr 18 22:44:21 2000 +0000
+++ b/lib/libcurses/clrtoeol.c  Tue Apr 18 22:45:23 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clrtoeol.c,v 1.12 2000/04/15 13:17:03 blymn Exp $      */
+/*     $NetBSD: clrtoeol.c,v 1.13 2000/04/18 22:45:24 jdc Exp $        */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)clrtoeol.c 8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: clrtoeol.c,v 1.12 2000/04/15 13:17:03 blymn Exp $");
+__RCSID("$NetBSD: clrtoeol.c,v 1.13 2000/04/18 22:45:24 jdc Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -82,12 +82,15 @@
        minx = -1;
        maxx = &win->lines[y]->line[x];
        for (sp = maxx; sp < end; sp++)
-               if (sp->ch != ' ' || sp->attr != 0) {
+               if (sp->ch != ' ' || sp->attr != 0 ||
+                   sp->bch != win->bch || sp->battr != win->battr) {
                        maxx = sp;
                        if (minx == -1)
                                minx = sp - win->lines[y]->line;
                        sp->ch = ' ';
+                       sp->bch = win->bch;
                        sp->attr = 0;
+                       sp->battr = win->battr;
                }
 #ifdef DEBUG
        __CTRACE("CLRTOEOL: minx = %d, maxx = %d, firstch = %d, lastch = %d\n",
diff -r ecdd052e5d6a -r 0a97887c89dd lib/libcurses/delch.c
--- a/lib/libcurses/delch.c     Tue Apr 18 22:44:21 2000 +0000
+++ b/lib/libcurses/delch.c     Tue Apr 18 22:45:23 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: delch.c,v 1.12 2000/04/15 13:17:03 blymn Exp $ */
+/*     $NetBSD: delch.c,v 1.13 2000/04/18 22:45:24 jdc Exp $   */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)delch.c    8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: delch.c,v 1.12 2000/04/15 13:17:03 blymn Exp $");
+__RCSID("$NetBSD: delch.c,v 1.13 2000/04/18 22:45:24 jdc Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -100,7 +100,9 @@
                temp1++, temp2++;
        }
        temp1->ch = ' ';
+       temp1->bch = win->bch;
        temp1->attr = 0;
+       temp1->battr = win->battr;
        __touchline(win, (int) win->cury, (int) win->curx, (int) win->maxx - 1, 0);
        return (OK);
 }
diff -r ecdd052e5d6a -r 0a97887c89dd lib/libcurses/erase.c
--- a/lib/libcurses/erase.c     Tue Apr 18 22:44:21 2000 +0000
+++ b/lib/libcurses/erase.c     Tue Apr 18 22:45:23 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: erase.c,v 1.13 2000/04/15 13:17:03 blymn Exp $ */
+/*     $NetBSD: erase.c,v 1.14 2000/04/18 22:45:24 jdc Exp $   */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)erase.c    8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: erase.c,v 1.13 2000/04/15 13:17:03 blymn Exp $");
+__RCSID("$NetBSD: erase.c,v 1.14 2000/04/18 22:45:24 jdc Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -81,12 +81,15 @@
                start = win->lines[y]->line;
                end = &start[win->maxx];
                for (sp = start; sp < end; sp++)
-                       if (sp->ch != ' ' || sp->attr != 0) {
+                       if (sp->ch != ' ' || sp->attr != 0 ||
+                           sp->bch != win->bch || sp->battr != win->battr) {
                                maxx = sp;
                                if (minx == -1)
                                        minx = sp - start;
                                sp->ch = ' ';
+                               sp->bch = win->bch;
                                sp->attr = 0;
+                               sp->battr = win->battr;
                        }
                if (minx != -1)
                        __touchline(win, y, minx, maxx - win->lines[y]->line,
diff -r ecdd052e5d6a -r 0a97887c89dd lib/libcurses/insch.c
--- a/lib/libcurses/insch.c     Tue Apr 18 22:44:21 2000 +0000
+++ b/lib/libcurses/insch.c     Tue Apr 18 22:45:23 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: insch.c,v 1.13 2000/04/15 13:17:04 blymn Exp $ */
+/*     $NetBSD: insch.c,v 1.14 2000/04/18 22:45:24 jdc Exp $   */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)insch.c    8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: insch.c,v 1.13 2000/04/15 13:17:04 blymn Exp $");
+__RCSID("$NetBSD: insch.c,v 1.14 2000/04/18 22:45:24 jdc Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -102,11 +102,15 @@
                temp1--, temp2--;
        }
        temp1->ch = (wchar_t) ch & __CHARTEXT;
+       temp1->bch = win->bch;
        temp1->attr = (attr_t) ch & __ATTRIBUTES;
+       temp1->battr = win->battr;
        __touchline(win, (int) win->cury, (int) win->curx, (int) win->maxx - 1, 0);
        if (win->cury == LINES - 1 &&
            (win->lines[LINES - 1]->line[COLS - 1].ch != ' ' ||
-               win->lines[LINES - 1]->line[COLS - 1].attr != 0)) {
+               win->lines[LINES - 1]->line[COLS - 1].bch != ' ' ||
+               win->lines[LINES - 1]->line[COLS - 1].attr != 0 ||
+               win->lines[LINES - 1]->line[COLS - 1].battr != 0)) {
                if (win->flags & __SCROLLOK) {
                        wrefresh(win);
                        scroll(win);
diff -r ecdd052e5d6a -r 0a97887c89dd lib/libcurses/insdelln.c
--- a/lib/libcurses/insdelln.c  Tue Apr 18 22:44:21 2000 +0000
+++ b/lib/libcurses/insdelln.c  Tue Apr 18 22:45:23 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: insdelln.c,v 1.4 2000/04/16 05:48:25 mycroft Exp $     */
+/*     $NetBSD: insdelln.c,v 1.5 2000/04/18 22:45:24 jdc Exp $ */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -100,7 +100,9 @@
                for (y = win->cury - 1 + lines; y >= win->cury; --y)
                        for (i = 0; i < win->maxx; i++) {
                                win->lines[y]->line[i].ch = ' ';
+                               win->lines[y]->line[i].bch = win->bch;
                                win->lines[y]->line[i].attr = 0;
+                               win->lines[y]->line[i].battr = win->battr;
                        }
                for (y = win->maxy - 1; y >= win->cury; --y)
                        __touchline(win, y, 0, (int) win->maxx - 1, 0);
@@ -126,7 +128,9 @@
                for (y = win->maxy - lines; y < win->maxy; y++)
                        for (i = 0; i < win->maxx; i++) {
                                win->lines[y]->line[i].ch = ' ';
+                               win->lines[y]->line[i].bch = win->bch;
                                win->lines[y]->line[i].attr = 0;
+                               win->lines[y]->line[i].battr = win->battr;
                        }
                for (y = win->cury; y < win->maxy; y++)
                        __touchline(win, y, 0, (int) win->maxx - 1, 0);
diff -r ecdd052e5d6a -r 0a97887c89dd lib/libcurses/newwin.c
--- a/lib/libcurses/newwin.c    Tue Apr 18 22:44:21 2000 +0000
+++ b/lib/libcurses/newwin.c    Tue Apr 18 22:45:23 2000 +0000
@@ -1,4 +1,4 @@



Home | Main Index | Thread Index | Old Index