]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_touch.3x
ncurses 6.1 - patch 20190121
[ncurses.git] / man / curs_touch.3x
1 .\"***************************************************************************
2 .\" Copyright (c) 1998-2017,2018 Free Software Foundation, Inc.              *
3 .\"                                                                          *
4 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
5 .\" copy of this software and associated documentation files (the            *
6 .\" "Software"), to deal in the Software without restriction, including      *
7 .\" without limitation the rights to use, copy, modify, merge, publish,      *
8 .\" distribute, distribute with modifications, sublicense, and/or sell       *
9 .\" copies of the Software, and to permit persons to whom the Software is    *
10 .\" furnished to do so, subject to the following conditions:                 *
11 .\"                                                                          *
12 .\" The above copyright notice and this permission notice shall be included  *
13 .\" in all copies or substantial portions of the Software.                   *
14 .\"                                                                          *
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22 .\"                                                                          *
23 .\" Except as contained in this notice, the name(s) of the above copyright   *
24 .\" holders shall not be used in advertising or otherwise to promote the     *
25 .\" sale, use or other dealings in this Software without prior written       *
26 .\" authorization.                                                           *
27 .\"***************************************************************************
28 .\"
29 .\" $Id: curs_touch.3x,v 1.21 2018/07/28 21:34:56 tom Exp $
30 .TH curs_touch 3X ""
31 .na
32 .hy 0
33 .SH NAME
34 \fBtouchwin\fR,
35 \fBtouchline\fR,
36 \fBuntouchwin\fR,
37 \fBwtouchln\fR,
38 \fBis_linetouched\fR,
39 \fBis_wintouched\fR \- \fBcurses\fR refresh control routines
40 .ad
41 .hy
42 .SH SYNOPSIS
43 \fB#include <curses.h>\fR
44 .br
45 \fBint touchwin(WINDOW *win);\fR
46 .br
47 \fBint touchline(WINDOW *win, int start, int count);\fR
48 .br
49 \fBint untouchwin(WINDOW *win);\fR
50 .br
51 \fBint wtouchln(WINDOW *win, int y, int n, int changed);\fR
52 .br
53 \fBbool is_linetouched(WINDOW *win, int line);\fR
54 .br
55 \fBbool is_wintouched(WINDOW *win);\fR
56 .br
57 .SH DESCRIPTION
58 The \fBtouchwin\fR and \fBtouchline\fR routines throw away all
59 optimization information about which parts of the window have been
60 touched, by pretending that the entire window has been drawn on.
61 This
62 is sometimes necessary when using overlapping windows, since a change
63 to one window affects the other window, but the records of which lines
64 have been changed in the other window do not reflect the change.
65 The
66 routine \fBtouchline\fR only pretends that \fIcount\fR lines have been
67 changed, beginning with line \fIstart\fR.
68 .PP
69 The \fBuntouchwin\fR routine marks all lines in the window as unchanged since
70 the last call to \fBwrefresh\fR.
71 .PP
72 The \fBwtouchln\fR routine makes \fIn\fR lines in the window, starting
73 at line \fIy\fR, look as if they have (\fIchanged\fR\fB=1\fR) or have
74 not (\fIchanged\fR\fB=0\fR) been changed since the last call to
75 \fBwrefresh\fR.
76 .PP
77 The \fBis_linetouched\fR and \fBis_wintouched\fR routines return
78 \fBTRUE\fR if the specified line/window was modified since the last
79 call to \fBwrefresh\fR; otherwise they return \fBFALSE\fR.  In
80 addition, \fBis_linetouched\fR returns \fBERR\fR if \fIline\fR is not
81 valid for the given window.
82 .SH RETURN VALUE
83 All routines return the integer \fBERR\fR upon failure and an integer value
84 other than \fBERR\fR upon successful completion, unless otherwise noted in the
85 preceding routine descriptions.
86 .PP
87 X/Open does not define any error conditions.
88 In this implementation
89 .RS 3
90 .TP 5
91 \fBis_linetouched\fP
92 returns an error 
93 if the window pointer is null, or
94 if the line number is outside the window.
95 .IP
96 The constant \fBERR\fP is distinct from \fBTRUE\fP and \fBFALSE\fP,
97 which are the normal return values of this function.
98 Because the function returns a \fBbool\fP,
99 returning \fBERR\fP (which is neither \fBTRUE\fP nor \fBFALSE\fP)
100 may not be supported by the compiler.
101 .IP
102 To provide error-checking and also match the X/Open function prototype,
103 the \fBERR\fP is provided by a macro named \fBis_linetouched\fP.
104 The actual function returns \fBFALSE\fP when it detects an error.
105 .TP 5
106 \fBwtouchln\fP
107 returns an error 
108 if the window pointer is null, or
109 if the line number is outside the window.
110 .RE
111 .SH PORTABILITY
112 .PP
113 These functions were introduced by SVr4.
114 The Solaris curses header file,
115 for instance, defines both an actual function and macro for each.
116 The macros give the same result as the actual functions.
117 SVr4 curses does not check the window parameter \fIwin\fP to ensure
118 that it is not \fBNULL\fP;
119 otherwise this implementation behaves the same as SVr4.
120 .PP
121 The XSI Curses standard, Issue 4 describes these functions,
122 but defines no error conditions.
123 .SH NOTES
124 All of these routines except \fBwtouchln\fR may be macros.
125 .SH SEE ALSO
126 \fBcurses\fR(3X),
127 \fBcurs_refresh\fR(3X),
128 \fBcurs_variables\fR(3X).