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