#include "support/filetools.h"
#include "support/lstrings.h"
#include "support/Package.h"
-#include "support/Path.h"
+#include "support/PathChanger.h"
+#include "support/Translator.h"
#include <ostream>
// We have to have dummy default commands for security reasons!
Template::Template()
- : inputFormat("*")
+ : inputFormat("*"), automaticProduction(false), preview_mode(PREVIEW_OFF)
{}
<< "\tHelpTextEnd\n"
<< "\tInputFormat " << et.inputFormat << '\n'
<< "\tFileFilter " << et.fileRegExp << '\n'
- << "\tAutomaticProduction " << et.automaticProduction << '\n';
-
+ << "\tAutomaticProduction " << et.automaticProduction << '\n'
+ << "\tPreview ";
+ switch (et.preview_mode) {
+ case PREVIEW_OFF:
+ os_ << "Off\n";
+ break;
+ case PREVIEW_GRAPHICS:
+ os_ << "Graphics\n";
+ break;
+ case PREVIEW_INSTANT:
+ os_ << "InstantPreview\n";
+ break;
+ }
typedef vector<TransformID> IDs;
IDs::const_iterator it = et.transformIds.begin();
IDs::const_iterator end = et.transformIds.end();
TO_INPUTFORMAT,
TO_FILTER,
TO_AUTOMATIC,
+ TO_PREVIEW,
TO_TRANSFORM,
TO_FORMAT,
TO_END
{ "guiname", TO_GUINAME },
{ "helptext", TO_HELPTEXT },
{ "inputformat", TO_INPUTFORMAT },
+ { "preview", TO_PREVIEW },
{ "templateend", TO_END },
{ "transform", TO_TRANSFORM }
};
automaticProduction = lex.getBool();
break;
+ case TO_PREVIEW:
+ lex >> token;
+ if (token == "InstantPreview")
+ preview_mode = PREVIEW_INSTANT;
+ else if (token == "Graphics")
+ preview_mode = PREVIEW_GRAPHICS;
+ else
+ preview_mode = PREVIEW_OFF;
+ break;
+
case TO_TRANSFORM: {
lex >> token;
TransformID id = transformIDTranslator().find(token);
case TO_END:
return;
-
- default:
- lex.printError("external::Template::readTemplate: "
- "Wrong tag: $$Token");
- BOOST_ASSERT(false);
- break;
}
}
}