| 1 | /* |
| 2 | Copyright (C) 2010 Andres Cabrera |
| 3 | [email protected] |
| 4 | |
| 5 | This file is part of CsoundQt. |
| 6 | |
| 7 | CsoundQt is free software; you can redistribute it |
| 8 | and/or modify it under the terms of the GNU Lesser General Public |
| 9 | License as published by the Free Software Foundation; either |
| 10 | version 2.1 of the License, or (at your option) any later version. |
| 11 | |
| 12 | CsoundQt is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | GNU Lesser General Public License for more details. |
| 16 | |
| 17 | You should have received a copy of the GNU Lesser General Public |
| 18 | License along with Csound; if not, write to the Free Software |
| 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
| 20 | 02111-1307 USA |
| 21 | */ |
| 22 | |
| 23 | #ifndef PYTHONCONSOLE_H |
| 24 | #define PYTHONCONSOLE_H |
| 25 | |
| 26 | #include <QtWidgets> |
| 27 | |
| 28 | |
| 29 | class PyQcsObject; |
| 30 | class PythonQtScriptingConsole; |
| 31 | |
| 32 | class PythonConsole : public QDockWidget |
| 33 | { |
| 34 | Q_OBJECT |
| 35 | public: |
| 36 | PythonConsole(QWidget *parent); |
| 37 | ~PythonConsole(); |
| 38 | |
| 39 | public slots: |
| 40 | // void runCommand(QString command); |
| 41 | void evaluate(QString evalCode, bool notify = true); |
| 42 | void runScript(QString fileName); |
| 43 | void initializeInterpreter(); |
| 44 | |
| 45 | protected: |
| 46 | virtual void closeEvent(QCloseEvent * event); |
| 47 | // virtual void keyPressEvent ( QKeyEvent * event ); |
| 48 | |
| 49 | private: |
| 50 | // void runCurrentCommand(); |
| 51 | int countLines(QString evalCode); |
| 52 | |
| 53 | PyQcsObject *m_pqcs; |
| 54 | PythonQtScriptingConsole *m_console; |
| 55 | // QTextEdit *m_text; |
| 56 | // QString m_command; |
| 57 | |
| 58 | signals: |
| 59 | void Close(bool visible); |
| 60 | |
| 61 | }; |
| 62 | |
| 63 | #endif // PYTHONCONSOLE_H |