2 /* This file is part of
3 * =================================================
5 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich.
7 * Copyright 1995-2000 The LyX Team.
9 * This file Copyright 2000 Baruch Even
10 * ================================================= */
15 #pragma implementation
18 #include "graphics/GraphicsCache.h"
19 #include "graphics/GraphicsCacheItem.h"
20 #include "graphics/GraphicsCacheItem_pimpl.h"
21 #include "frontends/support/LyXImage.h"
24 GraphicsCacheItem::GraphicsCacheItem()
25 : pimpl(new GraphicsCacheItem_pimpl)
31 GraphicsCacheItem::~GraphicsCacheItem()
38 GraphicsCacheItem::setFilename(string const & filename)
41 return pimpl->setFilename(filename);
45 GraphicsCacheItem::GraphicsCacheItem(GraphicsCacheItem const & gci)
52 GraphicsCacheItem::operator=(GraphicsCacheItem const & gci)
54 // Are we trying to copy the object onto itself.
61 // And then copy new object.
68 GraphicsCacheItem::Clone() const
70 return new GraphicsCacheItem(*this);
74 GraphicsCacheItem::copy(GraphicsCacheItem const & gci)
82 GraphicsCacheItem::destroy()
86 if (pimpl->refCount == 0) {
87 { // We are deleting the pimpl but we want to mark it deleted
88 // even before it is deleted.
89 GraphicsCacheItem_pimpl * temp = pimpl;
93 GraphicsCache * gc = GraphicsCache::getInstance();
94 gc->removeFile(filename_);
100 GraphicsCacheItem::ImageStatus
101 GraphicsCacheItem::getImageStatus() const { return pimpl->imageStatus_; }
105 GraphicsCacheItem::getHeight() const { return pimpl->height_; }
109 GraphicsCacheItem::getWidth() const { return pimpl->width_; }
112 GraphicsCacheItem::getImage() const { return pimpl->pixmap_; }