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