src/toolsets/extprogramtoolset.h

changeset 970
c8aae45afd85
parent 969
b1742ee91d5b
child 971
c00f9665a9f8
--- a/src/toolsets/extprogramtoolset.h	Sun Aug 30 17:20:55 2015 +0300
+++ b/src/toolsets/extprogramtoolset.h	Mon Aug 31 04:57:16 2015 +0300
@@ -18,6 +18,26 @@
 
 #pragma once
 #include "toolset.h"
+#include "configurationvaluebag.h"
+
+enum ExtProgramType
+{
+	Isecalc,
+	Intersector,
+	Coverer,
+	Ytruder,
+	Rectifier,
+	Edger2,
+
+	NumExternalPrograms,
+};
+
+struct ExtProgramInfo
+{
+	QString name;
+	QString* path;
+	bool* wine;
+};
 
 class ExtProgramToolset : public Toolset
 {
@@ -30,4 +50,21 @@
 	Q_INVOKABLE void isecalc();
 	Q_INVOKABLE void rectifier();
 	Q_INVOKABLE void ytruder();
+
+private:
+	QString externalProgramName (ExtProgramType program);
+	bool programUsesWine (ExtProgramType program);
+	QString checkExtProgramPath (ExtProgramType program);
+	bool makeTempFile (QTemporaryFile& tmp, QString& fname);
+	bool runExtProgram (ExtProgramType prog, QString argvstr);
+	QString errorCodeString (ExtProgramType program, class QProcess& process);
+	void insertOutput (QString fname, bool replace, QList<LDColor> colorsToReplace);
+	void writeColorGroup (LDColor color, QString fname);
+	void writeObjects (const LDObjectList& objects, QFile& f);
+	void writeObjects (const LDObjectList& objects, QString fname);
+	void writeSelection (QString fname);
+	bool& getWineSetting (ExtProgramType program);
+	QString getPathSetting (ExtProgramType program);
+
+	ExtProgramInfo extProgramInfo[NumExternalPrograms];
 };

mercurial