| 1 |
.\"*************************************************************************** |
| 2 |
.\" Copyright 2018-2024,2025 Thomas E. Dickey * |
| 3 |
.\" Copyright 1998-2015,2017 Free Software Foundation, Inc. * |
| 4 |
.\" * |
| 5 |
.\" Permission is hereby granted, free of charge, to any person obtaining a * |
| 6 |
.\" copy of this software and associated documentation files (the * |
| 7 |
.\" "Software"), to deal in the Software without restriction, including * |
| 8 |
.\" without limitation the rights to use, copy, modify, merge, publish, * |
| 9 |
.\" distribute, distribute with modifications, sublicense, and/or sell * |
| 10 |
.\" copies of the Software, and to permit persons to whom the Software is * |
| 11 |
.\" furnished to do so, subject to the following conditions: * |
| 12 |
.\" * |
| 13 |
.\" The above copyright notice and this permission notice shall be included * |
| 14 |
.\" in all copies or substantial portions of the Software. * |
| 15 |
.\" * |
| 16 |
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * |
| 17 |
.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * |
| 18 |
.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * |
| 19 |
.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * |
| 20 |
.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * |
| 21 |
.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * |
| 22 |
.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * |
| 23 |
.\" * |
| 24 |
.\" Except as contained in this notice, the name(s) of the above copyright * |
| 25 |
.\" holders shall not be used in advertising or otherwise to promote the * |
| 26 |
.\" sale, use or other dealings in this Software without prior written * |
| 27 |
.\" authorization. * |
| 28 |
.\"*************************************************************************** |
| 29 |
.\" |
| 30 |
.\" $Id: curs_touch.3x,v 1.63 2025/01/19 00:51:10 tom Exp $ |
| 31 |
.TH touch 3NCURSES 2025-01-18 "ncurses 6.6" "Library calls" |
| 32 |
.ie \n(.g \{\ |
| 33 |
.ds `` \(lq |
| 34 |
.ds '' \(rq |
| 35 |
.\} |
| 36 |
.el \{\ |
| 37 |
.ie t .ds `` `` |
| 38 |
.el .ds `` "" |
| 39 |
.ie t .ds '' '' |
| 40 |
.el .ds '' "" |
| 41 |
.\} |
| 42 |
.SH NAME |
| 43 |
\fB\%touchwin\fP, |
| 44 |
\fB\%touchline\fP, |
| 45 |
\fB\%untouchwin\fP, |
| 46 |
\fB\%wtouchln\fP, |
| 47 |
\fB\%is_linetouched\fP, |
| 48 |
\fB\%is_wintouched\fP \- |
| 49 |
control terminal output refresh in a \fIcurses\fR window |
| 50 |
.SH SYNOPSIS |
| 51 |
.nf |
| 52 |
\fB#include <curses.h> |
| 53 |
.PP |
| 54 |
\fBint touchline(WINDOW *\fIwin\fP, int \fIstart\fP, int \fIcount\fP); |
| 55 |
.PP |
| 56 |
\fBint touchwin(WINDOW *\fIwin\fP); |
| 57 |
\fBint wtouchln(WINDOW *\fIwin\fP, int \fIy\fP, int \fIn\fP, int \fIchanged\fP); |
| 58 |
.PP |
| 59 |
\fBint untouchwin(WINDOW *\fIwin\fP); |
| 60 |
.PP |
| 61 |
\fBbool is_linetouched(WINDOW *\fIwin\fP, int \fIline\fP); |
| 62 |
\fBbool is_wintouched(WINDOW *\fIwin\fP); |
| 63 |
.fi |
| 64 |
.SH DESCRIPTION |
| 65 |
The \fB\%touchwin\fP and \fB\%touchline\fP routines throw away all |
| 66 |
optimization information about which parts of the window have been |
| 67 |
touched, by pretending that the entire window has been drawn on. |
| 68 |
This |
| 69 |
is sometimes necessary when using overlapping windows, since a change |
| 70 |
to one window affects the other window, but the records of which lines |
| 71 |
have been changed in the other window do not reflect the change. |
| 72 |
The |
| 73 |
routine \fB\%touchline\fP only pretends that \fIcount\fP lines have been |
| 74 |
changed, beginning with line \fIstart\fP. |
| 75 |
.PP |
| 76 |
The \fB\%untouchwin\fP routine marks all lines in the window as unchanged since |
| 77 |
the last call to \fB\%wrefresh\fP. |
| 78 |
.PP |
| 79 |
The \fB\%wtouchln\fP routine makes \fIn\fP lines in the window, starting |
| 80 |
at line \fIy\fR, look as if they have (\fIchanged\fB=1\fR) or have |
| 81 |
not (\fIchanged\fB=0\fR) been changed since the last call to |
| 82 |
\fB\%wrefresh\fP. |
| 83 |
.PP |
| 84 |
The \fB\%is_linetouched\fP and \fB\%is_wintouched\fP routines return |
| 85 |
\fBTRUE\fP if the specified line/window was modified since the last |
| 86 |
call to \fB\%wrefresh\fP; otherwise they return \fBFALSE\fP. In |
| 87 |
addition, \fB\%is_linetouched\fP returns \fBERR\fP if \fIline\fP is not |
| 88 |
valid for the given window. |
| 89 |
.SH RETURN VALUE |
| 90 |
Functions returning integers return |
| 91 |
.B ERR |
| 92 |
upon failure and |
| 93 |
.B OK |
| 94 |
upon success. |
| 95 |
.PP |
| 96 |
In |
| 97 |
.IR \%ncurses "," |
| 98 |
.RS 3 |
| 99 |
.TP 5 |
| 100 |
\fBis_linetouched\fP |
| 101 |
returns |
| 102 |
.B ERR |
| 103 |
if the window pointer is null, or |
| 104 |
if the line number is outside the window boundaries. |
| 105 |
.IP |
| 106 |
The constant \fBERR\fP is distinct from \fBTRUE\fP and \fBFALSE\fP, |
| 107 |
which are the normal return values of this function. |
| 108 |
Because the function returns a \fBbool\fP, |
| 109 |
returning \fBERR\fP (which is neither \fBTRUE\fP nor \fBFALSE\fP) |
| 110 |
may not be supported by the compiler. |
| 111 |
.IP |
| 112 |
To provide error-checking and also match the X/Open function prototype, |
| 113 |
the \fBERR\fP is provided by a macro named \fB\%is_linetouched\fP. |
| 114 |
The actual function returns \fBFALSE\fP when it detects an error. |
| 115 |
.TP 5 |
| 116 |
\fBwtouchln\fP |
| 117 |
returns |
| 118 |
.B ERR |
| 119 |
if the window pointer is null, or |
| 120 |
if the line number is outside the window boundaries. |
| 121 |
.RE |
| 122 |
.SH NOTES |
| 123 |
All of these functions except |
| 124 |
.B \%wtouchln |
| 125 |
may be implemented as macros. |
| 126 |
.SH PORTABILITY |
| 127 |
X/Open Curses Issue\ 4 describes these functions. |
| 128 |
It specifies no error conditions for them. |
| 129 |
.PP |
| 130 |
SVr4 describes a successful return value |
| 131 |
except where \*(``otherwise noted\*('' |
| 132 |
as |
| 133 |
\*(``an integer value other than |
| 134 |
.IR ERR \*(''. \" Courier roman in source; SVID 4, vol. 3, p. 540 |
| 135 |
.PP |
| 136 |
SVr4 does not check |
| 137 |
.I win |
| 138 |
to ensure that it is not a null pointer. |
| 139 |
.SH HISTORY |
| 140 |
SVr2 (1984) introduced |
| 141 |
.IR \%touchwin "," |
| 142 |
.PP |
| 143 |
SVr3 (1987) added |
| 144 |
.IR \%touchline "." |
| 145 |
SVr3.1 later that year supplied |
| 146 |
.IR \%is_linetouched "," |
| 147 |
.IR \%is_wintouched "," |
| 148 |
.IR \%untouchwin "," |
| 149 |
and |
| 150 |
.IR \%wtouchln "." |
| 151 |
.SH SEE ALSO |
| 152 |
\fB\%ncurses\fP(3NCURSES), |
| 153 |
\fB\%refresh\fP(3NCURSES), |
| 154 |
\fB\%curses_variables\fP(3NCURSES) |