all repos — mgba @ 44736f89be783d41571bb62347f42eeeb43b74a5

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