Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | .\"*************************************************************************** |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2 | .\" Copyright (c) 1998-2010,2015 Free Software Foundation, Inc. * |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 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 | .\" |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 29 | .\" $Id: curs_outopts.3x,v 1.26 2015/07/21 00:23:43 tom Exp $ |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 30 | .TH curs_outopts 3X "" |
| 31 | .na |
| 32 | .hy 0 |
| 33 | .SH NAME |
| 34 | \fBclearok\fR, |
| 35 | \fBidlok\fR, |
| 36 | \fBidcok\fR, |
| 37 | \fBimmedok\fR, |
| 38 | \fBleaveok\fR, |
| 39 | \fBsetscrreg\fR, |
| 40 | \fBwsetscrreg\fR, |
| 41 | \fBscrollok\fR, |
| 42 | \fBnl\fR, |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 43 | \fBnonl\fR \- \fBcurses\fR output options |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 44 | .ad |
| 45 | .hy |
| 46 | .SH SYNOPSIS |
| 47 | \fB#include <curses.h>\fR |
| 48 | .sp |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 49 | \fBint clearok(WINDOW *\fP\fIwin\fP\fB, bool \fP\fIbf\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 50 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 51 | \fBint idlok(WINDOW *\fP\fIwin\fP\fB, bool \fP\fIbf\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 52 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 53 | \fBvoid idcok(WINDOW *\fP\fIwin\fP\fB, bool \fP\fIbf\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 54 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 55 | \fBvoid immedok(WINDOW *\fP\fIwin\fP\fB, bool \fP\fIbf\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 56 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 57 | \fBint leaveok(WINDOW *\fP\fIwin\fP\fB, bool \fP\fIbf\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 58 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 59 | \fBint setscrreg(int \fP\fItop\fP\fB, int \fP\fIbot\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 60 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 61 | \fBint wsetscrreg(WINDOW *\fP\fIwin\fP\fB, int \fP\fItop\fP\fB, int \fP\fIbot\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 62 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 63 | \fBint scrollok(WINDOW *\fP\fIwin\fP\fB, bool \fP\fIbf\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 64 | .br |
| 65 | \fBint nl(void);\fR |
| 66 | .br |
| 67 | \fBint nonl(void);\fR |
| 68 | .br |
| 69 | .SH DESCRIPTION |
| 70 | These routines set options that change the style of output within |
| 71 | \fBcurses\fR. |
| 72 | All options are initially \fBFALSE\fR, unless otherwise stated. |
| 73 | It is not necessary to turn these options off before calling \fBendwin\fR. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 74 | .SS clearok |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 75 | .PP |
| 76 | If \fBclearok\fR is called with \fBTRUE\fR as argument, the next |
| 77 | call to \fBwrefresh\fR with this window will clear the screen completely and |
| 78 | redraw the entire screen from scratch. |
| 79 | This is useful when the contents of the |
| 80 | screen are uncertain, or in some cases for a more pleasing visual effect. |
| 81 | If |
| 82 | the \fIwin\fR argument to \fBclearok\fR is the global variable \fBcurscr\fR, |
| 83 | the next call to \fBwrefresh\fR with any window causes the screen to be cleared |
| 84 | and repainted from scratch. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 85 | .SS idlok |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 86 | .PP |
| 87 | If \fBidlok\fR is called with \fBTRUE\fR as second argument, \fBcurses\fR |
| 88 | considers using the hardware insert/delete line feature of terminals so |
| 89 | equipped. |
| 90 | Calling \fBidlok\fR with \fBFALSE\fR as second argument disables use |
| 91 | of line insertion and deletion. |
| 92 | This option should be enabled only if the |
| 93 | application needs insert/delete line, for example, for a screen editor. |
| 94 | It is |
| 95 | disabled by default because insert/delete line tends to be visually annoying |
| 96 | when used in applications where it is not really needed. |
| 97 | If insert/delete line |
| 98 | cannot be used, \fBcurses\fR redraws the changed portions of all lines. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 99 | .SS idcok |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 100 | .PP |
| 101 | If \fBidcok\fR is called with \fBFALSE\fR as second argument, \fBcurses\fR |
| 102 | no longer considers using the hardware insert/delete character feature of |
| 103 | terminals so equipped. |
| 104 | Use of character insert/delete is enabled by default. |
| 105 | Calling \fBidcok\fR with \fBTRUE\fR as second argument re-enables use |
| 106 | of character insertion and deletion. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 107 | .SS immedok |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 108 | .PP |
| 109 | If \fBimmedok\fR is called with \fBTRUE as argument\fR, any change |
| 110 | in the window image, such as the ones caused by \fBwaddch, wclrtobot, wscrl\fR, |
| 111 | etc., automatically cause a call to \fBwrefresh\fR. |
| 112 | However, it may |
| 113 | degrade performance considerably, due to repeated calls to \fBwrefresh\fR. |
| 114 | It is disabled by default. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 115 | .SS leaveok |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 116 | .PP |
| 117 | Normally, the hardware cursor is left at the location of the window cursor |
| 118 | being refreshed. |
| 119 | The \fBleaveok\fR option allows the cursor to be left |
| 120 | wherever the update happens to leave it. |
| 121 | It is useful for applications where |
| 122 | the cursor is not used, since it reduces the need for cursor motions. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 123 | .SS setscrreg |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 124 | .PP |
| 125 | The \fBsetscrreg\fR and \fBwsetscrreg\fR routines allow the application |
| 126 | programmer to set a software scrolling region in a window. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 127 | The \fItop\fR and |
| 128 | \fIbot\fR parameters |
| 129 | are the line numbers of the top and bottom margin of the scrolling |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 130 | region. |
| 131 | (Line 0 is the top line of the window.) If this option and |
| 132 | \fBscrollok\fR are enabled, an attempt to move off the bottom margin line |
| 133 | causes all lines in the scrolling region to scroll one line in the direction |
| 134 | of the first line. |
| 135 | Only the text of the window is scrolled. |
| 136 | (Note that this |
| 137 | has nothing to do with the use of a physical scrolling region capability in the |
| 138 | terminal, like that in the VT100. |
| 139 | If \fBidlok\fR is enabled and the terminal |
| 140 | has either a scrolling region or insert/delete line capability, they will |
| 141 | probably be used by the output routines.) |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 142 | .SS scrollok |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 143 | .PP |
| 144 | The \fBscrollok\fR option controls what happens when the cursor of a window is |
| 145 | moved off the edge of the window or scrolling region, either as a result of a |
| 146 | newline action on the bottom line, or typing the last character of the last |
| 147 | line. |
| 148 | If disabled, (\fIbf\fR is \fBFALSE\fR), the cursor is left on the bottom |
| 149 | line. |
| 150 | If enabled, (\fIbf\fR is \fBTRUE\fR), the window is scrolled up one line |
| 151 | (Note that to get the physical scrolling effect on the terminal, it is |
| 152 | also necessary to call \fBidlok\fR). |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 153 | .SS nl, nonl |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 154 | .PP |
| 155 | The \fBnl\fR and \fBnonl\fR routines control whether the underlying display |
| 156 | device translates the return key into newline on input, and whether it |
| 157 | translates newline into return and line-feed on output (in either case, the |
| 158 | call \fBaddch('\\n')\fR does the equivalent of return and line feed on the |
| 159 | virtual screen). |
| 160 | Initially, these translations do occur. |
| 161 | If you disable them |
| 162 | using \fBnonl\fR, \fBcurses\fR will be able to make better use of the line-feed |
| 163 | capability, resulting in faster cursor motion. |
| 164 | Also, \fBcurses\fR will then be |
| 165 | able to detect the return key. |
| 166 | .SH RETURN VALUE |
| 167 | The functions \fBsetscrreg\fR and \fBwsetscrreg\fR return \fBOK\fR upon success |
| 168 | and \fBERR\fR upon failure. |
| 169 | All other routines that return an integer always |
| 170 | return \fBOK\fR. |
| 171 | .PP |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 172 | X/Open Curses does not define any error conditions. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 173 | .PP |
| 174 | In this implementation, those functions that have a window pointer |
| 175 | will return an error if the window pointer is null. |
| 176 | .RS |
| 177 | .TP 5 |
| 178 | .B wclrtoeol |
| 179 | returns an error |
| 180 | if the cursor position is about to wrap. |
| 181 | .TP 5 |
| 182 | .B wsetscrreg |
| 183 | returns an error if the scrolling region limits extend outside the window. |
| 184 | .RE |
| 185 | .PP |
| 186 | X/Open does not define any error conditions. |
| 187 | This implementation returns an error |
| 188 | if the window pointer is null. |
| 189 | .SH PORTABILITY |
| 190 | These functions are described in the XSI Curses standard, Issue 4. |
| 191 | .PP |
| 192 | The XSI Curses standard is ambiguous on the question of whether \fBraw\fR() |
| 193 | should disable the CRLF translations controlled by \fBnl\fR() and \fBnonl\fR(). |
| 194 | BSD curses did turn off these translations; AT&T curses (at least as late as |
| 195 | SVr1) did not. |
| 196 | We choose to do so, on the theory that a programmer requesting |
| 197 | raw input wants a clean (ideally 8-bit clean) connection that the operating |
| 198 | system will not alter. |
| 199 | .PP |
| 200 | Some historic curses implementations had, as an undocumented feature, the |
| 201 | ability to do the equivalent of \fBclearok(..., 1)\fR by saying |
| 202 | \fBtouchwin(stdscr)\fR or \fBclear(stdscr)\fR. |
| 203 | This will not work under |
| 204 | ncurses. |
| 205 | .PP |
| 206 | Earlier System V curses implementations specified that with \fBscrollok\fR |
| 207 | enabled, any window modification triggering a scroll also forced a physical |
| 208 | refresh. |
| 209 | XSI Curses does not require this, and \fBncurses\fR avoids doing |
| 210 | it to perform better vertical-motion optimization at \fBwrefresh\fR |
| 211 | time. |
| 212 | .PP |
| 213 | The XSI Curses standard does not mention that the cursor should be |
| 214 | made invisible as a side-effect of \fBleaveok\fR. |
| 215 | SVr4 curses documentation does this, but the code does not. |
| 216 | Use \fBcurs_set\fR to make the cursor invisible. |
| 217 | .SH NOTES |
| 218 | Note that \fBclearok\fR, \fBleaveok\fR, \fBscrollok\fR, \fBidcok\fR, \fBnl\fR, |
| 219 | \fBnonl\fR and \fBsetscrreg\fR may be macros. |
| 220 | .PP |
| 221 | The \fBimmedok\fR routine is useful for windows that are used as terminal |
| 222 | emulators. |
| 223 | .SH SEE ALSO |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 224 | .na |
| 225 | \fBcurses\fR(3X), |
| 226 | \fBcurs_addch\fR(3X), |
| 227 | \fBcurs_clear\fR(3X), |
| 228 | \fBcurs_initscr\fR(3X), |
| 229 | \fBcurs_scroll\fR(3X), |
| 230 | \fBcurs_refresh\fR(3X), |
| 231 | \fBcurs_variables\fR(3X). |