diff options
Diffstat (limited to 'src/osd/modules/debugger/win/pointswininfo.cpp')
-rw-r--r-- | src/osd/modules/debugger/win/pointswininfo.cpp | 99 |
1 files changed, 90 insertions, 9 deletions
diff --git a/src/osd/modules/debugger/win/pointswininfo.cpp b/src/osd/modules/debugger/win/pointswininfo.cpp index 24a8f865e6f..70ec6606280 100644 --- a/src/osd/modules/debugger/win/pointswininfo.cpp +++ b/src/osd/modules/debugger/win/pointswininfo.cpp @@ -2,7 +2,7 @@ // copyright-holders:Aaron Giles, Vas Crabb //============================================================ // -// pointswininfo.c - Win32 debug window handling +// pointswininfo.cpp - Win32 debug window handling // //============================================================ @@ -11,16 +11,20 @@ #include "debugviewinfo.h" +#include "util/xmlfile.h" + #include "winutf8.h" +namespace osd::debugger::win { + pointswin_info::pointswin_info(debugger_windows_interface &debugger) : debugwin_info(debugger, false, std::string("All Breakpoints").c_str(), nullptr) { if (!window()) return; - m_views[0].reset(global_alloc(debugview_info(debugger, *this, window(), DVT_BREAK_POINTS))); + m_views[0].reset(new debugview_info(debugger, *this, window(), DVT_BREAK_POINTS)); if ((m_views[0] == nullptr) || !m_views[0]->is_valid()) { m_views[0].reset(); @@ -31,6 +35,8 @@ pointswin_info::pointswin_info(debugger_windows_interface &debugger) : HMENU const optionsmenu = CreatePopupMenu(); AppendMenu(optionsmenu, MF_ENABLED, ID_SHOW_BREAKPOINTS, TEXT("Breakpoints\tCtrl+1")); AppendMenu(optionsmenu, MF_ENABLED, ID_SHOW_WATCHPOINTS, TEXT("Watchpoints\tCtrl+2")); + AppendMenu(optionsmenu, MF_ENABLED, ID_SHOW_REGISTERPOINTS, TEXT("Registerpoints\tCtrl+3")); + AppendMenu(optionsmenu, MF_ENABLED, ID_SHOW_EXCEPTIONPOINTS, TEXT("Exceptionpoints\tCtrl+4")); AppendMenu(GetMenu(window()), MF_ENABLED | MF_POPUP, (UINT_PTR)optionsmenu, TEXT("Options")); // compute a client rect @@ -43,11 +49,9 @@ pointswin_info::pointswin_info(debugger_windows_interface &debugger) : // clamp the min/max size set_maxwidth(bounds.right - bounds.left); - // position the window at the bottom-right - SetWindowPos(window(), HWND_TOP, 100, 100, bounds.right - bounds.left, bounds.bottom - bounds.top, SWP_SHOWWINDOW); - - // recompute the children - debugwin_info::recompute_children(); + // position the window and recompute children + debugger.stagger_window(window(), bounds.right - bounds.left, bounds.bottom - bounds.top); + recompute_children(); } @@ -69,6 +73,14 @@ bool pointswin_info::handle_key(WPARAM wparam, LPARAM lparam) case '2': SendMessage(window(), WM_COMMAND, ID_SHOW_WATCHPOINTS, 0); return true; + + case '3': + SendMessage(window(), WM_COMMAND, ID_SHOW_REGISTERPOINTS, 0); + return true; + + case '4': + SendMessage(window(), WM_COMMAND, ID_SHOW_EXCEPTIONPOINTS, 0); + return true; } } @@ -83,6 +95,8 @@ void pointswin_info::update_menu() HMENU const menu = GetMenu(window()); CheckMenuItem(menu, ID_SHOW_BREAKPOINTS, MF_BYCOMMAND | (m_views[0]->type() == DVT_BREAK_POINTS ? MF_CHECKED : MF_UNCHECKED)); CheckMenuItem(menu, ID_SHOW_WATCHPOINTS, MF_BYCOMMAND | (m_views[0]->type() == DVT_WATCH_POINTS ? MF_CHECKED : MF_UNCHECKED)); + CheckMenuItem(menu, ID_SHOW_REGISTERPOINTS, MF_BYCOMMAND | (m_views[0]->type() == DVT_REGISTER_POINTS ? MF_CHECKED : MF_UNCHECKED)); + CheckMenuItem(menu, ID_SHOW_EXCEPTIONPOINTS, MF_BYCOMMAND | (m_views[0]->type() == DVT_EXCEPTION_POINTS ? MF_CHECKED : MF_UNCHECKED)); } @@ -96,7 +110,7 @@ bool pointswin_info::handle_command(WPARAM wparam, LPARAM lparam) { case ID_SHOW_BREAKPOINTS: m_views[0].reset(); - m_views[0].reset(global_alloc(debugview_info(debugger(), *this, window(), DVT_BREAK_POINTS))); + m_views[0].reset(new debugview_info(debugger(), *this, window(), DVT_BREAK_POINTS)); if (!m_views[0]->is_valid()) m_views[0].reset(); win_set_window_text_utf8(window(), "All Breakpoints"); @@ -105,14 +119,81 @@ bool pointswin_info::handle_command(WPARAM wparam, LPARAM lparam) case ID_SHOW_WATCHPOINTS: m_views[0].reset(); - m_views[0].reset(global_alloc(debugview_info(debugger(), *this, window(), DVT_WATCH_POINTS))); + m_views[0].reset(new debugview_info(debugger(), *this, window(), DVT_WATCH_POINTS)); if (!m_views[0]->is_valid()) m_views[0].reset(); win_set_window_text_utf8(window(), "All Watchpoints"); recompute_children(); return true; + + case ID_SHOW_REGISTERPOINTS: + m_views[0].reset(); + m_views[0].reset(new debugview_info(debugger(), *this, window(), DVT_REGISTER_POINTS)); + if (!m_views[0]->is_valid()) + m_views[0].reset(); + win_set_window_text_utf8(window(), "All Registerpoints"); + recompute_children(); + return true; + + case ID_SHOW_EXCEPTIONPOINTS: + m_views[0].reset(); + m_views[0].reset(new debugview_info(debugger(), *this, window(), DVT_EXCEPTION_POINTS)); + if (!m_views[0]->is_valid()) + m_views[0].reset(); + win_set_window_text_utf8(window(), "All Exceptionpoints"); + recompute_children(); + return true; } break; } return debugwin_info::handle_command(wparam, lparam); } + + +void pointswin_info::restore_configuration_from_node(util::xml::data_node const &node) +{ + switch (node.get_attribute_int(ATTR_WINDOW_POINTS_TYPE, -1)) + { + case 0: + SendMessage(window(), WM_COMMAND, ID_SHOW_BREAKPOINTS, 0); + break; + case 1: + SendMessage(window(), WM_COMMAND, ID_SHOW_WATCHPOINTS, 0); + break; + case 2: + SendMessage(window(), WM_COMMAND, ID_SHOW_REGISTERPOINTS, 0); + break; + case 3: + SendMessage(window(), WM_COMMAND, ID_SHOW_EXCEPTIONPOINTS, 0); + break; + } + + debugwin_info::restore_configuration_from_node(node); +} + + +void pointswin_info::save_configuration_to_node(util::xml::data_node &node) +{ + debugwin_info::save_configuration_to_node(node); + + node.set_attribute_int(ATTR_WINDOW_TYPE, WINDOW_TYPE_POINTS_VIEWER); + switch (m_views[0]->type()) + { + case DVT_BREAK_POINTS: + node.set_attribute_int(ATTR_WINDOW_POINTS_TYPE, 0); + break; + case DVT_WATCH_POINTS: + node.set_attribute_int(ATTR_WINDOW_POINTS_TYPE, 1); + break; + case DVT_REGISTER_POINTS: + node.set_attribute_int(ATTR_WINDOW_POINTS_TYPE, 2); + break; + case DVT_EXCEPTION_POINTS: + node.set_attribute_int(ATTR_WINDOW_POINTS_TYPE, 3); + break; + default: + break; + } +} + +} // namespace osd::debugger::win |