2014-09-14 19:03:07 +00:00
|
|
|
// Copyright 2014 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2014-09-14 19:03:07 +00:00
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2014-09-15 00:44:07 +00:00
|
|
|
#include <memory>
|
2014-09-14 19:03:07 +00:00
|
|
|
#include <QMainWindow>
|
|
|
|
|
2014-11-02 18:53:48 +00:00
|
|
|
#include "Core/Core.h"
|
|
|
|
|
2014-11-11 02:41:17 +00:00
|
|
|
#include "DolphinQt/GameList/GameTracker.h"
|
2014-11-02 18:53:48 +00:00
|
|
|
#include "DolphinQt/VideoInterface/RenderWidget.h"
|
|
|
|
|
2014-09-14 19:03:07 +00:00
|
|
|
// Predefinitions
|
2014-10-27 17:11:39 +00:00
|
|
|
namespace Ui
|
|
|
|
{
|
2014-09-14 19:03:07 +00:00
|
|
|
class DMainWindow;
|
|
|
|
}
|
|
|
|
|
|
|
|
class DMainWindow : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2014-10-18 15:07:17 +00:00
|
|
|
explicit DMainWindow(QWidget* parent_widget = nullptr);
|
2014-09-14 19:03:07 +00:00
|
|
|
~DMainWindow();
|
|
|
|
|
2014-11-02 18:53:48 +00:00
|
|
|
// DRenderWidget
|
2014-11-29 14:30:35 +00:00
|
|
|
bool RenderWidgetHasFocus() const { return m_render_widget->isActiveWindow(); }
|
2014-11-02 18:53:48 +00:00
|
|
|
DRenderWidget* GetRenderWidget() { return m_render_widget.get(); }
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void CoreStateChanged(Core::EState state);
|
|
|
|
|
2014-12-12 19:29:48 +00:00
|
|
|
public slots:
|
|
|
|
// Main toolbar (also used by DRenderWidget)
|
|
|
|
bool OnStop();
|
|
|
|
|
2014-09-14 19:03:07 +00:00
|
|
|
private slots:
|
2014-11-02 18:53:48 +00:00
|
|
|
// Emulation
|
|
|
|
void StartGame(const QString filename);
|
|
|
|
void OnCoreStateChanged(Core::EState state);
|
|
|
|
|
|
|
|
// Main toolbar
|
2014-11-06 01:53:34 +00:00
|
|
|
void OnOpen();
|
2015-05-02 20:29:56 +00:00
|
|
|
void OnBrowse();
|
2015-05-02 09:36:54 +00:00
|
|
|
void OnExit();
|
2014-11-06 01:53:34 +00:00
|
|
|
void OnPlay();
|
2015-05-02 23:18:02 +00:00
|
|
|
void OnReset();
|
2014-09-14 19:03:07 +00:00
|
|
|
|
2014-11-11 02:41:17 +00:00
|
|
|
// View menu
|
|
|
|
void OnGameListStyleChanged();
|
|
|
|
|
2014-09-14 19:03:07 +00:00
|
|
|
// Help menu
|
2014-11-06 01:53:34 +00:00
|
|
|
void OnOpenWebsite();
|
|
|
|
void OnOpenDocs();
|
|
|
|
void OnOpenGitHub();
|
|
|
|
void OnOpenSystemInfo();
|
|
|
|
void OnOpenAbout();
|
2015-05-03 22:05:25 +00:00
|
|
|
void OnOpenAboutQt();
|
2014-09-14 19:03:07 +00:00
|
|
|
|
2014-11-02 18:53:48 +00:00
|
|
|
// Misc.
|
|
|
|
void UpdateIcons();
|
|
|
|
|
2014-09-14 19:03:07 +00:00
|
|
|
private:
|
2015-05-03 06:18:10 +00:00
|
|
|
void closeEvent(QCloseEvent* ce);
|
2014-10-25 13:21:05 +00:00
|
|
|
std::unique_ptr<Ui::DMainWindow> m_ui;
|
2014-11-11 02:41:17 +00:00
|
|
|
DGameTracker* m_game_tracker;
|
2014-11-02 18:53:48 +00:00
|
|
|
|
|
|
|
// Emulation
|
|
|
|
QString RequestBootFilename();
|
|
|
|
QString ShowFileDialog();
|
2015-05-02 20:29:56 +00:00
|
|
|
QString ShowFolderDialog();
|
2014-11-02 18:53:48 +00:00
|
|
|
void DoStartPause();
|
2015-05-02 09:36:54 +00:00
|
|
|
bool Stop();
|
2014-11-02 18:53:48 +00:00
|
|
|
|
2014-11-26 20:30:35 +00:00
|
|
|
std::unique_ptr<DRenderWidget> m_render_widget;
|
2014-11-02 18:53:48 +00:00
|
|
|
bool m_isStopping = false;
|
2014-09-14 19:03:07 +00:00
|
|
|
};
|
2014-11-02 18:53:48 +00:00
|
|
|
|
|
|
|
// Pointer to the only instance of DMainWindow, used by Host_*
|
|
|
|
extern DMainWindow* g_main_window;
|