Update ncurses to version 5.4.
[dragonfly.git] / lib / libncurses / man / form_driver.3
1 .\"***************************************************************************
2 .\" Copyright (c) 1998,2002 Free Software Foundation, Inc.                   *
3 .\"                                                                          *
4 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
5 .\" copy of this software and associated documentation files (the            *
6 .\" "Software"), to deal in the Software without restriction, including      *
7 .\" without limitation the rights to use, copy, modify, merge, publish,      *
8 .\" distribute, distribute with modifications, sublicense, and/or sell       *
9 .\" copies of the Software, and to permit persons to whom the Software is    *
10 .\" furnished to do so, subject to the following conditions:                 *
11 .\"                                                                          *
12 .\" The above copyright notice and this permission notice shall be included  *
13 .\" in all copies or substantial portions of the Software.                   *
14 .\"                                                                          *
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22 .\"                                                                          *
23 .\" Except as contained in this notice, the name(s) of the above copyright   *
24 .\" holders shall not be used in advertising or otherwise to promote the     *
25 .\" sale, use or other dealings in this Software without prior written       *
26 .\" authorization.                                                           *
27 .\"***************************************************************************
28 .\"
29 .\" $Id: form_driver.3x,v 1.9 2002/02/16 22:39:52 tom Exp $
30 .\" $DragonFly: src/lib/libncurses/man/form_driver.3,v 1.1 2005/03/12 19:13:54 eirikn Exp $
31 .TH form_driver 3X ""
32 .SH NAME
33 \fBform_driver\fR - command-processing loop of the form system
34 .SH SYNOPSIS
35 \fB#include <form.h>\fR
36 .br
37 int form_driver(FORM *form, int c);
38 .br
39 .SH DESCRIPTION
40 Once a form has been posted (displayed), you should funnel input events to it
41 through \fBform_driver\fR.  This routine has two major input cases; either
42 the input is a form navigation request or it's a printable ASCII character.
43 The form driver requests are as follows:
44 .TP 5
45 REQ_NEXT_PAGE
46 Move to the next page.
47 .TP 5
48 REQ_PREV_PAGE
49 Move to the previous page.
50 .TP 5
51 REQ_FIRST_PAGE
52 Move to the first page.
53 .TP 5
54 REQ_LAST_PAGE
55 Move to the last field.
56
57 .TP 5
58 REQ_NEXT_FIELD
59 Move to the next field.
60 .TP 5
61 REQ_PREV_FIELD
62 Move to the previous field.
63 .TP 5
64 REQ_FIRST_FIELD
65 Move to the first field.
66 .TP 5
67 REQ_LAST_FIELD
68 Move to the last field.
69 .TP 5
70 REQ_SNEXT_FIELD
71 Move to the sorted next field.
72 .TP 5
73 REQ_SPREV_FIELD
74 Move to the sorted previous field.
75 .TP 5
76 REQ_SFIRST_FIELD
77 Move to the sorted first field.
78 .TP 5
79 REQ_SLAST_FIELD
80 Move to the sorted last field.
81 .TP 5
82 REQ_LEFT_FIELD
83 Move left to a field.
84 .TP 5
85 REQ_RIGHT_FIELD
86 Move right to a field.
87 .TP 5
88 REQ_UP_FIELD
89 Move up to a field.
90 .TP 5
91 REQ_DOWN_FIELD
92 Move down to a field.
93
94 .TP 5
95 REQ_NEXT_CHAR
96 Move to the next char.
97 .TP 5
98 REQ_PREV_CHAR
99 Move to the previous char.
100 .TP 5
101 REQ_NEXT_LINE
102 Move to the next line.
103 .TP 5
104 REQ_PREV_LINE
105 Move to the previous line.
106 .TP 5
107 REQ_NEXT_WORD
108 Move to the next word.
109 .TP 5
110 REQ_PREV_WORD
111 Move to the previous word.
112 .TP 5
113 REQ_BEG_FIELD
114 Move to the beginning of the field.
115 .TP 5
116 REQ_END_FIELD
117 Move to the end of the field.
118 .TP 5
119 REQ_BEG_LINE
120 Move to the beginning of the line.
121 .TP 5
122 REQ_END_LINE
123 Move to the end of the line.
124 .TP 5
125 REQ_LEFT_CHAR
126 Move left in the field.
127 .TP 5
128 REQ_RIGHT_CHAR
129 Move right in the field.
130 .TP 5
131 REQ_UP_CHAR
132 Move up in the field.
133 .TP 5
134 REQ_DOWN_CHAR
135 Move down in the field.
136
137 .TP 5
138 REQ_NEW_LINE
139 Insert or overlay a new line.
140 .TP 5
141 REQ_INS_CHAR
142 Insert a blank at the cursor.
143 .TP 5
144 REQ_INS_LINE
145 Insert a blank line at the cursor.
146 .TP 5
147 REQ_DEL_CHAR
148 Delete character at the cursor.
149 .TP 5
150 REQ_DEL_PREV
151 Delete character before the cursor.
152 .TP 5
153 REQ_DEL_LINE
154 Delete line at the cursor.
155 .TP 5
156 REQ_DEL_WORD
157 Delete blank-delimited word at the cursor.
158 .TP 5
159 REQ_CLR_EOL
160 Clear to end of line from cursor.
161 .TP 5
162 REQ_CLR_EOF
163 Clear to end of field from cursor.
164 .TP 5
165 REQ_CLR_FIELD
166 Clear the entire field.
167 .TP 5
168 REQ_OVL_MODE
169 Enter overlay mode.
170 .TP 5
171 REQ_INS_MODE
172 Enter insert mode.
173
174 .TP 5
175 REQ_SCR_FLINE
176 Scroll the field forward a line.
177 .TP 5
178 REQ_SCR_BLINE
179 Scroll the field backward a line.
180 .TP 5
181 REQ_SCR_FPAGE
182 Scroll the field forward a page.
183 .TP 5
184 REQ_SCR_BPAGE
185 Scroll the field backward a page.
186 .TP 5
187 REQ_SCR_FHPAGE
188 Scroll the field forward half a page.
189 .TP 5
190 REQ_SCR_BHPAGE
191 Scroll the field backward half a page.
192
193 .TP 5
194 REQ_SCR_FCHAR
195 Scroll the field forward a character.
196 .TP 5
197 REQ_SCR_BCHAR
198 Scroll the field backward a character.
199 .TP 5
200 REQ_SCR_HFLINE
201 Horizontal scroll the field forward a line.
202 .TP 5
203 REQ_SCR_HBLINE
204 Horizontal scroll the field backward a line.
205 .TP 5
206 REQ_SCR_HFHALF
207 Horizontal scroll the field forward half a line.
208 .TP 5
209 REQ_SCR_HBHALF
210 Horizontal scroll the field backward half a line.
211
212 .TP
213 REQ_VALIDATION
214 Validate field.
215 .TP
216 REQ_NEXT_CHOICE
217 Display next field choice.
218 .TP
219 REQ_PREV_CHOICE
220 Display previous field choice.
221 .PP
222 If the second argument is a printable ASCII character, the driver places it
223 in the current position in the current field.  If it is one of the forms
224 requests listed above, that request is executed.
225 .PP
226 If the second argument is neither printable ASCII nor one of the above
227 pre-defined form requests, the driver assumes it is an application-specific
228 command and returns \fBE_UNKNOWN_COMMAND\fR.  Application-defined commands
229 should be defined relative to \fBMAX_COMMAND\fR, the maximum value of these
230 pre-defined requests.
231 .SH RETURN VALUE
232 \fBform_driver\fR return one of the following error codes:
233 .TP 5
234 \fBE_OK\fR
235 The routine succeeded.
236 .TP 5
237 \fBE_SYSTEM_ERROR\fR
238 System error occurred (see \fBerrno\fR).
239 .TP 5
240 \fBE_BAD_ARGUMENT\fR
241 Routine detected an incorrect or out-of-range argument.
242 .TP 5
243 \fBE_BAD_STATE\fR
244 Routine was called from an initialization or termination function.
245 .TP 5
246 \fBE_NOT_POSTED\fR
247 The form has not been posted.
248 .TP 5
249 \fBE_UNKNOWN_COMMAND\fR
250 The form driver code saw an unknown request code.
251 .TP 5
252 \fBE_INVALID_FIELD\fR
253 Contents of field is invalid.
254 .TP 5
255 \fBE_REQUEST_DENIED\fR
256 The form driver could not process the request.
257 .SH SEE ALSO
258 \fBcurses\fR(3X), \fBform\fR(3X).
259 .SH NOTES
260 The header file \fB<form.h>\fR automatically includes the header files
261 \fB<curses.h>\fR.
262 .SH PORTABILITY
263 These routines emulate the System V forms library.  They were not supported on
264 Version 7 or BSD versions.
265 .SH AUTHORS
266 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
267 S. Raymond.
268 .\"#
269 .\"# The following sets edit modes for GNU EMACS
270 .\"# Local Variables:
271 .\"# mode:nroff
272 .\"# fill-column:79
273 .\"# End: