all repos — mgba @ fafcfebf2efa65db88d5fadc80d0a19ef06f8111

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	struct GUIMenuItemList items;
26	size_t index;
27	struct GUIBackground* background;
28};
29
30enum GUIMenuExitReason {
31	GUI_MENU_EXIT_ACCEPT,
32	GUI_MENU_EXIT_BACK,
33	GUI_MENU_EXIT_CANCEL,
34};
35
36struct GUIParams;
37enum GUIMenuExitReason GUIShowMenu(struct GUIParams* params, struct GUIMenu* menu, struct GUIMenuItem** item);
38
39#endif