GC __FORCEPAINT.

This commit is contained in:
mycroft 2000-05-20 15:12:15 +00:00
parent a8377e933e
commit 94f8eb040a
10 changed files with 55 additions and 84 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: clrtobot.c,v 1.13 2000/04/18 22:45:24 jdc Exp $ */
/* $NetBSD: clrtobot.c,v 1.14 2000/05/20 15:12:15 mycroft 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.13 2000/04/18 22:45:24 jdc Exp $");
__RCSID("$NetBSD: clrtobot.c,v 1.14 2000/05/20 15:12:15 mycroft Exp $");
#endif
#endif /* not lint */
@ -94,8 +94,7 @@ wclrtobot(WINDOW *win)
sp->battr = win->battr;
}
if (minx != -1)
__touchline(win, y, minx, maxx - win->lines[y]->line,
0);
__touchline(win, y, minx, maxx - win->lines[y]->line);
startx = 0;
}
return (OK);

View File

@ -1,4 +1,4 @@
/* $NetBSD: clrtoeol.c,v 1.13 2000/04/18 22:45:24 jdc Exp $ */
/* $NetBSD: clrtoeol.c,v 1.14 2000/05/20 15:12:15 mycroft 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.13 2000/04/18 22:45:24 jdc Exp $");
__RCSID("$NetBSD: clrtoeol.c,v 1.14 2000/05/20 15:12:15 mycroft Exp $");
#endif
#endif /* not lint */
@ -98,5 +98,5 @@ wclrtoeol(WINDOW *win)
*win->lines[y]->lastchp);
#endif
/* Update firstch and lastch for the line. */
return (__touchline(win, y, x, (int) win->maxx - 1, 0));
return (__touchline(win, y, x, (int) win->maxx - 1));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: curses_private.h,v 1.9 2000/05/01 12:30:30 blymn Exp $ */
/* $NetBSD: curses_private.h,v 1.10 2000/05/20 15:12:15 mycroft Exp $ */
/*-
* Copyright (c) 1998-2000 Brett Lymn
@ -53,7 +53,6 @@ struct __ldata {
struct __line {
#define __ISDIRTY 0x01 /* Line is dirty. */
#define __ISPASTEOL 0x02 /* Cursor is past end of line */
#define __FORCEPAINT 0x04 /* Force a repaint of the line */
unsigned int flags;
unsigned int hash; /* Hash value for the line. */
int *firstchp, *lastchp; /* First and last chngd columns ptrs */
@ -126,7 +125,7 @@ void __stop_signal_handler(int signo);
int __stopwin(void);
void __swflags(WINDOW *win);
int __timeout(int delay);
int __touchline(WINDOW *win, int y, int sx, int ex, int force);
int __touchline(WINDOW *win, int y, int sx, int ex);
int __touchwin(WINDOW *win);
char *__tscroll(const char *cap, int n1, int n2);
void __unsetattr(int);

View File

@ -1,4 +1,4 @@
/* $NetBSD: delch.c,v 1.13 2000/04/18 22:45:24 jdc Exp $ */
/* $NetBSD: delch.c,v 1.14 2000/05/20 15:12:15 mycroft 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.13 2000/04/18 22:45:24 jdc Exp $");
__RCSID("$NetBSD: delch.c,v 1.14 2000/05/20 15:12:15 mycroft Exp $");
#endif
#endif /* not lint */
@ -103,6 +103,6 @@ wdelch(WINDOW *win)
temp1->bch = win->bch;
temp1->attr = 0;
temp1->battr = win->battr;
__touchline(win, (int) win->cury, (int) win->curx, (int) win->maxx - 1, 0);
__touchline(win, (int) win->cury, (int) win->curx, (int) win->maxx - 1);
return (OK);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: erase.c,v 1.14 2000/04/18 22:45:24 jdc Exp $ */
/* $NetBSD: erase.c,v 1.15 2000/05/20 15:12:15 mycroft 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.14 2000/04/18 22:45:24 jdc Exp $");
__RCSID("$NetBSD: erase.c,v 1.15 2000/05/20 15:12:15 mycroft Exp $");
#endif
#endif /* not lint */
@ -92,8 +92,7 @@ werase(WINDOW *win)
sp->battr = win->battr;
}
if (minx != -1)
__touchline(win, y, minx, maxx - win->lines[y]->line,
0);
__touchline(win, y, minx, maxx - win->lines[y]->line);
}
wmove(win, 0, 0);
return (OK);

