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