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