1 // license:BSD-3-Clause
2 // copyright-holders:Nicola Salmoria, Aaron Giles, Nathan Woods
3 /***************************************************************************
4 
5     ui/uimain.h
6 
7     Internal MAME menus for the user interface.
8 
9 ***************************************************************************/
10 
11 #ifndef MAME_EMU_UI_UIMAIN_H
12 #define MAME_EMU_UI_UIMAIN_H
13 
14 #pragma once
15 
16 
17 /***************************************************************************
18     TYPE DEFINITIONS
19 ***************************************************************************/
20 
21 class ui_manager
22 {
23 public:
24 	// construction/destruction
ui_manager(running_machine & machine)25 	ui_manager(running_machine &machine) : m_machine(machine),m_show_timecode_counter(false),m_show_timecode_total(false) { }
26 
~ui_manager()27 	virtual ~ui_manager() { }
28 
set_startup_text(const char * text,bool force)29 	virtual void set_startup_text(const char *text, bool force) { }
30 
31 	// is a menuing system active?  we want to disable certain keyboard/mouse inputs under such context
is_menu_active()32 	virtual bool is_menu_active() { return false; }
33 
set_show_timecode_counter(bool value)34 	void set_show_timecode_counter(bool value) { m_show_timecode_counter = value; m_show_timecode_total = true; }
35 
show_timecode_counter()36 	bool show_timecode_counter() const { return m_show_timecode_counter; }
show_timecode_total()37 	bool show_timecode_total() const { return m_show_timecode_total; }
38 
popup_time_string(int seconds,std::string message)39 	virtual void popup_time_string(int seconds, std::string message) { }
40 
menu_reset()41 	virtual void menu_reset() { }
42 
43 	template <typename Format, typename... Params> void popup_time(int seconds, Format &&fmt, Params &&... args);
44 
45 protected:
46 	// instance variables
47 	running_machine &       m_machine;
48 	bool                    m_show_timecode_counter;
49 	bool                    m_show_timecode_total;
50 };
51 
52 /***************************************************************************
53     MEMBER TEMPLATES
54 ***************************************************************************/
55 
56 //-------------------------------------------------
57 //  popup_time - popup a message for a specific
58 //  amount of time
59 //-------------------------------------------------
60 
61 template <typename Format, typename... Params>
popup_time(int seconds,Format && fmt,Params &&...args)62 inline void ui_manager::popup_time(int seconds, Format &&fmt, Params &&... args)
63 {
64 	// extract the text
65 	popup_time_string(seconds, string_format(std::forward<Format>(fmt), std::forward<Params>(args)...));
66 }
67 
68 #endif // MAME_EMU_UI_UIMAIN_H
69