libncurses: updated to 6.0
[tomato.git] / release / src / router / libncurses / doc / html / man / curs_outopts.3x.html
blobd6f6b7d66d391d61aa8888be37822d2ec9da3d74
1 <!--
2 ****************************************************************************
3 * Copyright (c) 1998-2010,2015 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 * @Id: curs_outopts.3x,v 1.26 2015/07/21 00:23:43 tom Exp @
30 -->
31 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
32 <HTML>
33 <HEAD>
34 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
35 <meta name="generator" content="Manpage converted by man2html - see http://invisible-island.net/scripts/readme.html#others_scripts">
36 <TITLE>curs_outopts 3x</TITLE>
37 <link rev=made href="mailto:bug-ncurses@gnu.org">
38 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
39 </HEAD>
40 <BODY>
41 <H1 class="no-header">curs_outopts 3x</H1>
42 <PRE>
43 <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG> <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>
48 </PRE>
49 <H2><a name="h2-NAME">NAME</a></H2><PRE>
50 <STRONG>clearok</STRONG>, <STRONG>idlok</STRONG>, <STRONG>idcok</STRONG>, <STRONG>immedok</STRONG>, <STRONG>leaveok</STRONG>, <STRONG>setscrreg</STRONG>,
51 <STRONG>wsetscrreg</STRONG>, <STRONG>scrollok</STRONG>, <STRONG>nl</STRONG>, <STRONG>nonl</STRONG> - <STRONG>curses</STRONG> output options
54 </PRE>
55 <H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
56 <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
58 <STRONG>int</STRONG> <STRONG>clearok(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>bool</STRONG> <EM>bf</EM><STRONG>);</STRONG>
59 <STRONG>int</STRONG> <STRONG>idlok(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>bool</STRONG> <EM>bf</EM><STRONG>);</STRONG>
60 <STRONG>void</STRONG> <STRONG>idcok(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>bool</STRONG> <EM>bf</EM><STRONG>);</STRONG>
61 <STRONG>void</STRONG> <STRONG>immedok(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>bool</STRONG> <EM>bf</EM><STRONG>);</STRONG>
62 <STRONG>int</STRONG> <STRONG>leaveok(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>bool</STRONG> <EM>bf</EM><STRONG>);</STRONG>
63 <STRONG>int</STRONG> <STRONG>setscrreg(int</STRONG> <EM>top</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>bot</EM><STRONG>);</STRONG>
64 <STRONG>int</STRONG> <STRONG>wsetscrreg(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>top</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>bot</EM><STRONG>);</STRONG>
65 <STRONG>int</STRONG> <STRONG>scrollok(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>bool</STRONG> <EM>bf</EM><STRONG>);</STRONG>
66 <STRONG>int</STRONG> <STRONG>nl(void);</STRONG>
67 <STRONG>int</STRONG> <STRONG>nonl(void);</STRONG>
70 </PRE>
71 <H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
72 These routines set options that change the style of output
73 within <STRONG>curses</STRONG>. All options are initially <STRONG>FALSE</STRONG>, unless
74 otherwise stated. It is not necessary to turn these op-
75 tions off before calling <STRONG>endwin</STRONG>.
78 </PRE>
79 <H3><a name="h3-clearok">clearok</a></H3><PRE>
80 If <STRONG>clearok</STRONG> is called with <STRONG>TRUE</STRONG> as argument, the next call
81 to <STRONG>wrefresh</STRONG> with this window will clear the screen com-
82 pletely and redraw the entire screen from scratch. This
83 is useful when the contents of the screen are uncertain,
84 or in some cases for a more pleasing visual effect. If
85 the <EM>win</EM> argument to <STRONG>clearok</STRONG> is the global variable <STRONG>curscr</STRONG>,
86 the next call to <STRONG>wrefresh</STRONG> with any window causes the
87 screen to be cleared and repainted from scratch.
90 </PRE>
91 <H3><a name="h3-idlok">idlok</a></H3><PRE>
92 If <STRONG>idlok</STRONG> is called with <STRONG>TRUE</STRONG> as second argument, <STRONG>curses</STRONG>
93 considers using the hardware insert/delete line feature of
94 terminals so equipped. Calling <STRONG>idlok</STRONG> with <STRONG>FALSE</STRONG> as second
95 argument disables use of line insertion and deletion.
96 This option should be enabled only if the application
97 needs insert/delete line, for example, for a screen edi-
98 tor. It is disabled by default because insert/delete line
99 tends to be visually annoying when used in applications
100 where it is not really needed. If insert/delete line can-
101 not be used, <STRONG>curses</STRONG> redraws the changed portions of all
102 lines.
105 </PRE>
106 <H3><a name="h3-idcok">idcok</a></H3><PRE>
107 If <STRONG>idcok</STRONG> is called with <STRONG>FALSE</STRONG> as second argument, <STRONG>curses</STRONG>
108 no longer considers using the hardware insert/delete char-
109 acter feature of terminals so equipped. Use of character
110 insert/delete is enabled by default. Calling <STRONG>idcok</STRONG> with
111 <STRONG>TRUE</STRONG> as second argument re-enables use of character inser-
112 tion and deletion.
115 </PRE>
116 <H3><a name="h3-immedok">immedok</a></H3><PRE>
117 If <STRONG>immedok</STRONG> is called with <STRONG>TRUE</STRONG> <STRONG>as</STRONG> <STRONG>argument</STRONG>, any change in
118 the window image, such as the ones caused by <STRONG>waddch,</STRONG> <STRONG>wclr-</STRONG>
119 <STRONG>tobot,</STRONG> <STRONG>wscrl</STRONG>, etc., automatically cause a call to <STRONG>wre-</STRONG>
120 <STRONG>fresh</STRONG>. However, it may degrade performance considerably,
121 due to repeated calls to <STRONG>wrefresh</STRONG>. It is disabled by de-
122 fault.
125 </PRE>
126 <H3><a name="h3-leaveok">leaveok</a></H3><PRE>
127 Normally, the hardware cursor is left at the location of
128 the window cursor being refreshed. The <STRONG>leaveok</STRONG> option al-
129 lows the cursor to be left wherever the update happens to
130 leave it. It is useful for applications where the cursor
131 is not used, since it reduces the need for cursor motions.
134 </PRE>
135 <H3><a name="h3-setscrreg">setscrreg</a></H3><PRE>
136 The <STRONG>setscrreg</STRONG> and <STRONG>wsetscrreg</STRONG> routines allow the applica-
137 tion programmer to set a software scrolling region in a
138 window. The <EM>top</EM> and <EM>bot</EM> parameters are the line numbers
139 of the top and bottom margin of the scrolling region.
140 (Line 0 is the top line of the window.) If this option
141 and <STRONG>scrollok</STRONG> are enabled, an attempt to move off the bot-
142 tom margin line causes all lines in the scrolling region
143 to scroll one line in the direction of the first line.
144 Only the text of the window is scrolled. (Note that this
145 has nothing to do with the use of a physical scrolling re-
146 gion capability in the terminal, like that in the VT100.
147 If <STRONG>idlok</STRONG> is enabled and the terminal has either a
148 scrolling region or insert/delete line capability, they
149 will probably be used by the output routines.)
152 </PRE>
153 <H3><a name="h3-scrollok">scrollok</a></H3><PRE>
154 The <STRONG>scrollok</STRONG> option controls what happens when the cursor
155 of a window is moved off the edge of the window or
156 scrolling region, either as a result of a newline action
157 on the bottom line, or typing the last character of the
158 last line. If disabled, (<EM>bf</EM> is <STRONG>FALSE</STRONG>), the cursor is left
159 on the bottom line. If enabled, (<EM>bf</EM> is <STRONG>TRUE</STRONG>), the window
160 is scrolled up one line (Note that to get the physical
161 scrolling effect on the terminal, it is also necessary to
162 call <STRONG>idlok</STRONG>).
165 </PRE>
166 <H3><a name="h3-nl_-nonl">nl, nonl</a></H3><PRE>
167 The <STRONG>nl</STRONG> and <STRONG>nonl</STRONG> routines control whether the underlying
168 display device translates the return key into newline on
169 input, and whether it translates newline into return and
170 line-feed on output (in either case, the call <STRONG>addch('\n')</STRONG>
171 does the equivalent of return and line feed on the virtual
172 screen). Initially, these translations do occur. If you
173 disable them using <STRONG>nonl</STRONG>, <STRONG>curses</STRONG> will be able to make bet-
174 ter use of the line-feed capability, resulting in faster
175 cursor motion. Also, <STRONG>curses</STRONG> will then be able to detect
176 the return key.
179 </PRE>
180 <H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
181 The functions <STRONG>setscrreg</STRONG> and <STRONG>wsetscrreg</STRONG> return <STRONG>OK</STRONG> upon suc-
182 cess and <STRONG>ERR</STRONG> upon failure. All other routines that return
183 an integer always return <STRONG>OK</STRONG>.
185 X/Open Curses does not define any error conditions.
187 In this implementation, those functions that have a window
188 pointer will return an error if the window pointer is
189 null.
191 <STRONG>wclrtoeol</STRONG>
192 returns an error if the cursor position is
193 about to wrap.
195 <STRONG>wsetscrreg</STRONG>
196 returns an error if the scrolling region lim-
197 its extend outside the window.
199 X/Open does not define any error conditions. This imple-
200 mentation returns an error if the window pointer is null.
203 </PRE>
204 <H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
205 These functions are described in the XSI Curses standard,
206 Issue 4.
208 The XSI Curses standard is ambiguous on the question of
209 whether <STRONG>raw</STRONG>() should disable the CRLF translations con-
210 trolled by <STRONG>nl</STRONG>() and <STRONG>nonl</STRONG>(). BSD curses did turn off these
211 translations; AT&amp;T curses (at least as late as SVr1) did
212 not. We choose to do so, on the theory that a programmer
213 requesting raw input wants a clean (ideally 8-bit clean)
214 connection that the operating system will not alter.
216 Some historic curses implementations had, as an undocu-
217 mented feature, the ability to do the equivalent of
218 <STRONG>clearok(...,</STRONG> <STRONG>1)</STRONG> by saying <STRONG>touchwin(stdscr)</STRONG> or <STRONG>clear(std-</STRONG>
219 <STRONG>scr)</STRONG>. This will not work under ncurses.
221 Earlier System V curses implementations specified that
222 with <STRONG>scrollok</STRONG> enabled, any window modification triggering
223 a scroll also forced a physical refresh. XSI Curses does
224 not require this, and <STRONG>ncurses</STRONG> avoids doing it to perform
225 better vertical-motion optimization at <STRONG>wrefresh</STRONG> time.
227 The XSI Curses standard does not mention that the cursor
228 should be made invisible as a side-effect of <STRONG>leaveok</STRONG>.
229 SVr4 curses documentation does this, but the code does
230 not. Use <STRONG>curs_set</STRONG> to make the cursor invisible.
233 </PRE>
234 <H2><a name="h2-NOTES">NOTES</a></H2><PRE>
235 Note that <STRONG>clearok</STRONG>, <STRONG>leaveok</STRONG>, <STRONG>scrollok</STRONG>, <STRONG>idcok</STRONG>, <STRONG>nl</STRONG>, <STRONG>nonl</STRONG> and
236 <STRONG>setscrreg</STRONG> may be macros.
238 The <STRONG>immedok</STRONG> routine is useful for windows that are used as
239 terminal emulators.
242 </PRE>
243 <H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
244 <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>, <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>,
245 <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>, <STRONG><A HREF="curs_scroll.3x.html">curs_scroll(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>,
246 <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>.
250 <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>
251 </PRE>
252 <div class="nav">
253 <ul>
254 <li><a href="#h2-NAME">NAME</a></li>
255 <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
256 <li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
257 <ul>
258 <li><a href="#h3-clearok">clearok</a></li>
259 <li><a href="#h3-idlok">idlok</a></li>
260 <li><a href="#h3-idcok">idcok</a></li>
261 <li><a href="#h3-immedok">immedok</a></li>
262 <li><a href="#h3-leaveok">leaveok</a></li>
263 <li><a href="#h3-setscrreg">setscrreg</a></li>
264 <li><a href="#h3-scrollok">scrollok</a></li>
265 <li><a href="#h3-nl_-nonl">nl, nonl</a></li>
266 </ul>
267 </li>
268 <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
269 <li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
270 <li><a href="#h2-NOTES">NOTES</a></li>
271 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
272 </ul>
273 </div>
274 </BODY>
275 </HTML>