1993-03-21 12:45:37 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 1981 Regents of the University of California.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by the University of
|
|
|
|
* California, Berkeley and its contributors.
|
|
|
|
* 4. Neither the name of the University nor the names of its contributors
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef lint
|
|
|
|
static char sccsid[] = "@(#)refresh.c 5.5 (Berkeley) 3/3/91";
|
|
|
|
#endif /* not lint */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* make the current screen look like "win" over the area coverd by
|
|
|
|
* win.
|
|
|
|
*/
|
|
|
|
|
|
|
|
# include "curses.ext"
|
|
|
|
|
|
|
|
# ifdef DEBUG
|
|
|
|
# define STATIC
|
|
|
|
# else
|
|
|
|
# define STATIC static
|
|
|
|
# endif
|
|
|
|
|
|
|
|
STATIC short ly, lx;
|
|
|
|
|
|
|
|
STATIC bool curwin;
|
|
|
|
|
|
|
|
WINDOW *_win = NULL;
|
|
|
|
|
|
|
|
STATIC int domvcur(), makech();
|
|
|
|
|
|
|
|
wrefresh(win)
|
|
|
|
reg WINDOW *win;
|
|
|
|
{
|
|
|
|
reg short wy;
|
|
|
|
reg int retval;
|
|
|
|
reg WINDOW *orig;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* make sure were in visual state
|
|
|
|
*/
|
|
|
|
if (_endwin) {
|
|
|
|
_puts(VS);
|
|
|
|
_puts(TI);
|
|
|
|
_endwin = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* initialize loop parameters
|
|
|
|
*/
|
|
|
|
|
|
|
|
ly = curscr->_cury;
|
|
|
|
lx = curscr->_curx;
|
|
|
|
wy = 0;
|
|
|
|
_win = win;
|
|
|
|
curwin = (win == curscr);
|
|
|
|
|
|
|
|
if (win->_clear || curscr->_clear || curwin) {
|
|
|
|
if ((win->_flags & _FULLWIN) || curscr->_clear) {
|
|
|
|
_puts(CL);
|
|
|
|
ly = 0;
|
|
|
|
lx = 0;
|
|
|
|
if (!curwin) {
|
|
|
|
curscr->_clear = FALSE;
|
|
|
|
curscr->_cury = 0;
|
|
|
|
curscr->_curx = 0;
|
|
|
|
werase(curscr);
|
|
|
|
}
|
|
|
|
touchwin(win);
|
|
|
|
}
|
|
|
|
win->_clear = FALSE;
|
|
|
|
}
|
|
|
|
if (!CA) {
|
|
|
|
if (win->_curx != 0)
|
|
|
|
_putchar('\n');
|
|
|
|
if (!curwin)
|
|
|
|
werase(curscr);
|
|
|
|
}
|
|
|
|
# ifdef DEBUG
|
|
|
|
fprintf(outf, "REFRESH(%0.2o): curwin = %d\n", win, curwin);
|
|
|
|
fprintf(outf, "REFRESH:\n\tfirstch\tlastch\n");
|
|
|
|
# endif
|
|
|
|
for (wy = 0; wy < win->_maxy; wy++) {
|
|
|
|
# ifdef DEBUG
|
|
|
|
fprintf(outf, "%d\t%d\t%d\n", wy, win->_firstch[wy],
|
|
|
|
win->_lastch[wy]);
|
|
|
|
# endif
|
|
|
|
if (win->_firstch[wy] != _NOCHANGE)
|
|
|
|
if (makech(win, wy) == ERR)
|
|
|
|
return ERR;
|
|
|
|
else {
|
|
|
|
if (win->_firstch[wy] >= win->_ch_off)
|
|
|
|
win->_firstch[wy] = win->_maxx +
|
|
|
|
win->_ch_off;
|
|
|
|
if (win->_lastch[wy] < win->_maxx +
|
|
|
|
win->_ch_off)
|
|
|
|
win->_lastch[wy] = win->_ch_off;
|
|
|
|
if (win->_lastch[wy] < win->_firstch[wy])
|
|
|
|
win->_firstch[wy] = _NOCHANGE;
|
|
|
|
}
|
|
|
|
# ifdef DEBUG
|
|
|
|
fprintf(outf, "\t%d\t%d\n", win->_firstch[wy],
|
|
|
|
win->_lastch[wy]);
|
|
|
|
# endif
|
|
|
|
}
|
|
|
|
|
|
|
|
if (win == curscr)
|
|
|
|
domvcur(ly, lx, win->_cury, win->_curx);
|
|
|
|
else {
|
|
|
|
if (win->_leave) {
|
|
|
|
curscr->_cury = ly;
|
|
|
|
curscr->_curx = lx;
|
|
|
|
ly -= win->_begy;
|
|
|
|
lx -= win->_begx;
|
|
|
|
if (ly >= 0 && ly < win->_maxy && lx >= 0 &&
|
|
|
|
lx < win->_maxx) {
|
|
|
|
win->_cury = ly;
|
|
|
|
win->_curx = lx;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
win->_cury = win->_curx = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
domvcur(ly, lx, win->_cury + win->_begy,
|
|
|
|
win->_curx + win->_begx);
|
|
|
|
curscr->_cury = win->_cury + win->_begy;
|
|
|
|
curscr->_curx = win->_curx + win->_begx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
retval = OK;
|
|
|
|
ret:
|
|
|
|
_win = NULL;
|
|
|
|
fflush(stdout);
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* make a change on the screen
|
|
|
|
*/
|
|
|
|
STATIC
|
|
|
|
makech(win, wy)
|
|
|
|
reg WINDOW *win;
|
|
|
|
short wy;
|
|
|
|
{
|
added Andrew Chernov's patch set:
Standard curses library use eight bit for standout mode, so
8-bit characters displays like highlighted 7-bit characters.
This patch produce library which is fully compatible with all curses
programs and add 8-bit chars to all input/display functions.
---
I don't think, that any programs wish to use internal curses
attribute _STANDOUT directly, in expressions like:
addch( ch | _STANDOUT );
Normal interface use standout() and standend() functions instead.
Many programs use 'char' type (with sign extention) for input characters
and sign extention becomes _STANDOUT mode in this case.
So, I refuse this future and allow 8-bit characters for programs,
which is designed for 7-bit only ('char' type using instead of
'unsigned char').
---
This small patch fix unpleasant standard curses bug:
curses can't expand TAB at all (but tries).
A man who wrote this curses misplace SYNC_IN and SYNCH_OUT,
this patch exchange macro calls.
This patch useful for standard 7-bit curses too, for this
you must delete '_' symbol before waddbytes and apply patch.
---
Oh, NO! This curses are really buggy!
This small patch fix following problem:
[ assumed scrollok(stdscr, TRUE) ]
when addch(ch) at lower right corner of screen, curses are realy
gone mad instead if simple scrolling... Curses code assumed that
this will be done correctly, but implement it with two bugs.
1993-07-09 09:34:14 +04:00
|
|
|
reg chtype *nsp, *csp, *ce;
|
1993-03-21 12:45:37 +03:00
|
|
|
reg short wx, lch, y;
|
|
|
|
reg int nlsp, clsp; /* last space in lines */
|
added Andrew Chernov's patch set:
Standard curses library use eight bit for standout mode, so
8-bit characters displays like highlighted 7-bit characters.
This patch produce library which is fully compatible with all curses
programs and add 8-bit chars to all input/display functions.
---
I don't think, that any programs wish to use internal curses
attribute _STANDOUT directly, in expressions like:
addch( ch | _STANDOUT );
Normal interface use standout() and standend() functions instead.
Many programs use 'char' type (with sign extention) for input characters
and sign extention becomes _STANDOUT mode in this case.
So, I refuse this future and allow 8-bit characters for programs,
which is designed for 7-bit only ('char' type using instead of
'unsigned char').
---
This small patch fix unpleasant standard curses bug:
curses can't expand TAB at all (but tries).
A man who wrote this curses misplace SYNC_IN and SYNCH_OUT,
this patch exchange macro calls.
This patch useful for standard 7-bit curses too, for this
you must delete '_' symbol before waddbytes and apply patch.
---
Oh, NO! This curses are really buggy!
This small patch fix following problem:
[ assumed scrollok(stdscr, TRUE) ]
when addch(ch) at lower right corner of screen, curses are realy
gone mad instead if simple scrolling... Curses code assumed that
this will be done correctly, but implement it with two bugs.
1993-07-09 09:34:14 +04:00
|
|
|
char *ce_tcap;
|
|
|
|
static chtype blank[] = {' ','\0'};
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
wx = win->_firstch[wy] - win->_ch_off;
|
|
|
|
if (wx >= win->_maxx)
|
|
|
|
return OK;
|
|
|
|
else if (wx < 0)
|
|
|
|
wx = 0;
|
|
|
|
lch = win->_lastch[wy] - win->_ch_off;
|
|
|
|
if (lch < 0)
|
|
|
|
return OK;
|
|
|
|
else if (lch >= win->_maxx)
|
|
|
|
lch = win->_maxx - 1;;
|
|
|
|
y = wy + win->_begy;
|
|
|
|
|
|
|
|
if (curwin)
|
added Andrew Chernov's patch set:
Standard curses library use eight bit for standout mode, so
8-bit characters displays like highlighted 7-bit characters.
This patch produce library which is fully compatible with all curses
programs and add 8-bit chars to all input/display functions.
---
I don't think, that any programs wish to use internal curses
attribute _STANDOUT directly, in expressions like:
addch( ch | _STANDOUT );
Normal interface use standout() and standend() functions instead.
Many programs use 'char' type (with sign extention) for input characters
and sign extention becomes _STANDOUT mode in this case.
So, I refuse this future and allow 8-bit characters for programs,
which is designed for 7-bit only ('char' type using instead of
'unsigned char').
---
This small patch fix unpleasant standard curses bug:
curses can't expand TAB at all (but tries).
A man who wrote this curses misplace SYNC_IN and SYNCH_OUT,
this patch exchange macro calls.
This patch useful for standard 7-bit curses too, for this
you must delete '_' symbol before waddbytes and apply patch.
---
Oh, NO! This curses are really buggy!
This small patch fix following problem:
[ assumed scrollok(stdscr, TRUE) ]
when addch(ch) at lower right corner of screen, curses are realy
gone mad instead if simple scrolling... Curses code assumed that
this will be done correctly, but implement it with two bugs.
1993-07-09 09:34:14 +04:00
|
|
|
csp = blank;
|
1993-03-21 12:45:37 +03:00
|
|
|
else
|
|
|
|
csp = &curscr->_y[wy + win->_begy][wx + win->_begx];
|
|
|
|
|
|
|
|
nsp = &win->_y[wy][wx];
|
|
|
|
if (CE && !curwin) {
|
|
|
|
for (ce = &win->_y[wy][win->_maxx - 1]; *ce == ' '; ce--)
|
|
|
|
if (ce <= win->_y[wy])
|
|
|
|
break;
|
|
|
|
nlsp = ce - win->_y[wy];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!curwin)
|
added Andrew Chernov's patch set:
Standard curses library use eight bit for standout mode, so
8-bit characters displays like highlighted 7-bit characters.
This patch produce library which is fully compatible with all curses
programs and add 8-bit chars to all input/display functions.
---
I don't think, that any programs wish to use internal curses
attribute _STANDOUT directly, in expressions like:
addch( ch | _STANDOUT );
Normal interface use standout() and standend() functions instead.
Many programs use 'char' type (with sign extention) for input characters
and sign extention becomes _STANDOUT mode in this case.
So, I refuse this future and allow 8-bit characters for programs,
which is designed for 7-bit only ('char' type using instead of
'unsigned char').
---
This small patch fix unpleasant standard curses bug:
curses can't expand TAB at all (but tries).
A man who wrote this curses misplace SYNC_IN and SYNCH_OUT,
this patch exchange macro calls.
This patch useful for standard 7-bit curses too, for this
you must delete '_' symbol before waddbytes and apply patch.
---
Oh, NO! This curses are really buggy!
This small patch fix following problem:
[ assumed scrollok(stdscr, TRUE) ]
when addch(ch) at lower right corner of screen, curses are realy
gone mad instead if simple scrolling... Curses code assumed that
this will be done correctly, but implement it with two bugs.
1993-07-09 09:34:14 +04:00
|
|
|
ce_tcap = CE;
|
1993-03-21 12:45:37 +03:00
|
|
|
else
|
added Andrew Chernov's patch set:
Standard curses library use eight bit for standout mode, so
8-bit characters displays like highlighted 7-bit characters.
This patch produce library which is fully compatible with all curses
programs and add 8-bit chars to all input/display functions.
---
I don't think, that any programs wish to use internal curses
attribute _STANDOUT directly, in expressions like:
addch( ch | _STANDOUT );
Normal interface use standout() and standend() functions instead.
Many programs use 'char' type (with sign extention) for input characters
and sign extention becomes _STANDOUT mode in this case.
So, I refuse this future and allow 8-bit characters for programs,
which is designed for 7-bit only ('char' type using instead of
'unsigned char').
---
This small patch fix unpleasant standard curses bug:
curses can't expand TAB at all (but tries).
A man who wrote this curses misplace SYNC_IN and SYNCH_OUT,
this patch exchange macro calls.
This patch useful for standard 7-bit curses too, for this
you must delete '_' symbol before waddbytes and apply patch.
---
Oh, NO! This curses are really buggy!
This small patch fix following problem:
[ assumed scrollok(stdscr, TRUE) ]
when addch(ch) at lower right corner of screen, curses are realy
gone mad instead if simple scrolling... Curses code assumed that
this will be done correctly, but implement it with two bugs.
1993-07-09 09:34:14 +04:00
|
|
|
ce_tcap = NULL;
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
while (wx <= lch) {
|
|
|
|
if (*nsp != *csp) {
|
|
|
|
domvcur(ly, lx, y, wx + win->_begx);
|
|
|
|
# ifdef DEBUG
|
|
|
|
fprintf(outf, "MAKECH: 1: wx = %d, lx = %d\n", wx, lx);
|
|
|
|
# endif
|
|
|
|
ly = y;
|
|
|
|
lx = wx + win->_begx;
|
|
|
|
while (*nsp != *csp && wx <= lch) {
|
added Andrew Chernov's patch set:
Standard curses library use eight bit for standout mode, so
8-bit characters displays like highlighted 7-bit characters.
This patch produce library which is fully compatible with all curses
programs and add 8-bit chars to all input/display functions.
---
I don't think, that any programs wish to use internal curses
attribute _STANDOUT directly, in expressions like:
addch( ch | _STANDOUT );
Normal interface use standout() and standend() functions instead.
Many programs use 'char' type (with sign extention) for input characters
and sign extention becomes _STANDOUT mode in this case.
So, I refuse this future and allow 8-bit characters for programs,
which is designed for 7-bit only ('char' type using instead of
'unsigned char').
---
This small patch fix unpleasant standard curses bug:
curses can't expand TAB at all (but tries).
A man who wrote this curses misplace SYNC_IN and SYNCH_OUT,
this patch exchange macro calls.
This patch useful for standard 7-bit curses too, for this
you must delete '_' symbol before waddbytes and apply patch.
---
Oh, NO! This curses are really buggy!
This small patch fix following problem:
[ assumed scrollok(stdscr, TRUE) ]
when addch(ch) at lower right corner of screen, curses are realy
gone mad instead if simple scrolling... Curses code assumed that
this will be done correctly, but implement it with two bugs.
1993-07-09 09:34:14 +04:00
|
|
|
if (ce_tcap != NULL && wx >= nlsp && *nsp == ' ') {
|
1993-03-21 12:45:37 +03:00
|
|
|
/*
|
|
|
|
* check for clear to end-of-line
|
|
|
|
*/
|
|
|
|
ce = &curscr->_y[ly][COLS - 1];
|
|
|
|
while (*ce == ' ')
|
|
|
|
if (ce-- <= csp)
|
|
|
|
break;
|
|
|
|
clsp = ce - curscr->_y[ly] - win->_begx;
|
|
|
|
# ifdef DEBUG
|
|
|
|
fprintf(outf, "MAKECH: clsp = %d, nlsp = %d\n", clsp, nlsp);
|
|
|
|
# endif
|
|
|
|
if (clsp - nlsp >= strlen(CE)
|
|
|
|
&& clsp < win->_maxx) {
|
|
|
|
# ifdef DEBUG
|
|
|
|
fprintf(outf, "MAKECH: using CE\n");
|
|
|
|
# endif
|
|
|
|
_puts(CE);
|
|
|
|
lx = wx + win->_begx;
|
|
|
|
while (wx++ <= clsp)
|
|
|
|
*csp++ = ' ';
|
|
|
|
return OK;
|
|
|
|
}
|
added Andrew Chernov's patch set:
Standard curses library use eight bit for standout mode, so
8-bit characters displays like highlighted 7-bit characters.
This patch produce library which is fully compatible with all curses
programs and add 8-bit chars to all input/display functions.
---
I don't think, that any programs wish to use internal curses
attribute _STANDOUT directly, in expressions like:
addch( ch | _STANDOUT );
Normal interface use standout() and standend() functions instead.
Many programs use 'char' type (with sign extention) for input characters
and sign extention becomes _STANDOUT mode in this case.
So, I refuse this future and allow 8-bit characters for programs,
which is designed for 7-bit only ('char' type using instead of
'unsigned char').
---
This small patch fix unpleasant standard curses bug:
curses can't expand TAB at all (but tries).
A man who wrote this curses misplace SYNC_IN and SYNCH_OUT,
this patch exchange macro calls.
This patch useful for standard 7-bit curses too, for this
you must delete '_' symbol before waddbytes and apply patch.
---
Oh, NO! This curses are really buggy!
This small patch fix following problem:
[ assumed scrollok(stdscr, TRUE) ]
when addch(ch) at lower right corner of screen, curses are realy
gone mad instead if simple scrolling... Curses code assumed that
this will be done correctly, but implement it with two bugs.
1993-07-09 09:34:14 +04:00
|
|
|
ce_tcap = NULL;
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|
|
|
|
/*
|
|
|
|
* enter/exit standout mode as appropriate
|
|
|
|
*/
|
|
|
|
if (SO && (*nsp&_STANDOUT) != (curscr->_flags&_STANDOUT)) {
|
|
|
|
if (*nsp & _STANDOUT) {
|
|
|
|
_puts(SO);
|
|
|
|
curscr->_flags |= _STANDOUT;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
_puts(SE);
|
|
|
|
curscr->_flags &= ~_STANDOUT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
wx++;
|
|
|
|
if (wx >= win->_maxx && wy == win->_maxy - 1)
|
|
|
|
if (win->_scroll) {
|
|
|
|
if ((curscr->_flags&_STANDOUT) &&
|
|
|
|
(win->_flags & _ENDLINE))
|
|
|
|
if (!MS) {
|
|
|
|
_puts(SE);
|
|
|
|
curscr->_flags &= ~_STANDOUT;
|
|
|
|
}
|
|
|
|
if (!curwin)
|
added Andrew Chernov's patch set:
Standard curses library use eight bit for standout mode, so
8-bit characters displays like highlighted 7-bit characters.
This patch produce library which is fully compatible with all curses
programs and add 8-bit chars to all input/display functions.
---
I don't think, that any programs wish to use internal curses
attribute _STANDOUT directly, in expressions like:
addch( ch | _STANDOUT );
Normal interface use standout() and standend() functions instead.
Many programs use 'char' type (with sign extention) for input characters
and sign extention becomes _STANDOUT mode in this case.
So, I refuse this future and allow 8-bit characters for programs,
which is designed for 7-bit only ('char' type using instead of
'unsigned char').
---
This small patch fix unpleasant standard curses bug:
curses can't expand TAB at all (but tries).
A man who wrote this curses misplace SYNC_IN and SYNCH_OUT,
this patch exchange macro calls.
This patch useful for standard 7-bit curses too, for this
you must delete '_' symbol before waddbytes and apply patch.
---
Oh, NO! This curses are really buggy!
This small patch fix following problem:
[ assumed scrollok(stdscr, TRUE) ]
when addch(ch) at lower right corner of screen, curses are realy
gone mad instead if simple scrolling... Curses code assumed that
this will be done correctly, but implement it with two bugs.
1993-07-09 09:34:14 +04:00
|
|
|
_putchar((*csp = *nsp));
|
1993-03-21 12:45:37 +03:00
|
|
|
else
|
added Andrew Chernov's patch set:
Standard curses library use eight bit for standout mode, so
8-bit characters displays like highlighted 7-bit characters.
This patch produce library which is fully compatible with all curses
programs and add 8-bit chars to all input/display functions.
---
I don't think, that any programs wish to use internal curses
attribute _STANDOUT directly, in expressions like:
addch( ch | _STANDOUT );
Normal interface use standout() and standend() functions instead.
Many programs use 'char' type (with sign extention) for input characters
and sign extention becomes _STANDOUT mode in this case.
So, I refuse this future and allow 8-bit characters for programs,
which is designed for 7-bit only ('char' type using instead of
'unsigned char').
---
This small patch fix unpleasant standard curses bug:
curses can't expand TAB at all (but tries).
A man who wrote this curses misplace SYNC_IN and SYNCH_OUT,
this patch exchange macro calls.
This patch useful for standard 7-bit curses too, for this
you must delete '_' symbol before waddbytes and apply patch.
---
Oh, NO! This curses are really buggy!
This small patch fix following problem:
[ assumed scrollok(stdscr, TRUE) ]
when addch(ch) at lower right corner of screen, curses are realy
gone mad instead if simple scrolling... Curses code assumed that
this will be done correctly, but implement it with two bugs.
1993-07-09 09:34:14 +04:00
|
|
|
_putchar(*nsp);
|
1993-03-21 12:45:37 +03:00
|
|
|
if (win->_flags&_FULLWIN && !curwin)
|
|
|
|
scroll(curscr);
|
|
|
|
ly = win->_begy+win->_cury;
|
|
|
|
lx = win->_begx+win->_curx;
|
|
|
|
return OK;
|
|
|
|
}
|
|
|
|
else if (win->_flags&_SCROLLWIN) {
|
|
|
|
lx = --wx;
|
|
|
|
return ERR;
|
|
|
|
}
|
|
|
|
if (!curwin)
|
added Andrew Chernov's patch set:
Standard curses library use eight bit for standout mode, so
8-bit characters displays like highlighted 7-bit characters.
This patch produce library which is fully compatible with all curses
programs and add 8-bit chars to all input/display functions.
---
I don't think, that any programs wish to use internal curses
attribute _STANDOUT directly, in expressions like:
addch( ch | _STANDOUT );
Normal interface use standout() and standend() functions instead.
Many programs use 'char' type (with sign extention) for input characters
and sign extention becomes _STANDOUT mode in this case.
So, I refuse this future and allow 8-bit characters for programs,
which is designed for 7-bit only ('char' type using instead of
'unsigned char').
---
This small patch fix unpleasant standard curses bug:
curses can't expand TAB at all (but tries).
A man who wrote this curses misplace SYNC_IN and SYNCH_OUT,
this patch exchange macro calls.
This patch useful for standard 7-bit curses too, for this
you must delete '_' symbol before waddbytes and apply patch.
---
Oh, NO! This curses are really buggy!
This small patch fix following problem:
[ assumed scrollok(stdscr, TRUE) ]
when addch(ch) at lower right corner of screen, curses are realy
gone mad instead if simple scrolling... Curses code assumed that
this will be done correctly, but implement it with two bugs.
1993-07-09 09:34:14 +04:00
|
|
|
_putchar((*csp++ = *nsp));
|
1993-03-21 12:45:37 +03:00
|
|
|
else
|
added Andrew Chernov's patch set:
Standard curses library use eight bit for standout mode, so
8-bit characters displays like highlighted 7-bit characters.
This patch produce library which is fully compatible with all curses
programs and add 8-bit chars to all input/display functions.
---
I don't think, that any programs wish to use internal curses
attribute _STANDOUT directly, in expressions like:
addch( ch | _STANDOUT );
Normal interface use standout() and standend() functions instead.
Many programs use 'char' type (with sign extention) for input characters
and sign extention becomes _STANDOUT mode in this case.
So, I refuse this future and allow 8-bit characters for programs,
which is designed for 7-bit only ('char' type using instead of
'unsigned char').
---
This small patch fix unpleasant standard curses bug:
curses can't expand TAB at all (but tries).
A man who wrote this curses misplace SYNC_IN and SYNCH_OUT,
this patch exchange macro calls.
This patch useful for standard 7-bit curses too, for this
you must delete '_' symbol before waddbytes and apply patch.
---
Oh, NO! This curses are really buggy!
This small patch fix following problem:
[ assumed scrollok(stdscr, TRUE) ]
when addch(ch) at lower right corner of screen, curses are realy
gone mad instead if simple scrolling... Curses code assumed that
this will be done correctly, but implement it with two bugs.
1993-07-09 09:34:14 +04:00
|
|
|
_putchar(*nsp);
|
1993-03-21 12:45:37 +03:00
|
|
|
# ifdef FULLDEBUG
|
|
|
|
fprintf(outf,
|
added Andrew Chernov's patch set:
Standard curses library use eight bit for standout mode, so
8-bit characters displays like highlighted 7-bit characters.
This patch produce library which is fully compatible with all curses
programs and add 8-bit chars to all input/display functions.
---
I don't think, that any programs wish to use internal curses
attribute _STANDOUT directly, in expressions like:
addch( ch | _STANDOUT );
Normal interface use standout() and standend() functions instead.
Many programs use 'char' type (with sign extention) for input characters
and sign extention becomes _STANDOUT mode in this case.
So, I refuse this future and allow 8-bit characters for programs,
which is designed for 7-bit only ('char' type using instead of
'unsigned char').
---
This small patch fix unpleasant standard curses bug:
curses can't expand TAB at all (but tries).
A man who wrote this curses misplace SYNC_IN and SYNCH_OUT,
this patch exchange macro calls.
This patch useful for standard 7-bit curses too, for this
you must delete '_' symbol before waddbytes and apply patch.
---
Oh, NO! This curses are really buggy!
This small patch fix following problem:
[ assumed scrollok(stdscr, TRUE) ]
when addch(ch) at lower right corner of screen, curses are realy
gone mad instead if simple scrolling... Curses code assumed that
this will be done correctly, but implement it with two bugs.
1993-07-09 09:34:14 +04:00
|
|
|
"MAKECH:putchar(%c)\n", *nsp);
|
1993-03-21 12:45:37 +03:00
|
|
|
# endif
|
|
|
|
if (UC && (*nsp & _STANDOUT)) {
|
|
|
|
_putchar('\b');
|
|
|
|
_puts(UC);
|
|
|
|
}
|
|
|
|
nsp++;
|
|
|
|
}
|
|
|
|
# ifdef DEBUG
|
|
|
|
fprintf(outf, "MAKECH: 2: wx = %d, lx = %d\n", wx, lx);
|
|
|
|
# endif
|
|
|
|
if (lx == wx + win->_begx) /* if no change */
|
|
|
|
break;
|
|
|
|
lx = wx + win->_begx;
|
|
|
|
if (lx >= COLS && AM) {
|
|
|
|
lx = 0;
|
|
|
|
ly++;
|
|
|
|
/*
|
|
|
|
* xn glitch: chomps a newline after auto-wrap.
|
|
|
|
* we just feed it now and forget about it.
|
|
|
|
*/
|
|
|
|
if (XN) {
|
|
|
|
_putchar('\n');
|
|
|
|
_putchar('\r');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (wx <= lch)
|
|
|
|
while (*nsp == *csp && wx <= lch) {
|
|
|
|
nsp++;
|
|
|
|
if (!curwin)
|
|
|
|
csp++;
|
|
|
|
++wx;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
break;
|
|
|
|
# ifdef DEBUG
|
|
|
|
fprintf(outf, "MAKECH: 3: wx = %d, lx = %d\n", wx, lx);
|
|
|
|
# endif
|
|
|
|
}
|
|
|
|
return OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* perform a mvcur, leaving standout mode if necessary
|
|
|
|
*/
|
|
|
|
STATIC
|
|
|
|
domvcur(oy, ox, ny, nx)
|
|
|
|
int oy, ox, ny, nx; {
|
|
|
|
|
|
|
|
if (curscr->_flags & _STANDOUT && !MS) {
|
|
|
|
_puts(SE);
|
|
|
|
curscr->_flags &= ~_STANDOUT;
|
|
|
|
}
|
|
|
|
mvcur(oy, ox, ny, nx);
|
|
|
|
}
|