dolphin/Source/Core/DolphinQt2/MainWindow.h

113 lines
2.5 KiB
C
Raw Normal View History

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>
#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"
#include "DolphinQt2/ToolBar.h"
2015-11-27 08:33:07 +00:00
class HotkeyScheduler;
class MappingWindow;
class SettingsWindow;
2017-05-09 16:49:10 +00:00
class ControllersWindow;
2017-06-26 21:22:40 +00:00
class DragEnterEvent;
class GraphicsWindow;
2016-02-10 04:42:06 +00:00
2015-11-27 08:33:07 +00:00
class MainWindow final : public QMainWindow
{
Q_OBJECT
2015-11-27 08:33:07 +00:00
public:
explicit MainWindow();
~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:
void EmulationStarted();
void EmulationPaused();
void EmulationStopped();
2015-11-27 08:33:07 +00:00
private slots:
void Open();
void Play();
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 09:01:32 +00:00
void BootWiiSystemMenu();
void PerformOnlineUpdate(const std::string& region);
void FullScreen();
void ScreenShot();
2015-11-27 08:33:07 +00:00
private:
void CreateComponents();
void ConnectGameList();
void ConnectHotkeys();
void ConnectMenuBar();
void ConnectRenderWidget();
void ConnectStack();
void ConnectToolBar();
2017-05-23 20:12:01 +00:00
void InitControllers();
void ShutdownControllers();
2017-05-23 20:12:01 +00:00
void InitCoreCallbacks();
void StartGame(const QString& path);
void ShowRenderWidget();
void HideRenderWidget();
void ShowSettingsWindow();
2017-05-09 16:49:10 +00:00
void ShowControllersWindow();
void ShowGraphicsWindow();
void ShowAboutDialog();
void ShowHotkeyDialog();
void OnStopComplete();
2017-06-26 21:22:40 +00:00
void dragEnterEvent(QDragEnterEvent* event) override;
void dropEvent(QDropEvent* event) override;
QSize sizeHint() const override;
2017-06-26 21:22:40 +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;
bool m_exit_requested = false;
int m_state_slot = 1;
QString m_pending_boot;
HotkeyScheduler* m_hotkey_scheduler;
2017-05-09 16:49:10 +00:00
ControllersWindow* m_controllers_window;
SettingsWindow* m_settings_window;
MappingWindow* m_hotkey_window;
GraphicsWindow* m_graphics_window;
2015-11-27 08:33:07 +00:00
};