- /** Sets the status of the loading process. Also notifies
- * listeners that the status has chacnged.
- */
- void setStatus(ImageStatus new_status);
-
- /// The filename we refer too.
- string filename_;
- /// Is the file compressed?
- bool zipped_;
- /// If so, store the uncompressed file in this temporary file.
- string unzipped_filename_;
- /// What file are we trying to load?
- string file_to_load_;
- /** Should we delete the file after loading? True if the file is
- * the result of a conversion process.
- */
- bool remove_loaded_file_;
-
- /// The original, unmodified image and its loading status.
- ImagePtr image_;
- ///
- ImageStatus status_;
-
- /** A SignalLoadTypePtr is connected to this->imageLoaded and
- * then passed to ImagePtr::load.
- * When the image has been loaded, the signal is emitted.
- *
- * We pass a shared_ptr because it is eminently possible for the
- * ModifiedItem to be destructed before the loading is complete and
- * the signal must remain in scope. It doesn't matter if the slot
- * disappears, SigC takes care of that.
- */
- typedef boost::signal1<void, bool> SignalLoadType;
- ///
- typedef boost::shared_ptr<SignalLoadType> SignalLoadTypePtr;
-
- /// The connection of the signal passed to ImagePtr::loadImage.
- boost::signals::connection cl_;
-
- /** A SignalConvertTypePtr is connected to this->imageConverted and
- * then passed to GConverter::convert.
- * When the image has been converted to a loadable format, the signal
- * is emitted, returning the name of the loadable file to
- * imageConverted.
- */
- typedef boost::signal1<void, string const &> SignalConvertType;
- ///
- typedef boost::shared_ptr<SignalConvertType> SignalConvertTypePtr;
-
- /// The connection of the signal passed to GConverter::convert.
- boost::signals::connection cc_;
-
- /// The list of all modified images.
- typedef std::list<ModifiedItemPtr> ListType;
- ///
- ListType modified_images;
-};
-
-
-///
-class ModifiedItem {
-public:
- ///
- ModifiedItem(InsetGraphics const &, GParams const &, ImagePtr const &);
-
- ///
- GParams const & params() { return *p_.get(); }
-
- /// Add inset to the list of insets.
- void add(InsetGraphics const & inset);
-
- /// Remove inset from the list of insets.
- void remove(InsetGraphics const & inset);
-
- ///
- bool empty() const { return insets.empty(); }
-
- /// Is this ModifiedItem referenced by inset?
- bool referencedBy(InsetGraphics const & inset) const;
-
- ///
- ImagePtr const image() const;
-
- /// How far have we got in loading the modified image?
- ImageStatus status() const { return status_; }
-
- /** Called from GCacheItem once the raw image is loaded.
- * Modifies the image in accord with p_.
- */
- void modify(ImagePtr const &);
-
- /// Updates the pixmap.
- void setPixmap();
-
- /** changeDisplay returns a full ModifiedItemPtr if any of the
- * insets have display=DEFAULT and if that DEFAULT value has
- * changed.
- * If this occurs, then this has these insets removed.