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_PIMPL_H
13 #define GRAPHICSCACHEITEM_PIMPL_H
21 #include "graphics/GraphicsCacheItem.h"
23 #include XPM_H_LOCATION
25 #include "graphics/ImageLoader.h"
26 #include "support/syscall.h"
28 #include "sigc++/signal_system.h"
29 #ifdef SIGC_CXX_NAMESPACES
35 /// A GraphicsCache item holder.
36 class GraphicsCacheItem_pimpl {
38 /// d-tor, frees the image structures.
39 ~GraphicsCacheItem_pimpl();
41 /// Return a pixmap that can be displayed on X server.
42 LyXImage * getImage() const { return image_; };
44 typedef GraphicsCacheItem::ImageStatus ImageStatus;
46 /// Is the pixmap ready for display?
47 ImageStatus getImageStatus() const;
49 /** Get a notification when the image conversion is done.
50 used by an internal callback mechanism. */
51 void imageConverted(int retval);
54 /// Private c-tor so that only GraphicsCache can create an instance.
55 GraphicsCacheItem_pimpl();
57 /// Set the filename this item will be pointing too.
58 bool setFilename(string const & filename);
60 /// Create an XPM file version of the image.
61 bool renderXPM(string const & filename);
63 /// Load the image from XPM to memory Pixmap
67 friend class GraphicsCacheItem;
69 /// The file name of the XPM file.
71 /// Is the pixmap loaded?
72 ImageStatus imageStatus_;
75 /// The rendering object.
76 ImageLoader * imageLoader;
78 /// The system caller, runs the convertor.
81 /// The reference count