diff options
author | 2023-01-29 03:02:02 +1100 | |
---|---|---|
committer | 2023-01-29 03:16:14 +1100 | |
commit | 68472d3d72ea4bbc545c0669348172b4e96c7b41 (patch) | |
tree | e34fca0f55c977624148d1c806ecc6c44a5edd11 /src/osd/modules/debugger/debugqt.cpp | |
parent | 01fcb2e0decf670a4cdee3d37b6f7ebde9b8f02b (diff) |
Various input and OSD refactoring:
osd: Supply OSD object to modules on initialisation. Encapsulated some
event handling in the OSD objects rather than leaving it in free
functions. Put various stuff in namespaces.
osd/modules/input: Enabled dinput, xinput and winhybrid modules for
Windows SDL builds, and enabled background input for dinput and xinput
(and by extension winhybrid) modules. Also fixed some COM and X11
resource leaks.
osd/modules/input/input_sdl.cpp: Flipped SDL mouse button order to match
Windows, and exposed vertical and horizontal scroll as Z and rZ axes.
Moved SDL UI event handling out of input devices into OSD object.
osd/modules/input_rawinput.cpp: Changed lightgun Z axis token so it's
correctly identified as a relative axis (it maps to the scroll wheel
equivalent).
osd: Added an option to choose the network provider module. Mostly
useful if you build with both TUN/TAP and pcap support included, or if
you want to disable emulated networking completely.
emu/input.cpp: Use a better strategy for assembling input code names
that uses fewer temporary strings and doesn't require use of the
non-Unicode-aware space trimming function (fixes MT08552).
osd/modules/input_dinput.cpp: Improved polling logic.
osd: Made various parts of the input code less dependent on concrete emu
objects, and reduced inappropriately passing around the machine object.
Made input modules less dependent on OSD implementation. Encapsulated
some stuff and got rid of some vestigial newui and SDL1 support code.
Cleaned up some interfaces. Moved OSD options classes to their own
files.
Prepare to remove main.h from emu.h - it's mostly used to get the
application name, which the vast majority of emulated devices don't need
to do.
Diffstat (limited to 'src/osd/modules/debugger/debugqt.cpp')
-rw-r--r-- | src/osd/modules/debugger/debugqt.cpp | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/src/osd/modules/debugger/debugqt.cpp b/src/osd/modules/debugger/debugqt.cpp index 1afe6ffff66..cdf3fb014bc 100644 --- a/src/osd/modules/debugger/debugqt.cpp +++ b/src/osd/modules/debugger/debugqt.cpp @@ -43,9 +43,11 @@ bool winwindow_qt_filter(void *message); #endif +namespace osd { + namespace { -class debug_qt : public osd_module, public debug_module, protected osd::debugger::qt::DebuggerQt +class debug_qt : public osd_module, public debug_module, protected debugger::qt::DebuggerQt #if defined(_WIN32) && !defined(SDLMAME_WIN32) , public QAbstractNativeEventFilter #endif @@ -61,7 +63,7 @@ public: virtual ~debug_qt() { } - virtual int init(const osd_options &options) override { return 0; } + virtual int init(osd_interface &osd, const osd_options &options) override { return 0; } virtual void exit() override; virtual void init_debugger(running_machine &machine) override; @@ -83,7 +85,7 @@ private: void load_window_configurations(util::xml::data_node const &parentnode); running_machine *m_machine; - osd::debugger::qt::MainWindow *m_mainwindow; + debugger::qt::MainWindow *m_mainwindow; util::xml::file::ptr m_config; }; @@ -142,7 +144,7 @@ void debug_qt::wait_for_debugger(device_t &device, bool firststop) // Dialog initialization if (!m_mainwindow) { - m_mainwindow = new osd::debugger::qt::MainWindow(*this); + m_mainwindow = new debugger::qt::MainWindow(*this); if (m_config) { load_window_configurations(*m_config->get_first_child()); @@ -211,31 +213,31 @@ void debug_qt::configuration_save(config_type which_type, util::xml::data_node * void debug_qt::load_window_configurations(util::xml::data_node const &parentnode) { - for (util::xml::data_node const *wnode = parentnode.get_child(osd::debugger::NODE_WINDOW); wnode; wnode = wnode->get_next_sibling(osd::debugger::NODE_WINDOW)) + for (util::xml::data_node const *wnode = parentnode.get_child(debugger::NODE_WINDOW); wnode; wnode = wnode->get_next_sibling(debugger::NODE_WINDOW)) { - osd::debugger::qt::WindowQt *win = nullptr; - switch (wnode->get_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, -1)) + debugger::qt::WindowQt *win = nullptr; + switch (wnode->get_attribute_int(debugger::ATTR_WINDOW_TYPE, -1)) { - case osd::debugger::WINDOW_TYPE_CONSOLE: + case debugger::WINDOW_TYPE_CONSOLE: win = m_mainwindow; break; - case osd::debugger::WINDOW_TYPE_MEMORY_VIEWER: - win = new osd::debugger::qt::MemoryWindow(*this); + case debugger::WINDOW_TYPE_MEMORY_VIEWER: + win = new debugger::qt::MemoryWindow(*this); break; - case osd::debugger::WINDOW_TYPE_DISASSEMBLY_VIEWER: - win = new osd::debugger::qt::DasmWindow(*this); + case debugger::WINDOW_TYPE_DISASSEMBLY_VIEWER: + win = new debugger::qt::DasmWindow(*this); break; - case osd::debugger::WINDOW_TYPE_ERROR_LOG_VIEWER: - win = new osd::debugger::qt::LogWindow(*this); + case debugger::WINDOW_TYPE_ERROR_LOG_VIEWER: + win = new debugger::qt::LogWindow(*this); break; - case osd::debugger::WINDOW_TYPE_POINTS_VIEWER: - win = new osd::debugger::qt::BreakpointsWindow(*this); + case debugger::WINDOW_TYPE_POINTS_VIEWER: + win = new debugger::qt::BreakpointsWindow(*this); break; - case osd::debugger::WINDOW_TYPE_DEVICES_VIEWER: - win = new osd::debugger::qt::DevicesWindow(*this); + case debugger::WINDOW_TYPE_DEVICES_VIEWER: + win = new debugger::qt::DevicesWindow(*this); break; - case osd::debugger::WINDOW_TYPE_DEVICE_INFO_VIEWER: - win = new osd::debugger::qt::DeviceInformationWindow(*this); + case debugger::WINDOW_TYPE_DEVICE_INFO_VIEWER: + win = new debugger::qt::DeviceInformationWindow(*this); break; } if (win) @@ -245,10 +247,12 @@ void debug_qt::load_window_configurations(util::xml::data_node const &parentnode } // anonymous namespace +} // namespace osd + #else // USE_QTDEBUG -MODULE_NOT_SUPPORTED(debug_qt, OSD_DEBUG_PROVIDER, "qt") +namespace osd { namespace { MODULE_NOT_SUPPORTED(debug_qt, OSD_DEBUG_PROVIDER, "qt") } } #endif -MODULE_DEFINITION(DEBUG_QT, debug_qt) +MODULE_DEFINITION(DEBUG_QT, osd::debug_qt) |