all repos — mgba @ a6f5bbbeb9f8a20d66cd325b27a97d73ce832175

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 closeEvent(QCloseEvent*) override;
44
45signals:
46	void audioBufferSamplesChanged(int samples);
47	void fpsTargetChanged(float target);
48
49public slots:
50	void toggleFullScreen();
51
52private slots:
53	void gameStarted(GBAThread*);
54	void gameStopped();
55
56private:
57	void setupMenu(QMenuBar*);
58	void openStateWindow(LoadSave);
59
60	void attachWidget(QWidget* widget);
61
62	GameController* m_controller;
63	Display* m_display;
64	QList<QAction*> m_gameActions;
65	LogView* m_logView;
66	LoadSaveState* m_stateWindow;
67	QLabel* m_screenWidget;
68
69#ifdef USE_GDB_STUB
70	GDBController* m_gdbController;
71#endif
72};
73
74}
75
76#endif