ostringstream os;
WriteStream wi(os, false, false);
par_->write(wi);
- if (preview(os.str(), preview_) && preview_.get()) {
+ if (preview(os.str(), preview_)) {
cerr << "image could be drawn\n";
- // LyX crashes if we try that. Why? Andre'
- //pi.pain.image(x, y, w, h, *(preview_->image()));
+ pi.pain.image(x + 40, y, 50, 50, *(preview_->image()));
}
#endif
#include "graphics/GraphicsTypes.h"
#include "graphics/GraphicsImage.h"
#include "graphics/GraphicsCache.h"
+#include "graphics/GraphicsImage.h"
+#include "graphics/GraphicsParams.h"
#include "graphics/GraphicsCacheItem.h"
#include "Lsstream.h"
{
string base = canonical_name(str);
string dir = "/tmp/lyx/";
- string file = dir + base + ".ps";
+ string file = dir + base + ".eps";
cerr << "writing '" << str << "' to '" << file << "'\n";
// get the cache
// is it already loaded?
if (gr->status() == grfx::Loaded) {
cerr << "file '" << file << "' ready for display\n";
- cerr << "im: " << graphic.get() << " " << gr.get() << "\n";
graphic = gr;
- return true;
+ return graphic->image()->setPixmap(grfx::GParams());
}
// otherwise we have to wait again
of.close();
string const cmd =
- "latex " + base + ".tex ; dvips -o " + base + ".ps " + base + ".dvi ";
+ "latex " + base + ".tex ; dvips -E -o " + base + ".eps " + base + ".dvi ";
//cerr << "calling: '" << "(cd " + dir + "; " + cmd + ")\n";
Systemcall sc;
sc.startscript(Systemcall::Wait, "(cd " + dir + "; " + cmd + ")");