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