[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
tty_update.c (part 3)
From: |
Philippe Blain |
Subject: |
tty_update.c (part 3) |
Date: |
Sat, 14 Dec 2002 08:15:02 +0100 |
>From Philippe Blain, Bordeaux, France.
My old computer: P133 - 8,4 Go - 32 Mo Red Hat Linux 7.0
To maintainers of 'ncurses'.(and to Mr Dickey)
Subject: Corrections for ncurses-5.3-20021206+
Here are some problems I found :
----------------------------------------------------------------------------
File : ncurses/base/tty_update.c
In all hard-scroll functions, tputs is used with parameter 0 , meaning
a delay of 0 milliseconds.
The padding is not done by tputs on terminals which require it.
tputs (scroll_forward, 0, _nc_outch); --> e.g DEC vt132
tputs (scroll_reverse, 0, _nc_outch); --> e.g Arm Risc PC, vt100
tputs (delete_line, 0, _nc_outch); --> e.g wyse 120,150
tputs (insert_line, 0, _nc_outch); --> e.g wyse
Should be set to 1 (n if proportional) or use "putp(capability);".
----------------------------------------------------------------------------
File : ncurses/base/tty_update.c
Line 1656 :
I don't understand the test for saving cursor when the terminal has a
settable scrolling region. Is it some rest of old code ?
The terminfo pages do not mention that the cursor must be at bottom
before setting a scrolling region, and I don't see relation with n==1 ?
All sufficient cases are considered in scroll_csr_forward/backward.
if (res == ERR && change_scroll_region) {
==> if ((((n == 1 && scroll_forward) || parm_index)
==> && (SP->_cursrow == bot || SP->_cursrow == bot - 1))
==> && save_cursor && restore_cursor) {
cursor_saved = TRUE;
TPUTS_TRACE ("save_cursor");
tputs (save_cursor, 0, _nc_outch);
}
TPUTS_TRACE ("change_scroll_region");
tputs (tparm (change_scroll_region, top, bot), 0, _nc_outch);
if (cursor_saved) {
TPUTS_TRACE ("restore_cursor");
tputs (restore_cursor, 0, _nc_outch);
==> cursor_saved = FALSE; /* secure */
}
else {
SP->_cursrow = SP->_curscol = -1;
}
res = scroll_csr_forward (n, top, bot, top, bot, blank);
TPUTS_TRACE ("change_scroll_region");
tputs (tparm (change_scroll_region, 0, maxy), 0, _nc_outch);
SP->_cursrow = SP->_curscol = -1;
}
----------------------------------------------------------------------------
File : ncurses/base/tty_update.c
Line 1689 :
................
if (bot == maxy && clr_eos) {
==> GoTo(bot - n, 0);
ClrToEOS(blank2);
................
Should be GoTo(bot - n + 1, 0); because in the following 'else{..}',
i varies from 0 to n - 1 inclusive starting from bottom.
----------------------------------------------------------------------------
File : ncurses/base/tty_update.c
The following new routine clears the screen between 2 lines inclusive.
static int _hard_clear_from_to (int y1, int y2, NCURSES_CH_T blank)
{
TR (TRACE_UPDATE, ("_hard_clear_from_to() called"));
if (clr_eol && can_clear_with (CHREF (blank))) {
int i, j, row, col;
row = SP->_cursrow;
col = SP->_curscol;
UpdateAttrs (AttrOf (blank));
if (y2 >= screen_lines - 1 && clr_eos) {
GoTo (0, y1);
TPUTS_TRACE ("clr_eos");
tputs (clr_eos, screen_lines - y1, _nc_outch);
}
else {
for (i = y1; i <= y2 && i < screen_lines; i++) {
GoTo (0, i);
TPUTS_TRACE ("clr_eol");
putp (clr_eol);
}
}
GoTo (col, row);
for (i = y1; i <= y2; i++)
for (j = 0; j < screen_columns; j++)
curscr->_line[i].text[j] = blank;
returnCode (OK);
}
else returnCode (ERR);
}
Can be used in _nc_scrolln()
Line 1688 and 1734 :
................
if (res != ERR &&
(non_dest_scroll_region || (memory_below && bot == maxy))) {
NCURSES_CH_T blank2 = NewChar (BLANK_TEXT);
==> _hard_clear_from_to (bot - n + 1, bot, blank2);
}
................
if (res != ERR &&
(non_dest_scroll_region || (memory_above && top == 0))) {
NCURSES_CH_T blank2 = NewChar (BLANK_TEXT);
==> _hard_clear_from_to (top, top - n - 1, blank2);
}
................
----------------------------------------------------------------------------
- Philippe
- tty_update.c (part 3),
Philippe Blain <=