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"
22 GraphicsCacheItem::GraphicsCacheItem()
23 : pimpl(new GraphicsCacheItem_pimpl)
28 GraphicsCacheItem::~GraphicsCacheItem()
34 GraphicsCacheItem::setFilename(string const & filename)
37 return pimpl->setFilename(filename);
40 GraphicsCacheItem::GraphicsCacheItem(GraphicsCacheItem const & gci)
46 GraphicsCacheItem const &
47 GraphicsCacheItem::operator=(GraphicsCacheItem const & gci)
49 // Are we trying to copy the object onto itself.
56 // And then copy new object.
63 GraphicsCacheItem::copy(GraphicsCacheItem const & gci)
70 GraphicsCacheItem::destroy()
74 if (pimpl->refCount == 0) {
76 GraphicsCache * gc = GraphicsCache::getInstance();
77 gc->removeFile(filename_);
82 GraphicsCacheItem::ImageStatus
83 GraphicsCacheItem::getImageStatus() const { return pimpl->imageStatus_; }
86 GraphicsCacheItem::getHeight() const { return pimpl->height_; }
89 GraphicsCacheItem::getWidth() const { return pimpl->width_; }
92 GraphicsCacheItem::getImage() const { return pimpl->pixmap_; }