xref: /csrg-svn/lib/libcurses/PSD.doc/doc.I (revision 37201)
1*37201Sbostic .\" Copyright (c) 1980 The Regents of the University of California.
2*37201Sbostic .\" All rights reserved.
327289Smckusick .\"
4*37201Sbostic .\" Redistribution and use in source and binary forms are permitted
5*37201Sbostic .\" provided that the above copyright notice and this paragraph are
6*37201Sbostic .\" duplicated in all such forms and that any documentation,
7*37201Sbostic .\" advertising materials, and other materials related to such
8*37201Sbostic .\" distribution and use acknowledge that the software was developed
9*37201Sbostic .\" by the University of California, Berkeley.  The name of the
10*37201Sbostic .\" University may not be used to endorse or promote products derived
11*37201Sbostic .\" from this software without specific prior written permission.
12*37201Sbostic .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13*37201Sbostic .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14*37201Sbostic .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1527289Smckusick .\"
16*37201Sbostic .\"	@(#)doc.I	6.2 (Berkeley) 03/17/89
17*37201Sbostic .\"
1827289Smckusick .Ds
1927289Smckusick .Fd addch ch \*m
2027289Smckusick char	ch;
2127289Smckusick .Fd waddch win\*,ch
2227289Smckusick WINDOW	*win;
2327289Smckusick char	ch;
2427289Smckusick .De
2527289Smckusick Add the character
2627289Smckusick .Vn ch
2727289Smckusick on the window
2827289Smckusick at the current \*y.
2927289Smckusick If the character is a newline
3027289Smckusick (\'\en\')
3127289Smckusick the line will be cleared to the end,
3227289Smckusick and the current \*y will be changed to the
3327289Smckusick beginning off the next line
3427289Smckusick if newline mapping is on,
3527289Smckusick or to the next line at the same x co-ordinate
3627289Smckusick if it is off.
3727289Smckusick A return
3827289Smckusick (\'\er\')
3927289Smckusick will move to the beginning of the line on the window.
4027289Smckusick Tabs
4127289Smckusick (\'\et\')
4227289Smckusick will be expanded into spaces
4327289Smckusick in the normal tabstop positions of
4427289Smckusick every eight characters.
4527289Smckusick \*(Es
4627289Smckusick .Ds
4727289Smckusick .Fd addstr str \*m
4827289Smckusick char	*str;
4927289Smckusick .Fd waddstr win\*,str
5027289Smckusick WINDOW	*win;
5127289Smckusick char	*str;
5227289Smckusick .De
5327289Smckusick Add the string pointed to by
5427289Smckusick .Vn str
5527289Smckusick on the window at the current \*y.
5627289Smckusick \*(Es
5727289Smckusick In this case, it will put on as much as it can.
5827289Smckusick .Ds
5927289Smckusick .Fd box win\*,vert\*,hor
6027289Smckusick WINDOW	*win;
6127289Smckusick char	vert\*,hor;
6227289Smckusick .De
6327289Smckusick .Pp
6427289Smckusick Draws a box around the window using
6527289Smckusick .Vn vert
6627289Smckusick as the character for drawing the vertical sides, and
6727289Smckusick .Vn hor
6827289Smckusick for drawing the horizontal lines.
6927289Smckusick If scrolling is not allowed,
7027289Smckusick and the window encompasses the lower right-hand corner of the terminal,
7127289Smckusick the corners are left blank to avoid a scroll.
7227289Smckusick .Ds
7327289Smckusick .Fd clear "" \*m
7427289Smckusick .Fd wclear win
7527289Smckusick WINDOW	*win;
7627289Smckusick .De
7727289Smckusick Resets the entire window to blanks.
7827289Smckusick If
7927289Smckusick .Vn win
8027289Smckusick is a screen,
8127289Smckusick this sets the clear flag,
8227289Smckusick which will cause a clear-screen sequence to be sent
8327289Smckusick on the next
8427289Smckusick .Fn refresh
8527289Smckusick call.
8627289Smckusick This also moves the current \*y
8727289Smckusick to (0\*,0).
8827289Smckusick .Ds
8927289Smckusick .Fd clearok scr\*,boolf \*m
9027289Smckusick WINDOW	*scr;
9127289Smckusick bool	boolf;
9227289Smckusick .De
9327289Smckusick Sets the clear flag for the screen
9427289Smckusick .Vn scr .
9527289Smckusick If
9627289Smckusick .Vn boolf
9727289Smckusick is TRUE,
9827289Smckusick this will force a clear-screen to be printed on the next
9927289Smckusick .Fn refresh ,
10027289Smckusick or stop it from doing so if
10127289Smckusick .Vn boolf
10227289Smckusick is FALSE.
10327289Smckusick This only works on screens,
10427289Smckusick and,
10527289Smckusick unlike
10627289Smckusick .Fn clear ,
10727289Smckusick does not alter the contents of the screen.
10827289Smckusick If
10927289Smckusick .Vn scr
11027289Smckusick is
11127289Smckusick .Vn curscr ,
11227289Smckusick the next
11327289Smckusick .Fn refresh
11427289Smckusick call will cause a clear-screen,
11527289Smckusick even if the window passed to
11627289Smckusick .Fn refresh
11727289Smckusick is not a screen.
11827289Smckusick .Ds
11927289Smckusick .Fd clrtobot "" \*m
12027289Smckusick .Fd wclrtobot win
12127289Smckusick WINDOW	*win;
12227289Smckusick .De
12327289Smckusick Wipes the window clear from the current \*y to the bottom.
12427289Smckusick This does not force a clear-screen sequence on the next refresh
12527289Smckusick under any circumstances.
12627289Smckusick \*(Nm
12727289Smckusick .Ds
12827289Smckusick .Fd clrtoeol "" \*m
12927289Smckusick .Fd wclrtoeol win
13027289Smckusick WINDOW	*win;
13127289Smckusick .De
13227289Smckusick Wipes the window clear from the current \*y to the end of the line.
13327289Smckusick \*(Nm
13427289Smckusick .Ds
13527289Smckusick .Fd delch
13627289Smckusick .Fd wdelch win
13727289Smckusick WINDOW	*win;
13827289Smckusick .De
13927289Smckusick Delete the character at the current \*y.
14027289Smckusick Each character after it on the line shifts to the left,
14127289Smckusick and the last character becomes blank.
14227289Smckusick .Ds
14327289Smckusick .Fd deleteln
14427289Smckusick .Fd wdeleteln win
14527289Smckusick WINDOW	*win;
14627289Smckusick .De
14727289Smckusick Delete the current line.
14827289Smckusick Every line below the current one will move up,
14927289Smckusick and the bottom line will become blank.
15027289Smckusick The current \*y will remain unchanged.
15127289Smckusick .Ds
15227289Smckusick .Fd erase "" \*m
15327289Smckusick .Fd werase win
15427289Smckusick WINDOW	*win;
15527289Smckusick .De
15627289Smckusick Erases the window to blanks without setting the clear flag.
15727289Smckusick This is analagous to
15827289Smckusick .Fn clear ,
15927289Smckusick except that it never causes a clear-screen sequence to be generated
16027289Smckusick on a
16127289Smckusick .Fn refresh .
16227289Smckusick \*(Nm
16327289Smckusick .Ds
16427291Smckusick .Fd flushok win\*,boolf \*m
16527291Smckusick WINDOW	*win;
16627291Smckusick bool	boolf;
16727291Smckusick .De
16827291Smckusick Normally,
16927291Smckusick .Fn refresh
17027291Smckusick .Fn fflush 's
17127291Smckusick .Vn stdout
17227291Smckusick when it is finished.
17327291Smckusick .Fn flushok
17427291Smckusick allows you to control this.
17527291Smckusick if
17627291Smckusick .Vn boolf
17727291Smckusick is TRUE
17827291Smckusick (\c
17927291Smckusick .i i.e. ,
18027291Smckusick non-zero)
18127291Smckusick it will do the
18227291Smckusick .Fn fflush ;
18327291Smckusick if it is FALSE.
18427291Smckusick it will not.
18527291Smckusick .Ds
18627291Smckusick .Fd idlok win\*,boolf
18727291Smckusick WINDOW	*win;
18827291Smckusick bool	boolf;
18927291Smckusick .De
19027291Smckusick Reserved for future use.
19127291Smckusick This will eventually signal to
19227291Smckusick .Fn refresh
19327291Smckusick that it is all right to use the insert and delete line sequences
19427291Smckusick when updating the window.
19527291Smckusick .Ds
19627289Smckusick .Fd insch c
19727289Smckusick char	c;
19827289Smckusick .Fd winsch win\*,c
19927289Smckusick WINDOW	*win;
20027289Smckusick char	c;
20127289Smckusick .De
20227289Smckusick Insert
20327289Smckusick .Vn c
20427289Smckusick at the current \*y
20527289Smckusick Each character after it shifts to the right,
20627289Smckusick and the last character disappears.
20727289Smckusick \*(Es
20827289Smckusick .Ds
20927289Smckusick .Fd insertln
21027289Smckusick .Fd winsertln win
21127289Smckusick WINDOW	*win;
21227289Smckusick .De
21327289Smckusick Insert a line above the current one.
21427289Smckusick Every line below the current line
21527289Smckusick will be shifted down,
21627289Smckusick and the bottom line will disappear.
21727289Smckusick The current line will become blank,
21827289Smckusick and the current \*y will remain unchanged.
21927289Smckusick .Ds
22027289Smckusick .Fd move y\*,x \*m
22127289Smckusick int	y\*,x;
22227289Smckusick .Fd wmove win\*,y\*,x
22327289Smckusick WINDOW	*win;
22427289Smckusick int	y\*,x;
22527289Smckusick .De
22627289Smckusick Change the current \*y of the window to
22727289Smckusick .Vn y\*,x ). (
22827289Smckusick \*(Es
22927289Smckusick .Ds
23027289Smckusick .Fd overlay win1\*,win2
23127289Smckusick WINDOW	*win1\*,*win2;
23227289Smckusick .De
23327289Smckusick Overlay
23427289Smckusick .Vn win1
23527289Smckusick on
23627289Smckusick .Vn win2 .
23727289Smckusick The contents of
23827289Smckusick .Vn win1 ,
23927289Smckusick insofar as they fit,
24027289Smckusick are placed on
24127289Smckusick .Vn win2
24227289Smckusick at their starting \*y.
24327289Smckusick This is done non-destructively,
24427289Smckusick i.e., blanks on
24527289Smckusick .Vn win1
24627289Smckusick leave the contents of the space on
24727289Smckusick .Vn win2
24827289Smckusick untouched.
24927289Smckusick .Ds
25027289Smckusick .Fd overwrite win1\*,win2
25127289Smckusick WINDOW	*win1\*,*win2;
25227289Smckusick .De
25327289Smckusick Overwrite
25427289Smckusick .Vn win1
25527289Smckusick on
25627289Smckusick .Vn win2 .
25727289Smckusick The contents of
25827289Smckusick .Vn win1 ,
25927289Smckusick insofar as they fit,
26027289Smckusick are placed on
26127289Smckusick .Vn win2
26227289Smckusick at their starting \*y.
26327289Smckusick This is done destructively,
26427291Smckusick .i i.e. ,
26527291Smckusick blanks on
26627289Smckusick .Vn win1
26727289Smckusick become blank on
26827289Smckusick .Vn win2 .
26927289Smckusick .Ds
27027289Smckusick .Fd printw fmt\*,arg1\*,arg2\*,...
27127289Smckusick char	*fmt;
27227289Smckusick .Fd wprintw win\*,fmt\*,arg1\*,arg2\*,...
27327289Smckusick WINDOW	*win;
27427289Smckusick char	*fmt;
27527289Smckusick .De
27627289Smckusick Performs a
27727289Smckusick .Fn printf
27827289Smckusick on the window starting at the current \*y.
27927289Smckusick It uses
28027289Smckusick .Fn addstr
28127289Smckusick to add the string on the window.
28227289Smckusick It is often advisable to use the field width options of
28327289Smckusick .Fn printf
28427289Smckusick to avoid leaving things on the window from earlier calls.
28527289Smckusick \*(Es
28627289Smckusick .Ds
28727289Smckusick .Fd refresh "" \*m
28827289Smckusick .Fd wrefresh win
28927289Smckusick WINDOW	*win;
29027289Smckusick .De
29127289Smckusick Synchronize the terminal screen with the desired window.
29227289Smckusick If the window is not a screen,
29327289Smckusick only that part covered by it is updated.
29427289Smckusick \*(Es
29527289Smckusick In this case, it will update whatever it can
29627289Smckusick without causing the scroll.
29727291Smckusick .sp
29827291Smckusick As a special case,
29927291Smckusick if
30027291Smckusick .Fn wrefresh
30127291Smckusick is called with the window
30227291Smckusick .Vn curscr
30327291Smckusick the screen is cleared
30427291Smckusick and repainted as it is currently.
30527291Smckusick This is very useful for allowing the redrawing of the screen
30627291Smckusick when the user has garbage dumped on his terminal.
30727289Smckusick .Ds
30827289Smckusick .Fd standout "" \*m
30927289Smckusick .Fd wstandout win
31027289Smckusick WINDOW	*win;
31127289Smckusick .Fd standend "" \*m
31227289Smckusick .Fd wstandend win
31327289Smckusick WINDOW	*win;
31427289Smckusick .De
31527289Smckusick Start and stop putting characters onto
31627289Smckusick .i win
31727289Smckusick in standout mode.
31827289Smckusick .Fn standout
31927289Smckusick causes any characters added to the window
32027289Smckusick to be put in standout mode on the terminal
32127289Smckusick (if it has that capability).
32227289Smckusick .Fn standend
32327289Smckusick stops this.
32427289Smckusick The sequences
32527289Smckusick .Vn SO
32627289Smckusick and
32727289Smckusick .Vn SE
32827289Smckusick (or
32927289Smckusick .Vn US
33027289Smckusick and
33127289Smckusick .Vn UE
33227289Smckusick if they are not defined)
33327289Smckusick are used (see Appendix A).
334