Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | .\"*************************************************************************** |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2 | .\" Copyright 2018-2023,2024 Thomas E. Dickey * |
| 3 | .\" Copyright 1998-2015,2017 Free Software Foundation, Inc. * |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 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 | .\" |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 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" |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 32 | .SH NAME |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 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 |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 40 | .SH SYNOPSIS |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 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 |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 54 | .SH DESCRIPTION |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 55 | The \fB\%touchwin\fP and \fB\%touchline\fP routines throw away all |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 56 | optimization information about which parts of the window have been |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 57 | touched, by pretending that the entire window has been drawn on. |
| 58 | This |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 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 |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 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. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 65 | .PP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 66 | The \fB\%untouchwin\fP routine marks all lines in the window as unchanged since |
| 67 | the last call to \fB\%wrefresh\fP. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 68 | .PP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 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. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 73 | .PP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 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 |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 78 | valid for the given window. |
| 79 | .SH RETURN VALUE |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 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 |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 82 | preceding routine descriptions. |
| 83 | .PP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 84 | X/Open Curses does not specify any error conditions. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 85 | In this implementation |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 86 | .RS 3 |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 87 | .TP 5 |
| 88 | \fBis_linetouched\fP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 89 | returns an error |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 90 | if the window pointer is null, or |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 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. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 102 | .TP 5 |
| 103 | \fBwtouchln\fP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 104 | returns an error |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 105 | if the window pointer is null, or |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 106 | if the line number is outside the window boundaries. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 107 | .RE |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 108 | .SH NOTES |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 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. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 121 | .SH SEE ALSO |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 122 | \fB\%curses\fP(3X), |
| 123 | \fB\%curs_refresh\fP(3X), |
| 124 | \fB\%curs_variables\fP(3X) |