Play-/Source/ui_unix/mainwindow.h

106 lines
2.8 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"
#include "GamePad/GamePadInputEventListener.h"
#include "GamePad/GamePadDeviceListener.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);
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);
2017-04-22 19:46:31 +01:00
void toggleFullscreen();
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;
2017-03-25 21:53:28 +00:00
ElidedLabel* m_msgLabel;
2016-08-23 00:54:10 +01:00
CStatsManager* StatsManager;
CInputBindingManager* m_InputBindingManager;
2016-08-10 16:42:37 +01:00
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;
std::unique_ptr<CGamePadDeviceListener> m_GPDL;
2016-07-29 19:19:27 +01:00
enum BootType { CD, ELF };
struct lastOpenCommand
{
BootType type;
std::string filename;
lastOpenCommand() = default;
lastOpenCommand(BootType m_type, std::string m_filename) : type(m_type),filename(m_filename){}
2016-07-29 19:19:27 +01:00
};
lastOpenCommand m_lastOpenCommand;
QString m_lastpath = QDir::homePath();
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();
2017-04-09 06:50:07 +01:00
void on_actionCapture_Screen_triggered();
2017-04-22 19:46:31 +01:00
void doubleClickEvent(QMouseEvent*);
2016-09-06 00:12:56 +01:00
};
#endif // MAINWINDOW_H