]> git.lyx.org Git - features.git/blob - src/support/Systemcall.cpp
add progress view of system calls
[features.git] / src / support / Systemcall.cpp
1 /**
2  * \file Systemcall.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Asger Alstrup
7  * \author Peter Kümmel
8  *
9  * Interface cleaned up by
10  * \author Angus Leeming
11  *
12  * Full author contact details are available in file CREDITS.
13  */
14
15 #include <config.h>
16
17 #include "support/Systemcall.h"
18 #include "support/SystemcallPrivate.h"
19 #include "support/ProgressInterface.h"
20
21 namespace lyx {
22 namespace support {
23
24 static ProgressInterface* progress_impl = 0;
25
26
27 void Systemcall::registerProgressInterface(ProgressInterface* p)
28 {
29         progress_impl = p;
30 }
31
32
33 ProgressInterface* Systemcall::progress()
34 {
35         return progress_impl;
36 }
37
38
39 int Systemcall::startscript(Starttype how, std::string const & what)
40 {
41         // TODO Reuse of instance?
42         SystemcallPrivate* process = new SystemcallPrivate;
43         if (how == Wait)
44                 return process->start(what, true);
45         return process->start(what, false);
46 }
47
48
49 } // namespace support
50 } // namespace lyx