X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fgraphics%2FGraphicsCacheItem.C;h=a92f0812b25f8e77422216ccad16d920f56a3464;hb=45a03f4f67bb00f8142e465c615f348f0622eb32;hp=2cea9589ad0e6f2cde7e0942de65e0caf492e6ed;hpb=c00fe603385b4275c039c9bb35c2b241db93d021;p=lyx.git diff --git a/src/graphics/GraphicsCacheItem.C b/src/graphics/GraphicsCacheItem.C index 2cea9589ad..a92f0812b2 100644 --- a/src/graphics/GraphicsCacheItem.C +++ b/src/graphics/GraphicsCacheItem.C @@ -19,17 +19,20 @@ #include "graphics/GraphicsCacheItem.h" #include "graphics/GraphicsCacheItem_pimpl.h" + GraphicsCacheItem::GraphicsCacheItem() : pimpl(new GraphicsCacheItem_pimpl) { pimpl->refCount = 1; } + GraphicsCacheItem::~GraphicsCacheItem() { destroy(); } + bool GraphicsCacheItem::setFilename(string const & filename) { @@ -37,20 +40,21 @@ GraphicsCacheItem::setFilename(string const & filename) return pimpl->setFilename(filename); } + GraphicsCacheItem::GraphicsCacheItem(GraphicsCacheItem const & gci) { pimpl = 0; copy(gci); } -GraphicsCacheItem const & +GraphicsCacheItem & GraphicsCacheItem::operator=(GraphicsCacheItem const & gci) { // Are we trying to copy the object onto itself. if (this == &gci) return *this; - // Destory old copy + // Destroy old copy destroy(); // And then copy new object. @@ -59,6 +63,7 @@ GraphicsCacheItem::operator=(GraphicsCacheItem const & gci) return *this; } + void GraphicsCacheItem::copy(GraphicsCacheItem const & gci) { @@ -66,6 +71,7 @@ GraphicsCacheItem::copy(GraphicsCacheItem const & gci) ++(pimpl->refCount); } + void GraphicsCacheItem::destroy() { @@ -79,14 +85,18 @@ GraphicsCacheItem::destroy() } } + GraphicsCacheItem::ImageStatus GraphicsCacheItem::getImageStatus() const { return pimpl->imageStatus_; } + int GraphicsCacheItem::getHeight() const { return pimpl->height_; } - + + int GraphicsCacheItem::getWidth() const { return pimpl->width_; } + Pixmap GraphicsCacheItem::getImage() const { return pimpl->pixmap_; }