Add description field to macros.
[cboard.git] / src / input.h
blob14a33f3ffde25fb47dde3e486a4a57cd81c9f568
1 /* vim:tw=78:ts=8:sw=4:set ft=c: */
2 /*
3 Copyright (C) 2002-2018 Ben Kibbey <bjk@luxsci.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef INPUT_H
20 #define INPUT_H
22 #define INPUT_WIDTH ((COLS / 4) * 3)
24 enum
26 INPUT_HIST_ENGINE,
27 INPUT_HIST_CLOCK,
28 INPUT_HIST_FILE,
29 INPUT_HIST_MOVE_EXP,
30 INPUT_HIST_GAME_EXP,
31 #ifdef WITH_LIBPERL
32 INPUT_HIST_PERL,
33 #endif
34 INPUT_HIST_MAX
37 enum
39 FIELD_TYPE_ALNUM, FIELD_TYPE_ALPHA, FIELD_TYPE_INTEGER,
40 FIELD_TYPE_NUMERIC, FIELD_TYPE_REGEXP, FIELD_TYPE_IPV4, FIELD_TYPE_ENUM,
41 FIELD_TYPE_PGN_TAG_NAME, FIELD_TYPE_PGN_DATE, FIELD_TYPE_PGN_ROUND,
42 FIELD_TYPE_PGN_RESULT
45 typedef void (input_func) (void *);
46 struct input_s
48 char buf[MAX_PGN_LINE_LEN];
49 WINDOW *sw;
50 FIELD *fields[2];
51 FORM *f;
52 FIELDTYPE *ft;
53 int w;
54 int h;
55 int lines;
56 char *init;
57 char **extra;
58 input_func *func;
59 char *arg;
60 wint_t c;
61 void *data;
62 int reset;
63 int hist;
66 struct input_data_s
68 void *data;
69 void *moredata;
70 char *str;
71 window_exit_func *efunc;
74 WIN *construct_input (const char *title, const char *init, int lines,
75 int reset, const char *extra_help, input_func * func,
76 void *arg, wint_t key, struct input_data_s *id,
77 int history, window_resize_func, int type, ...);
79 #endif