4 * Copyright 2002 the LyX Team
5 * Read the file COPYING
7 * \author Angus Leeming <leeming@lyx.org>
10 /* An instantiation of Image that makes use of the xforms lirary routines
11 * to load and store the image in memory.
21 #include "graphics/GraphicsImage.h"
26 typedef flimage_ FL_IMAGE;
30 class xformsImage : public Image
33 /// Access to this class is through this static method.
34 static ImagePtr newImage();
36 /// Return the list of loadable formats.
37 static FormatList loadableFormats();
43 Image * clone() const;
46 Pixmap getPixmap() const;
48 /// Get the image width
49 unsigned int getWidth() const;
51 /// Get the image height
52 unsigned int getHeight() const;
54 virtual bool isDrawable() const;
56 /** Load the image file into memory.
57 * The process is asynchronous, so this method starts the loading.
58 * When finished, the Image::finishedLoading signal is emitted.
60 void load(string const & filename);
62 /** Generate the pixmap, based on the current state of
63 * image_ (clipped, rotated, scaled etc).
64 * Uses the params to decide on color, grayscale etc.
65 * Returns true if the pixmap is created.
67 bool setPixmap(Params const & params);
69 /// Clip the image using params.
70 void clip(Params const & params);
72 /// Rotate the image using params.
73 void rotate(Params const & params);
75 /// Scale the image using params.
76 void scale(Params const & params);
78 /// Internal callbacks.
79 void statusCB(string const &);
81 void errorCB(string const &);
84 /// Access to the class is through newImage() and clone.
87 xformsImage(xformsImage const &);
89 /// The xforms container.
92 /// The pixmap itself.
95 /// Is the pixmap initialized?
105 PixmapStatus pixmap_status_;
110 #endif // XFORMSIMAGE_H