void MainWindow::CreateComponents() { m_menu_bar = new MenuBar(this); m_tool_bar = new ToolBar(this); m_game_list = new GameList(this); m_render_widget = new RenderWidget; m_stack = new QStackedWidget(this); m_controllers_window = new ControllersWindow(this); m_settings_window = new SettingsWindow(this); m_hotkey_window = new MappingWindow(this, 0); connect(this, &MainWindow::EmulationStarted, m_settings_window, &SettingsWindow::EmulationStarted); connect(this, &MainWindow::EmulationStopped, m_settings_window, &SettingsWindow::EmulationStopped); #if defined(HAVE_XRANDR) && HAVE_XRANDR m_graphics_window = new GraphicsWindow( new X11Utils::XRRConfiguration( static_cast<Display*>(QGuiApplication::platformNativeInterface()->nativeResourceForWindow( "display", windowHandle())), winId()), this); #else m_graphics_window = new GraphicsWindow(nullptr, this); #endif InstallHotkeyFilter(m_hotkey_window); InstallHotkeyFilter(m_controllers_window); InstallHotkeyFilter(m_settings_window); InstallHotkeyFilter(m_graphics_window); }
void MainWindow::CreateComponents() { m_menu_bar = new MenuBar(this); m_tool_bar = new ToolBar(this); m_search_bar = new SearchBar(this); m_game_list = new GameList(this); m_render_widget = new RenderWidget; m_stack = new QStackedWidget(this); m_controllers_window = new ControllersWindow(this); m_settings_window = new SettingsWindow(this); for (int i = 0; i < 4; i++) { m_gc_tas_input_windows[i] = new GCTASInputWindow(this, i); m_wii_tas_input_windows[i] = new WiiTASInputWindow(this, i); } Movie::SetGCInputManip([this](GCPadStatus* pad_status, int controller_id) { m_gc_tas_input_windows[controller_id]->GetValues(pad_status); }); Movie::SetWiiInputManip([this](u8* input_data, WiimoteEmu::ReportFeatures rptf, int controller_id, int ext, wiimote_key key) { m_wii_tas_input_windows[controller_id]->GetValues(input_data, rptf, ext, key); }); m_hotkey_window = new MappingWindow(this, MappingWindow::Type::MAPPING_HOTKEYS, 0); m_log_widget = new LogWidget(this); m_log_config_widget = new LogConfigWidget(this); m_fifo_window = new FIFOPlayerWindow(this); connect(m_fifo_window, &FIFOPlayerWindow::LoadFIFORequested, this, [this](const QString& path) { StartGame(path); }); m_register_widget = new RegisterWidget(this); m_watch_widget = new WatchWidget(this); m_breakpoint_widget = new BreakpointWidget(this); m_code_widget = new CodeWidget(this); connect(m_watch_widget, &WatchWidget::RequestMemoryBreakpoint, [this](u32 addr) { m_breakpoint_widget->AddAddressMBP(addr); }); connect(m_register_widget, &RegisterWidget::RequestMemoryBreakpoint, [this](u32 addr) { m_breakpoint_widget->AddAddressMBP(addr); }); connect(m_code_widget, &CodeWidget::BreakpointsChanged, m_breakpoint_widget, &BreakpointWidget::Update); #if defined(HAVE_XRANDR) && HAVE_XRANDR m_graphics_window = new GraphicsWindow( new X11Utils::XRRConfiguration( static_cast<Display*>(QGuiApplication::platformNativeInterface()->nativeResourceForWindow( "display", windowHandle())), winId()), this); #else m_graphics_window = new GraphicsWindow(nullptr, this); #endif InstallHotkeyFilter(m_hotkey_window); InstallHotkeyFilter(m_controllers_window); InstallHotkeyFilter(m_settings_window); InstallHotkeyFilter(m_graphics_window); }