]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/PreviewImage.C
* src/LaTeX.C
[lyx.git] / src / graphics / PreviewImage.C
index 72777140cf87e0590d44fbca2c69e3f0950313fe..050ca62de8694efddff57a0096829c00081e374b 100644 (file)
@@ -1,39 +1,43 @@
 /**
- *  \file PreviewImage.C
- *  Read the file COPYING
+ * \file PreviewImage.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author Angus Leeming 
+ * \author Angus Leeming
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 #include "PreviewImage.h"
-#include "PreviewLoader.h"
 #include "GraphicsImage.h"
 #include "GraphicsLoader.h"
+#include "PreviewLoader.h"
 
+#include "support/filename.h"
 #include "support/lyxlib.h"
 
 #include <boost/bind.hpp>
-#include <boost/signals/trackable.hpp>
 
+using std::string;
+
+
+namespace lyx {
+
+using support::FileName;
 
-namespace grfx {
+namespace graphics {
 
-struct PreviewImage::Impl : public boost::signals::trackable {
+class PreviewImage::Impl : public boost::signals::trackable {
+public:
        ///
        Impl(PreviewImage & p, PreviewLoader & l,
-            string const & s, string const & f, double af);
+            string const & s, FileName const & f, double af);
        ///
        ~Impl();
        ///
-       Image const * image(Inset const &, BufferView const &);
+       Image const * image();
        ///
        void statusChanged();
 
@@ -52,7 +56,7 @@ struct PreviewImage::Impl : public boost::signals::trackable {
 
 PreviewImage::PreviewImage(PreviewLoader & l,
                           string const & s,
-                          string const & f,
+                          FileName const & f,
                           double af)
        : pimpl_(new Impl(*this, l, s, f, af))
 {}
@@ -96,16 +100,15 @@ int PreviewImage::width() const
 }
 
 
-Image const * PreviewImage::image(Inset const & inset,
-                                 BufferView const & bv) const
+Image const * PreviewImage::image() const
 {
-       return pimpl_->image(inset, bv);
+       return pimpl_->image();
 }
 
 
 PreviewImage::Impl::Impl(PreviewImage & p, PreviewLoader & l,
                         string const & s,
-                        string const & bf,
+                        FileName const & bf,
                         double af)
        : parent_(p), ploader_(l), iloader_(bf),
          snippet_(s), ascent_frac_(af)
@@ -116,15 +119,14 @@ PreviewImage::Impl::Impl(PreviewImage & p, PreviewLoader & l,
 
 PreviewImage::Impl::~Impl()
 {
-       lyx::unlink(iloader_.filename());
+       support::unlink(iloader_.filename());
 }
 
 
-Image const * PreviewImage::Impl::image(Inset const & inset,
-                                       BufferView const & bv)
+Image const * PreviewImage::Impl::image()
 {
        if (iloader_.status() == WaitingToLoad)
-               iloader_.startLoading(inset, bv);
+               iloader_.startLoading();
 
        return iloader_.image();
 }
@@ -150,10 +152,11 @@ void PreviewImage::Impl::statusChanged()
                break;
 
        case Ready:
-               lyx::unlink(iloader_.filename());
-               ploader_.emitSignal(parent_);
+               support::unlink(iloader_.filename());
                break;
        }
+       ploader_.emitSignal(parent_);
 }
 
-} // namespace grfx
+} // namespace graphics
+} // namespace lyx