dolphin/Source/Core/DolphinQt/MainWindow.h

207 lines
5.0 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 <memory>
#include <optional>
#include <string>
2018-03-23 19:13:56 -06:00
class QProgressDialog;
class QStackedWidget;
class QString;
2018-03-23 19:13:56 -06:00
class BreakpointWidget;
struct BootParameters;
2018-03-25 20:17:47 -06:00
class CheatsManager;
2018-02-14 15:25:01 -07:00
class CodeWidget;
2018-03-23 19:13:56 -06:00
class ControllersWindow;
2018-07-03 15:50:08 -06:00
class DiscordHandler;
2018-03-23 19:13:56 -06:00
class DragEnterEvent;
2017-08-30 08:44:28 -06:00
class FIFOPlayerWindow;
class GameList;
2018-03-23 19:13:56 -06:00
class GCTASInputWindow;
class GraphicsWindow;
class HotkeyScheduler;
2018-04-09 07:31:20 -06:00
class JITWidget;
class LogConfigWidget;
class LogWidget;
2018-03-16 05:39:53 -06:00
class MemoryWidget;
class MenuBar;
2017-07-21 14:48:21 -06:00
class NetPlayDialog;
class NetPlaySetupDialog;
2018-03-23 19:13:56 -06:00
class RegisterWidget;
class RenderWidget;
2018-03-21 04:13:53 -06:00
class SearchBar;
class SettingsWindow;
class ToolBar;
2017-09-27 00:53:05 -06:00
class WatchWidget;
2018-01-31 04:35:09 -07:00
class WiiTASInputWindow;
2016-02-09 21:42:06 -07:00
namespace DiscIO
{
enum class Region;
}
namespace X11Utils
{
class XRRConfiguration;
}
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
void Show();
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();
2018-06-04 13:44:46 -06:00
void RefreshGameList();
void Play(const std::optional<std::string>& savestate_path = {});
void Pause();
void TogglePause();
// 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);
2018-05-17 12:27:14 -06:00
void StateLoadLastSavedAt(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 SetFullScreenResolution(bool fullscreen);
void FullScreen();
void ScreenShot();
2015-11-27 01:33:07 -07:00
void CreateComponents();
void ConnectGameList();
2018-03-23 19:13:56 -06:00
void ConnectHost();
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(const std::string& path, const std::optional<std::string>& savestate_path = {});
void StartGame(std::unique_ptr<BootParameters>&& parameters);
void ShowRenderWidget();
2018-03-21 13:53:37 -06:00
void HideRenderWidget(bool reinit = true);
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();
2018-01-25 11:54:50 -07:00
void ShowMemcardManager();
2018-03-25 20:17:47 -06:00
void ShowCheatsManager();
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();
void OnConnectWiiRemote(int id);
2018-05-22 13:30:54 -06:00
void OnSignal();
2017-08-27 05:55:05 -06:00
2018-03-23 19:13:56 -06:00
void OnUpdateProgressDialog(QString label, int progress, int total);
2017-08-27 05:55:05 -06:00
void OnPlayRecording();
void OnStartRecording();
void OnStopRecording();
void OnExportRecording();
2018-01-27 06:35:02 -07:00
void ShowTASInput();
2017-08-27 05:55:05 -06:00
void ChangeDisc();
void EjectDisc();
QString PromptFileName();
2018-01-01 14:15:26 -07:00
void EnableScreenSaver(bool enable);
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
#if defined(HAVE_XRANDR) && HAVE_XRANDR
std::unique_ptr<X11Utils::XRRConfiguration> m_xrr_config;
#endif
2018-03-23 19:13:56 -06:00
QProgressDialog* m_progress_dialog = nullptr;
QStackedWidget* m_stack;
ToolBar* m_tool_bar;
MenuBar* m_menu_bar;
2018-03-21 04:13:53 -06:00
SearchBar* m_search_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;
bool m_fullscreen_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;
2017-07-21 14:48:21 -06:00
NetPlayDialog* m_netplay_dialog;
2018-07-03 15:50:08 -06:00
DiscordHandler* m_netplay_discord;
2017-07-21 14:48:21 -06:00
NetPlaySetupDialog* m_netplay_setup_dialog;
GraphicsWindow* m_graphics_window;
2018-01-31 04:35:09 -07:00
static constexpr int num_gc_controllers = 4;
std::array<GCTASInputWindow*, num_gc_controllers> m_gc_tas_input_windows{};
static constexpr int num_wii_controllers = 4;
std::array<WiiTASInputWindow*, num_wii_controllers> m_wii_tas_input_windows{};
BreakpointWidget* m_breakpoint_widget;
2018-02-14 15:25:01 -07:00
CodeWidget* m_code_widget;
2018-04-09 07:31:20 -06:00
JITWidget* m_jit_widget;
LogWidget* m_log_widget;
LogConfigWidget* m_log_config_widget;
2018-03-16 05:39:53 -06:00
MemoryWidget* m_memory_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;
2018-03-25 20:17:47 -06:00
CheatsManager* m_cheats_manager;
QByteArray m_render_widget_geometry;
2015-11-27 01:33:07 -07:00
};