summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame/ui/imgcntrl.h
blob: 501a095d6f98775c358ec6c43cde6c18646b9991 (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
76
77
// license:BSD-3-Clause
// copyright-holders:Nathan Woods
/***************************************************************************

    ui/imgcntrl.h

    MESS's clunky built-in file manager

***************************************************************************/

#pragma once

#ifndef MAME_FRONTEND_UI_IMAGECNTRL_H
#define MAME_FRONTEND_UI_IMAGECNTRL_H

#include "ui/menu.h"
#include "ui/filesel.h"
#include "ui/swlist.h"

namespace ui {
// ======================> menu_control_device_image

class menu_control_device_image : public menu
{
public:
	menu_control_device_image(mame_ui_manager &mui, render_container *container, device_image_interface *image);
	virtual ~menu_control_device_image() override;
	virtual void populate() override;
	virtual void handle() override;

protected:
	enum {
		START_FILE, START_OTHER_PART, START_SOFTLIST,
		SELECT_PARTLIST, SELECT_ONE_PART, SELECT_OTHER_PART,
		SELECT_FILE, CREATE_FILE, CREATE_CONFIRM, CHECK_CREATE, DO_CREATE, SELECT_SOFTLIST,
		LAST_ID
	};

	// protected instance variables
	int state;
	device_image_interface *image;

	// this is a single union that contains all of the different types of
	// results we could get from child menus
	union
	{
		menu_file_selector::result filesel;
		menu_software_parts::result swparts;
		menu_select_rw::result rw;
		int i;
	} submenu_result;

	std::string m_current_directory;
	std::string m_current_file;

	// methods
	virtual void hook_load(std::string filename, bool softlist);

	bool create_ok;

private:
	// instance variables
	bool create_confirmed;
	//bool softlist_done;
	const software_info *swi;
	const software_part *swp;
	class software_list_device *sld;
	std::string software_info_name;

	// methods
	void test_create(bool &can_create, bool &need_confirm);
	void load_software_part();
};

} // namespace ui

#endif /* MAME_FRONTEND_UI_IMAGECNTRL_H */