trunk/src/osd/modules/debugger/debugqt.c
| r30627 | r30628 | |
| 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 |
| r30627 | r30628 | |
| 278 | 278 | continue; |
| 279 | 279 | widget->show(); |
| 280 | 280 | } |
| 281 | | bring_main_window_to_front(); |
| 282 | 281 | |
| 282 | if (firststop) |
| 283 | { |
| 284 | bring_main_window_to_front(); |
| 285 | } |
| 286 | |
| 283 | 287 | // Set the main window to display the proper cpu |
| 284 | 288 | mainQtWindow->setProcessor(&device); |
| 285 | 289 | |
| 286 | 290 | // Run our own QT event loop |
| 287 | | while (debug_cpu_is_stopped(m_osd.machine())) |
| 291 | osd_sleep(50000); |
| 292 | qApp->processEvents(QEventLoop::AllEvents, 1); |
| 293 | |
| 294 | // Refresh everyone if requested |
| 295 | if (mainQtWindow->wantsRefresh()) |
| 288 | 296 | { |
| 289 | | osd_sleep(50000); |
| 290 | | qApp->processEvents(QEventLoop::AllEvents, 1); |
| 297 | QWidgetList allWidgets = qApp->allWidgets(); |
| 298 | for (int i = 0; i < allWidgets.length(); i++) |
| 299 | allWidgets[i]->update(); |
| 300 | mainQtWindow->clearRefreshFlag(); |
| 301 | } |
| 291 | 302 | |
| 292 | | // Refresh everyone if requested |
| 293 | | if (mainQtWindow->wantsRefresh()) |
| 303 | // Hide all top level widgets if requested |
| 304 | if (mainQtWindow->wantsHide()) |
| 305 | { |
| 306 | foreach (QWidget* widget, QApplication::topLevelWidgets()) |
| 294 | 307 | { |
| 295 | | QWidgetList allWidgets = qApp->allWidgets(); |
| 296 | | for (int i = 0; i < allWidgets.length(); i++) |
| 297 | | allWidgets[i]->update(); |
| 298 | | mainQtWindow->clearRefreshFlag(); |
| 308 | if (!widget->isWindow() || widget->windowType() != Qt::Window) |
| 309 | continue; |
| 310 | widget->hide(); |
| 299 | 311 | } |
| 312 | mainQtWindow->clearHideFlag(); |
| 313 | } |
| 300 | 314 | |
| 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 | | } |
| 315 | // Exit if the machine has been instructed to do so (scheduled event == exit || hard_reset) |
| 316 | if (m_osd.machine().scheduled_event_pending()) |
| 317 | { |
| 318 | // Keep a list of windows we want to save. |
| 319 | // We need to do this here because by the time xml_configuration_save gets called |
| 320 | // all the QT windows are already gone. |
| 321 | gather_save_configurations(); |
| 322 | } |
| 322 | 323 | #if defined(WIN32) && !defined(SDLMAME_WIN32) |
| 323 | 324 | winwindow_update_cursor_state(m_osd.machine()); // make sure the cursor isn't hidden while in debugger |
| 324 | 325 | #endif |
| 325 | | } |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | |