X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fgraphics%2FGraphicsLoader.h;h=1fa51d3ee8312c5e5182fc77747cc0cbaccb571a;hb=e0e548217eb7b3c8728a1af17aa42be496b91281;hp=145c0e585881af1db0d5f64a7816d3517d58ccd8;hpb=8e6e970d7ba017dba14bdb821f4c4489665d947c;p=lyx.git diff --git a/src/graphics/GraphicsLoader.h b/src/graphics/GraphicsLoader.h index 145c0e5858..1fa51d3ee8 100644 --- a/src/graphics/GraphicsLoader.h +++ b/src/graphics/GraphicsLoader.h @@ -26,8 +26,7 @@ #include "GraphicsTypes.h" -#include -#include +#include "support/signals.h" namespace lyx { @@ -41,22 +40,22 @@ class Params; class Loader { public: /// Must use the reset methods to make this instance usable. - Loader(); + Loader(support::FileName const & doc_file); /// The image is not transformed, just displayed as-is. - Loader(support::FileName const & file_with_path, DisplayType = ColorDisplay); + Loader(support::FileName const & doc_file, support::FileName const & file_with_path, bool display = true); /// The image is transformed before display. - Loader(support::FileName const & file_with_path, Params const &); + Loader(support::FileName const & doc_file, support::FileName const & file_with_path, Params const &); /// - Loader(Loader const &); - - /// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy. + Loader(support::FileName const & doc_file, Loader const &); + /// + Loader(Loader const & other); + /// Needed for the pimpl ~Loader(); Loader & operator=(Loader const &); /// The file can be changed, or the display params, or both. - void reset(support::FileName const & file_with_path, - DisplayType = ColorDisplay) const; + void reset(support::FileName const & file_with_path, bool display = true) const; /// void reset(support::FileName const & file_with_path, Params const &) const; /// @@ -71,6 +70,10 @@ public: */ void startLoading() const; + /** Tries to reload the image. + */ + void reload() const; + /** Monitor any changes to the file. * There is no point monitoring the file before startLoading() is * invoked. @@ -78,11 +81,8 @@ public: void startMonitoring() const; /// bool monitoring() const; - /** Returns the check sum of filename() so that, for example, you can - * ascertain whether to output a new PostScript version of the file - * for a LaTeX run. - */ - unsigned long checksum() const; + /// + void checkModifiedAsync() const; /// How far have we got in loading the image? ImageStatus status() const; @@ -90,21 +90,24 @@ public: /** Connect and you'll be informed when the loading status of the image * changes. */ - typedef boost::signal sig_type; - typedef sig_type::slot_type slot_type; + typedef signal sig; + typedef sig::slot_type slot; /// - boost::signals::connection connect(slot_type const &) const; + connection connect(slot const &) const; /** The loaded image with Pixmap set. * If the Pixmap is not yet set (see status() for why...), returns 0. */ Image const * image() const; + double displayPixelRatio() const; + void setDisplayPixelRatio(double scale); + private: /// Use the Pimpl idiom to hide the internals. class Impl; /// The pointer never changes although *pimpl_'s contents may. - boost::scoped_ptr const pimpl_; + Impl * pimpl_; }; } // namespace graphics