In making available the generalized terminal descriptions in \*(tc,
much information was made available to the programmer,
but little work was taken out of one's hands.
The purpose of this package is to allow the C programmer
to do the most common type of terminal dependent functions,
those of movement optimization and optimal screen updating,
without doing any of the dirty work,
and (hopefully) with nearly as much ease as is necessary to simply print
The package is split into three parts:
(2) Screen updating with user input;
(3) Cursor motion optimization.
It is possible to use the motion optimization
without using either of the other two,
and screen updating and input can be done
without any programmer knowledge of the motion optimization,
or indeed the \*(et \*(db itself.
.sh 2 "Terminology (or, Words You Can Say to Sound Brilliant)"
the following terminology is kept to with reasonable consistency:
An internal representation
containing an image of what a section of the terminal screen may look like
This subsection can either encompass the entire terminal screen,
or any smaller portion down to a single character within that screen.
The package's idea of what the terminal's screen currently looks like,
i.e., what the user sees now.
This is a subset of windows which are as large as the terminal screen,
i.e., they start at the upper left hand corner
and encompass the lower right hand corner.
is automatically provided for the programmer.
In order to use the library,
it is necessary to have certain types and variables defined.
Therefore, the programmer must have a line:
at the top of the program source.
so the one should not do so oneself\**.
The screen package also uses the Standard I/O library,
for the programmer to do it, too.
compilations should have the following form:
.ie t \fBcc\fR [ \fIflags\fR ] file ... \fB\-lcurses \-ltermlib\fR
.el \fIcc\fR [ flags ] file ... \fI\-lcurses \-ltermlib\fR
In order to update the screen optimally,
it is necessary for the routines to know what the screen currently looks like
and what the programmer wants it to look like next.
which describes a window image to the routines,
including its starting position on the screen
(the \*y of the upper left hand corner)
is a screen image of what the terminal currently looks like.
A window is a purely internal representation.
It is used to build and store
a potential image of a portion of the terminal.
It doesn't bear any necessary relation
to what is really on the terminal screen.
It is more like an array of characters on which to make changes.
When one has a window which describes
what some part the terminal should look like,
in the area covered by the window,
Note, therefore, that changing something on a window
.i "change the terminal" .
Actual updates to the terminal screen
This allows the programmer to maintain several different ideas
of what a portion of the terminal screen should look like.
Also, changes can be made to windows in any order,
without regard to motion efficiency.
the programmer can effectively say
.q "make it look like this,"
and let the package worry about the best way to do this.
.sh 2 "Naming Conventions"
the routines can use several windows,
but two are automatically given:
which knows what the terminal looks like,
which is what the programmer wants the terminal to look like next.
The user should never really access
Changes should be made to
Many functions are set up to deal with
For example, to add a character to
with the desired character.
If a different window is to be used,
as are most of the "functions" which deal with
This convention of prepending function names with a
when they are to be applied to specific windows
The only routines which do
to which a window must always be specified.
In order to move the current \*y from one point to another,
it is often desirable to first move and then perform some I/O operation.
In order to avoid clumsyness,
most I/O routines can be preceded by the prefix
and the desired \*y then can be added to the arguments to the function.
mvwaddch(win\*,y\*,x\*,ch);
Note that the window description pointer
comes before the added \*y.
If such pointers are need,
they are always the first parameters passed.