1 /* Copyright (c) 2013-2016 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 #pragma once 7 8 #include "ui_DebuggerConsole.h" 9 10 namespace QGBA { 11 12 class DebuggerConsoleController; 13 14 class DebuggerConsole : public QWidget { 15 Q_OBJECT 16 17 public: 18 DebuggerConsole(DebuggerConsoleController* controller, QWidget* parent = nullptr); 19 20 private slots: 21 void log(const QString&); 22 void postLine(); 23 24 protected: 25 bool eventFilter(QObject*, QEvent*) override; 26 27 private: 28 Ui::DebuggerConsole m_ui; 29 QStringList m_history; 30 int m_historyOffset; 31 32 DebuggerConsoleController* m_consoleController; 33 }; 34 35 } 36