Debian Codegraph @

src/inspector.h

raw symbols SCIP
1 /*
2 Copyright (C) 2009 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 INSPECTOR_H
24 #define INSPECTOR_H
25
26 #include <QDockWidget>
27 #include <QTreeWidget>
28 #include <QMutex>
29 #include "types.h"
30
31 class TreeItem : public QTreeWidgetItem
32 {
33 public:
34 TreeItem(QTreeWidget *parent, QStringList columnslist) : QTreeWidgetItem(parent, columnslist) {;}
35 TreeItem(QTreeWidgetItem *parent, QStringList columnslist) : QTreeWidgetItem(parent, columnslist) {;}
36 ~TreeItem() {;}
37
38 int getLine() {return m_line;}
39 void setLine(int line) {m_line = line;}
40 void setInputArgs(QString args) { inargs = args; }
41 void setOutputArgs(QString args) { outargs = args; }
42
43 private:
44 int m_line;
45 QString inargs;
46 QString outargs;
47 };
48
49
50 class Inspector : public QDockWidget
51 {
52 Q_OBJECT
53 public:
54 Inspector(QWidget *parent);
55 ~Inspector();
56 void parseText(const QString &text);
57 void parsePythonText(const QString &text);
58 QStringList getParsedUDOs() { return m_opcodes; }
59 QVector<Opcode*> getUdosVector() { return udosVector; }
60 QHash<QString, Opcode>*getUdosMap() { return &udosMap; }
61
62
63 protected:
64 virtual void focusInEvent (QFocusEvent * event);
65 virtual void closeEvent(QCloseEvent * event);
66
67 private:
68 QTreeWidget *m_treeWidget;
69 TreeItem *treeItem1;
70 TreeItem *treeItem2;
71 TreeItem *treeItem3;
72 TreeItem *treeItem4;
73 TreeItem *treeItem5;
74
75 QMutex inspectorMutex;
76 // QVector<QString> m_opcodes;
77 QStringList m_opcodes;
78 QRegExp opcodeRegexp;
79 QRegularExpression rxOpcode;
80 bool inspectLabels;
81 QHash<QString, Opcode>udosMap;
82 QVector<Opcode *>udosVector;
83
84 QRegularExpression xinRx;
85 QRegularExpression xoutRx;
86 QRegularExpression ftableRx1;
87 QRegularExpression ftableRx2;
88
89
90 private slots:
91 void itemActivated(QTreeWidgetItem * item, int column = 0);
92 void itemChanged(QTreeWidgetItem * newItem, QTreeWidgetItem * oldItem);
93
94 signals:
95 void Close(bool visible);
96 void jumpToLine(int line);
97 void parsedUDOs();
98 };
99
100 #endif // INSPECTOR_H