Mercurial > hg > octave-lyh
annotate gui/src/octave-adapter/octave-link.h @ 14709:f50591409306 gui
Started to rename class names and methods from camel case to underscore-
author | Jacob Dawid <jacob.dawid@googlemail.com> |
---|---|
date | Thu, 31 May 2012 22:59:47 +0200 |
parents | 674740c44c09 |
children | 5cb54cca8a06 |
rev | line source |
---|---|
13674
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13595
diff
changeset
|
1 /* OctaveGUI - A graphical user interface for Octave |
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13595
diff
changeset
|
2 * Copyright (C) 2011 John P. Swensen, Jacob Dawid (jacob.dawid@googlemail.com) |
13501 | 3 * |
13674
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13595
diff
changeset
|
4 * This program is free software: you can redistribute it and/or modify |
14290
faece6b2ab90
Corrected license headers in all files to GPL.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13683
diff
changeset
|
5 * it under the terms of the GNU General Public License as |
13674
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13595
diff
changeset
|
6 * published by the Free Software Foundation, either version 3 of the |
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13595
diff
changeset
|
7 * License, or (at your option) any later version. |
13501 | 8 * |
13674
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13595
diff
changeset
|
9 * This program is distributed in the hope that it will be useful, |
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13595
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13595
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14290
faece6b2ab90
Corrected license headers in all files to GPL.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13683
diff
changeset
|
12 * GNU General Public License for more details. |
13501 | 13 * |
14290
faece6b2ab90
Corrected license headers in all files to GPL.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13683
diff
changeset
|
14 * You should have received a copy of the GNU General Public License |
13674
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13595
diff
changeset
|
15 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13595
diff
changeset
|
16 */ |
13501 | 17 |
18 #ifndef OCTAVELINK_H | |
19 #define OCTAVELINK_H | |
20 | |
21 // Octave includes | |
22 #undef PACKAGE_BUGREPORT | |
23 #undef PACKAGE_NAME | |
24 #undef PACKAGE_STRING | |
25 #undef PACKAGE_TARNAME | |
26 #undef PACKAGE_VERSION | |
27 #undef PACKAGE_URL | |
13595
56eb9348ff02
Added missing include flags.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13543
diff
changeset
|
28 #include "octave/config.h" |
13501 | 29 #include "octave/cmd-edit.h" |
30 #include "octave/error.h" | |
31 #include "octave/file-io.h" | |
32 #include "octave/input.h" | |
33 #include "octave/lex.h" | |
34 #include "octave/load-path.h" | |
35 #include "octave/octave.h" | |
36 #include "octave/oct-hist.h" | |
37 #include "octave/oct-map.h" | |
38 #include "octave/oct-obj.h" | |
39 #include "octave/ops.h" | |
40 #include "octave/ov.h" | |
41 #include "octave/ov-usr-fcn.h" | |
42 #include "octave/symtab.h" | |
43 #include "octave/pt.h" | |
44 #include "octave/pt-eval.h" | |
45 #include "octave/config.h" | |
46 #include "octave/Range.h" | |
47 #include "octave/toplev.h" | |
48 #include "octave/procstream.h" | |
49 #include "octave/sighandlers.h" | |
50 #include "octave/debug.h" | |
51 #include "octave/sysdep.h" | |
52 #include "octave/ov.h" | |
53 #include "octave/unwind-prot.h" | |
54 #include "octave/utils.h" | |
55 #include "octave/variables.h" | |
56 | |
57 // Standard includes | |
58 #include <iostream> | |
59 #include <string> | |
60 #include <vector> | |
61 #include <readline/readline.h> | |
62 | |
63 // Qt includes | |
64 #include <QMutexLocker> | |
65 #include <QMutex> | |
66 #include <QFileInfo> | |
67 #include <QList> | |
68 #include <QString> | |
13517
86adc9c4ec4b
History deactivated.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13513
diff
changeset
|
69 #include <QStringList> |
13501 | 70 #include <QVector> |
71 #include <QSemaphore> | |
72 #include <QObject> | |
13518
bace956a3724
Put history model part into OctaveLink.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13517
diff
changeset
|
73 #include <QStringListModel> |
14671
f346343654a4
Settings readline event hook and fixed race condition.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14668
diff
changeset
|
74 #include <QTimer> |
13501 | 75 |
14707
674740c44c09
Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14703
diff
changeset
|
76 #include "workspace-model.h" |
674740c44c09
Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14703
diff
changeset
|
77 #include "octave-main-thread.h" |
674740c44c09
Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14703
diff
changeset
|
78 #include "symbol-information.h" |
13541
b48ac9ad8de0
Highly improved separation of model and view classes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13522
diff
changeset
|
79 |
13501 | 80 /** |
81 * \class OctaveLink | |
82 * Manages a link to an octave instance. | |
83 */ | |
14709
f50591409306
Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14707
diff
changeset
|
84 class octave_link:public QObject |
13501 | 85 { |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
86 Q_OBJECT |
13501 | 87 public: |
14709
f50591409306
Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14707
diff
changeset
|
88 static octave_link * |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
89 instance () |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
90 { |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
91 return &m_singleton; |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
92 } |
13501 | 93 |
13541
b48ac9ad8de0
Highly improved separation of model and view classes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13522
diff
changeset
|
94 void launchOctave (); |
b48ac9ad8de0
Highly improved separation of model and view classes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13522
diff
changeset
|
95 void terminateOctave (); |
14664
664f54233c98
Extracted model code from the WorkspaceView and rearranged it in a new model class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14599
diff
changeset
|
96 QStringListModel *historyModel (); |
14709
f50591409306
Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14707
diff
changeset
|
97 workspace_model *workspaceModel (); |
13501 | 98 |
14599
97cb9286919c
Cleaned up code.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14290
diff
changeset
|
99 void triggerUpdateHistoryModel (); |
14700
7623bece76df
Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14698
diff
changeset
|
100 void updateCurrentWorkingDirectory (); |
14698
79c9a6d06590
Wrote SymbolInformation struct and refactored code that updates the symbol table.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14671
diff
changeset
|
101 |
79c9a6d06590
Wrote SymbolInformation struct and refactored code that updates the symbol table.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14671
diff
changeset
|
102 void acquireSymbolInformation (); |
79c9a6d06590
Wrote SymbolInformation struct and refactored code that updates the symbol table.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14671
diff
changeset
|
103 void releaseSymbolInformation (); |
79c9a6d06590
Wrote SymbolInformation struct and refactored code that updates the symbol table.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14671
diff
changeset
|
104 void buildSymbolInformation (); |
79c9a6d06590
Wrote SymbolInformation struct and refactored code that updates the symbol table.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14671
diff
changeset
|
105 const QList <SymbolInformation>& symbolInformation () const; |
13501 | 106 |
14700
7623bece76df
Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14698
diff
changeset
|
107 signals: |
7623bece76df
Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14698
diff
changeset
|
108 void workingDirectoryChanged (QString directory); |
7623bece76df
Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14698
diff
changeset
|
109 |
13501 | 110 private: |
14709
f50591409306
Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14707
diff
changeset
|
111 octave_link (); |
f50591409306
Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14707
diff
changeset
|
112 ~octave_link (); |
13501 | 113 |
13518
bace956a3724
Put history model part into OctaveLink.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13517
diff
changeset
|
114 QStringListModel *m_historyModel; |
14709
f50591409306
Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14707
diff
changeset
|
115 workspace_model *m_workspaceModel; |
13519
35ecb6063c7b
Made the view connect with the history model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13518
diff
changeset
|
116 |
13541
b48ac9ad8de0
Highly improved separation of model and view classes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13522
diff
changeset
|
117 // Threads for running octave and managing the data interaction. |
14709
f50591409306
Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14707
diff
changeset
|
118 octave_main_thread *m_octaveMainThread; |
14671
f346343654a4
Settings readline event hook and fixed race condition.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14668
diff
changeset
|
119 QTimer _updateWorkspaceModelTimer; |
13541
b48ac9ad8de0
Highly improved separation of model and view classes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13522
diff
changeset
|
120 |
14698
79c9a6d06590
Wrote SymbolInformation struct and refactored code that updates the symbol table.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14671
diff
changeset
|
121 QSemaphore *_symbolInformationSemaphore; |
79c9a6d06590
Wrote SymbolInformation struct and refactored code that updates the symbol table.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14671
diff
changeset
|
122 QList <SymbolInformation> _symbolInformation; |
79c9a6d06590
Wrote SymbolInformation struct and refactored code that updates the symbol table.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14671
diff
changeset
|
123 |
14700
7623bece76df
Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14698
diff
changeset
|
124 QString _currentWorkingDirectory; |
14709
f50591409306
Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14707
diff
changeset
|
125 static octave_link m_singleton; |
13501 | 126 }; |
127 #endif // OCTAVELINK_H |