source: trunk/minix/man/man3/curses.3@ 12

Last change on this file since 12 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 8.6 KB
Line 
1.TH CURSES 3
2.SH NAME
3curses \- screen/window management library
4.SH SYNOPSIS
5cc demo.c -lcurses
6.SH DESCRIPTION
7Curses is a library of screen and window management routines. It is modeled
8after the UNIX curses and ncurses libraries. Normally, programs written for
9curses should be easily ported to UNIX, and vice versa.
10.PP
11To use the routines, the function initscr() must first be called.
12This creates two 'windows' for the user: stdscr and curscr. Stdscr is the
13default
14window for the user to make changes on, and curscr reflects the current
15contents of the physical display screen. The user writes or edits the stdscr
16window to his liking, then calls the refresh() function to make curscr
17and the physical screen look like stdscr. When the user program terminates,
18it should call the endwin() function to restore things to normal.
19.PP
20There are all sorts of window manipulation routines available to the
21programmer: auxiliary windows may be created, edited, moved and deleted. The
22terminal may be set in many different modes, output text may be attributed
23with blink, blank, bold and reverse attributes. Screen colors may also be
24set, foreground and background. There are window-specific
25printf- and scanf-like routines, routines for scrolling, box-drawing,
26window overlaying, clearing routines etc.
27.PP
28For more and detailed information, see the library source codes. All curses
29functions are preceded by a complete description.
30.SH FUNCTIONS
31Below is a list over the available functions, together with a brief
32description of what they do. In general, functions whose names start with 'w'
33differ from the one without 'w' (like wmove vs. move) signify that
34a specific window is used. Without a 'w', sdtscr is implied. The functions
35that start with 'mv' before the 'genereic' function name signify that a
36cursor motion should be made before the actual work. 'mv' and 'w' combine
37as expected.
38.PP
39Most routines that return an int will return the manifest constant ERR if
40there is a failure during execution. Routines that return a char actually
41return an int, so that ERR does not conflict with the character code 0xff.
42All characters from 0 to 0xff are allowed for usage with curses.
43.PP
44Some routines, like {mv}{w} printw() and {mv}{w}scanw() return a meaningful
45positive value if the operation is successful.
46.PP
47The curses package uses some predefined types, variables and manifest
48constants that are also available to the programmer. There are also a few
49globally accessible variables that should not be touched by the application
50program. Those untouchable variables have names starting with an
51underscore (_) to avoid conflicts. The user-accessible types, variables
52and constants are (there are a number of other constants defining character
53attribute names and function key names - consult <curses.h> for details):
54.sp
55.nf
56.ta 3i
57(manifest constants)
58.RS
59TRUE boolean true
60FALSE boolean false
61ERR unsuccessfull operation
62OK successfull operation
63.RE
64.sp
65(types)
66.RS
67WINDOW a window structure type
68bool boolean flag type
69.RE
70.sp
71(variables)
72.RS
73WINDOW curscr physical display image
74WINDOW stdscr default user drawing board
75int LINES terminal height
76int COLS terminal width
77int NONL \\n causes CR and LF when TRUE
78.RE
79.sp
80.fi
81The following is an alphabetical list of the curses functions, together
82with their types, parameters and a short comment for each (win is a window,
83ch, vc, hc are characters, buf is a character buffer, attrs is an
84attribute bit map, bf is a boolean flag. Note that `characters' in this
85context usually can have 16 bits):
86.nf
87.sp
88int waddch(win,ch) put char in stdscr
89int addch(ch)
90int mvaddch(y,x,ch)
91int mvwaddch(win,y,x,ch)
92
93int waddstr(win,str) put string in stdscr
94int addstr(str)
95int mvaddstr(y,x,str)
96int mvwaddstr(win,y,x,str)
97
98void wattroff(win,attrs) clear attribute(s) in window
99void attroff(attrs)
100
101void wattron(win,attrs) add attribute(s) in window
102void attron(attrs)
103
104void wattrset(win,attrs) set window char attributes
105void attrset(attrs)
106
107int baudrate() dummy for compatibility
108
109void beep() ring the bell or visible bell if no bell available
110
111void flash() flash terminal screen or rings bell if no visible bell available
112
113void wbox(win,miny,minx,maxy,maxx,vc,hc) box in a window, with given characters
114void box(win,vc,hc)
115
116void cbreak() set terminal cbreak mode
117
118void wclear(win) clear stdscr
119void clear()
120
121void clearok(win,bf) marks window for screen clear
122
123int wclrtobot(win) clear from cursor to end of line and all lines down this line
124int clrtobot()
125int mvclrtoeol(y,x)
126int mvwclrtobot(win,y,x)
127
128int wclrtoeol(win) clear from cursor to end of line
129int clrtoeol()
130int mvclrtoeol(y,x)
131int mvwclrtoeol(win,y,x)
132
133int wdelch(win) delete a char in a window
134int delch()
135int mvdelch(y,x)
136int mvwdelch(win,y,x)
137
138int wdeleteln(win) delete a line in a window
139int deleteln()
140int mvdeleteln(y,x)
141int mvwdeleteln(win,y,x)
142
143void delwin(win) delete a window or a subwindow
144void doupdate() update physical screen
145void echo() set terminal echo mode
146int endwin() cleanup and curses finitialization
147
148void werase(win) erase a window
149void erase()
150
151int erasechar() return char delete character
152int fixterm() dummy for compatibility
153void flushinp() kill pending keyboard input
154
155int wgetch(win) get char via a window
156int getch()
157int mvgetch(y,x)
158int mvwgetch(win,y,x)
159
160int wgetstr(win,str) get string via window to a buffer
161int getstr(str)
162int mvgetstr(y,x,str)
163int mvwgetstr(win,y,x,str)
164
165void getyx(win,y,x) get a window's cursor position
166
167int gettmode() dummy for compatibility
168void idlok(win,bf) dummy for compatibility
169WINDOW *initscr() curses initialization (ret stdscr or NULL)
170
171int winch(win) get char at window cursor
172int inch()
173int mvinch(y,x)
174int mvwinch(win,y,x)
175
176int winsch(win,ch) insert character in a window
177int insch(ch)
178int mvinsch(y,x,ch)
179int mvwinsch(win,y,x,ch)
180
181int winsertln(win) insert new line in a window
182int insertln()
183int mvinsertln(y,x)
184int mvwinsertln(win,y,x)
185
186void keypad(win,bf) marks a window for keypad usage
187int killchar() return line delete character
188char *longname() returns terminal description string
189void leaveok(win,bf) marks window for cursor 'update leave'
190void meta(win,bf) marks window for meta
191int move(y,x) move cursor in stdscr
192int mvcur(oldy,oldx,y,x) move terminal cursor to <y,x>
193
194int mvprintw(y,x,fmt,args) move & print string in stdscr
195
196int mvscanw(y,x,fmt,args) move & get values via stdscr
197int mvwin(win,y,x) move window on physical screen
198int mvwprintw(win,x,y,fmt,args) move & print string in a window
199int mvwscanw(win,y,x,fmt,args) move & get values via a window
200WINDOW *newwin(lines,cols,begy,begx) create a new window
201void nl() set terminal cr-crlf mapping mode
202void nocbreak() unset terminal cbreak mod
203void nodelay(win,bf) marks window for no input wait
204void noecho() unset terminal echo mode
205void nonl() unset terminal cr-crlf mapping mode
206void noraw() unset raw terminal mode
207void overlay(win1,win2) overlay one window on another
208void overwrite(win1,win2) overwrite one window on another
209int printw(fmt,args) print string in stdscr
210void raw() set raw terminal mode
211void refrbrk(bf) set screen update break mode
212void refresh() refresh stdscr
213int resetterm() dummy for compatibility
214int resetty() restore terminal I/O modes
215int saveoldterm() dummy for compatibility
216int saveterm() dummy for compatibility
217int savetty() save terminal I/O modes
218int scanw(fmt,args) get values via stdscr
219void scroll(win) scroll scrolling region of a window
220void scrollok(win,bf) marks a window to allow scroll
221void setcolors(A_COLOR(for,back)) sets the forground and background
222 colors of stdscr
223void set_curs(visibility) 0 for invisible, 1 for visible, 2 for good
224 visible
225int setsrcreg(miny,maxy) define stdscr's scroll region
226int setterm() dummy for compatibility
227int setupterm(term,fd,errret) set up terminal
228void standend() start normal chars in stdscr
229void standout() start standout chars in stdscr
230WINDOW *subwin(win,lines,cols,begy,begx)
231 create a sub-window in window win
232int tabsize(ts) set/get tabsize of stdscr
233void touchwin(win) mark a window as totally modified
234char *unctrl(ch) char-to-string converter
235int wmove(win,y,x) move cursor in a window
236void wnoutrefresh(win) create internal screen image
237int wprintw(win,fmt,args) print string in a window
238void wrefresh(win) refresh window
239int wscanw(win,fmt,args) get values via a window
240void wsetcolors(win,A_COLOR(for,back)) sets the forground and
241 background colors of the specified window
242int wsetsrcreg(win,miny,maxy) define a window's scrolling region
243void wstandend(win) start normal chars in window
244void wstandout(win) start standout chars in window
245int wtabsize(win,ts) set/get tabsize of a window
246.SH BUGS
247Function keys are not available under the MINIX version.
248.\" $PchId: curses.3,v 1.3 1996/02/22 21:26:28 philip Exp $
Note: See TracBrowser for help on using the repository browser.