#include "support/forkedcontr.h"
#include "support/lstrings.h"
#include "support/lyxlib.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include <boost/bind.hpp>
/// Store info on a currently executing, forked process.
-struct InProgress {
+class InProgress {
+public:
///
InProgress() : pid(0) {}
///
namespace lyx {
namespace graphics {
-struct PreviewLoader::Impl : public boost::signals::trackable {
+class PreviewLoader::Impl : public boost::signals::trackable {
+public:
///
Impl(PreviewLoader & p, Buffer const & b);
/// Stop any InProgress items still executing.
namespace {
-struct IncrementedFileName {
+class IncrementedFileName {
+public:
IncrementedFileName(string const & to_format,
string const & filename_base)
: to_format_(to_format), base_(filename_base), counter_(1)
: parent_(p), buffer_(b), font_scaling_factor_(0.0)
{
font_scaling_factor_ = 0.01 * lyxrc.dpi * lyxrc.zoom *
- lyxrc.preview_scale_factor;
+ convert<double>(lyxrc.preview_scale_factor);
lyxerr[Debug::GRAPHICS] << "The font scaling factor is "
<< font_scaling_factor_ << endl;
namespace {
-struct EraseSnippet {
+class EraseSnippet {
+public:
EraseSnippet(string const & s) : snippet_(s) {}
void operator()(InProgressProcess & process)
{
// The conversion command.
ostringstream cs;
cs << pconverter_->command << ' ' << pconverter_->to << ' '
- << latexfile << ' ' << int(font_scaling_factor_) << ' '
+ << support::quoteName(latexfile) << ' '
+ << int(font_scaling_factor_) << ' '
<< lyx_gui::hexname(LColor::preview) << ' '
<< lyx_gui::hexname(LColor::background);
- string const command = support::LibScriptSearch(cs.str());
+ string const command = support::libScriptSearch(cs.str());
// Initiate the conversion from LaTeX to bitmap images files.
support::Forkedcall::SignalTypePtr
runparams.nice = true;
runparams.moving_arg = true;
runparams.free_spacing = true;
- tmp.makeLaTeXFile(os, buffer_.filePath(), runparams, true, false);
+ tmp.writeLaTeXSource(os, buffer_.filePath(), runparams, true, false);
// FIXME! This is a HACK! The proper fix is to control the 'true'
// passed to WriteStream below:
string const unique_filename(string const bufferpath)
{
static int theCounter = 0;
- string const filename = tostr(theCounter++) + "lyxpreview";
- return support::AddName(bufferpath, filename);
+ string const filename = convert<string>(theCounter++) + "lyxpreview";
+ return support::addName(bufferpath, filename);
}