src/platform/qt/OverrideView.h (view raw)
1/* Copyright (c) 2013-2015 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#ifndef QGBA_OVERRIDE_VIEW
7#define QGBA_OVERRIDE_VIEW
8
9#include <QDialog>
10
11#include <memory>
12
13#ifdef M_CORE_GB
14#include <mgba/gb/interface.h>
15#endif
16
17#include "Override.h"
18
19#include "ui_OverrideView.h"
20
21struct mCoreThread;
22
23namespace QGBA {
24
25class ConfigController;
26class CoreController;
27class Override;
28
29class OverrideView : public QDialog {
30Q_OBJECT
31
32public:
33 OverrideView(ConfigController* config, QWidget* parent = nullptr);
34
35 void setController(std::shared_ptr<CoreController> controller);
36
37public slots:
38 void saveOverride();
39
40private slots:
41 void updateOverrides();
42 void gameStarted();
43 void gameStopped();
44
45protected:
46 bool eventFilter(QObject* obj, QEvent* event) override;
47
48private:
49 Ui::OverrideView m_ui;
50
51 std::shared_ptr<CoreController> m_controller;
52 std::unique_ptr<Override> m_override;
53 ConfigController* m_config;
54
55#ifdef M_CORE_GB
56 uint32_t m_gbColors[4]{};
57
58 static QList<enum GBModel> s_gbModelList;
59 static QList<enum GBMemoryBankControllerType> s_mbcList;
60#endif
61};
62
63}
64
65#endif