1 /**************************************************************
3 Copyright (C) 1997 Oskar Swida
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 NOTE: This software is using the free software license of
23 the QT library v.1.30 from Troll Tech AS.
24 See the file LICENSE.QT.
27 To contact the author, write:
28 e-mail: swida@aragorn.pb.bialystok.pl
30 ************************************************************/
35 #include <QtGui/QMainWindow>
36 #include <QtGui/QListWidget>
37 #include <QtGui/QTextEdit>
38 #include <QtCore/QSocketNotifier>
39 #include <QtCore/QDir>
43 #include "ui/kernelwindow.h"
48 #define REMOTE_PATH "REMOTE"
50 #define MAXINSTANCES 256
63 /** Interpreter identifier */
65 /** Defines if interpreter is remote or not */
73 QSocketNotifier *notify;
74 /* IDs of my remote INT modules */
75 int RInstances[MAXINSTANCES];
76 /* Parent interpreter info */
87 ConnectEntry(char *s) {
91 ConnectEntry(const char *s) {
100 class QKernel : public QMainWindow, private Ui::KernelWindow {
108 QKernel(int argc, char **argv);
110 void WriteMessage(const char * msg);
114 void IntMessage(int);
117 virtual void closeEvent (QCloseEvent * e);
120 QList<InterpEntry*> Interpreters;
121 QList<ConnectEntry*> ConnectList;
124 * number of working interpreters
125 * @attention Currently not in use
130 * number of connected VLPs
132 int ActiveConnections;
134 * Indicates state of the Kernel Program. Is it locked or not.
143 QSocketNotifier *Net_Notify;
148 void loadConfig(const QString &fname);
149 void loadConfig(const char *);
151 void RunGraphModule(char*);
153 InterpEntry *findINTbySocket(int);
154 InterpEntry *findINTbyID(int);
155 InterpEntry *RunIntModule(char *ss, int r);
156 void RemoteInstance(InterpEntry*, int);
157 void CloseInstances(InterpEntry*);
160 * Sets QKernel menu entries to the given status
161 * @param locked status which will be set on the menu entries.
163 void setLocked(bool locked);
165 QString getConfigFilePath();
166 const char * getHomeDir();
167 const char * getRemoteDir();
169 const char * getNetModuleSocket();
170 const char * getGraphModuleSocket();
173 void on_actionExecute_triggered();
174 void on_actionKill_triggered();
175 void on_actionQuit_triggered();
177 void on_actionMessage_triggered();
178 void on_actionConnect_triggered();
179 void on_actionDisconnect_triggered();
180 void on_actionInfo_triggered();
182 void on_actionEditor_triggered();
183 void on_actionHelp_triggered();
184 void on_actionOptions_triggered();
185 void on_actionInfo_messages_triggered();
186 void on_actionLock_console_triggered();
187 void on_actionUnlock_console_triggered();
190 #endif /* VLP_KERNEL_H */