1: /*
2: * Guitar-ZyX(tm)::MasterControlProgram - portable guitar F/X controller
3: * Copyright (C) 2009 Douglas McClendon
4: *
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, version 3 of the License.
8: *
9: * This program is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: * GNU General Public License for more details.
13: *
14: * You should have received a copy of the GNU General Public License
15: * along with this program. If not, see <http://www.gnu.org/licenses/>.
16: */
17: /*
18: #############################################################################
19: #############################################################################
20: #
21: ## gzmcpc::mode__main_menu: the main menu(/command-tree) system header file
22: #
23: #############################################################################
24: ##
25: ## Copyright 2008-2009 Douglas McClendon <dmc AT filteredperception DOT org>
26: ##
27: #############################################################################
28: #############################################################################
29: #
30: */
31:
32: #ifndef _NDS_CLIENT_MODE__MAIN_MENU_H
33: #define _NDS_CLIENT_MODE__MAIN_MENU_H
34:
35:
36:
37: #define MENU_LABEL_MAXLEN 256
38:
39: #define FS_PATH_MAXLEN 1023
40:
41: #define MM_TXT_DEFAULTCOLOR (RGB15(31 / 2, 31, 31 / 2))
42: #define MM_HILITE_DEFAULTCOLOR (RGB15(31 / 3, 0, 0))
43: #define MM_BG_BMP dlavaBitmap
44: #define MM_BG_PAL dlavaPal
45:
46: #define MM_HILITE_COLOR_INDEX 253
47: #define MM_FONT_COLOR_INDEX 187
48:
49: #define MAIN_MENU__TOP_BG_FADE_IN_START_MS 0
50: #define MAIN_MENU__TOP_BG_FADE_IN_DURATION_MS 1000
51: #define MAIN_MENU__TOP_BG_FADE_OUT_DURATION_MS 1000
52:
53: #define MAIN_MENU__BOT_BG_FADE_IN_START_MS 500
54: #define MAIN_MENU__BOT_BG_FADE_IN_DURATION_MS 500
55: #define MAIN_MENU__BOT_BG_FADE_OUT_DURATION_MS 1000
56:
57: #define MAIN_MENU__BOT_TXT_FADE_IN_START_MS 750
58: #define MAIN_MENU__BOT_TXT_FADE_IN_DURATION_MS 750
59: #define MAIN_MENU__BOT_TXT_FADE_OUT_DURATION_MS 500
60:
61: #define MAIN_MENU__BOT_TXT_INTRAMODE_FADE_DURATION_MS 250
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72: typedef struct gzmcp_menu_node gzmcp_menu_node;
73: struct gzmcp_menu_node {
74:
75: // the name of this node/item
76: char label[MENU_LABEL_MAXLEN + 1];
77:
78: // whether or not the item is selectable
79: int selectable;
80:
81: // may want to add type(file_ogg, file_nds, dir, setting,...)
82: // may want to add descriptive text and other metadata to display on top
83:
84: // menu node selection callback function will be run if this
85: // item is selected
86: void (*select_cb)(void);
87:
88: // menu node hilite callback function
89: // note: for now, I'll let top reindeer handle most things that might
90: // apply to this
91: // void (*hilite_cb)(void);
92:
93: // the next node in this level/directory's linked list
94: gzmcp_menu_node *next;
95:
96: };
97:
98:
99:
100:
101: void mode__main_menu___init(void);
102: void mode__main_menu___top_renderer(void);
103: void mode__main_menu___bot_renderer(void);
104: void mode__main_menu___input_handler(void);
105: void mode__main_menu___idle(void);
106: void mode__main_menu___exit(void);
107:
108:
109: void mm_set_doublemode(int mode);
110:
111: void render_hilite(int bgid,
112: int color,
113: int y_offset,
114: int width,
115: int height,
116: int roundness,
117: int unrender);
118:
119: void mm_add_node(const char *label,
120: int selectable,
121: void(*select_cb)(void));
122:
123: void mm_free(void);
124:
125: void mm_alphasort(gzmcp_menu_node *head,
126: int from_index,
127: int to_index);
128:
129: gzmcp_menu_node *mm_get_node_by_index(int index);
130:
131: int mm_get_index_by_label(const char *label);
132:
133: void mm_set_selection_by_index(int index);
134:
135: void mm_set_selection_by_label(const char *label);
136:
137: void mm_set_selection_by_hist(void);
138:
139: void mm_print(void);
140:
141: void mm_hist_push(const char *label);
142: char *mm_hist_peek(void);
143: void mm_hist_pop(void);
144:
145: void mm_go_whammypad(void);
146: void mm_go_settings(void);
147: void mm_go_files(void);
148: void mm_go_usermanual(void);
149: void mm_go_misc(void);
150: void mm_go_shutdown(void);
151:
152: void mm_go_get_update(void);
153: void mm_go_get_and_burn_update(void);
154: void mm_go_ssid_input(void);
155: void mm_go_show_credits(void);
156: void mm_go_show_ssid_list(void);
157:
158: void mm_go_back(void);
159: void mm_go_misc_back(void);
160: void mm_go_files_back(void);
161:
162: void mm_go_files_entry(void);
163:
164: void mm_create(void (*create_func)(void));
165: void mm_create_last(void);
166: void mm_create_root(void);
167: void mm_create_misc(void);
168: void mm_create_files(void);
169:
170:
171:
172:
173: extern gzmcp_menu_node *mm_list;
174: extern gzmcp_menu_node *mm_hist;
175:
176: #endif // _NDS_CLIENT_MODE__MAIN_MENU_H
177: