src/util/gui/menu.h (view raw)
1/* Copyright (c) 2013-2015 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#ifndef GUI_MENU_H
7#define GUI_MENU_H
8
9#include "util/vector.h"
10
11struct GUIMenu;
12struct GUIMenuItem {
13 const char* title;
14 void* data;
15 unsigned state;
16 const char* const* validStates;
17 unsigned nStates;
18 struct GUIMenu* submenu;
19};
20
21DECLARE_VECTOR(GUIMenuItemList, struct GUIMenuItem);
22
23struct GUIBackground;
24struct GUIMenu {
25 const char* title;
26 const char* subtitle;
27 struct GUIMenuItemList items;
28 size_t index;
29 struct GUIBackground* background;
30};
31
32enum GUIMenuExitReason {
33 GUI_MENU_EXIT_ACCEPT,
34 GUI_MENU_EXIT_BACK,
35 GUI_MENU_EXIT_CANCEL,
36};
37
38struct GUIParams;
39enum GUIMenuExitReason GUIShowMenu(struct GUIParams* params, struct GUIMenu* menu, struct GUIMenuItem** item);
40
41void GUIDrawBattery(struct GUIParams* params);
42void GUIDrawClock(struct GUIParams* params);
43
44#endif