all repos — mgba @ fb5f01e46ac3c64fbddeea913ce238c27f092ec3

mGBA Game Boy Advance Emulator

src/platform/qt/Window.h (view raw)

 1#ifndef QGBA_WINDOW
 2#define QGBA_WINDOW
 3
 4#include <QAudioOutput>
 5#include <QMainWindow>
 6
 7extern "C" {
 8#include "gba.h"
 9}
10
11#include "Display.h"
12#include "LoadSaveState.h"
13
14namespace QGBA {
15
16class GameController;
17class GDBController;
18class LogView;
19
20class Window : public QMainWindow {
21Q_OBJECT
22
23public:
24	Window(QWidget* parent = nullptr);
25	virtual ~Window();
26
27	static GBAKey mapKey(int qtKey);
28
29signals:
30	void startDrawing(const uint32_t*, GBAThread*);
31	void shutdown();
32
33public slots:
34	void selectROM();
35
36#ifdef USE_GDB_STUB
37	void gdbOpen();
38#endif
39
40protected:
41	virtual void keyPressEvent(QKeyEvent* event) override;
42	virtual void keyReleaseEvent(QKeyEvent* event) override;
43	virtual void resizeEvent(QResizeEvent*) override;
44	virtual void closeEvent(QCloseEvent*) override;
45
46signals:
47	void audioBufferSamplesChanged(int samples);
48	void fpsTargetChanged(float target);
49
50public slots:
51	void toggleFullScreen();
52
53private slots:
54	void gameStarted(GBAThread*);
55	void gameStopped();
56	void redoLogo();
57
58private:
59	void setupMenu(QMenuBar*);
60	void openStateWindow(LoadSave);
61
62	void attachWidget(QWidget* widget);
63	void detachWidget(QWidget* widget);
64
65	GameController* m_controller;
66	Display* m_display;
67	QList<QAction*> m_gameActions;
68	LogView* m_logView;
69	LoadSaveState* m_stateWindow;
70	QLabel* m_screenWidget;
71	QPixmap m_logo;
72
73#ifdef USE_GDB_STUB
74	GDBController* m_gdbController;
75#endif
76};
77
78}
79
80#endif