all repos — mgba @ c3aededf05edf9337f89191dfdbfc3189885fb14

mGBA Game Boy Advance Emulator

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** validStates;
17	struct GUIMenu* submenu;
18};
19
20DECLARE_VECTOR(GUIMenuItemList, struct GUIMenuItem);
21
22struct GUIBackground;
23struct GUIMenu {
24	const char* title;
25	const char* subtitle;
26	struct GUIMenuItemList items;
27	size_t index;
28	struct GUIBackground* background;
29};
30
31enum GUIMenuExitReason {
32	GUI_MENU_EXIT_ACCEPT,
33	GUI_MENU_EXIT_BACK,
34	GUI_MENU_EXIT_CANCEL,
35};
36
37struct GUIParams;
38enum GUIMenuExitReason GUIShowMenu(struct GUIParams* params, struct GUIMenu* menu, struct GUIMenuItem** item);
39
40void GUIDrawBattery(struct GUIParams* params);
41void GUIDrawClock(struct GUIParams* params);
42
43#endif