1 .\"***************************************************************************
2 .\" Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
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: *
12 .\" The above copyright notice and this permission notice shall be included *
13 .\" in all copies or substantial portions of the Software. *
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. *
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 *
27 .\"***************************************************************************
29 .\" $Id: form_driver.3x,v 1.15 2007/06/02 22:56:49 tom Exp $
32 \fBform_driver\fR - command-processing loop of the form system
34 \fB#include <form.h>\fR
36 int form_driver(FORM *form, int c);
39 Once a form has been posted (displayed), you should funnel input events to it
40 through \fBform_driver\fR. This routine has two major input cases; either
41 the input is a form navigation request or it is a printable ASCII character.
42 The form driver requests are as follows:
45 Move to the next page.
48 Move to the previous page.
51 Move to the first page.
54 Move to the last field.
58 Move to the next field.
61 Move to the previous field.
64 Move to the first field.
67 Move to the last field.
70 Move to the sorted next field.
73 Move to the sorted previous field.
76 Move to the sorted first field.
79 Move to the sorted last field.
85 Move right to a field.
95 Move to the next char.
98 Move to the previous char.
101 Move to the next line.
104 Move to the previous line.
107 Move to the next word.
110 Move to the previous word.
113 Move to the beginning of the field.
116 Move to the end of the field.
119 Move to the beginning of the line.
122 Move to the end of the line.
125 Move left in the field.
128 Move right in the field.
131 Move up in the field.
134 Move down in the field.
138 Insert or overlay a new line.
141 Insert a blank at the cursor.
144 Insert a blank line at the cursor.
147 Delete character at the cursor.
150 Delete character before the cursor.
153 Delete line at the cursor.
156 Delete blank-delimited word at the cursor.
159 Clear to end of line from cursor.
162 Clear to end of field from cursor.
165 Clear the entire field.
175 Scroll the field forward a line.
178 Scroll the field backward a line.
181 Scroll the field forward a page.
184 Scroll the field backward a page.
187 Scroll the field forward half a page.
190 Scroll the field backward half a page.
194 Scroll the field forward a character.
197 Scroll the field backward a character.
200 Horizontal scroll the field forward a line.
203 Horizontal scroll the field backward a line.
206 Horizontal scroll the field forward half a line.
209 Horizontal scroll the field backward half a line.
216 Display next field choice.
219 Display previous field choice.
221 If the second argument is a printable ASCII character, the driver places it
222 in the current position in the current field. If it is one of the forms
223 requests listed above, that request is executed.
226 If the second argument is the KEY_MOUSE special key, the associated
227 mouse event is translated into one of the above pre-defined requests.
228 Currently only clicks in the user window (e.g. inside the form display
229 area or the decoration window) are handled.
231 If you click above the display region of the form:
234 a REQ_PREV_FIELD is generated for a single click,
236 a REQ_PREV_PAGE is generated for a double-click and
238 a REQ_FIRST_FIELD is generated for a triple-click.
241 If you click below the display region of the form:
244 a REQ_NEXT_FIELD is generated for a single click,
246 a REQ_NEXT_PAGE is generated for a double-click and
248 a REQ_LAST_FIELD is generated for a triple-click.
251 If you click at an field inside the display area of the form:
255 the form cursor is positioned to that field.
258 If you double-click a field,
259 the form cursor is positioned to that field
260 and \fBE_UNKNOWN_COMMAND\fR is returned.
261 This return value makes sense,
262 because a double click usually means that an field-specific action should
264 It is exactly the purpose of this return value to signal that an
265 application specific command should be executed.
269 into a request was done, \fBform_driver\fR returns the result of this request.
272 If you clicked outside the user window or the mouse event couldn't be translated
273 into a form request an \fBE_REQUEST_DENIED\fR is returned.
274 .SS APPLICATION-DEFINED COMMANDS
276 If the second argument is neither printable ASCII nor one of the above
277 pre-defined form requests, the driver assumes it is an application-specific
278 command and returns \fBE_UNKNOWN_COMMAND\fR. Application-defined commands
279 should be defined relative to \fBMAX_COMMAND\fR, the maximum value of these
280 pre-defined requests.
282 \fBform_driver\fR returns one of the following error codes:
285 The routine succeeded.
288 Routine detected an incorrect or out-of-range argument.
291 Routine was called from an initialization or termination function.
294 The form has not been posted.
297 Contents of field is invalid.
300 The form driver could not process the request.
303 System error occurred (see \fBerrno\fR).
306 The form driver code saw an unknown request code.
309 \fBcurses\fR(3X), \fBform\fR(3X).
311 The header file \fB<form.h>\fR automatically includes the header files
314 These routines emulate the System V forms library. They were not supported on
315 Version 7 or BSD versions.
317 Juergen Pfeifer. Manual pages and adaptation for new curses by Eric
320 .\"# The following sets edit modes for GNU EMACS
321 .\"# Local Variables: