Explicitly specify `all' as the default target(as it used to be), so as
[dragonfly.git] / lib / libncurses / man / curs_outopts.3
1 .\"***************************************************************************
2 .\" Copyright (c) 1998-2001,2003 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_outopts.3x,v 1.18 2003/05/10 20:33:49 jmc Exp $
30 .\" $DragonFly: src/lib/libncurses/man/curs_outopts.3,v 1.1 2005/03/12 19:13:54 eirikn Exp $
31 .TH curs_outopts 3X ""
32 .SH NAME
33 \fBclearok\fR, \fBidlok\fR, \fBidcok\fR, \fBimmedok\fR,
34 \fBleaveok\fR, \fBsetscrreg\fR, \fBwsetscrreg\fR, \fBscrollok\fR,
35 \fBnl\fR, \fBnonl\fR - \fBcurses\fR output options
36 .SH SYNOPSIS
37 \fB#include <curses.h>\fR
38
39 \fBint clearok(WINDOW *win, bool bf);\fR
40 .br
41 \fBint idlok(WINDOW *win, bool bf);\fR
42 .br
43 \fBvoid idcok(WINDOW *win, bool bf);\fR
44 .br
45 \fBvoid immedok(WINDOW *win, bool bf);\fR
46 .br
47 \fBint leaveok(WINDOW *win, bool bf);\fR
48 .br
49 \fBint setscrreg(int top, int bot);\fR
50 .br
51 \fBint wsetscrreg(WINDOW *win, int top, int bot);\fR
52 .br
53 \fBint scrollok(WINDOW *win, bool bf);\fR
54 .br
55 \fBint nl(void);\fR
56 .br
57 \fBint nonl(void);\fR
58 .br
59 .SH DESCRIPTION
60 These routines set options that change the style of output within
61 \fBcurses\fR.
62 All options are initially \fBFALSE\fR, unless otherwise stated.
63 It is not necessary to turn these options off before calling \fBendwin\fR.
64
65 If \fBclearok\fR is called with \fBTRUE\fR as argument, the next
66 call to \fBwrefresh\fR with this window will clear the screen completely and
67 redraw the entire screen from scratch.
68 This is useful when the contents of the
69 screen are uncertain, or in some cases for a more pleasing visual effect.
70 If
71 the \fIwin\fR argument to \fBclearok\fR is the global variable \fBcurscr\fR,
72 the next call to \fBwrefresh\fR with any window causes the screen to be cleared
73 and repainted from scratch.
74
75 If \fBidlok\fR is called with \fBTRUE\fR as second argument, \fBcurses\fR
76 considers using the hardware insert/delete line feature of terminals so
77 equipped.
78 Calling \fBidlok\fR with \fBFALSE\fR as second argument disables use
79 of line insertion and deletion.
80 This option should be enabled only if the
81 application needs insert/delete line, for example, for a screen editor.
82 It is
83 disabled by default because insert/delete line tends to be visually annoying
84 when used in applications where it isn't really needed.
85 If insert/delete line
86 cannot be used, \fBcurses\fR redraws the changed portions of all lines.
87
88 If \fBidcok\fR is called with \fBFALSE\fR as second argument, \fBcurses\fR
89 no longer considers using the hardware insert/delete character feature of
90 terminals so equipped.
91 Use of character insert/delete is enabled by default.
92 Calling \fBidcok\fR with \fBTRUE\fR as second argument re-enables use
93 of character insertion and deletion.
94
95 If \fBimmedok\fR is called with \fBTRUE as argument\fR, any change
96 in the window image, such as the ones caused by \fBwaddch, wclrtobot, wscrl\fR,
97 etc., automatically cause a call to \fBwrefresh\fR.
98 However, it may
99 degrade performance considerably, due to repeated calls to \fBwrefresh\fR.
100 It is disabled by default.
101
102 Normally, the hardware cursor is left at the location of the window cursor
103 being refreshed.
104 The \fBleaveok\fR option allows the cursor to be left
105 wherever the update happens to leave it.
106 It is useful for applications where
107 the cursor is not used, since it reduces the need for cursor motions.
108
109 The \fBsetscrreg\fR and \fBwsetscrreg\fR routines allow the application
110 programmer to set a software scrolling region in a window.
111 \fItop\fR and
112 \fIbot\fR are the line numbers of the top and bottom margin of the scrolling
113 region.
114 (Line 0 is the top line of the window.)  If this option and
115 \fBscrollok\fR are enabled, an attempt to move off the bottom margin line
116 causes all lines in the scrolling region to scroll one line in the direction
117 of the first line.
118 Only the text of the window is scrolled.
119 (Note that this
120 has nothing to do with the use of a physical scrolling region capability in the
121 terminal, like that in the VT100.
122 If \fBidlok\fR is enabled and the terminal
123 has either a scrolling region or insert/delete line capability, they will
124 probably be used by the output routines.)
125
126 The \fBscrollok\fR option controls what happens when the cursor of a window is
127 moved off the edge of the window or scrolling region, either as a result of a
128 newline action on the bottom line, or typing the last character of the last
129 line.
130 If disabled, (\fIbf\fR is \fBFALSE\fR), the cursor is left on the bottom
131 line.
132 If enabled, (\fIbf\fR is \fBTRUE\fR), the window is scrolled up one line
133 (Note that to get the physical scrolling effect on the terminal, it is
134 also necessary to call \fBidlok\fR).
135
136 The \fBnl\fR and \fBnonl\fR routines control whether the underlying display
137 device translates the return key into newline on input, and whether it
138 translates newline into return and line-feed on output (in either case, the
139 call \fBaddch('\\n')\fR does the equivalent of return and line feed on the
140 virtual screen).
141 Initially, these translations do occur.
142 If you disable them
143 using \fBnonl\fR, \fBcurses\fR will be able to make better use of the line-feed
144 capability, resulting in faster cursor motion.
145 Also, \fBcurses\fR will then be
146 able to detect the return key.
147 .SH RETURN VALUE
148 The functions \fBsetscrreg\fR and \fBwsetscrreg\fR return \fBOK\fR upon success
149 and \fBERR\fR upon failure.
150 All other routines that return an integer always
151 return \fBOK\fR.
152 .SH PORTABILITY
153 These functions are described in the XSI Curses standard, Issue 4.
154
155 The XSI Curses standard is ambiguous on the question of whether \fBraw\fR()
156 should disable the CRLF translations controlled by \fBnl\fR() and \fBnonl\fR().
157 BSD curses did turn off these translations; AT&T curses (at least as late as
158 SVr1) did not.
159 We choose to do so, on the theory that a programmer requesting
160 raw input wants a clean (ideally 8-bit clean) connection that the operating
161 system does not mess with.
162
163 Some historic curses implementations had, as an undocumented feature, the
164 ability to do the equivalent of \fBclearok(..., 1)\fR by saying
165 \fBtouchwin(stdscr)\fR or \fBclear(stdscr)\fR.
166 This will not work under
167 ncurses.
168
169 Earlier System V curses implementations specified that with \fBscrollok\fR
170 enabled, any window modification triggering a scroll also forced a physical
171 refresh.
172 XSI Curses does not require this, and \fBncurses\fR avoids doing
173 it to perform better vertical-motion optimization at \fBwrefresh\fR
174 time.
175
176 The XSI Curses standard does not mention that the cursor should be
177 made invisible as a side-effect of \fBleaveok\fR.
178 SVr4 curses documentation does this, but the code does not.
179 Use \fBcurs_set\fR to make the cursor invisible.
180 .SH NOTES
181 Note that \fBclearok\fR, \fBleaveok\fR, \fBscrollok\fR, \fBidcok\fR, \fBnl\fR,
182 \fBnonl\fR and \fBsetscrreg\fR may be macros.
183
184 The \fBimmedok\fR routine is useful for windows that are used as terminal
185 emulators.
186 .SH SEE ALSO
187 \fBcurses\fR(3X), \fBcurs_addch\fR(3X), \fBcurs_clear\fR(3X),
188 \fBcurs_initscr\fR(3X), \fBcurs_scroll\fR(3X), \fBcurs_refresh\fR(3X)
189 .\"#
190 .\"# The following sets edit modes for GNU EMACS
191 .\"# Local Variables:
192 .\"# mode:nroff
193 .\"# fill-column:79
194 .\"# End: