2015-11-27 08:33:07 +00:00
|
|
|
// Copyright 2015 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QStackedWidget>
|
|
|
|
#include <QString>
|
|
|
|
#include <QToolBar>
|
|
|
|
|
2017-08-24 14:35:47 +00:00
|
|
|
#include <memory>
|
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
#include "DolphinQt2/GameList/GameList.h"
|
2015-12-20 05:24:48 +00:00
|
|
|
#include "DolphinQt2/MenuBar.h"
|
2015-11-27 08:33:07 +00:00
|
|
|
#include "DolphinQt2/RenderWidget.h"
|
2015-12-04 04:41:17 +00:00
|
|
|
#include "DolphinQt2/ToolBar.h"
|
2015-11-27 08:33:07 +00:00
|
|
|
|
2017-08-24 14:35:47 +00:00
|
|
|
struct BootParameters;
|
2017-08-30 14:44:28 +00:00
|
|
|
class FIFOPlayerWindow;
|
2017-06-06 11:49:49 +00:00
|
|
|
class HotkeyScheduler;
|
2017-08-27 22:10:06 +00:00
|
|
|
class LogConfigWidget;
|
|
|
|
class LogWidget;
|
2017-06-06 11:49:49 +00:00
|
|
|
class MappingWindow;
|
2017-07-21 20:48:21 +00:00
|
|
|
class NetPlayClient;
|
|
|
|
class NetPlayDialog;
|
|
|
|
class NetPlayServer;
|
|
|
|
class NetPlaySetupDialog;
|
2016-05-09 13:34:07 +00:00
|
|
|
class SettingsWindow;
|
2017-05-09 16:49:10 +00:00
|
|
|
class ControllersWindow;
|
2017-06-26 21:22:40 +00:00
|
|
|
class DragEnterEvent;
|
2017-06-15 23:42:12 +00:00
|
|
|
class GraphicsWindow;
|
2016-02-10 04:42:06 +00:00
|
|
|
|
2015-11-27 08:33:07 +00:00
|
|
|
class MainWindow final : public QMainWindow
|
|
|
|
{
|
2016-06-24 08:43:46 +00:00
|
|
|
Q_OBJECT
|
2015-11-27 08:33:07 +00:00
|
|
|
|
|
|
|
public:
|
2017-10-01 22:09:07 +00:00
|
|
|
explicit MainWindow(std::unique_ptr<BootParameters> boot_parameters);
|
2016-06-24 08:43:46 +00:00
|
|
|
~MainWindow();
|
2015-11-27 08:33:07 +00:00
|
|
|
|
2017-06-24 15:00:37 +00:00
|
|
|
bool eventFilter(QObject* object, QEvent* event) override;
|
|
|
|
|
2015-11-27 08:33:07 +00:00
|
|
|
signals:
|
2017-08-27 11:55:05 +00:00
|
|
|
void ReadOnlyModeChanged(bool read_only);
|
|
|
|
void RecordingStatusChanged(bool recording);
|
2015-11-27 08:33:07 +00:00
|
|
|
|
2017-06-30 09:24:26 +00:00
|
|
|
private:
|
2016-06-24 08:43:46 +00:00
|
|
|
void Open();
|
|
|
|
void Play();
|
|
|
|
void Pause();
|
|
|
|
|
|
|
|
// May ask for confirmation. Returns whether or not it actually stopped.
|
2017-07-03 14:04:24 +00:00
|
|
|
bool RequestStop();
|
2016-06-24 08:43:46 +00:00
|
|
|
void ForceStop();
|
|
|
|
void Reset();
|
|
|
|
void FrameAdvance();
|
|
|
|
void StateLoad();
|
|
|
|
void StateSave();
|
|
|
|
void StateLoadSlot();
|
|
|
|
void StateSaveSlot();
|
|
|
|
void StateLoadSlotAt(int slot);
|
|
|
|
void StateSaveSlotAt(int slot);
|
|
|
|
void StateLoadUndo();
|
|
|
|
void StateSaveUndo();
|
|
|
|
void StateSaveOldest();
|
|
|
|
void SetStateSlot(int slot);
|
2017-07-06 09:01:32 +00:00
|
|
|
void BootWiiSystemMenu();
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2017-06-14 09:58:11 +00:00
|
|
|
void PerformOnlineUpdate(const std::string& region);
|
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
void FullScreen();
|
|
|
|
void ScreenShot();
|
2015-11-27 08:33:07 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
void CreateComponents();
|
|
|
|
|
|
|
|
void ConnectGameList();
|
2017-06-06 11:49:49 +00:00
|
|
|
void ConnectHotkeys();
|
2016-06-24 08:43:46 +00:00
|
|
|
void ConnectMenuBar();
|
|
|
|
void ConnectRenderWidget();
|
|
|
|
void ConnectStack();
|
|
|
|
void ConnectToolBar();
|
|
|
|
|
2017-05-23 20:12:01 +00:00
|
|
|
void InitControllers();
|
2017-06-01 04:11:54 +00:00
|
|
|
void ShutdownControllers();
|
2017-05-23 20:12:01 +00:00
|
|
|
|
2017-06-16 13:27:00 +00:00
|
|
|
void InitCoreCallbacks();
|
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
void StartGame(const QString& path);
|
2017-08-24 14:35:47 +00:00
|
|
|
void StartGame(std::unique_ptr<BootParameters>&& parameters);
|
2016-06-24 08:43:46 +00:00
|
|
|
void ShowRenderWidget();
|
|
|
|
void HideRenderWidget();
|
|
|
|
|
|
|
|
void ShowSettingsWindow();
|
2017-09-10 17:10:45 +00:00
|
|
|
void ShowGeneralWindow();
|
2017-07-16 21:11:11 +00:00
|
|
|
void ShowAudioWindow();
|
2017-05-09 16:49:10 +00:00
|
|
|
void ShowControllersWindow();
|
2017-06-15 23:42:12 +00:00
|
|
|
void ShowGraphicsWindow();
|
2016-06-24 08:43:46 +00:00
|
|
|
void ShowAboutDialog();
|
2017-06-06 11:49:49 +00:00
|
|
|
void ShowHotkeyDialog();
|
2017-07-21 20:48:21 +00:00
|
|
|
void ShowNetPlaySetupDialog();
|
2017-08-30 14:44:28 +00:00
|
|
|
void ShowFIFOPlayer();
|
2017-07-21 20:48:21 +00:00
|
|
|
|
|
|
|
void NetPlayInit();
|
|
|
|
bool NetPlayJoin();
|
|
|
|
bool NetPlayHost(const QString& game_id);
|
|
|
|
void NetPlayQuit();
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2017-08-24 14:35:47 +00:00
|
|
|
void OnBootGameCubeIPL(DiscIO::Region region);
|
2017-08-24 15:38:31 +00:00
|
|
|
void OnImportNANDBackup();
|
2017-08-27 11:55:05 +00:00
|
|
|
|
|
|
|
void OnPlayRecording();
|
|
|
|
void OnStartRecording();
|
|
|
|
void OnStopRecording();
|
|
|
|
void OnExportRecording();
|
|
|
|
|
2017-07-03 14:04:24 +00:00
|
|
|
void OnStopComplete();
|
2017-06-26 21:22:40 +00:00
|
|
|
void dragEnterEvent(QDragEnterEvent* event) override;
|
|
|
|
void dropEvent(QDropEvent* event) override;
|
2017-05-27 01:24:07 +00:00
|
|
|
QSize sizeHint() const override;
|
2017-06-26 21:22:40 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
QStackedWidget* m_stack;
|
|
|
|
ToolBar* m_tool_bar;
|
|
|
|
MenuBar* m_menu_bar;
|
|
|
|
GameList* m_game_list;
|
|
|
|
RenderWidget* m_render_widget;
|
|
|
|
bool m_rendering_to_main;
|
2017-06-24 15:00:37 +00:00
|
|
|
bool m_stop_requested = false;
|
2017-07-03 14:04:24 +00:00
|
|
|
bool m_exit_requested = false;
|
2016-06-24 08:43:46 +00:00
|
|
|
int m_state_slot = 1;
|
2017-08-24 14:35:47 +00:00
|
|
|
std::unique_ptr<BootParameters> m_pending_boot;
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2017-06-06 11:49:49 +00:00
|
|
|
HotkeyScheduler* m_hotkey_scheduler;
|
2017-05-09 16:49:10 +00:00
|
|
|
ControllersWindow* m_controllers_window;
|
2016-06-24 08:43:46 +00:00
|
|
|
SettingsWindow* m_settings_window;
|
2017-06-06 11:49:49 +00:00
|
|
|
MappingWindow* m_hotkey_window;
|
2017-07-21 20:48:21 +00:00
|
|
|
NetPlayDialog* m_netplay_dialog;
|
|
|
|
NetPlaySetupDialog* m_netplay_setup_dialog;
|
2017-06-15 23:42:12 +00:00
|
|
|
GraphicsWindow* m_graphics_window;
|
2017-08-27 22:10:06 +00:00
|
|
|
LogWidget* m_log_widget;
|
|
|
|
LogConfigWidget* m_log_config_widget;
|
2017-08-30 14:44:28 +00:00
|
|
|
FIFOPlayerWindow* m_fifo_window;
|
2015-11-27 08:33:07 +00:00
|
|
|
};
|