extprogs.h

Mon, 06 May 2013 03:31:03 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Mon, 06 May 2013 03:31:03 +0300
changeset 165
88a03c1a52d9
child 166
72ec7b60da54
permissions
-rw-r--r--

Begin work on external program support (Ytruder partially supported)

165
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
1 #ifndef EXTPROGS_H
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
2 #define EXTPROGS_H
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
3
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
4 #include <qobject.h>
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
5
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
6 class QProcess;
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
7 class ProcessWaiter : public QObject {
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
8 Q_OBJECT
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
9
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
10 public:
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
11 ProcessWaiter (QProcess* proc, bool& readyvar) : m_proc (proc), m_readyvar (readyvar) {
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
12 m_readyvar = false;
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
13 }
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
14
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
15 int exitFlag () { return m_exitflag; }
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
16
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
17 public slots:
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
18 void slot_procDone (int exitflag) {
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
19 m_readyvar = true;
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
20 m_exitflag = exitflag;
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
21 }
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
22
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
23 private:
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
24 QProcess* m_proc;
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
25 bool& m_readyvar;
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
26 int m_exitflag;
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
27 };
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
28
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
29 enum extprog {
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
30 IseCalc,
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
31 Intersector,
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
32 Coverer,
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
33 Ytruder,
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
34 DATHeader
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
35 };
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
36
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
37 void runYtruder ();
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
38
88a03c1a52d9 Begin work on external program support (Ytruder partially supported)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
39 #endif // EXTPROGS_H

mercurial