4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
9 * Full author contact details are available in file CREDITS
12 /* An instantiation of Image that makes use of the xforms lirary routines
13 * to load and store the image in memory.
23 #include "graphics/GraphicsImage.h"
28 typedef flimage_ FL_IMAGE;
32 class xformsImage : public Image
35 /// Access to this class is through this static method.
36 static ImagePtr newImage();
38 /// Return the list of loadable formats.
39 static FormatList loadableFormats();
45 Image * clone() const;
48 Pixmap getPixmap() const;
50 /// Get the image width
51 unsigned int getWidth() const;
53 /// Get the image height
54 unsigned int getHeight() const;
56 virtual bool isDrawable() const;
58 /** Load the image file into memory.
59 * The process is asynchronous, so this method starts the loading.
60 * When finished, the Image::finishedLoading signal is emitted.
62 void load(string const & filename);
64 /** Generate the pixmap, based on the current state of
65 * image_ (clipped, rotated, scaled etc).
66 * Uses the params to decide on color, grayscale etc.
67 * Returns true if the pixmap is created.
69 bool setPixmap(Params const & params);
71 /// Clip the image using params.
72 void clip(Params const & params);
74 /// Rotate the image using params.
75 void rotate(Params const & params);
77 /// Scale the image using params.
78 void scale(Params const & params);
80 /// Internal callbacks.
81 void statusCB(string const &);
83 void errorCB(string const &);
86 /// Access to the class is through newImage() and clone.
89 xformsImage(xformsImage const &);
91 /// The xforms container.
94 /// The pixmap itself.
97 /// Is the pixmap initialized?
100 PIXMAP_UNINITIALISED,
107 PixmapStatus pixmap_status_;
112 #endif // XFORMSIMAGE_H