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
13namespace QGBA {
14
15class AudioThread;
16class GameController;
17class GDBController;
18
19class Window : public QMainWindow {
20Q_OBJECT
21
22public:
23 Window(QWidget* parent = nullptr);
24 static GBAKey mapKey(int qtKey);
25
26signals:
27 void startDrawing(const uint32_t*, GBAThread*);
28 void shutdown();
29
30public slots:
31 void selectROM();
32
33#ifdef USE_GDB_STUB
34 void gdbOpen();
35#endif
36
37protected:
38 virtual void keyPressEvent(QKeyEvent* event) override;
39 virtual void keyReleaseEvent(QKeyEvent* event) override;
40 virtual void closeEvent(QCloseEvent*) override;
41
42private slots:
43 void gameStarted(GBAThread*);
44 void gameStopped();
45
46private:
47 void setupMenu(QMenuBar*);
48 GameController* m_controller;
49 Display* m_display;
50 AudioThread* m_audioThread;
51 QList<QAction*> m_gameActions;
52
53#ifdef USE_GDB_STUB
54 GDBController* m_gdbController;
55#endif
56};
57
58}
59
60#endif