xref: /csrg-svn/lib/libcurses/PSD.doc/doc.I (revision 27290)
1 .\" Copyright (c) 1980 Regents of the University of California.
2 .\" All rights reserved.  The Berkeley software License Agreement
3 .\" specifies the terms and conditions for redistribution.
4 .\"
5 .\"	@(#)doc.I	5.1 (Berkeley) 04/23/86
6 .\"
7 .Ds
8 .Fd addch ch \*m
9 char	ch;
10 .sp .5
11 .Fd waddch win\*,ch
12 WINDOW	*win;
13 char	ch;
14 .De
15 Add the character
16 .Vn ch
17 on the window
18 at the current \*y.
19 If the character is a newline
20 (\'\en\')
21 the line will be cleared to the end,
22 and the current \*y will be changed to the
23 beginning off the next line
24 if newline mapping is on,
25 or to the next line at the same x co-ordinate
26 if it is off.
27 A return
28 (\'\er\')
29 will move to the beginning of the line on the window.
30 Tabs
31 (\'\et\')
32 will be expanded into spaces
33 in the normal tabstop positions of
34 every eight characters.
35 \*(Es
36 .Ds
37 .Fd addstr str \*m
38 char	*str;
39 .sp .5
40 .Fd waddstr win\*,str
41 WINDOW	*win;
42 char	*str;
43 .De
44 Add the string pointed to by
45 .Vn str
46 on the window at the current \*y.
47 \*(Es
48 In this case, it will put on as much as it can.
49 .Ds
50 .Fd box win\*,vert\*,hor
51 WINDOW	*win;
52 char	vert\*,hor;
53 .De
54 .Pp
55 Draws a box around the window using
56 .Vn vert
57 as the character for drawing the vertical sides, and
58 .Vn hor
59 for drawing the horizontal lines.
60 If scrolling is not allowed,
61 and the window encompasses the lower right-hand corner of the terminal,
62 the corners are left blank to avoid a scroll.
63 .Ds
64 .Fd clear "" \*m
65 .sp .5
66 .Fd wclear win
67 WINDOW	*win;
68 .De
69 Resets the entire window to blanks.
70 If
71 .Vn win
72 is a screen,
73 this sets the clear flag,
74 which will cause a clear-screen sequence to be sent
75 on the next
76 .Fn refresh
77 call.
78 This also moves the current \*y
79 to (0\*,0).
80 .Ds
81 .Fd clearok scr\*,boolf \*m
82 WINDOW	*scr;
83 bool	boolf;
84 .De
85 Sets the clear flag for the screen
86 .Vn scr .
87 If
88 .Vn boolf
89 is TRUE,
90 this will force a clear-screen to be printed on the next
91 .Fn refresh ,
92 or stop it from doing so if
93 .Vn boolf
94 is FALSE.
95 This only works on screens,
96 and,
97 unlike
98 .Fn clear ,
99 does not alter the contents of the screen.
100 If
101 .Vn scr
102 is
103 .Vn curscr ,
104 the next
105 .Fn refresh
106 call will cause a clear-screen,
107 even if the window passed to
108 .Fn refresh
109 is not a screen.
110 .Ds
111 .Fd clrtobot "" \*m
112 .sp .5
113 .Fd wclrtobot win
114 WINDOW	*win;
115 .De
116 Wipes the window clear from the current \*y to the bottom.
117 This does not force a clear-screen sequence on the next refresh
118 under any circumstances.
119 \*(Nm
120 .Ds
121 .Fd clrtoeol "" \*m
122 .sp .5
123 .Fd wclrtoeol win
124 WINDOW	*win;
125 .De
126 Wipes the window clear from the current \*y to the end of the line.
127 \*(Nm
128 .Ds
129 .Fd delch
130 .sp .5
131 .Fd wdelch win
132 WINDOW	*win;
133 .De
134 Delete the character at the current \*y.
135 Each character after it on the line shifts to the left,
136 and the last character becomes blank.
137 .Ds
138 .Fd deleteln
139 .sp .5
140 .Fd wdeleteln win
141 WINDOW	*win;
142 .De
143 Delete the current line.
144 Every line below the current one will move up,
145 and the bottom line will become blank.
146 The current \*y will remain unchanged.
147 .Ds
148 .Fd erase "" \*m
149 .sp .5
150 .Fd werase win
151 WINDOW	*win;
152 .De
153 Erases the window to blanks without setting the clear flag.
154 This is analagous to
155 .Fn clear ,
156 except that it never causes a clear-screen sequence to be generated
157 on a
158 .Fn refresh .
159 \*(Nm
160 .Ds
161 .Fd insch c
162 char	c;
163 .sp .5
164 .Fd winsch win\*,c
165 WINDOW	*win;
166 char	c;
167 .De
168 Insert
169 .Vn c
170 at the current \*y
171 Each character after it shifts to the right,
172 and the last character disappears.
173 \*(Es
174 .Ds
175 .Fd insertln
176 .sp .5
177 .Fd winsertln win
178 WINDOW	*win;
179 .De
180 Insert a line above the current one.
181 Every line below the current line
182 will be shifted down,
183 and the bottom line will disappear.
184 The current line will become blank,
185 and the current \*y will remain unchanged.
186 \*(Es
187 .Ds
188 .Fd move y\*,x \*m
189 int	y\*,x;
190 .sp .5
191 .Fd wmove win\*,y\*,x
192 WINDOW	*win;
193 int	y\*,x;
194 .De
195 Change the current \*y of the window to
196 .Vn y\*,x ). (
197 \*(Es
198 .Ds
199 .Fd overlay win1\*,win2
200 WINDOW	*win1\*,*win2;
201 .De
202 Overlay
203 .Vn win1
204 on
205 .Vn win2 .
206 The contents of
207 .Vn win1 ,
208 insofar as they fit,
209 are placed on
210 .Vn win2
211 at their starting \*y.
212 This is done non-destructively,
213 i.e., blanks on
214 .Vn win1
215 leave the contents of the space on
216 .Vn win2
217 untouched.
218 .Ds
219 .Fd overwrite win1\*,win2
220 WINDOW	*win1\*,*win2;
221 .De
222 Overwrite
223 .Vn win1
224 on
225 .Vn win2 .
226 The contents of
227 .Vn win1 ,
228 insofar as they fit,
229 are placed on
230 .Vn win2
231 at their starting \*y.
232 This is done destructively,
233 i.e., blanks on
234 .Vn win1
235 become blank on
236 .Vn win2 .
237 .Ds
238 .Fd printw fmt\*,arg1\*,arg2\*,...
239 char	*fmt;
240 .sp .5
241 .Fd wprintw win\*,fmt\*,arg1\*,arg2\*,...
242 WINDOW	*win;
243 char	*fmt;
244 .De
245 Performs a
246 .Fn printf
247 on the window starting at the current \*y.
248 It uses
249 .Fn addstr
250 to add the string on the window.
251 It is often advisable to use the field width options of
252 .Fn printf
253 to avoid leaving things on the window from earlier calls.
254 \*(Es
255 .Ds
256 .Fd refresh "" \*m
257 .sp .5
258 .Fd wrefresh win
259 WINDOW	*win;
260 .De
261 Synchronize the terminal screen with the desired window.
262 If the window is not a screen,
263 only that part covered by it is updated.
264 \*(Es
265 In this case, it will update whatever it can
266 without causing the scroll.
267 .Ds
268 .Fd standout "" \*m
269 .sp .5
270 .Fd wstandout win
271 WINDOW	*win;
272 .sp .5
273 .Fd standend "" \*m
274 .sp .5
275 .Fd wstandend win
276 WINDOW	*win;
277 .De
278 Start and stop putting characters onto
279 .i win
280 in standout mode.
281 .Fn standout
282 causes any characters added to the window
283 to be put in standout mode on the terminal
284 (if it has that capability).
285 .Fn standend
286 stops this.
287 The sequences
288 .Vn SO
289 and
290 .Vn SE
291 (or
292 .Vn US
293 and
294 .Vn UE
295 if they are not defined)
296 are used (see Appendix A).
297