1 /* Copyright (C) 2020 SovietPony
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, version 3 of the License ONLY.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 */
15 #ifndef MENU_H_INCLUDED
16 #define MENU_H_INCLUDED
20 /* menu types */
21 #define GM_BIG 1
22 #define GM_SMALL 2
24 /* variant types */
25 #define GM_BUTTON 1
26 #define GM_SCROLLER 2
27 #define GM_TEXTFIELD 3
28 #define GM_SMALL_BUTTON 4
29 #define GM_TEXTFIELD_BUTTON 5
31 /* menu messages */
32 #define GM_GETINT 1
33 #define GM_SETINT 2
34 #define GM_GETSTR 3
35 #define GM_SETSTR 4
46 #define GM_UP 15
47 #define GM_DOWN 16
48 #define GM_KEY 17
51 byte type;
57 byte type;
62 byte type;
63 menu_str_msg_t string;
64 menu_int_msg_t integer;
70 };
73 byte type;
84 #define GM_MAX_INPUT 24
92 #define GM_INIT_STRING(msg, str) GM_init_str(msg, str, sizeof str);
93 #define GM_CYCLE(i, m, n) ((i) < (m) ? (n) : (((i) > (n)) ? (m) : (i)))