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 * ================================================= */
12 #ifndef GRAPHICSCACHEITEM_H
13 #define GRAPHICSCACHEITEM_H
21 #include XPM_H_LOCATION
24 #include <boost/utility.hpp>
25 #include <boost/smart_ptr.hpp>
27 #include "sigc++/signal_system.h"
28 #ifdef SIGC_CXX_NAMESPACES
35 /// A GraphicsCache item holder.
36 class GraphicsCacheItem : public noncopyable {
39 GraphicsCacheItem(string const & filename);
40 /// d-tor, frees the image structures.
43 /// Return a pixmap that can be displayed on X server.
44 LyXImage * getImage() const;
59 /// Is the pixmap ready for display?
60 ImageStatus getImageStatus() const;
62 /** Get a notification when the image conversion is done.
63 used by an internal callback mechanism.
65 void imageConverted(int retval);
68 bool renderXPM(string const & filename);
71 /** The filename we refer too.
72 This is used when removing ourselves from the cache.
75 /// The temporary file that we use
78 ImageStatus imageStatus_;
79 /// The image (if it got loaded)
80 boost::scoped_ptr<LyXImage> image_;