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 "sigc++/signal_system.h"
25 #ifdef SIGC_CXX_NAMESPACES
30 /* (Baruch Even 2000-08-05)
31 * This has a major drawback: it is only designed for X servers, no easy
32 * porting to non X-server based platform is offered right now, this is done
33 * in order to get a first version out of the door.
35 * Later versions should consider how to do this with more platform
36 * independence, this will probably involve changing the Painter class too.
39 class GraphicsCacheItem_pimpl;
42 /// A GraphicsCache item holder.
43 class GraphicsCacheItem {
45 /// d-tor, frees the image structures.
48 GraphicsCacheItem(GraphicsCacheItem const &);
49 /// Assignment operator.
50 GraphicsCacheItem & operator=(GraphicsCacheItem const &);
52 /// Get the height of the image. Returns -1 on error.
53 int getHeight() const;
55 /// Get the width of the image. Returns -1 on error.
58 /// Return a pixmap that can be displayed on X server.
59 LyXImage * getImage() const;
74 /// Is the pixmap ready for display?
75 ImageStatus getImageStatus() const;
77 /** Get a notification when the image conversion is done.
78 used by an internal callback mechanism.
80 void imageConverted(int retval);
82 /// Create another copy of the object.
83 GraphicsCacheItem * Clone() const;
86 /// Private c-tor so that only GraphicsCache can create an instance.
89 /// internal copy mechanism.
90 void copy(GraphicsCacheItem const &);
91 /// internal destroy mechanism.
94 /// Set the filename this item will be pointing too.
95 bool setFilename(string const & filename);
98 friend class GraphicsCache;
101 GraphicsCacheItem_pimpl * pimpl;
103 /** The filename we refer too.
104 This is used when removing ourselves from the cache.