-
Notifications
You must be signed in to change notification settings - Fork 2
/
AoCodeNavigator.h
111 lines (97 loc) · 2.94 KB
/
AoCodeNavigator.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
#ifndef LISACODENAVIGATOR_H
#define LISACODENAVIGATOR_H
/*
* Copyright 2023 Rochus Keller <mailto:me@rochus-keller.ch>
*
* This file is part of the ActiveOberon parser/navigator project.
*
* The following is the license that applies to this copy of the
* file. For a license to use the file under conditions
* other than those described here, please email to me@rochus-keller.ch.
*
* 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 Lisa Pascal Navigator
#include <QMainWindow>
#include "AoRowCol.h"
#include "AoFileSystem.h"
class QLabel;
class QPlainTextEdit;
class QTreeView;
class QTreeWidget;
class QModelIndex;
namespace Ao
{
class CodeModel;
class ModuleDetailMdl;
class Symbol;
class Declaration;
class CodeNavigator : public QMainWindow
{
Q_OBJECT
public:
explicit CodeNavigator(QWidget *parent = 0);
~CodeNavigator();
void open( const QString& sourceTreePath);
void logMessage(const QString&);
protected:
struct Place
{
FilePos d_loc;
quint16 d_yoff;
bool operator==( const Place& rhs ) { return d_loc.d_pos.d_row == rhs.d_loc.d_pos.d_row &&
d_loc.d_pos.d_col == rhs.d_loc.d_pos.d_col && d_loc.d_filePath == rhs.d_loc.d_filePath; }
Place(const FilePos& loc, quint16 y ):d_loc(loc),d_yoff(y){}
Place():d_yoff(0) {}
};
void createModuleList();
void createDetails();
void createUsedBy();
void createLog();
void pushLocation( const Place& );
void showViewer( const Place& );
void fillUsedBy(Symbol* id, Declaration*);
void setPathTitle(const FileSystem::File* f, int row, int col);
void syncModuleList();
// overrides
void closeEvent(QCloseEvent* event);
protected slots:
void onCursorPositionChanged();
void onModuleDblClick(const QModelIndex&);
void onItemDblClick(const QModelIndex&);
void onUsedByDblClicked();
void onGoBack();
void onGoForward();
void onGotoLine();
void onFindInFile();
void onFindAgain();
void onGotoDefinition();
void onOpen();
void onRunReload();
void onIncreaseSize();
void onDecreaseSize();
private:
class Viewer;
Viewer* d_view;
QLabel* d_pathTitle;
QPlainTextEdit* d_msgLog;
QTreeView* d_modules;
QTreeView* d_module;
QLabel* d_usedByTitle;
QTreeWidget* d_usedBy;
CodeModel* d_mdl;
ModuleDetailMdl* d_mdl2;
QString d_dir;
QList<Place> d_backHisto; // d_backHisto.last() is current place
QList<Place> d_forwardHisto;
bool d_pushBackLock;
};
}
#endif // LISACODENAVIGATOR_H