dolphin/Source/Core/DolphinQt2/MainWindow.h

150 lines
3.6 KiB
C
Raw Normal View History

2015-11-27 01:33:07 -07: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>
#include <memory>
#include <optional>
#include "DolphinQt2/GameList/GameList.h"
2015-12-19 22:24:48 -07:00
#include "DolphinQt2/MenuBar.h"
2015-11-27 01:33:07 -07:00
#include "DolphinQt2/RenderWidget.h"
#include "DolphinQt2/ToolBar.h"
2015-11-27 01:33:07 -07:00
struct BootParameters;
2017-08-30 08:44:28 -06:00
class FIFOPlayerWindow;
class HotkeyScheduler;
class LogConfigWidget;
class LogWidget;
class MappingWindow;
2017-07-21 14:48:21 -06:00
class NetPlayClient;
class NetPlayDialog;
class NetPlayServer;
class NetPlaySetupDialog;
class SettingsWindow;
2017-05-09 10:49:10 -06:00
class ControllersWindow;
2017-06-26 15:22:40 -06:00
class DragEnterEvent;
class GraphicsWindow;
class RegisterWidget;
2017-09-27 00:53:05 -06:00
class WatchWidget;
2016-02-09 21:42:06 -07:00
2015-11-27 01:33:07 -07:00
class MainWindow final : public QMainWindow
{
Q_OBJECT
2015-11-27 01:33:07 -07:00
public:
explicit MainWindow(std::unique_ptr<BootParameters> boot_parameters);
~MainWindow();
2015-11-27 01:33:07 -07:00
2017-06-24 09:00:37 -06:00
bool eventFilter(QObject* object, QEvent* event) override;
2015-11-27 01:33:07 -07:00
signals:
2017-08-27 05:55:05 -06:00
void ReadOnlyModeChanged(bool read_only);
void RecordingStatusChanged(bool recording);
2015-11-27 01:33:07 -07:00
private:
void Open();
void Play(const std::optional<std::string>& savestate_path = {});
void Pause();
// May ask for confirmation. Returns whether or not it actually stopped.
bool RequestStop();
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 03:01:32 -06:00
void BootWiiSystemMenu();
void PerformOnlineUpdate(const std::string& region);
void FullScreen();
void ScreenShot();
2015-11-27 01:33:07 -07:00
void CreateComponents();
void ConnectGameList();
void ConnectHotkeys();
void ConnectMenuBar();
void ConnectRenderWidget();
void ConnectStack();
void ConnectToolBar();
2017-05-23 14:12:01 -06:00
void InitControllers();
void ShutdownControllers();
2017-05-23 14:12:01 -06:00
void InitCoreCallbacks();
void StartGame(const QString& path, const std::optional<std::string>& savestate_path = {});
void StartGame(std::unique_ptr<BootParameters>&& parameters);
void ShowRenderWidget();
void HideRenderWidget();
void ShowSettingsWindow();
void ShowGeneralWindow();
void ShowAudioWindow();
2017-05-09 10:49:10 -06:00
void ShowControllersWindow();
void ShowGraphicsWindow();
void ShowAboutDialog();
void ShowHotkeyDialog();
2017-07-21 14:48:21 -06:00
void ShowNetPlaySetupDialog();
2017-08-30 08:44:28 -06:00
void ShowFIFOPlayer();
2017-07-21 14:48:21 -06:00
void NetPlayInit();
bool NetPlayJoin();
bool NetPlayHost(const QString& game_id);
void NetPlayQuit();
void OnBootGameCubeIPL(DiscIO::Region region);
void OnImportNANDBackup();
2017-08-27 05:55:05 -06:00
void OnPlayRecording();
void OnStartRecording();
void OnStopRecording();
void OnExportRecording();
void OnStopComplete();
2017-06-26 15:22:40 -06:00
void dragEnterEvent(QDragEnterEvent* event) override;
void dropEvent(QDropEvent* event) override;
QSize sizeHint() const override;
2017-06-26 15:22:40 -06: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 09:00:37 -06:00
bool m_stop_requested = false;
bool m_exit_requested = false;
int m_state_slot = 1;
std::unique_ptr<BootParameters> m_pending_boot;
HotkeyScheduler* m_hotkey_scheduler;
2017-05-09 10:49:10 -06:00
ControllersWindow* m_controllers_window;
SettingsWindow* m_settings_window;
MappingWindow* m_hotkey_window;
2017-07-21 14:48:21 -06:00
NetPlayDialog* m_netplay_dialog;
NetPlaySetupDialog* m_netplay_setup_dialog;
GraphicsWindow* m_graphics_window;
LogWidget* m_log_widget;
LogConfigWidget* m_log_config_widget;
2017-08-30 08:44:28 -06:00
FIFOPlayerWindow* m_fifo_window;
RegisterWidget* m_register_widget;
2017-09-27 00:53:05 -06:00
WatchWidget* m_watch_widget;
2015-11-27 01:33:07 -07:00
};