summaryrefslogtreecommitdiffstats
path: root/src/frontend/mame/ui/submenu.h
blob: fdcbfa2c7c2f7960b1bee36a58757bb3904f5ed8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// license:BSD-3-Clause
// copyright-holders:Maurizio Petrarota,Jeffrey Clark
/***************************************************************************

    ui/submenu.h

    UI options menu.

***************************************************************************/
#ifndef MAME_FRONTEND_UI_SUBMENU_H
#define MAME_FRONTEND_UI_SUBMENU_H

#pragma once

#include "ui/menu.h"

#include "emuopts.h"

#include <string>
#include <vector>


namespace ui {

//-------------------------------------------------
//  class ui menu
//-------------------------------------------------
class submenu : public menu
{
public:
	enum class option_type
	{
		HEAD,
		SEP,
		MENU,
		CMD,
		EMU,
		UI,
		OSD,
	};

	struct option
	{
		option_type type;
		const char *description = nullptr;
		const char *name = nullptr;
		core_options::entry::shared_ptr entry;
		core_options *options = nullptr;
		std::vector<std::string> value;
	};

	submenu(mame_ui_manager &mui, render_container &container, std::vector<option> const &suboptions, const game_driver *drv = nullptr, emu_options *options = nullptr);
	submenu(mame_ui_manager &mui, render_container &container, std::vector<option> &&suboptions, const game_driver *drv = nullptr, emu_options *options = nullptr);
	virtual ~submenu();

	static std::vector<option> misc_options();
	static std::vector<option> advanced_options();
	static std::vector<option> control_options();
	static std::vector<option> video_options();
	//static std::vector<option> export_options();

protected:
	virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override;

private:
	virtual void populate(float &customtop, float &custombottom) override;
	virtual void handle(event const *ev) override;

	std::vector<option> m_options;
	game_driver const *const m_driver;
};

} // namespace ui

#endif // MAME_FRONTEND_UI_SUBMENU_H