blob: 613b6958268dbc82d871abb9cd6e5abb990ce8ae [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301.\"***************************************************************************
micky3879b9f5e72025-07-08 18:04:53 -04002.\" Copyright 2018-2023,2024 Thomas E. Dickey *
3.\" Copyright 1998-2015,2017 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05304.\" *
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.\"
micky3879b9f5e72025-07-08 18:04:53 -040030.\" $Id: curs_touch.3x,v 1.47 2024/04/20 21:20:07 tom Exp $
31.TH curs_touch 3X 2024-04-20 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls"
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053032.SH NAME
micky3879b9f5e72025-07-08 18:04:53 -040033\fB\%touchwin\fP,
34\fB\%touchline\fP,
35\fB\%untouchwin\fP,
36\fB\%wtouchln\fP,
37\fB\%is_linetouched\fP,
38\fB\%is_wintouched\fP \-
39control terminal output refresh in a \fIcurses\fR window
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053040.SH SYNOPSIS
micky3879b9f5e72025-07-08 18:04:53 -040041.nf
42\fB#include <curses.h>
43.PP
44\fBint touchline(WINDOW *\fIwin\fP, int \fIstart\fP, int \fIcount\fP);
45.PP
46\fBint touchwin(WINDOW *\fIwin\fP);
47\fBint wtouchln(WINDOW *\fIwin\fP, int \fIy\fP, int \fIn\fP, int \fIchanged\fP);
48.PP
49\fBint untouchwin(WINDOW *\fIwin\fP);
50.PP
51\fBbool is_linetouched(WINDOW *\fIwin\fP, int \fIline\fP);
52\fBbool is_wintouched(WINDOW *\fIwin\fP);
53.fi
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053054.SH DESCRIPTION
micky3879b9f5e72025-07-08 18:04:53 -040055The \fB\%touchwin\fP and \fB\%touchline\fP routines throw away all
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053056optimization information about which parts of the window have been
micky3879b9f5e72025-07-08 18:04:53 -040057touched, by pretending that the entire window has been drawn on.
58This
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053059is sometimes necessary when using overlapping windows, since a change
60to one window affects the other window, but the records of which lines
micky3879b9f5e72025-07-08 18:04:53 -040061have been changed in the other window do not reflect the change.
62The
63routine \fB\%touchline\fP only pretends that \fIcount\fP lines have been
64changed, beginning with line \fIstart\fP.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053065.PP
micky3879b9f5e72025-07-08 18:04:53 -040066The \fB\%untouchwin\fP routine marks all lines in the window as unchanged since
67the last call to \fB\%wrefresh\fP.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053068.PP
micky3879b9f5e72025-07-08 18:04:53 -040069The \fB\%wtouchln\fP routine makes \fIn\fP lines in the window, starting
70at line \fIy\fR, look as if they have (\fIchanged\fB=1\fR) or have
71not (\fIchanged\fB=0\fR) been changed since the last call to
72\fB\%wrefresh\fP.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053073.PP
micky3879b9f5e72025-07-08 18:04:53 -040074The \fB\%is_linetouched\fP and \fB\%is_wintouched\fP routines return
75\fBTRUE\fP if the specified line/window was modified since the last
76call to \fB\%wrefresh\fP; otherwise they return \fBFALSE\fP. In
77addition, \fB\%is_linetouched\fP returns \fBERR\fP if \fIline\fP is not
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053078valid for the given window.
79.SH RETURN VALUE
micky3879b9f5e72025-07-08 18:04:53 -040080All routines return the integer \fBERR\fP upon failure and an integer value
81other than \fBERR\fP upon successful completion, unless otherwise noted in the
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053082preceding routine descriptions.
83.PP
micky3879b9f5e72025-07-08 18:04:53 -040084X/Open Curses does not specify any error conditions.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053085In this implementation
micky3879b9f5e72025-07-08 18:04:53 -040086.RS 3
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053087.TP 5
88\fBis_linetouched\fP
micky3879b9f5e72025-07-08 18:04:53 -040089returns an error
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053090if the window pointer is null, or
micky3879b9f5e72025-07-08 18:04:53 -040091if the line number is outside the window boundaries.
92.IP
93The constant \fBERR\fP is distinct from \fBTRUE\fP and \fBFALSE\fP,
94which are the normal return values of this function.
95Because the function returns a \fBbool\fP,
96returning \fBERR\fP (which is neither \fBTRUE\fP nor \fBFALSE\fP)
97may not be supported by the compiler.
98.IP
99To provide error-checking and also match the X/Open function prototype,
100the \fBERR\fP is provided by a macro named \fB\%is_linetouched\fP.
101The actual function returns \fBFALSE\fP when it detects an error.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530102.TP 5
103\fBwtouchln\fP
micky3879b9f5e72025-07-08 18:04:53 -0400104returns an error
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530105if the window pointer is null, or
micky3879b9f5e72025-07-08 18:04:53 -0400106if the line number is outside the window boundaries.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530107.RE
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530108.SH NOTES
micky3879b9f5e72025-07-08 18:04:53 -0400109All of these routines except \fB\%wtouchln\fP may be macros.
110.SH PORTABILITY
111These functions were introduced by SVr4.
112The Solaris \fIcurses\fP header file,
113for instance, defines both an actual function and macro for each.
114The macros give the same result as the actual functions.
115SVr4 \fIcurses\fP does not check the window parameter \fIwin\fP to ensure
116that it is not \fBNULL\fP;
117otherwise this implementation behaves the same as SVr4.
118.PP
119X/Open Curses, Issue 4 describes these functions,
120but defines no error conditions.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530121.SH SEE ALSO
micky3879b9f5e72025-07-08 18:04:53 -0400122\fB\%curses\fP(3X),
123\fB\%curs_refresh\fP(3X),
124\fB\%curs_variables\fP(3X)