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