mgba/src/util/gui/menu.h

38 lines
843 B
C
Raw Normal View History

2015-08-30 20:14:29 +00:00
/* Copyright (c) 2013-2015 Jeffrey Pfau
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef GUI_MENU_H
#define GUI_MENU_H
#include "util/vector.h"
2015-09-02 05:09:12 +00:00
struct GUIMenu;
2015-08-30 20:14:29 +00:00
struct GUIMenuItem {
const char* title;
void* data;
2015-09-02 05:09:12 +00:00
struct GUIMenu* submenu;
2015-08-30 20:14:29 +00:00
};
DECLARE_VECTOR(GUIMenuItemList, struct GUIMenuItem);
2015-09-02 04:51:14 +00:00
struct GUIBackground;
2015-08-30 20:14:29 +00:00
struct GUIMenu {
const char* title;
struct GUIMenuItemList items;
size_t index;
2015-09-02 04:51:14 +00:00
struct GUIBackground* background;
2015-08-30 20:14:29 +00:00
};
enum GUIMenuExitReason {
GUI_MENU_EXIT_ACCEPT,
GUI_MENU_EXIT_BACK,
GUI_MENU_EXIT_CANCEL,
};
struct GUIParams;
enum GUIMenuExitReason GUIShowMenu(struct GUIParams* params, struct GUIMenu* menu, struct GUIMenuItem* item);
#endif