View File

@ -1,4 +1,4 @@
/* $NetBSD: insch.c,v 1.14 2000/04/18 22:45:24 jdc Exp $ */
/* $NetBSD: insch.c,v 1.15 2000/05/20 15:12:15 mycroft 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.14 2000/04/18 22:45:24 jdc Exp $");
__RCSID("$NetBSD: insch.c,v 1.15 2000/05/20 15:12:15 mycroft Exp $");
#endif
#endif /* not lint */
@ -105,7 +105,7 @@ winsch(WINDOW *win, chtype ch)
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);
__touchline(win, (int) win->cury, (int) win->curx, (int) win->maxx - 1);
if (win->cury == LINES - 1 &&
(win->lines[LINES - 1]->line[COLS - 1].ch != ' ' ||
win->lines[LINES - 1]->line[COLS - 1].bch != ' ' ||

View File

@ -1,4 +1,4 @@
/* $NetBSD: insdelln.c,v 1.6 2000/04/24 14:09:43 blymn Exp $ */
/* $NetBSD: insdelln.c,v 1.7 2000/05/20 15:12:15 mycroft Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: insdelln.c,v 1.6 2000/04/24 14:09:43 blymn Exp $");
__RCSID("$NetBSD: insdelln.c,v 1.7 2000/05/20 15:12:15 mycroft Exp $");
#endif /* not lint */
/*
@ -110,7 +110,7 @@ winsdelln(WINDOW *win, int lines)
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);
__touchline(win, y, 0, (int) win->maxx - 1);
} else {
/* Delete lines */
lines = 0 - lines;
@ -138,7 +138,7 @@ winsdelln(WINDOW *win, int lines)
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);
__touchline(win, y, 0, (int) win->maxx - 1);
}
if (win->orig != NULL)
__id_subwins(win->orig);

View File

