diff options
author | 2022-09-20 04:22:51 +1000 | |
---|---|---|
committer | 2022-09-20 04:22:51 +1000 | |
commit | 76541e8c81f1a38707bd4d1c973f6e4f86478de5 (patch) | |
tree | cfb6ba0d92911763ae0fa56be563cf81612c7ab7 /src/osd/modules/debugger/win/debugwininfo.cpp | |
parent | 05d3b10a6c6223b7a384a4aa02ad9d55923d778d (diff) |
Debugger updates:
Made closing the Qt debugger console window hide all debugger windows
and run the emulated machine (debugger windows will be shown on next
user break or breakpoint hit). This matches the behaviour of the Win32
and Cocoa debuggers.
Made Qt debugger clean up its windows on exit rather than on subsequent
starts. This fixes GitHub #9789.
Made Qt debugger less reliant on global variables, and made code to save
and load configuration a bit less convoluted. It still needs more
refactoring on this front, but it's in slightly better shape now.
Made Qt debugger a bit less crashy on invalid configuration. Still
plenty of ways to crash it, but every little bit counts.
Made Qt debugger do less comparisons on menu item names and object
names - it might be possible to localise one day.
Moved all the C++ debugger implementations into namespaces. They're
using awfully generic class names, so it's about time.
Diffstat (limited to 'src/osd/modules/debugger/win/debugwininfo.cpp')
-rw-r--r-- | src/osd/modules/debugger/win/debugwininfo.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/osd/modules/debugger/win/debugwininfo.cpp b/src/osd/modules/debugger/win/debugwininfo.cpp index f2f29fc9838..63d257b6529 100644 --- a/src/osd/modules/debugger/win/debugwininfo.cpp +++ b/src/osd/modules/debugger/win/debugwininfo.cpp @@ -2,7 +2,7 @@ // copyright-holders:Aaron Giles, Vas Crabb //============================================================ // -// debugwininfo.c - Win32 debug window handling +// debugwininfo.cpp - Win32 debug window handling // //============================================================ @@ -26,6 +26,8 @@ #include <cstring> +namespace osd::debugger::win { + bool debugwin_info::s_window_class_registered = false; @@ -264,7 +266,7 @@ bool debugwin_info::handle_key(WPARAM wparam, LPARAM lparam) void debugwin_info::save_configuration(util::xml::data_node &parentnode) { - util::xml::data_node *const node = parentnode.add_child(osd::debugger::NODE_WINDOW, nullptr); + util::xml::data_node *const node = parentnode.add_child(NODE_WINDOW, nullptr); if (node) save_configuration_to_node(*node); } @@ -282,10 +284,10 @@ void debugwin_info::restore_configuration_from_node(util::xml::data_node const & // get saved size and adjust for window chrome RECT desired; - desired.left = node.get_attribute_int(osd::debugger::ATTR_WINDOW_POSITION_X, origin.x); - desired.top = node.get_attribute_int(osd::debugger::ATTR_WINDOW_POSITION_Y, origin.y); - desired.right = desired.left + node.get_attribute_int(osd::debugger::ATTR_WINDOW_WIDTH, bounds.right); - desired.bottom = desired.top + node.get_attribute_int(osd::debugger::ATTR_WINDOW_HEIGHT, bounds.bottom); + desired.left = node.get_attribute_int(ATTR_WINDOW_POSITION_X, origin.x); + desired.top = node.get_attribute_int(ATTR_WINDOW_POSITION_Y, origin.y); + desired.right = desired.left + node.get_attribute_int(ATTR_WINDOW_WIDTH, bounds.right); + desired.bottom = desired.top + node.get_attribute_int(ATTR_WINDOW_HEIGHT, bounds.bottom); // TODO: sanity checks... if (!AdjustWindowRectEx(&desired, DEBUG_WINDOW_STYLE, GetMenu(window()) ? TRUE : FALSE, DEBUG_WINDOW_STYLE_EX)) return; @@ -494,10 +496,10 @@ void debugwin_info::save_configuration_to_node(util::xml::data_node &node) origin.y = 0; if (GetClientRect(window(), &bounds) && ClientToScreen(window(), &origin)) { - node.set_attribute_int(osd::debugger::ATTR_WINDOW_POSITION_X, origin.x); - node.set_attribute_int(osd::debugger::ATTR_WINDOW_POSITION_Y, origin.y); - node.set_attribute_int(osd::debugger::ATTR_WINDOW_WIDTH, bounds.right); - node.set_attribute_int(osd::debugger::ATTR_WINDOW_HEIGHT, bounds.bottom); + node.set_attribute_int(ATTR_WINDOW_POSITION_X, origin.x); + node.set_attribute_int(ATTR_WINDOW_POSITION_Y, origin.y); + node.set_attribute_int(ATTR_WINDOW_WIDTH, bounds.right); + node.set_attribute_int(ATTR_WINDOW_HEIGHT, bounds.bottom); } } @@ -730,3 +732,5 @@ void debugwin_info::register_window_class() s_window_class_registered = true; } } + +} // namespace osd::debugger::win |