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