Mercurial > hg > svgui
diff layer/ImageLayer.h @ 305:013a37723c0a
* Add support for remote files to image layer
author | Chris Cannam |
---|---|
date | Fri, 05 Oct 2007 15:52:52 +0000 |
parents | 4b7e8da8f069 |
children | 6de6f78b13a1 |
line wrap: on
line diff
--- a/layer/ImageLayer.h Fri Oct 05 13:27:21 2007 +0000 +++ b/layer/ImageLayer.h Fri Oct 05 15:52:52 2007 +0000 @@ -22,11 +22,13 @@ #include <QObject> #include <QColor> #include <QImage> +#include <QMutex> #include <map> class View; class QPainter; +class RemoteFile; class ImageLayer : public Layer { @@ -34,6 +36,7 @@ public: ImageLayer(); + virtual ~ImageLayer(); virtual void paint(View *v, QPainter &paint, QRect rect) const; @@ -93,6 +96,10 @@ void setProperties(const QXmlAttributes &attributes); +protected slots: + void checkAddRemotes(); + void remoteFileReady(); + protected: ImageModel::PointList getLocalPoints(View *v, int x, int y) const; @@ -106,11 +113,15 @@ typedef std::map<QString, QImage> ImageMap; typedef std::map<const View *, ImageMap> ViewImageMap; - - + typedef std::map<QString, RemoteFile *> RemoteFileMap; static ImageMap m_images; + static QMutex m_imageMapMutex; mutable ViewImageMap m_scaled; + mutable RemoteFileMap m_remoteFiles; + + QString getLocalFilename(QString img) const; + void checkAddRemote(QString img) const; ImageModel *m_model; bool m_editing;