🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix
Article #464

Curses scrolling (was: curses "untouch"?)

#464
From: usenet
Date: Wed, 21 Oct 1987 22:54
44 lines
3189 bytes
The identifiers in caps are masks for the flags word in the window
structure; the others are elements of the same structure.  There is
also an array or two that tells which lines were changed, and how much
of each line was changed.  Touchwin() marks these to show all of every
line changed.  Names and uses are generally version-dependent.

I think you're asking the questions backwards.  If your curses has an
IDLINE mask, you can probably get what you want using idlok(win,TRUE);
that should set IDLINE and thus activate insert/delete line, which also
activates hardware scrolling.  I have a more difficult problem: how to
force hardware scrolling, with a terminal without insert/delete line,
in a curses that does not support the idlok() function.

To do what you describe, you should be aware that curses not only keeps
a map of each window (e.g., "stdscr") before updating, it also keeps a
map in a window called "curscr"	of how the screen looks after
updating.  It uses this map, for instance, if you refresh(curscr) in
response to receiving CTRL-L.  So you would also have to scroll(curscr),
assuming your curses allows that call.  If you don't, then on the next
refresh(win) curses will compare win with curscr and repaint the screen.

To understand why curses doesn't always use hardware scrolling when
it's defined in terminfo or termcap, just keep in mind that curses does
not remember what functions led up to the configuration of your
window.  If you scroll(win), it simply does a logical scroll of win.
Then when you wrefresh(win), it can't use hardware scrolling unless it
compares win with curscr to find matching lines in different positions,
so it can decide whether sending a hardware scroll is more efficient
than repainting the screen.  Unless otherwise instructed, it skips
those comparisons and just repaints.

I do some work on a UNIX(tm) system in which curses does not support
idlok().  In that system, curses does hardware scrolling only if the
terminal has insert-line and delete-line capabilities, because the same
line-to-line comparison algorithm is used for deciding how to use all
three capabilities: insert-line, delete-line, and scrolling.  I have a
terminal with both forward and reverse scrolling capability, but no
insert- or delete-line capability.  With that terminal, vi uses forward
and reverse scrolling, but curses uses neither.  Can I make that old
curses use hardware scrolling with my terminal?
-- 
M. B. Brilliant					Marty
AT&T-BL HO 3D-520	(201)-949-1858
Holmdel, NJ 07733	ihnp4!houdi!marty1
Technical Details
Message-ID: <2120@mcdchg.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!mcdchg!usenet
References: <2059@mcdchg.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!mcdchg!usenet
From: usenet@mcdchg.UUCP
Newsgroups: comp.unix
Subject: Curses scrolling (was: curses "untouch"?)
Message-ID: <2120@mcdchg.UUCP>
Date: Wed, 21-Oct-87 18:54:44 EDT
Article-I.D.: mcdchg.2120
Posted: Wed Oct 21 18:54:44 1987
Date-Received: Sat, 24-Oct-87 11:11:17 EDT
References: <2059@mcdchg.UUCP>
Sender: usenet@mcdchg.UUCP
Organization: AT&T Bell Laboratories, Holmdel
Lines: 44
Approved: usenet@mcdchg.UUCP
Summary: Hardware scrolling is terminal- and impelementation-dependent