Play-/Source/ui_unix/mainwindow.h

120 lines
2.7 KiB
C
Raw Normal View History

2016-09-06 00:12:56 +01:00
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QLabel>
#include <QKeyEvent>
2016-09-06 00:23:31 +01:00
#include <QXmlStreamReader>
#include <QDir>
#include "AppConfig.h"
2016-07-02 03:12:06 +03:00
#include "PS2VM.h"
#include "PS2VM_Preferences.h"
2016-08-23 00:54:10 +01:00
#include "StatsManager.h"
2016-07-26 00:52:31 +01:00
#include "PH_HidUnix.h"
2017-03-25 21:53:28 +00:00
#include "ElidedLabel.h"
2018-05-23 03:11:24 +03:00
#ifdef HAS_LIBEVDEV
#include "GamePad/GamePadInputEventListener.h"
#include "GamePad/GamePadDeviceListener.h"
2018-05-23 03:11:24 +03:00
#endif
2016-09-06 00:12:56 +01:00
2018-04-30 21:01:23 +01:00
namespace Ui
{
class MainWindow;
2016-09-06 00:12:56 +01:00
}
class MainWindow : public QMainWindow
{
2018-04-30 21:01:23 +01:00
Q_OBJECT
2016-09-06 00:12:56 +01:00
public:
2018-04-30 21:01:23 +01:00
explicit MainWindow(QWidget* parent = 0);
~MainWindow();
2016-07-01 05:28:39 +03:00
private:
2018-04-30 21:01:23 +01:00
void SetOpenGlPanelSize();
void CreateStatusBar();
void InitEmu();
void SetupSoundHandler();
void Setupfpscounter();
void SetupSaveLoadStateSlots();
QString SaveStateInfo(int);
void OnRunningStateChange();
void OnExecutableChange();
void UpdateUI();
void RegisterPreferences();
void BootElf(const char*);
void BootCDROM();
void saveState(int);
void loadState(int);
void toggleFullscreen();
2016-07-01 05:21:58 +03:00
2018-04-30 21:01:23 +01:00
Ui::MainWindow* ui;
2018-04-30 21:01:23 +01:00
QWindow* m_openglpanel;
QLabel* gameIDLabel;
QLabel* fpsLabel;
QLabel* m_dcLabel;
QLabel* m_stateLabel;
ElidedLabel* m_msgLabel;
CStatsManager* StatsManager;
CInputBindingManager* m_InputBindingManager;
QTimer* m_fpstimer = nullptr;
CPS2VM* g_virtualMachine = nullptr;
bool m_deactivatePause = false;
bool m_pauseFocusLost = true;
2018-05-23 03:11:24 +03:00
#ifdef HAS_LIBEVDEV
2018-04-30 21:01:23 +01:00
std::unique_ptr<CGamePadDeviceListener> m_GPDL;
2018-05-23 03:11:24 +03:00
#endif
2018-04-30 21:01:23 +01:00
enum BootType
{
CD,
ELF
};
struct lastOpenCommand
{
BootType type;
std::string filename;
lastOpenCommand() = default;
2018-04-30 21:01:23 +01:00
lastOpenCommand(BootType m_type, std::string m_filename)
: type(m_type)
, filename(m_filename)
{
}
};
lastOpenCommand m_lastOpenCommand;
2018-04-30 21:01:23 +01:00
QString m_lastpath = QDir::homePath();
QString ReadElementValue(QXmlStreamReader& Rxml);
2016-07-26 00:52:31 +01:00
2016-07-01 05:28:39 +03:00
protected:
2018-04-30 21:01:23 +01:00
void closeEvent(QCloseEvent*) Q_DECL_OVERRIDE;
void showEvent(QShowEvent*) Q_DECL_OVERRIDE;
public slots:
2018-04-30 21:01:23 +01:00
void openGLWindow_resized();
void setFPS();
private slots:
2018-04-30 21:01:23 +01:00
void on_actionOpen_Game_triggered();
void on_actionBoot_ELF_triggered();
void on_actionExit_triggered();
2018-07-30 13:25:08 -04:00
void keyPressEvent(QKeyEvent*) Q_DECL_OVERRIDE;
void keyReleaseEvent(QKeyEvent*) Q_DECL_OVERRIDE;
2018-04-30 21:01:23 +01:00
void on_actionSettings_triggered();
void on_actionPause_Resume_triggered();
void on_actionAbout_triggered();
void focusOutEvent(QFocusEvent*) Q_DECL_OVERRIDE;
void focusInEvent(QFocusEvent*) Q_DECL_OVERRIDE;
void on_actionPause_when_focus_is_lost_triggered(bool checked);
void on_actionReset_triggered();
void on_actionMemory_Card_Manager_triggered();
void on_actionVFS_Manager_triggered();
void on_actionController_Manager_triggered();
void on_actionCapture_Screen_triggered();
void doubleClickEvent(QMouseEvent*);
2016-09-06 00:12:56 +01:00
};
#endif // MAINWINDOW_H