all repos — mgba @ 956f63bba31032ff1e955afa96ccbde0486b016a

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* 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
38enum GUIMessageBoxButtons {
39	GUI_MESSAGE_BOX_OK = 1,
40	GUI_MESSAGE_BOX_CANCEL = 2
41};
42
43struct GUIParams;
44enum GUIMenuExitReason GUIShowMenu(struct GUIParams* params, struct GUIMenu* menu, struct GUIMenuItem** item);
45
46ATTRIBUTE_FORMAT(printf, 4, 5)
47enum GUIMenuExitReason GUIShowMessageBox(struct GUIParams* params, int buttons, int frames, const char* format, ...);
48
49void GUIDrawBattery(struct GUIParams* params);
50void GUIDrawClock(struct GUIParams* params);
51
52#endif