Play-/Source/ui_unix/mainwindow.h

99 lines
2.5 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 "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"
2016-09-06 00:12:56 +01:00
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
2016-07-01 05:28:39 +03:00
private:
2016-08-10 16:42:37 +01:00
void SetOpenGlPanelSize();
void CreateStatusBar();
void InitEmu();
void SetupSoundHandler();
2016-07-01 05:21:58 +03:00
void Setupfpscounter();
2016-08-10 16:42:37 +01:00
void SetupSaveLoadStateSlots();
QString SaveStateInfo(int);
2016-07-26 15:06:37 +01:00
boost::filesystem::path GetStateDirectoryPath();
boost::filesystem::path GenerateStatePath(int);
void OnRunningStateChange();
2016-07-27 13:47:50 +01:00
void OnExecutableChange();
void UpdateUI();
void RegisterPreferences();
2016-07-29 19:19:27 +01:00
void BootElf(const char*);
void BootCDROM();
2017-02-25 13:12:31 +00:00
void saveState(int);
void loadState(int);
2016-07-01 05:21:58 +03:00
2016-07-01 05:28:39 +03:00
Ui::MainWindow *ui;
2016-08-10 16:42:37 +01:00
QWindow* m_openglpanel;
2017-02-19 15:00:25 +00:00
QLabel *gameIDLabel;
2016-08-23 00:54:10 +01:00
QLabel* fpsLabel;
2016-08-10 16:42:37 +01:00
QLabel* m_dcLabel;
QLabel* m_stateLabel;
2016-08-23 00:54:10 +01:00
CStatsManager* StatsManager;
2016-08-10 16:42:37 +01:00
CPH_HidUnix* m_padhandler = nullptr;
QTimer *m_fpstimer = nullptr;
2016-07-02 03:12:06 +03:00
CPS2VM* g_virtualMachine = nullptr;
2016-07-29 18:31:09 +01:00
bool m_deactivatePause = false;
bool m_pauseFocusLost = true;
2016-07-29 19:19:27 +01:00
enum BootType { CD, ELF };
struct lastOpenCommand
{
BootType type;
const char* filename;
lastOpenCommand(BootType m_type, const char* m_filename) : type(m_type),filename(m_filename){}
};
lastOpenCommand* m_lastOpenCommand = nullptr;
2016-07-26 00:52:31 +01:00
2016-09-06 00:23:31 +01:00
QString ReadElementValue(QXmlStreamReader &Rxml);
2016-07-01 05:28:39 +03:00
protected:
2016-07-26 00:22:08 +01:00
void closeEvent(QCloseEvent*) Q_DECL_OVERRIDE;
2016-07-01 05:28:39 +03:00
void showEvent(QShowEvent*) Q_DECL_OVERRIDE;
public slots:
2016-07-01 05:21:58 +03:00
void openGLWindow_resized();
2016-08-23 00:54:10 +01:00
void setFPS();
private slots:
void on_actionOpen_Game_triggered();
void on_actionBoot_ELF_triggered();
void on_actionExit_triggered();
2016-07-26 00:52:31 +01:00
void keyPressEvent(QKeyEvent *);
void keyReleaseEvent(QKeyEvent *);
2016-08-23 00:54:10 +01:00
void on_actionSettings_triggered();
void on_actionPause_Resume_triggered();
2016-08-10 16:29:40 +01:00
void on_actionAbout_triggered();
2016-07-29 18:31:09 +01:00
void focusOutEvent(QFocusEvent*) Q_DECL_OVERRIDE;
void focusInEvent(QFocusEvent*) Q_DECL_OVERRIDE;
void on_actionPause_when_focus_is_lost_triggered(bool checked);
2016-07-29 19:19:27 +01:00
void on_actionReset_triggered();
2016-08-10 14:56:16 +01:00
void on_actionMemory_Card_Manager_triggered();
2016-09-06 00:03:02 +01:00
void on_actionVFS_Manager_triggered();
2016-09-06 00:23:31 +01:00
void on_actionController_Manager_triggered();
2016-09-06 00:12:56 +01:00
};
#endif // MAINWINDOW_H