Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | /**************************************************************************** |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2 | * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 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 | /**************************************************************************** |
| 30 | * Author: Juergen Pfeifer, 1995,1997 * |
| 31 | ****************************************************************************/ |
| 32 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 33 | /* $Id: form.h,v 0.24 2014/07/26 20:52:28 tom Exp $ */ |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 34 | |
| 35 | #ifndef FORM_H |
| 36 | #define FORM_H |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 37 | /* *INDENT-OFF*/ |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 38 | |
| 39 | #include <curses.h> |
| 40 | #include <eti.h> |
| 41 | |
| 42 | #ifdef __cplusplus |
| 43 | extern "C" { |
| 44 | #endif |
| 45 | |
| 46 | #ifndef FORM_PRIV_H |
| 47 | typedef void *FIELD_CELL; |
| 48 | #endif |
| 49 | |
| 50 | #ifndef NCURSES_FIELD_INTERNALS |
| 51 | #define NCURSES_FIELD_INTERNALS /* nothing */ |
| 52 | #endif |
| 53 | |
| 54 | typedef int Form_Options; |
| 55 | typedef int Field_Options; |
| 56 | |
| 57 | /********** |
| 58 | * _PAGE * |
| 59 | **********/ |
| 60 | |
| 61 | typedef struct { |
| 62 | short pmin; /* index of first field on page */ |
| 63 | short pmax; /* index of last field on page */ |
| 64 | short smin; /* index of top leftmost field on page */ |
| 65 | short smax; /* index of bottom rightmost field on page */ |
| 66 | } _PAGE; |
| 67 | |
| 68 | /********** |
| 69 | * FIELD * |
| 70 | **********/ |
| 71 | |
| 72 | typedef struct fieldnode { |
| 73 | unsigned short status; /* flags */ |
| 74 | short rows; /* size in rows */ |
| 75 | short cols; /* size in cols */ |
| 76 | short frow; /* first row */ |
| 77 | short fcol; /* first col */ |
| 78 | int drows; /* dynamic rows */ |
| 79 | int dcols; /* dynamic cols */ |
| 80 | int maxgrow; /* maximum field growth */ |
| 81 | int nrow; /* off-screen rows */ |
| 82 | short nbuf; /* additional buffers */ |
| 83 | short just; /* justification */ |
| 84 | short page; /* page on form */ |
| 85 | short index; /* into form -> field */ |
| 86 | int pad; /* pad character */ |
| 87 | chtype fore; /* foreground attribute */ |
| 88 | chtype back; /* background attribute */ |
| 89 | Field_Options opts; /* options */ |
| 90 | struct fieldnode * snext; /* sorted order pointer */ |
| 91 | struct fieldnode * sprev; /* sorted order pointer */ |
| 92 | struct fieldnode * link; /* linked field chain */ |
| 93 | struct formnode * form; /* containing form */ |
| 94 | struct typenode * type; /* field type */ |
| 95 | void * arg; /* argument for type */ |
| 96 | FIELD_CELL * buf; /* field buffers */ |
| 97 | void * usrptr; /* user pointer */ |
| 98 | /* |
| 99 | * The wide-character configuration requires extra information. Because |
| 100 | * there are existing applications that manipulate the members of FIELD |
| 101 | * directly, we cannot make the struct opaque. Offsets of members up to |
| 102 | * this point are the same in the narrow- and wide-character configuration. |
| 103 | * But note that the type of buf depends on the configuration, and is made |
| 104 | * opaque for that reason. |
| 105 | */ |
| 106 | NCURSES_FIELD_INTERNALS |
| 107 | } FIELD; |
| 108 | |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 109 | |
| 110 | /********* |
| 111 | * FORM * |
| 112 | *********/ |
| 113 | |
| 114 | typedef struct formnode { |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 115 | unsigned short status; /* flags */ |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 116 | short rows; /* size in rows */ |
| 117 | short cols; /* size in cols */ |
| 118 | int currow; /* current row in field window */ |
| 119 | int curcol; /* current col in field window */ |
| 120 | int toprow; /* in scrollable field window */ |
| 121 | int begincol; /* in horiz. scrollable field */ |
| 122 | short maxfield; /* number of fields */ |
| 123 | short maxpage; /* number of pages */ |
| 124 | short curpage; /* index into page */ |
| 125 | Form_Options opts; /* options */ |
| 126 | WINDOW * win; /* window */ |
| 127 | WINDOW * sub; /* subwindow */ |
| 128 | WINDOW * w; /* window for current field */ |
| 129 | FIELD ** field; /* field [maxfield] */ |
| 130 | FIELD * current; /* current field */ |
| 131 | _PAGE * page; /* page [maxpage] */ |
| 132 | void * usrptr; /* user pointer */ |
| 133 | |
| 134 | void (*forminit)(struct formnode *); |
| 135 | void (*formterm)(struct formnode *); |
| 136 | void (*fieldinit)(struct formnode *); |
| 137 | void (*fieldterm)(struct formnode *); |
| 138 | |
| 139 | } FORM; |
| 140 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 141 | |
| 142 | /************** |
| 143 | * FIELDTYPE * |
| 144 | **************/ |
| 145 | |
| 146 | typedef struct typenode { |
| 147 | unsigned short status; /* flags */ |
| 148 | long ref; /* reference count */ |
| 149 | struct typenode * left; /* ptr to operand for | */ |
| 150 | struct typenode * right; /* ptr to operand for | */ |
| 151 | |
| 152 | void* (*makearg)(va_list *); /* make fieldtype arg */ |
| 153 | void* (*copyarg)(const void *); /* copy fieldtype arg */ |
| 154 | void (*freearg)(void *); /* free fieldtype arg */ |
| 155 | |
| 156 | #if NCURSES_INTEROP_FUNCS |
| 157 | union { |
| 158 | bool (*ofcheck)(FIELD *,const void *); /* field validation */ |
| 159 | bool (*gfcheck)(FORM*,FIELD *,const void*); /* generic field validation */ |
| 160 | } fieldcheck; |
| 161 | union { |
| 162 | bool (*occheck)(int,const void *); /* character validation */ |
| 163 | bool (*gccheck)(int,FORM*, |
| 164 | FIELD*,const void*); /* generic char validation */ |
| 165 | } charcheck; |
| 166 | union { |
| 167 | bool (*onext)(FIELD *,const void *); /* enumerate next value */ |
| 168 | bool (*gnext)(FORM*,FIELD*,const void*); /* generic enumerate next */ |
| 169 | } enum_next; |
| 170 | union { |
| 171 | bool (*oprev)(FIELD *,const void *); /* enumerate prev value */ |
| 172 | bool (*gprev)(FORM*,FIELD*,const void*); /* generic enumerate prev */ |
| 173 | } enum_prev; |
| 174 | void* (*genericarg)(void*); /* Alternate Arg method */ |
| 175 | #else |
| 176 | bool (*fcheck)(FIELD *,const void *); /* field validation */ |
| 177 | bool (*ccheck)(int,const void *); /* character validation */ |
| 178 | |
| 179 | bool (*next)(FIELD *,const void *); /* enumerate next value */ |
| 180 | bool (*prev)(FIELD *,const void *); /* enumerate prev value */ |
| 181 | #endif |
| 182 | } FIELDTYPE; |
| 183 | |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 184 | typedef void (*Form_Hook)(FORM *); |
| 185 | |
| 186 | /*************************** |
| 187 | * miscellaneous #defines * |
| 188 | ***************************/ |
| 189 | |
| 190 | /* field justification */ |
| 191 | #define NO_JUSTIFICATION (0) |
| 192 | #define JUSTIFY_LEFT (1) |
| 193 | #define JUSTIFY_CENTER (2) |
| 194 | #define JUSTIFY_RIGHT (3) |
| 195 | |
| 196 | /* field options */ |
| 197 | #define O_VISIBLE (0x0001U) |
| 198 | #define O_ACTIVE (0x0002U) |
| 199 | #define O_PUBLIC (0x0004U) |
| 200 | #define O_EDIT (0x0008U) |
| 201 | #define O_WRAP (0x0010U) |
| 202 | #define O_BLANK (0x0020U) |
| 203 | #define O_AUTOSKIP (0x0040U) |
| 204 | #define O_NULLOK (0x0080U) |
| 205 | #define O_PASSOK (0x0100U) |
| 206 | #define O_STATIC (0x0200U) |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 207 | #define O_DYNAMIC_JUSTIFY (0x0400U) /* ncurses extension */ |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 208 | |
| 209 | /* form options */ |
| 210 | #define O_NL_OVERLOAD (0x0001U) |
| 211 | #define O_BS_OVERLOAD (0x0002U) |
| 212 | |
| 213 | /* form driver commands */ |
| 214 | #define REQ_NEXT_PAGE (KEY_MAX + 1) /* move to next page */ |
| 215 | #define REQ_PREV_PAGE (KEY_MAX + 2) /* move to previous page */ |
| 216 | #define REQ_FIRST_PAGE (KEY_MAX + 3) /* move to first page */ |
| 217 | #define REQ_LAST_PAGE (KEY_MAX + 4) /* move to last page */ |
| 218 | |
| 219 | #define REQ_NEXT_FIELD (KEY_MAX + 5) /* move to next field */ |
| 220 | #define REQ_PREV_FIELD (KEY_MAX + 6) /* move to previous field */ |
| 221 | #define REQ_FIRST_FIELD (KEY_MAX + 7) /* move to first field */ |
| 222 | #define REQ_LAST_FIELD (KEY_MAX + 8) /* move to last field */ |
| 223 | #define REQ_SNEXT_FIELD (KEY_MAX + 9) /* move to sorted next field */ |
| 224 | #define REQ_SPREV_FIELD (KEY_MAX + 10) /* move to sorted prev field */ |
| 225 | #define REQ_SFIRST_FIELD (KEY_MAX + 11) /* move to sorted first field */ |
| 226 | #define REQ_SLAST_FIELD (KEY_MAX + 12) /* move to sorted last field */ |
| 227 | #define REQ_LEFT_FIELD (KEY_MAX + 13) /* move to left to field */ |
| 228 | #define REQ_RIGHT_FIELD (KEY_MAX + 14) /* move to right to field */ |
| 229 | #define REQ_UP_FIELD (KEY_MAX + 15) /* move to up to field */ |
| 230 | #define REQ_DOWN_FIELD (KEY_MAX + 16) /* move to down to field */ |
| 231 | |
| 232 | #define REQ_NEXT_CHAR (KEY_MAX + 17) /* move to next char in field */ |
| 233 | #define REQ_PREV_CHAR (KEY_MAX + 18) /* move to prev char in field */ |
| 234 | #define REQ_NEXT_LINE (KEY_MAX + 19) /* move to next line in field */ |
| 235 | #define REQ_PREV_LINE (KEY_MAX + 20) /* move to prev line in field */ |
| 236 | #define REQ_NEXT_WORD (KEY_MAX + 21) /* move to next word in field */ |
| 237 | #define REQ_PREV_WORD (KEY_MAX + 22) /* move to prev word in field */ |
| 238 | #define REQ_BEG_FIELD (KEY_MAX + 23) /* move to first char in field */ |
| 239 | #define REQ_END_FIELD (KEY_MAX + 24) /* move after last char in fld */ |
| 240 | #define REQ_BEG_LINE (KEY_MAX + 25) /* move to beginning of line */ |
| 241 | #define REQ_END_LINE (KEY_MAX + 26) /* move after last char in line */ |
| 242 | #define REQ_LEFT_CHAR (KEY_MAX + 27) /* move left in field */ |
| 243 | #define REQ_RIGHT_CHAR (KEY_MAX + 28) /* move right in field */ |
| 244 | #define REQ_UP_CHAR (KEY_MAX + 29) /* move up in field */ |
| 245 | #define REQ_DOWN_CHAR (KEY_MAX + 30) /* move down in field */ |
| 246 | |
| 247 | #define REQ_NEW_LINE (KEY_MAX + 31) /* insert/overlay new line */ |
| 248 | #define REQ_INS_CHAR (KEY_MAX + 32) /* insert blank char at cursor */ |
| 249 | #define REQ_INS_LINE (KEY_MAX + 33) /* insert blank line at cursor */ |
| 250 | #define REQ_DEL_CHAR (KEY_MAX + 34) /* delete char at cursor */ |
| 251 | #define REQ_DEL_PREV (KEY_MAX + 35) /* delete char before cursor */ |
| 252 | #define REQ_DEL_LINE (KEY_MAX + 36) /* delete line at cursor */ |
| 253 | #define REQ_DEL_WORD (KEY_MAX + 37) /* delete word at cursor */ |
| 254 | #define REQ_CLR_EOL (KEY_MAX + 38) /* clear to end of line */ |
| 255 | #define REQ_CLR_EOF (KEY_MAX + 39) /* clear to end of field */ |
| 256 | #define REQ_CLR_FIELD (KEY_MAX + 40) /* clear entire field */ |
| 257 | #define REQ_OVL_MODE (KEY_MAX + 41) /* begin overlay mode */ |
| 258 | #define REQ_INS_MODE (KEY_MAX + 42) /* begin insert mode */ |
| 259 | #define REQ_SCR_FLINE (KEY_MAX + 43) /* scroll field forward a line */ |
| 260 | #define REQ_SCR_BLINE (KEY_MAX + 44) /* scroll field backward a line */ |
| 261 | #define REQ_SCR_FPAGE (KEY_MAX + 45) /* scroll field forward a page */ |
| 262 | #define REQ_SCR_BPAGE (KEY_MAX + 46) /* scroll field backward a page */ |
| 263 | #define REQ_SCR_FHPAGE (KEY_MAX + 47) /* scroll field forward half page */ |
| 264 | #define REQ_SCR_BHPAGE (KEY_MAX + 48) /* scroll field backward half page */ |
| 265 | #define REQ_SCR_FCHAR (KEY_MAX + 49) /* horizontal scroll char */ |
| 266 | #define REQ_SCR_BCHAR (KEY_MAX + 50) /* horizontal scroll char */ |
| 267 | #define REQ_SCR_HFLINE (KEY_MAX + 51) /* horizontal scroll line */ |
| 268 | #define REQ_SCR_HBLINE (KEY_MAX + 52) /* horizontal scroll line */ |
| 269 | #define REQ_SCR_HFHALF (KEY_MAX + 53) /* horizontal scroll half line */ |
| 270 | #define REQ_SCR_HBHALF (KEY_MAX + 54) /* horizontal scroll half line */ |
| 271 | |
| 272 | #define REQ_VALIDATION (KEY_MAX + 55) /* validate field */ |
| 273 | #define REQ_NEXT_CHOICE (KEY_MAX + 56) /* display next field choice */ |
| 274 | #define REQ_PREV_CHOICE (KEY_MAX + 57) /* display prev field choice */ |
| 275 | |
| 276 | #define MIN_FORM_COMMAND (KEY_MAX + 1) /* used by form_driver */ |
| 277 | #define MAX_FORM_COMMAND (KEY_MAX + 57) /* used by form_driver */ |
| 278 | |
| 279 | #if defined(MAX_COMMAND) |
| 280 | # if (MAX_FORM_COMMAND > MAX_COMMAND) |
| 281 | # error Something is wrong -- MAX_FORM_COMMAND is greater than MAX_COMMAND |
| 282 | # elif (MAX_COMMAND != (KEY_MAX + 128)) |
| 283 | # error Something is wrong -- MAX_COMMAND is already inconsistently defined. |
| 284 | # endif |
| 285 | #else |
| 286 | # define MAX_COMMAND (KEY_MAX + 128) |
| 287 | #endif |
| 288 | |
| 289 | /************************* |
| 290 | * standard field types * |
| 291 | *************************/ |
| 292 | extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALPHA; |
| 293 | extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALNUM; |
| 294 | extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ENUM; |
| 295 | extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_INTEGER; |
| 296 | extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_NUMERIC; |
| 297 | extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_REGEXP; |
| 298 | |
| 299 | /************************************ |
| 300 | * built-in additional field types * |
| 301 | * They are not defined in SVr4 * |
| 302 | ************************************/ |
| 303 | extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4; /* Internet IP Version 4 address */ |
| 304 | |
| 305 | /*********************** |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 306 | * FIELDTYPE routines * |
| 307 | ***********************/ |
| 308 | extern NCURSES_EXPORT(FIELDTYPE *) new_fieldtype ( |
| 309 | bool (* const field_check)(FIELD *,const void *), |
| 310 | bool (* const char_check)(int,const void *)); |
| 311 | extern NCURSES_EXPORT(FIELDTYPE *) link_fieldtype( |
| 312 | FIELDTYPE *, FIELDTYPE *); |
| 313 | |
| 314 | extern NCURSES_EXPORT(int) free_fieldtype (FIELDTYPE *); |
| 315 | extern NCURSES_EXPORT(int) set_fieldtype_arg (FIELDTYPE *, |
| 316 | void * (* const make_arg)(va_list *), |
| 317 | void * (* const copy_arg)(const void *), |
| 318 | void (* const free_arg)(void *)); |
| 319 | extern NCURSES_EXPORT(int) set_fieldtype_choice (FIELDTYPE *, |
| 320 | bool (* const next_choice)(FIELD *,const void *), |
| 321 | bool (* const prev_choice)(FIELD *,const void *)); |
| 322 | |
| 323 | /******************* |
| 324 | * FIELD routines * |
| 325 | *******************/ |
| 326 | extern NCURSES_EXPORT(FIELD *) new_field (int,int,int,int,int,int); |
| 327 | extern NCURSES_EXPORT(FIELD *) dup_field (FIELD *,int,int); |
| 328 | extern NCURSES_EXPORT(FIELD *) link_field (FIELD *,int,int); |
| 329 | |
| 330 | extern NCURSES_EXPORT(int) free_field (FIELD *); |
| 331 | extern NCURSES_EXPORT(int) field_info (const FIELD *,int *,int *,int *,int *,int *,int *); |
| 332 | extern NCURSES_EXPORT(int) dynamic_field_info (const FIELD *,int *,int *,int *); |
| 333 | extern NCURSES_EXPORT(int) set_max_field ( FIELD *,int); |
| 334 | extern NCURSES_EXPORT(int) move_field (FIELD *,int,int); |
| 335 | extern NCURSES_EXPORT(int) set_field_type (FIELD *,FIELDTYPE *,...); |
| 336 | extern NCURSES_EXPORT(int) set_new_page (FIELD *,bool); |
| 337 | extern NCURSES_EXPORT(int) set_field_just (FIELD *,int); |
| 338 | extern NCURSES_EXPORT(int) field_just (const FIELD *); |
| 339 | extern NCURSES_EXPORT(int) set_field_fore (FIELD *,chtype); |
| 340 | extern NCURSES_EXPORT(int) set_field_back (FIELD *,chtype); |
| 341 | extern NCURSES_EXPORT(int) set_field_pad (FIELD *,int); |
| 342 | extern NCURSES_EXPORT(int) field_pad (const FIELD *); |
| 343 | extern NCURSES_EXPORT(int) set_field_buffer (FIELD *,int,const char *); |
| 344 | extern NCURSES_EXPORT(int) set_field_status (FIELD *,bool); |
| 345 | extern NCURSES_EXPORT(int) set_field_userptr (FIELD *, void *); |
| 346 | extern NCURSES_EXPORT(int) set_field_opts (FIELD *,Field_Options); |
| 347 | extern NCURSES_EXPORT(int) field_opts_on (FIELD *,Field_Options); |
| 348 | extern NCURSES_EXPORT(int) field_opts_off (FIELD *,Field_Options); |
| 349 | |
| 350 | extern NCURSES_EXPORT(chtype) field_fore (const FIELD *); |
| 351 | extern NCURSES_EXPORT(chtype) field_back (const FIELD *); |
| 352 | |
| 353 | extern NCURSES_EXPORT(bool) new_page (const FIELD *); |
| 354 | extern NCURSES_EXPORT(bool) field_status (const FIELD *); |
| 355 | |
| 356 | extern NCURSES_EXPORT(void *) field_arg (const FIELD *); |
| 357 | |
| 358 | extern NCURSES_EXPORT(void *) field_userptr (const FIELD *); |
| 359 | |
| 360 | extern NCURSES_EXPORT(FIELDTYPE *) field_type (const FIELD *); |
| 361 | |
| 362 | extern NCURSES_EXPORT(char *) field_buffer (const FIELD *,int); |
| 363 | |
| 364 | extern NCURSES_EXPORT(Field_Options) field_opts (const FIELD *); |
| 365 | |
| 366 | /****************** |
| 367 | * FORM routines * |
| 368 | ******************/ |
| 369 | |
| 370 | extern NCURSES_EXPORT(FORM *) new_form (FIELD **); |
| 371 | |
| 372 | extern NCURSES_EXPORT(FIELD **) form_fields (const FORM *); |
| 373 | extern NCURSES_EXPORT(FIELD *) current_field (const FORM *); |
| 374 | |
| 375 | extern NCURSES_EXPORT(WINDOW *) form_win (const FORM *); |
| 376 | extern NCURSES_EXPORT(WINDOW *) form_sub (const FORM *); |
| 377 | |
| 378 | extern NCURSES_EXPORT(Form_Hook) form_init (const FORM *); |
| 379 | extern NCURSES_EXPORT(Form_Hook) form_term (const FORM *); |
| 380 | extern NCURSES_EXPORT(Form_Hook) field_init (const FORM *); |
| 381 | extern NCURSES_EXPORT(Form_Hook) field_term (const FORM *); |
| 382 | |
| 383 | extern NCURSES_EXPORT(int) free_form (FORM *); |
| 384 | extern NCURSES_EXPORT(int) set_form_fields (FORM *,FIELD **); |
| 385 | extern NCURSES_EXPORT(int) field_count (const FORM *); |
| 386 | extern NCURSES_EXPORT(int) set_form_win (FORM *,WINDOW *); |
| 387 | extern NCURSES_EXPORT(int) set_form_sub (FORM *,WINDOW *); |
| 388 | extern NCURSES_EXPORT(int) set_current_field (FORM *,FIELD *); |
| 389 | extern NCURSES_EXPORT(int) field_index (const FIELD *); |
| 390 | extern NCURSES_EXPORT(int) set_form_page (FORM *,int); |
| 391 | extern NCURSES_EXPORT(int) form_page (const FORM *); |
| 392 | extern NCURSES_EXPORT(int) scale_form (const FORM *,int *,int *); |
| 393 | extern NCURSES_EXPORT(int) set_form_init (FORM *,Form_Hook); |
| 394 | extern NCURSES_EXPORT(int) set_form_term (FORM *,Form_Hook); |
| 395 | extern NCURSES_EXPORT(int) set_field_init (FORM *,Form_Hook); |
| 396 | extern NCURSES_EXPORT(int) set_field_term (FORM *,Form_Hook); |
| 397 | extern NCURSES_EXPORT(int) post_form (FORM *); |
| 398 | extern NCURSES_EXPORT(int) unpost_form (FORM *); |
| 399 | extern NCURSES_EXPORT(int) pos_form_cursor (FORM *); |
| 400 | extern NCURSES_EXPORT(int) form_driver (FORM *,int); |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 401 | # if NCURSES_WIDECHAR |
| 402 | extern NCURSES_EXPORT(int) form_driver_w (FORM *,int,wchar_t); |
| 403 | # endif |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 404 | extern NCURSES_EXPORT(int) set_form_userptr (FORM *,void *); |
| 405 | extern NCURSES_EXPORT(int) set_form_opts (FORM *,Form_Options); |
| 406 | extern NCURSES_EXPORT(int) form_opts_on (FORM *,Form_Options); |
| 407 | extern NCURSES_EXPORT(int) form_opts_off (FORM *,Form_Options); |
| 408 | extern NCURSES_EXPORT(int) form_request_by_name (const char *); |
| 409 | |
| 410 | extern NCURSES_EXPORT(const char *) form_request_name (int); |
| 411 | |
| 412 | extern NCURSES_EXPORT(void *) form_userptr (const FORM *); |
| 413 | |
| 414 | extern NCURSES_EXPORT(Form_Options) form_opts (const FORM *); |
| 415 | |
| 416 | extern NCURSES_EXPORT(bool) data_ahead (const FORM *); |
| 417 | extern NCURSES_EXPORT(bool) data_behind (const FORM *); |
| 418 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 419 | #if NCURSES_SP_FUNCS |
| 420 | extern NCURSES_EXPORT(FORM *) NCURSES_SP_NAME(new_form) (SCREEN*, FIELD **); |
| 421 | #endif |
| 422 | |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 423 | #ifdef __cplusplus |
| 424 | } |
| 425 | #endif |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 426 | /* *INDENT-ON*/ |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 427 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 428 | #endif /* FORM_H */ |