4 * Copyright 2002 the LyX Team
5 * Read the file COPYING
7 * \author Angus Leeming, a.leeming@ic.ac.uk
10 /* An instantiation of GImage that makes use of the xforms lirary routines
11 * to load and store the image in memory.
14 #ifndef XFORMS_GRAPHICSIMAGE_H
15 #define XFORMS_GRAPHICSIMAGE_H
21 #include "graphics/GraphicsImage.h"
22 #include FORMS_H_LOCATION
26 class xformsGImage : public GImage
29 /// Access to this class is through this static method.
30 static ImagePtr newImage();
32 /// Return the list of loadable formats.
33 static FormatList loadableFormats();
39 GImage * clone() const;
42 Pixmap getPixmap() const;
44 /// Get the image width
45 unsigned int getWidth() const;
47 /// Get the image height
48 unsigned int getHeight() const;
50 /** Load the image file into memory.
51 * The process is asynchronous, so this method starts the loading
52 * and saves the signal. It is emitted once loading is finished.
54 void load(string const & filename, SignalTypePtr);
56 /** Generate the pixmap, based on the current state of
57 * image_ (clipped, rotated, scaled etc).
58 * Uses the params to decide on color, grayscale etc.
59 * Returns true if the pixmap is created.
61 bool setPixmap(GParams const & params);
63 /// Clip the image using params.
64 void clip(GParams const & params);
66 /// Rotate the image using params.
67 void rotate(GParams const & params);
69 /// Scale the image using params.
70 void scale(GParams const & params);
72 /// Internal callbacks.
73 void statusCB(string const &);
75 void errorCB(string const &);
78 /// Access to the class is through newImage() and clone.
81 xformsGImage(xformsGImage const &);
83 /// The xforms container.
86 /// The pixmap itself.
89 /// Is the pixmap initialized?
99 PixmapStatus pixmap_status_;
101 /// Emit this signal when the loading process is finished.
102 GImage::SignalTypePtr on_finish_;
107 #endif // XFORMS_GRAPHICSIMAGE_H