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