xref: /netbsd/lib/libcurses/PSD.doc/doc.I (revision bf9ec67e)
1 .\"	$NetBSD: doc.I,v 1.4 1998/01/09 04:12:06 perry Exp $
2 .\"
3 .\" Copyright (c) 1980, 1993
4 .\"	The Regents of the University of California.  All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\" 3. All advertising materials mentioning features or use of this software
15 .\"    must display the following acknowledgement:
16 .\"	This product includes software developed by the University of
17 .\"	California, Berkeley and its contributors.
18 .\" 4. Neither the name of the University nor the names of its contributors
19 .\"    may be used to endorse or promote products derived from this software
20 .\"    without specific prior written permission.
21 .\"
22 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" SUCH DAMAGE.
33 .\"
34 .\"	@(#)doc.I	8.1 (Berkeley) 6/4/93
35 .\"
36 .Ds
37 .Fd addch ch \*m
38 char	ch;
39 .Fd waddch win\*,ch
40 WINDOW	*win;
41 char	ch;
42 .De
43 Add the character
44 .Vn ch
45 on the window
46 at the current \*y.
47 If the character is a newline
48 (\'\en\')
49 the line will be cleared to the end,
50 and the current \*y will be changed to the
51 beginning off the next line
52 if newline mapping is on,
53 or to the next line at the same x co-ordinate
54 if it is off.
55 A return
56 (\'\er\')
57 will move to the beginning of the line on the window.
58 Tabs
59 (\'\et\')
60 will be expanded into spaces
61 in the normal tabstop positions of
62 every eight characters.
63 \*(Es
64 .Ds
65 .Fd addstr str \*m
66 char	*str;
67 .Fd waddstr win\*,str
68 WINDOW	*win;
69 char	*str;
70 .De
71 Add the string pointed to by
72 .Vn str
73 on the window at the current \*y.
74 \*(Es
75 In this case, it will put on as much as it can.
76 .Ds
77 .Fd box win\*,vert\*,hor
78 WINDOW	*win;
79 char	vert\*,hor;
80 .De
81 .Pp
82 Draws a box around the window using
83 .Vn vert
84 as the character for drawing the vertical sides, and
85 .Vn hor
86 for drawing the horizontal lines.
87 If scrolling is not allowed,
88 and the window encompasses the lower right-hand corner of the terminal,
89 the corners are left blank to avoid a scroll.
90 .Ds
91 .Fd clear "" \*m
92 .Fd wclear win
93 WINDOW	*win;
94 .De
95 Resets the entire window to blanks.
96 If
97 .Vn win
98 is a screen,
99 this sets the clear flag,
100 which will cause a clear-screen sequence to be sent
101 on the next
102 .Fn refresh
103 call.
104 This also moves the current \*y
105 to (0\*,0).
106 .Ds
107 .Fd clearok scr\*,boolf \*m
108 WINDOW	*scr;
109 bool	boolf;
110 .De
111 Sets the clear flag for the screen
112 .Vn scr .
113 If
114 .Vn boolf
115 is TRUE,
116 this will force a clear-screen to be printed on the next
117 .Fn refresh ,
118 or stop it from doing so if
119 .Vn boolf
120 is FALSE.
121 This only works on screens,
122 and,
123 unlike
124 .Fn clear ,
125 does not alter the contents of the screen.
126 If
127 .Vn scr
128 is
129 .Vn curscr ,
130 the next
131 .Fn refresh
132 call will cause a clear-screen,
133 even if the window passed to
134 .Fn refresh
135 is not a screen.
136 .Ds
137 .Fd clrtobot "" \*m
138 .Fd wclrtobot win
139 WINDOW	*win;
140 .De
141 Wipes the window clear from the current \*y to the bottom.
142 This does not force a clear-screen sequence on the next refresh
143 under any circumstances.
144 \*(Nm
145 .Ds
146 .Fd clrtoeol "" \*m
147 .Fd wclrtoeol win
148 WINDOW	*win;
149 .De
150 Wipes the window clear from the current \*y to the end of the line.
151 \*(Nm
152 .Ds
153 .Fd delch
154 .Fd wdelch win
155 WINDOW	*win;
156 .De
157 Delete the character at the current \*y.
158 Each character after it on the line shifts to the left,
159 and the last character becomes blank.
160 .Ds
161 .Fd deleteln
162 .Fd wdeleteln win
163 WINDOW	*win;
164 .De
165 Delete the current line.
166 Every line below the current one will move up,
167 and the bottom line will become blank.
168 The current \*y will remain unchanged.
169 .Ds
170 .Fd erase "" \*m
171 .Fd werase win
172 WINDOW	*win;
173 .De
174 Erases the window to blanks without setting the clear flag.
175 This is analagous to
176 .Fn clear ,
177 except that it never causes a clear-screen sequence to be generated
178 on a
179 .Fn refresh .
180 \*(Nm
181 .Ds
182 .Fd flushok win\*,boolf \*m
183 WINDOW	*win;
184 bool	boolf;
185 .De
186 Normally,
187 .Fn refresh
188 .Fn fflush 's
189 .Vn stdout
190 when it is finished.
191 .Fn flushok
192 allows you to control this.
193 if
194 .Vn boolf
195 is TRUE
196 (\c
197 .i i.e. ,
198 non-zero)
199 it will do the
200 .Fn fflush ;
201 if it is FALSE.
202 it will not.
203 .Ds
204 .Fd idlok win\*,boolf
205 WINDOW	*win;
206 bool	boolf;
207 .De
208 Reserved for future use.
209 This will eventually signal to
210 .Fn refresh
211 that it is all right to use the insert and delete line sequences
212 when updating the window.
213 .Ds
214 .Fd insch c
215 char	c;
216 .Fd winsch win\*,c
217 WINDOW	*win;
218 char	c;
219 .De
220 Insert
221 .Vn c
222 at the current \*y
223 Each character after it shifts to the right,
224 and the last character disappears.
225 \*(Es
226 .Ds
227 .Fd insertln
228 .Fd winsertln win
229 WINDOW	*win;
230 .De
231 Insert a line above the current one.
232 Every line below the current line
233 will be shifted down,
234 and the bottom line will disappear.
235 The current line will become blank,
236 and the current \*y will remain unchanged.
237 .Ds
238 .Fd move y\*,x \*m
239 int	y\*,x;
240 .Fd wmove win\*,y\*,x
241 WINDOW	*win;
242 int	y\*,x;
243 .De
244 Change the current \*y of the window to
245 .Vn y\*,x ). (
246 \*(Es
247 .Ds
248 .Fd overlay win1\*,win2
249 WINDOW	*win1\*,*win2;
250 .De
251 Overlay
252 .Vn win1
253 on
254 .Vn win2 .
255 The contents of
256 .Vn win1 ,
257 insofar as they fit,
258 are placed on
259 .Vn win2
260 at their starting \*y.
261 This is done non-destructively,
262 i.e., blanks on
263 .Vn win1
264 leave the contents of the space on
265 .Vn win2
266 untouched.
267 .Ds
268 .Fd overwrite win1\*,win2
269 WINDOW	*win1\*,*win2;
270 .De
271 Overwrite
272 .Vn win1
273 on
274 .Vn win2 .
275 The contents of
276 .Vn win1 ,
277 insofar as they fit,
278 are placed on
279 .Vn win2
280 at their starting \*y.
281 This is done destructively,
282 .i i.e. ,
283 blanks on
284 .Vn win1
285 become blank on
286 .Vn win2 .
287 .Ds
288 .Fd printw fmt\*,arg1\*,arg2\*,...
289 char	*fmt;
290 .Fd wprintw win\*,fmt\*,arg1\*,arg2\*,...
291 WINDOW	*win;
292 char	*fmt;
293 .De
294 Performs a
295 .Fn printf
296 on the window starting at the current \*y.
297 It uses
298 .Fn addstr
299 to add the string on the window.
300 It is often advisable to use the field width options of
301 .Fn printf
302 to avoid leaving things on the window from earlier calls.
303 \*(Es
304 .Ds
305 .Fd refresh "" \*m
306 .Fd wrefresh win
307 WINDOW	*win;
308 .De
309 Synchronize the terminal screen with the desired window.
310 If the window is not a screen,
311 only that part covered by it is updated.
312 \*(Es
313 In this case, it will update whatever it can
314 without causing the scroll.
315 .sp
316 As a special case,
317 if
318 .Fn wrefresh
319 is called with the window
320 .Vn curscr
321 the screen is cleared
322 and repainted as it is currently.
323 This is very useful for allowing the redrawing of the screen
324 when the user has garbage dumped on his terminal.
325 .Ds
326 .Fd standout "" \*m
327 .Fd wstandout win
328 WINDOW	*win;
329 .Fd standend "" \*m
330 .Fd wstandend win
331 WINDOW	*win;
332 .De
333 Start and stop putting characters onto
334 .i win
335 in standout mode.
336 .Fn standout
337 causes any characters added to the window
338 to be put in standout mode on the terminal
339 (if it has that capability).
340 .Fn standend
341 stops this.
342 The sequences
343 .Vn SO
344 and
345 .Vn SE
346 (or
347 .Vn US
348 and
349 .Vn UE
350 if they are not defined)
351 are used (see Appendix A).
352