trunk/src/osd/modules/debugger/debugqt.c
| r30621 | r30622 | |
| 2 | 2 | // |
| 3 | 3 | // debugqt.c - SDL/QT debug window handling |
| 4 | 4 | // |
| 5 | | // Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team. |
| 5 | // Copyright (c) 1996-2014, Nicola Salmoria and the MAME Team. |
| 6 | 6 | // Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | 7 | // |
| 8 | 8 | // SDLMAME by Olivier Galibert and R. Belmont |
| r30621 | r30622 | |
| 284 | 284 | mainQtWindow->setProcessor(&device); |
| 285 | 285 | |
| 286 | 286 | // Run our own QT event loop |
| 287 | | while (debug_cpu_is_stopped(m_osd.machine())) |
| 287 | osd_sleep(50000); |
| 288 | qApp->processEvents(QEventLoop::AllEvents, 1); |
| 289 | |
| 290 | // Refresh everyone if requested |
| 291 | if (mainQtWindow->wantsRefresh()) |
| 288 | 292 | { |
| 289 | | osd_sleep(50000); |
| 290 | | qApp->processEvents(QEventLoop::AllEvents, 1); |
| 293 | QWidgetList allWidgets = qApp->allWidgets(); |
| 294 | for (int i = 0; i < allWidgets.length(); i++) |
| 295 | allWidgets[i]->update(); |
| 296 | mainQtWindow->clearRefreshFlag(); |
| 297 | } |
| 291 | 298 | |
| 292 | | // Refresh everyone if requested |
| 293 | | if (mainQtWindow->wantsRefresh()) |
| 299 | // Hide all top level widgets if requested |
| 300 | if (mainQtWindow->wantsHide()) |
| 301 | { |
| 302 | foreach (QWidget* widget, QApplication::topLevelWidgets()) |
| 294 | 303 | { |
| 295 | | QWidgetList allWidgets = qApp->allWidgets(); |
| 296 | | for (int i = 0; i < allWidgets.length(); i++) |
| 297 | | allWidgets[i]->update(); |
| 298 | | mainQtWindow->clearRefreshFlag(); |
| 304 | if (!widget->isWindow() || widget->windowType() != Qt::Window) |
| 305 | continue; |
| 306 | widget->hide(); |
| 299 | 307 | } |
| 308 | mainQtWindow->clearHideFlag(); |
| 309 | } |
| 300 | 310 | |
| 301 | | // Hide all top level widgets if requested |
| 302 | | if (mainQtWindow->wantsHide()) |
| 303 | | { |
| 304 | | foreach (QWidget* widget, QApplication::topLevelWidgets()) |
| 305 | | { |
| 306 | | if (!widget->isWindow() || widget->windowType() != Qt::Window) |
| 307 | | continue; |
| 308 | | widget->hide(); |
| 309 | | } |
| 310 | | mainQtWindow->clearHideFlag(); |
| 311 | | } |
| 312 | | |
| 313 | | // Exit if the machine has been instructed to do so (scheduled event == exit || hard_reset) |
| 314 | | if (m_osd.machine().scheduled_event_pending()) |
| 315 | | { |
| 316 | | // Keep a list of windows we want to save. |
| 317 | | // We need to do this here because by the time xml_configuration_save gets called |
| 318 | | // all the QT windows are already gone. |
| 319 | | gather_save_configurations(); |
| 320 | | break; |
| 321 | | } |
| 311 | // Exit if the machine has been instructed to do so (scheduled event == exit || hard_reset) |
| 312 | if (m_osd.machine().scheduled_event_pending()) |
| 313 | { |
| 314 | // Keep a list of windows we want to save. |
| 315 | // We need to do this here because by the time xml_configuration_save gets called |
| 316 | // all the QT windows are already gone. |
| 317 | gather_save_configurations(); |
| 318 | } |
| 322 | 319 | #if defined(WIN32) && !defined(SDLMAME_WIN32) |
| 323 | 320 | winwindow_update_cursor_state(m_osd.machine()); // make sure the cursor isn't hidden while in debugger |
| 324 | 321 | #endif |
| 325 | | } |
| 326 | 322 | } |
| 327 | 323 | |
| 328 | 324 | |