-
Notifications
You must be signed in to change notification settings - Fork 3
/
LnIde.h
205 lines (193 loc) · 6.16 KB
/
LnIde.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
#ifndef _LuonIde_H
#define _LuonIde_H
/*
* Copyright 2024 Rochus Keller <mailto:[email protected]>
*
* This file is part of the Luon IDE application.
*
* The following is the license that applies to this copy of the
* library. For a license to use the library under conditions
* other than those described here, please email to [email protected].
*
* GNU General Public License Usage
* This file may be used under the terms of the GNU General Public
* License (GPL) versions 2.0 or 3.0 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in
* the packaging of this file. Please review the following information
* to ensure GNU General Public Licensing requirements will be met:
* http://www.fsf.org/licensing/licenses/info/GPLv2.html and
* http://www.gnu.org/copyleft/gpl.html.
*/
// Adopted from the Oberon+ IDE
#include <QMainWindow>
class QTreeWidget;
class QTreeWidgetItem;
class QLabel;
namespace Lua
{
class Engine2;
class BcViewer2;
class Terminal2;
}
namespace Gui
{
class AutoMenu;
}
namespace Ln
{
class Declaration;
class Type;
class Symbol;
class LjRuntime;
class Ide : public QMainWindow
{
Q_OBJECT
public:
Ide(QWidget *parent = 0);
~Ide();
void loadFile( const QString& path );
void logMessage(const QString& , bool err = false);
protected:
class Editor;
struct Location
{
// Qt-Koordinaten
quint32 d_line;
quint16 d_col;
quint16 d_yoff;
QString d_file;
bool operator==( const Location& rhs ) { return d_line == rhs.d_line && d_col == rhs.d_col &&
d_file == rhs.d_file; }
Location(const QString& f, quint32 l, quint16 c, quint16 y ):d_file(f),d_line(l),d_col(c),d_yoff(y){}
};
void createTerminal();
void createDumpView();
void createMods();
void createMod();
void createHier();
void createErrs();
void createXref();
void createStack();
void createLocals();
void createMenu();
void createMenuBar();
void closeEvent(QCloseEvent* event);
bool checkSaved( const QString& title );
bool compile(bool doGenerate = false);
void fillMods();
void showDocument( const QString& filePath );
void addTopCommands(Gui::AutoMenu * pop);
Editor* showEditor(const QString& path, int row = -1, int col = -1, bool setMarker = false , bool center = false);
void showEditor(Declaration*, bool setMarker = false, bool center = false);
void showEditor( const Location& );
void createMenu( Editor* );
void addDebugMenu(Gui::AutoMenu * pop);
bool luaRuntimeMessage(const QByteArray&, const QString& file);
void fillXref();
void fillXrefForSym(Symbol*, Declaration* module);
void syncModView(Declaration*);
void syncEditorMarks(Declaration*selected, Declaration* module);
Declaration* moduleOfCurrentEditor();
void fillStack();
void fillLocals();
void printLocalVal( QTreeWidgetItem* item, Type* type, int depth );
void fillModule(Declaration*);
void fillHier(Declaration*);
void removePosMarkers();
void enableDbgMenu();
void pushLocation( const Location& );
void clear();
void showBc( const QByteArray& bc );
protected slots:
void onCompile();
void onRun();
void onAbort();
void onGenerate();
void onNewPro();
void onOpenPro();
void onSavePro();
void onSaveFile();
void onSaveAs();
void onCaption();
void onGotoLnr(quint32);
void onFullScreen();
void onCursor();
void onExportBc();
void onExportAllBc();
void onModsDblClicked(QTreeWidgetItem*,int);
void onModDblClicked(QTreeWidgetItem*,int);
void onHierDblClicked(QTreeWidgetItem*,int);
void onStackDblClicked(QTreeWidgetItem*,int);
void onTabChanged();
void onTabClosing(int);
void onEditorChanged();
void onErrorsDblClicked();
void onErrors();
void onOpenFile();
void onOakwood();
void onSetOptions();
void onSetArguments();
void onAddFiles();
void onNewModule();
void onAddDir();
void onRemoveFile();
void onRemoveDir();
void onEnableDebug();
void onBreak();
void handleGoBack();
void handleGoForward();
void onUpdateLocation(int line, int col );
void onXrefDblClicked();
void onToggleBreakPt();
void onSingleStep();
void onStepOver();
void onStepOut();
void onContinue();
void onShowLlBc();
void onWorkingDir();
void onLuaNotify( int messageType, QByteArray val1, int val2 );
void onAbout();
void onQt();
void onExpMod();
void onBcDebug();
void onRowColMode();
void onShowBcFile();
void onJitEnabled();
void onRestartLua();
void onRunCommand();
private:
class DocTab;
class Debugger;
LjRuntime* d_rt;
DocTab* d_tab;
Debugger* d_dbg;
Lua::BcViewer2* d_bcv;
Lua::Terminal2* d_term;
QTreeWidget* d_mods;
QTreeWidget* d_mod;
QTreeWidget* d_hier;
QHash<Declaration*,QTreeWidgetItem*> d_modIdx;
QTreeWidget* d_stack;
QVector<Declaration*> d_scopes;
QTreeWidget* d_locals;
QLabel* d_xrefTitle;
QLabel* d_modTitle;
QLabel* d_hierTitle;
QTreeWidget* d_xref;
QTreeWidget* d_errs;
QList<Location> d_backHisto; // d_backHisto.last() ist aktuell angezeigtes Objekt
QList<Location> d_forwardHisto;
QAction* d_dbgBreak;
QAction* d_dbgAbort;
QAction* d_dbgContinue;
QAction* d_dbgStepIn;
QAction* d_dbgStepOver;
QAction* d_dbgStepOut;
QByteArray d_curBc;
Declaration* d_curModule;
bool d_lock, d_lock2, d_lock3, d_lock4;
bool d_filesDirty;
bool d_pushBackLock;
};
}
#endif // _LuonIde_H