-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmenu.h
99 lines (83 loc) · 1.99 KB
/
menu.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/** \file
* Menu structures and functions.
*
* When adding a menu item, the convention in the Magic Lantern menus
* is that there are 12 characters for the label and up to 7 characters
* for the value. The box that is drawn is 540 pixels wide, enough
* for 19 characters in FONT_LARGE.
*
* There is room for 8 entries in the menu.
*
* New menus must have a 5 character top level name.
*/
/*
* Copyright (C) 2009 Trammell Hudson <[email protected]>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef _menu_h_
#define _menu_h_
#define MENU_FONT FONT(FONT_MONO,COLOR_WHITE,COLOR_BG)
#define MENU_FONT_SEL FONT(FONT_MONO,COLOR_WHITE,COLOR_BLUE)
struct menu_entry
{
struct menu_entry * next;
struct menu_entry * prev;
int selected;
void * priv;
void (*select)(
void * priv
);
void (*display)(
void * priv,
int x,
int y,
int selected
);
};
struct menu
{
struct menu * next;
struct menu * prev;
const char * name;
struct menu_entry * children;
int selected;
};
extern void
menu_print(
void * priv,
int x,
int y,
int selected
);
extern void
menu_binary_toggle(
void * priv
);
extern void
menu_select(
struct menu_entry * entry
);
extern void
menu_add(
const char * name,
struct menu_entry * new_entry,
int count
);
extern void
menu_init( void );
#endif