]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_touch.3x
ncurses 6.4 - patch 20240420
[ncurses.git] / man / curs_touch.3x
1 .\"***************************************************************************
2 .\" Copyright 2018-2023,2024 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.47 2024/04/20 21:20:07 tom Exp $
31 .TH curs_touch 3X 2024-04-20 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls"
32 .SH NAME
33 \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 \-
39 control terminal output refresh in a \fIcurses\fR window
40 .SH SYNOPSIS
41 .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
54 .SH DESCRIPTION
55 The \fB\%touchwin\fP and \fB\%touchline\fP routines throw away all
56 optimization information about which parts of the window have been
57 touched, by pretending that the entire window has been drawn on.
58 This
59 is sometimes necessary when using overlapping windows, since a change
60 to one window affects the other window, but the records of which lines
61 have been changed in the other window do not reflect the change.
62 The
63 routine \fB\%touchline\fP only pretends that \fIcount\fP lines have been
64 changed, beginning with line \fIstart\fP.
65 .PP
66 The \fB\%untouchwin\fP routine marks all lines in the window as unchanged since
67 the last call to \fB\%wrefresh\fP.
68 .PP
69 The \fB\%wtouchln\fP routine makes \fIn\fP lines in the window, starting
70 at line \fIy\fR, look as if they have (\fIchanged\fB=1\fR) or have
71 not (\fIchanged\fB=0\fR) been changed since the last call to
72 \fB\%wrefresh\fP.
73 .PP
74 The \fB\%is_linetouched\fP and \fB\%is_wintouched\fP routines return
75 \fBTRUE\fP if the specified line/window was modified since the last
76 call to \fB\%wrefresh\fP; otherwise they return \fBFALSE\fP.  In
77 addition, \fB\%is_linetouched\fP returns \fBERR\fP if \fIline\fP is not
78 valid for the given window.
79 .SH RETURN VALUE
80 All routines return the integer \fBERR\fP upon failure and an integer value
81 other than \fBERR\fP upon successful completion, unless otherwise noted in the
82 preceding routine descriptions.
83 .PP
84 X/Open Curses does not specify any error conditions.
85 In this implementation
86 .RS 3
87 .TP 5
88 \fBis_linetouched\fP
89 returns an error
90 if the window pointer is null, or
91 if the line number is outside the window boundaries.
92 .IP
93 The constant \fBERR\fP is distinct from \fBTRUE\fP and \fBFALSE\fP,
94 which are the normal return values of this function.
95 Because the function returns a \fBbool\fP,
96 returning \fBERR\fP (which is neither \fBTRUE\fP nor \fBFALSE\fP)
97 may not be supported by the compiler.
98 .IP
99 To provide error-checking and also match the X/Open function prototype,
100 the \fBERR\fP is provided by a macro named \fB\%is_linetouched\fP.
101 The actual function returns \fBFALSE\fP when it detects an error.
102 .TP 5
103 \fBwtouchln\fP
104 returns an error
105 if the window pointer is null, or
106 if the line number is outside the window boundaries.
107 .RE
108 .SH NOTES
109 All of these routines except \fB\%wtouchln\fP may be macros.
110 .SH PORTABILITY
111 These functions were introduced by SVr4.
112 The Solaris \fIcurses\fP header file,
113 for instance, defines both an actual function and macro for each.
114 The macros give the same result as the actual functions.
115 SVr4 \fIcurses\fP does not check the window parameter \fIwin\fP to ensure
116 that it is not \fBNULL\fP;
117 otherwise this implementation behaves the same as SVr4.
118 .PP
119 X/Open Curses, Issue 4 describes these functions,
120 but defines no error conditions.
121 .SH SEE ALSO
122 \fB\%curses\fP(3X),
123 \fB\%curs_refresh\fP(3X),
124 \fB\%curs_variables\fP(3X)