🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix
Article #465

Re: curses "untouch"?

#465
From: usenet
Date: Wed, 21 Oct 1987 22:54
88 lines
4348 bytes
There is a macro called idlok which is _supposed_ to tell curses to use
the hardware insert/delete line capability if possible.  This is implemented
in the ATT version of curses but isn't in the Berkely version.  I will assume
that you have the Berkeley version.  This assumption is valid because
AT&T's version does not use the IDLINE flag, therefore you must be using
BSD.

Berkely's version of scroll() basically moves to line 0 then calls
deleteln (which touches all lines on the current window) and then
restores the cursor to it's original position on the screen.  What you
need to do is the same thing except that you should send the DL termcap
sequence to the terminal by yourself and then 'untouch' all lines in the
window.  A simple (and untested) function to do this is:

hwscroll(win)
WINDOW *win;
{
	int ox,oy,y;

	getyx(win, oy, ox);     /* save current cursor position */
	wmove(win, 0, 0);
	_puts(DL);              /* delete top line of window */
	deleteln(win);          /* update internal data structures of win */
	wmove (win, oy, ox);    /* restore cursor */

	/* now 'untouch' all lines in the current window */

	for (y=0; y<win->_maxy; y++)
	        win->_firstch[y] = _NOCHANGE;
}

This of course works best for windows which are the same size as
the terminal screen.  If this isn't the case then you may need to
insert a line (capability AL) to get the other window back to it's
normal state.

>   
>  Also, what are the flags ENDLINE,FULLWIN,SCROLLWIN,FLUSH,FULLLINE,IDLINE,
>  NOCHANGE, leave, clear, ch_off for?
>   

ENDLINE:  This flag is used to indicate that this window has the same number
	  of columns as the physical terminal screen.  This is useful for
	  functions like clrtoeol.
FULLWIN:  This flag is used to indicate that this window has the same
	  dimensions as the physical terminal screen (ie stdscr).
	  This should allow easy scrolling of the whole window by simply
	  printing a linefeed in the lower right corner of the screen
	  (if the cursor doesn't wrap to top left).

SCROLLWIN:This flag is used to indicate that the window could scroll by
	  accident.  This would occur if you write a character to the
	  lower right corner of the screen and the am capability is
	  present.

NOCHANGE: Is a simple indicator of change.  Different variables are set
	  to this value to indicate that no change has occured.  If the
	  variable is then queried later and the value is other than
	  -1 (NOCHANGE) then it is assumed that a change has occurred
	  (therefore some updating would be necessary).

IDLINE:   Set by the idlok macro.  Unused by Berkeley curses.

FLUSH:    Set by flushok macro.  Unused by Berkeley curses.

leave:    This flag tells the update logic where to leave the cursor at
	  the end of an update cycle.  If it is true then the cursor may
	  be left anywhere after an update.  If it is false then the cursor
	  is left at the current position.

clear:    A flag that is used to tell the refresh logic to clear the
	  terminal screen before the next update.

ch_off:   The character offset of a subwin from the left hand side of
          the terminal screen.  This is used to correctly position characters
          within subwindows and windows whose begx coordinate is not 0.

Hope that this info helps you out.
-- 
------------------------------------------------------------------------
Scott L. Wiegel                          +--+    +--+
					 |  |    |  |
Harris Computer Systems Division         |  +----+  |
2101 W. Cypress Creek Rd.		 |_/-\_/-\_/|
Ft. Lauderdale, Fl  33309                |  +----+  |
                                         |  |    |  |
UUCP:slwiegel@hcx1.harris.com            |__|    |__|
------------------------------------------------------------------------
Technical Details
Message-ID: <2121@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: Re: curses "untouch"?
Message-ID: <2121@mcdchg.UUCP>
Date: Wed, 21-Oct-87 18:54:51 EDT
Article-I.D.: mcdchg.2121
Posted: Wed Oct 21 18:54:51 1987
Date-Received: Sat, 24-Oct-87 11:11:45 EDT
References: <2059@mcdchg.UUCP>
Sender: usenet@mcdchg.UUCP
Reply-To: slwiegel@hcx1.harris.com
Lines: 88
Approved: usenet@mcdchg.UUCP