diff options
author | 2017-07-20 22:01:02 +1000 | |
---|---|---|
committer | 2017-07-20 22:01:02 +1000 | |
commit | c36c1572ec7d2e1830804884d75824e83bd883d5 (patch) | |
tree | df8d60961b90fdfefdd7d3a7eb7187ae6f0c9bc9 /src/osd/modules/debugger/osx/debugconsole.mm | |
parent | a549c6408a1a17ec94ef440cb969dcbbbf47816d (diff) |
Added basic support for saving/restoring Cocoa debugger window state, compatible with Qt debugger where possible
Diffstat (limited to 'src/osd/modules/debugger/osx/debugconsole.mm')
-rw-r--r-- | src/osd/modules/debugger/osx/debugconsole.mm | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/osd/modules/debugger/osx/debugconsole.mm b/src/osd/modules/debugger/osx/debugconsole.mm index 3510417f62a..aa93745dec6 100644 --- a/src/osd/modules/debugger/osx/debugconsole.mm +++ b/src/osd/modules/debugger/osx/debugconsole.mm @@ -25,6 +25,8 @@ #include "debug/debugcon.h" #include "debug/debugcpu.h" +#include "util/xmlfile.h" + @implementation MAMEDebugConsole @@ -378,6 +380,55 @@ } +- (void)loadConfiguration:(util::xml::data_node const *)parentnode { + util::xml::data_node const *node = nullptr; + for (node = parentnode->get_child("window"); node; node = node->get_next_sibling("window")) + { + MAMEDebugWindowHandler *win = nil; + switch (node->get_attribute_int("type", -1)) + { + case MAME_DEBUGGER_WINDOW_TYPE_CONSOLE: + [self restoreConfigurationFromNode:node]; + break; + case MAME_DEBUGGER_WINDOW_TYPE_MEMORY_VIEWER: + win = [[MAMEMemoryViewer alloc] initWithMachine:*machine console:self]; + break; + case MAME_DEBUGGER_WINDOW_TYPE_DISASSEMBLY_VIEWER: + win = [[MAMEDisassemblyViewer alloc] initWithMachine:*machine console:self]; + break; + case MAME_DEBUGGER_WINDOW_TYPE_ERROR_LOG_VIEWER: + win = [[MAMEErrorLogViewer alloc] initWithMachine:*machine console:self]; + break; + case MAME_DEBUGGER_WINDOW_TYPE_POINTS_VIEWER: + win = [[MAMEPointsViewer alloc] initWithMachine:*machine console:self]; + break; + case MAME_DEBUGGER_WINDOW_TYPE_DEVICES_VIEWER: + win = [[MAMEDevicesViewer alloc] initWithMachine:*machine console:self]; + break; + case MAME_DEBUGGER_WINDOW_TYPE_DEVICE_INFO_VIEWER: + // FIXME: needs device info on init, make another variant + //win = [[MAMEDeviceInfoViewer alloc] initWithMachine:*machine console:self]; + break; + default: + break; + } + if (win) + { + [auxiliaryWindows addObject:win]; + [win restoreConfigurationFromNode:node]; + [win release]; + [win activate]; + } + } +} + + +- (void)saveConfigurationToNode:(util::xml::data_node *)node { + [super saveConfigurationToNode:node]; + node->set_attribute_int("type", MAME_DEBUGGER_WINDOW_TYPE_CONSOLE); +} + + - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor { if (control == commandField) [history edit]; |