@ -1,4 +1,4 @@
/* $NetBSD: refresh.c,v 1.34 2000/05/19 16:00:52 mycroft Exp $ */
/* $NetBSD: refresh.c,v 1.35 2000/05/20 15:12:15 mycroft Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)refresh.c 8.7 (Berkeley) 8/13/94";
#else
__RCSID("$NetBSD: refresh.c,v 1.34 2000/05/19 16:00:52 mycroft Exp $");
__RCSID("$NetBSD: refresh.c,v 1.35 2000/05/20 15:12:15 mycroft Exp $");
#endif
#endif /* not lint */
@ -107,7 +107,7 @@ wnoutrefresh(WINDOW *win)
__CTRACE("wnoutrefresh: wy %d\tf: %d\tl:%d\tflags %x\n", wy,
*wlp->firstchp, *wlp->lastchp, wlp->flags);
#endif
if ((wlp->flags & (__FORCEPAINT | __ISDIRTY)) == 0)
if ((wlp->flags & __ISDIRTY) == 0)
continue;
vlp = __virtscr->lines[wy + win->begy];
@ -131,10 +131,6 @@ wnoutrefresh(WINDOW *win)
}
/* Set flags on "__virtscr" and unset on "win". */
if (wlp->flags & __FORCEPAINT) {
vlp->flags |= __FORCEPAINT;
wlp->flags &= ~__FORCEPAINT;
}
if (wlp->flags & __ISPASTEOL)
vlp->flags |= __ISPASTEOL;
else
@ -272,8 +268,7 @@ doupdate(void)
* in the window are dirty.
*/
for (wy = 0, dnum = 0; wy < win->maxy; wy++)
if (win->lines[wy]->flags &
(__ISDIRTY | __FORCEPAINT))
if (win->lines[wy]->flags & __ISDIRTY)
dnum++;
if (!__noqch && dnum > (int) win->maxy / 4)
quickch();
@ -318,7 +313,7 @@ doupdate(void)
#endif
if (!curwin)
curscr->lines[wy]->hash = wlp->hash;
if (wlp->flags & (__ISDIRTY | __FORCEPAINT)) {
if (wlp->flags & __ISDIRTY) {
if (makech(wy) == ERR)
return (ERR);
else {
@ -374,10 +369,9 @@ makech(wy)
WINDOW *win;
static __LDATA blank = {' ', 0, ' ', 0};
__LDATA *nsp, *csp, *cp, *cep;
u_int force;
int clsp, nlsp; /* Last space in lines. */
int lch, wx;
char *ce, cm_buff[1024];
char *ce;
attr_t lspc; /* Last space colour */
attr_t off, on;
@ -413,8 +407,6 @@ makech(wy)
csp = &curscr->lines[wy]->line[wx];
nsp = &win->lines[wy]->line[wx];
force = win->lines[wy]->flags & __FORCEPAINT;
win->lines[wy]->flags &= ~__FORCEPAINT;
if (CE && !curwin) {
cp = &win->lines[wy]->line[win->maxx - 1];
lspc = cp->attr & __COLOR;
@ -428,18 +420,8 @@ makech(wy)
else
ce = NULL;
if (force) {
if (CM) {
t_goto(NULL, CM, lx, ly, cm_buff, 1023);
tputs(cm_buff, 0, __cputchar);
} else {
tputs(HO, 0, __cputchar);
__mvcur(0, 0, ly, lx, 1);
}
}
while (wx <= lch) {
if (!force && memcmp(nsp, csp, sizeof(__LDATA)) == 0) {
if (memcmp(nsp, csp, sizeof(__LDATA)) == 0) {
if (wx <= lch) {
while (wx <= lch &&
memcmp(nsp, csp, sizeof(__LDATA)) == 0) {
@ -455,14 +437,12 @@ makech(wy)
domvcur(ly, lx, wy, wx);
#ifdef DEBUG
__CTRACE("makech: 1: wx = %d, ly= %d, lx = %d, newy = %d, newx = %d, force =%d\n",
wx, ly, lx, wy, wx, force);
__CTRACE("makech: 1: wx = %d, ly= %d, lx = %d, newy = %d, newx = %d\n",
wx, ly, lx, wy, wx);
#endif
ly = wy;
lx = wx;
while ((force || memcmp(nsp, csp, sizeof(__LDATA)) != 0)
&& wx <= lch) {
while (memcmp(nsp, csp, sizeof(__LDATA)) != 0 && wx <= lch) {
if (ce != NULL &&
wx >= nlsp && nsp->ch == ' ' && nsp->attr == lspc) {
/* Check for clear to end-of-line. */
@ -729,12 +709,11 @@ quickch(void)
* Find how many lines from the top of the screen are unchanged.
*/
for (top = 0; top < __virtscr->maxy; top++)
if (__virtscr->lines[top]->flags & __FORCEPAINT ||
(__virtscr->lines[top]->flags & __ISDIRTY &&
(__virtscr->lines[top]->hash != curscr->lines[top]->hash
|| memcmp(__virtscr->lines[top]->line,
if (__virtscr->lines[top]->flags & __ISDIRTY &&
(__virtscr->lines[top]->hash != curscr->lines[top]->hash ||
memcmp(__virtscr->lines[top]->line,
curscr->lines[top]->line,
(size_t) __virtscr->maxx * __LDATASIZE) != 0)))
(size_t) __virtscr->maxx * __LDATASIZE) != 0))
break;
else
__virtscr->lines[top]->flags &= ~__ISDIRTY;
@ -742,12 +721,11 @@ quickch(void)
* Find how many lines from bottom of screen are unchanged.
*/
for (bot = __virtscr->maxy - 1; bot >= 0; bot--)
if (__virtscr->lines[bot]->flags & __FORCEPAINT ||
(__virtscr->lines[bot]->flags & __ISDIRTY &&
(__virtscr->lines[bot]->hash != curscr->lines[bot]->hash
|| memcmp(__virtscr->lines[bot]->line,
if (__virtscr->lines[bot]->flags & __ISDIRTY &&
(__virtscr->lines[bot]->hash != curscr->lines[bot]->hash ||
memcmp(__virtscr->lines[bot]->line,
curscr->lines[bot]->line,
(size_t) __virtscr->maxx * __LDATASIZE) != 0)))
(size_t) __virtscr->maxx * __LDATASIZE) != 0))
break;
else
__virtscr->lines[bot]->flags &= ~__ISDIRTY;
@ -801,10 +779,8 @@ quickch(void)
starts++) {
for (curw = startw, curs = starts;
curs < starts + bsize; curw++, curs++)
if (__virtscr->lines[curw]->flags &
__FORCEPAINT ||
__virtscr->lines[curw]->hash !=
curscr->lines[curs]->hash)
if (__virtscr->lines[curw]->hash !=
curscr->lines[curs]->hash)
break;
if (curs != starts + bsize)
continue;
@ -939,18 +915,18 @@ done:
__CTRACE("-- blanked out: dirty\n");
#endif
clp->hash = blank_hash;
__touchline(__virtscr, target, 0, (int) __virtscr->maxx - 1, 0);
__touchline(__virtscr, target, 0, (int) __virtscr->maxx - 1);
} else {
#ifdef DEBUG
__CTRACE(" -- blank line already: dirty\n");
#endif
__touchline(__virtscr, target, 0, (int) __virtscr->maxx - 1, 0);
__touchline(__virtscr, target, 0, (int) __virtscr->maxx - 1);
}
} else {
#ifdef DEBUG
__CTRACE(" -- dirty\n");
#endif
__touchline(__virtscr, target, 0, (int) __virtscr->maxx - 1, 0);
__touchline(__virtscr, target, 0, (int) __virtscr->maxx - 1);
}
if (target == cur_period) {
i = target + 1;

View File

@ -1,4 +1,4 @@
/* $NetBSD: toucholap.c,v 1.11 2000/04/15 13:17:05 blymn Exp $ */
/* $NetBSD: toucholap.c,v 1.12 2000/05/20 15:12:15 mycroft Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)toucholap.c 8.2 (Berkeley) 5/4/94";
#else
__RCSID("$NetBSD: toucholap.c,v 1.11 2000/04/15 13:17:05 blymn Exp $");
__RCSID("$NetBSD: toucholap.c,v 1.12 2000/05/20 15:12:15 mycroft Exp $");
#endif
#endif /* not lint */
@ -78,6 +78,6 @@ touchoverlap(WINDOW *win1, WINDOW *win2)
endy -= win2->begy;
endx -= win2->begx;
for (--endx, y = starty; y < endy; y++)
__touchline(win2, y, startx, endx, 0);
__touchline(win2, y, startx, endx);
return (OK);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: touchwin.c,v 1.14 2000/05/19 07:39:20 mycroft Exp $ */
/* $NetBSD: touchwin.c,v 1.15 2000/05/20 15:12:15 mycroft Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)touchwin.c 8.2 (Berkeley) 5/4/94";
#else
__RCSID("$NetBSD: touchwin.c,v 1.14 2000/05/19 07:39:20 mycroft Exp $");
__RCSID("$NetBSD: touchwin.c,v 1.15 2000/05/20 15:12:15 mycroft Exp $");
#endif
#endif /* not lint */
@ -55,7 +55,7 @@ is_linetouched(WINDOW *win, int line)
if (line > win->maxy)
return FALSE;
return ((win->lines[line]->flags & (__ISDIRTY | __FORCEPAINT)) != 0);
return ((win->lines[line]->flags & __ISDIRTY) != 0);
}
@ -124,7 +124,7 @@ wtouchln(WINDOW *win, int line, int n, int changed)
for (y = line; y < line + n; y++) {
if (changed == 1)
__touchline(win, y, 0, (int) win->maxx - 1, 0);
__touchline(win, y, 0, (int) win->maxx - 1);
else {
wlp = win->lines[y];
if (*wlp->firstchp >= win->ch_off &&
@ -133,7 +133,7 @@ wtouchln(WINDOW *win, int line, int n, int changed)
if (*wlp->lastchp >= win->ch_off &&
*wlp->lastchp < win->maxx + win->ch_off)
*wlp->lastchp = win->ch_off;
wlp->flags &= ~(__FORCEPAINT | __ISDIRTY);
wlp->flags &= ~__ISDIRTY;
}
}
@ -151,20 +151,18 @@ __touchwin(WINDOW *win)
#endif
maxy = win->maxy;
for (y = 0; y < maxy; y++)
__touchline(win, y, 0, (int) win->maxx - 1, 0);
__touchline(win, y, 0, (int) win->maxx - 1);
return (OK);
}
int
__touchline(WINDOW *win, int y, int sx, int ex, int force)
__touchline(WINDOW *win, int y, int sx, int ex)
{
#ifdef DEBUG
__CTRACE("touchline: (%0.2o, %d, %d, %d, %d)\n", win, y, sx, ex, force);
__CTRACE("touchline: (%0.2o, %d, %d, %d)\n", win, y, sx, ex);
__CTRACE("touchline: first = %d, last = %d\n",
*win->lines[y]->firstchp, *win->lines[y]->lastchp);
#endif
if (force)
win->lines[y]->flags |= __FORCEPAINT;
sx += win->ch_off;
ex += win->ch_off;
if (!(win->lines[y]->flags & __ISDIRTY))