mirror of
https://github.com/ThomasDickey/ncurses-snapshots.git
synced 2026-01-26 11:04:35 +00:00
155 lines
5.7 KiB
Plaintext
155 lines
5.7 KiB
Plaintext
.\"***************************************************************************
|
|
.\" Copyright 2018-2024,2025 Thomas E. Dickey *
|
|
.\" Copyright 1998-2015,2017 Free Software Foundation, Inc. *
|
|
.\" *
|
|
.\" Permission is hereby granted, free of charge, to any person obtaining a *
|
|
.\" copy of this software and associated documentation files (the *
|
|
.\" "Software"), to deal in the Software without restriction, including *
|
|
.\" without limitation the rights to use, copy, modify, merge, publish, *
|
|
.\" distribute, distribute with modifications, sublicense, and/or sell *
|
|
.\" copies of the Software, and to permit persons to whom the Software is *
|
|
.\" furnished to do so, subject to the following conditions: *
|
|
.\" *
|
|
.\" The above copyright notice and this permission notice shall be included *
|
|
.\" in all copies or substantial portions of the Software. *
|
|
.\" *
|
|
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
|
.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
|
.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
|
.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
|
.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
|
.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
|
.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
|
.\" *
|
|
.\" Except as contained in this notice, the name(s) of the above copyright *
|
|
.\" holders shall not be used in advertising or otherwise to promote the *
|
|
.\" sale, use or other dealings in this Software without prior written *
|
|
.\" authorization. *
|
|
.\"***************************************************************************
|
|
.\"
|
|
.\" $Id: curs_touch.3x,v 1.63 2025/01/19 00:51:10 tom Exp $
|
|
.TH curs_touch 3X 2025-01-18 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls"
|
|
.ie \n(.g \{\
|
|
.ds `` \(lq
|
|
.ds '' \(rq
|
|
.\}
|
|
.el \{\
|
|
.ie t .ds `` ``
|
|
.el .ds `` ""
|
|
.ie t .ds '' ''
|
|
.el .ds '' ""
|
|
.\}
|
|
.SH NAME
|
|
\fB\%touchwin\fP,
|
|
\fB\%touchline\fP,
|
|
\fB\%untouchwin\fP,
|
|
\fB\%wtouchln\fP,
|
|
\fB\%is_linetouched\fP,
|
|
\fB\%is_wintouched\fP \-
|
|
control terminal output refresh in a \fIcurses\fR window
|
|
.SH SYNOPSIS
|
|
.nf
|
|
\fB#include <curses.h>
|
|
.PP
|
|
\fBint touchline(WINDOW *\fIwin\fP, int \fIstart\fP, int \fIcount\fP);
|
|
.PP
|
|
\fBint touchwin(WINDOW *\fIwin\fP);
|
|
\fBint wtouchln(WINDOW *\fIwin\fP, int \fIy\fP, int \fIn\fP, int \fIchanged\fP);
|
|
.PP
|
|
\fBint untouchwin(WINDOW *\fIwin\fP);
|
|
.PP
|
|
\fBbool is_linetouched(WINDOW *\fIwin\fP, int \fIline\fP);
|
|
\fBbool is_wintouched(WINDOW *\fIwin\fP);
|
|
.fi
|
|
.SH DESCRIPTION
|
|
The \fB\%touchwin\fP and \fB\%touchline\fP routines throw away all
|
|
optimization information about which parts of the window have been
|
|
touched, by pretending that the entire window has been drawn on.
|
|
This
|
|
is sometimes necessary when using overlapping windows, since a change
|
|
to one window affects the other window, but the records of which lines
|
|
have been changed in the other window do not reflect the change.
|
|
The
|
|
routine \fB\%touchline\fP only pretends that \fIcount\fP lines have been
|
|
changed, beginning with line \fIstart\fP.
|
|
.PP
|
|
The \fB\%untouchwin\fP routine marks all lines in the window as unchanged since
|
|
the last call to \fB\%wrefresh\fP.
|
|
.PP
|
|
The \fB\%wtouchln\fP routine makes \fIn\fP lines in the window, starting
|
|
at line \fIy\fR, look as if they have (\fIchanged\fB=1\fR) or have
|
|
not (\fIchanged\fB=0\fR) been changed since the last call to
|
|
\fB\%wrefresh\fP.
|
|
.PP
|
|
The \fB\%is_linetouched\fP and \fB\%is_wintouched\fP routines return
|
|
\fBTRUE\fP if the specified line/window was modified since the last
|
|
call to \fB\%wrefresh\fP; otherwise they return \fBFALSE\fP. In
|
|
addition, \fB\%is_linetouched\fP returns \fBERR\fP if \fIline\fP is not
|
|
valid for the given window.
|
|
.SH RETURN VALUE
|
|
Functions returning integers return
|
|
.B ERR
|
|
upon failure and
|
|
.B OK
|
|
upon success.
|
|
.PP
|
|
In
|
|
.IR \%ncurses ","
|
|
.RS 3
|
|
.TP 5
|
|
\fBis_linetouched\fP
|
|
returns
|
|
.B ERR
|
|
if the window pointer is null, or
|
|
if the line number is outside the window boundaries.
|
|
.IP
|
|
The constant \fBERR\fP is distinct from \fBTRUE\fP and \fBFALSE\fP,
|
|
which are the normal return values of this function.
|
|
Because the function returns a \fBbool\fP,
|
|
returning \fBERR\fP (which is neither \fBTRUE\fP nor \fBFALSE\fP)
|
|
may not be supported by the compiler.
|
|
.IP
|
|
To provide error-checking and also match the X/Open function prototype,
|
|
the \fBERR\fP is provided by a macro named \fB\%is_linetouched\fP.
|
|
The actual function returns \fBFALSE\fP when it detects an error.
|
|
.TP 5
|
|
\fBwtouchln\fP
|
|
returns
|
|
.B ERR
|
|
if the window pointer is null, or
|
|
if the line number is outside the window boundaries.
|
|
.RE
|
|
.SH NOTES
|
|
All of these functions except
|
|
.B \%wtouchln
|
|
may be implemented as macros.
|
|
.SH PORTABILITY
|
|
X/Open Curses Issue\ 4 describes these functions.
|
|
It specifies no error conditions for them.
|
|
.PP
|
|
SVr4 describes a successful return value
|
|
except where \*(``otherwise noted\*(''
|
|
as
|
|
\*(``an integer value other than
|
|
.IR ERR \*(''. \" Courier roman in source; SVID 4, vol. 3, p. 540
|
|
.PP
|
|
SVr4 does not check
|
|
.I win
|
|
to ensure that it is not a null pointer.
|
|
.SH HISTORY
|
|
SVr2 (1984) introduced
|
|
.IR \%touchwin ","
|
|
.PP
|
|
SVr3 (1987) added
|
|
.IR \%touchline "."
|
|
SVr3.1 later that year supplied
|
|
.IR \%is_linetouched ","
|
|
.IR \%is_wintouched ","
|
|
.IR \%untouchwin ","
|
|
and
|
|
.IR \%wtouchln "."
|
|
.SH SEE ALSO
|
|
\fB\%curses\fP(3X),
|
|
\fB\%curs_refresh\fP(3X),
|
|
\fB\%curs_variables\fP(3X)
|