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
24 #include FLIMAGE_H_LOCATION
29 class xformsGImage : public GImage
32 /// Access to this class is through this static method.
33 static ImagePtr newImage();
35 /// Return the list of loadable formats.
36 static FormatList loadableFormats();
42 GImage * clone() const;
45 Pixmap getPixmap() const;
47 /// Get the image width
48 unsigned int getWidth() const;
50 /// Get the image height
51 unsigned int getHeight() const;
53 /** Load the image file into memory.
54 * The process is asynchronous, so this method starts the loading
55 * and saves the signal. It is emitted once loading is finished.
57 void load(string const & filename, SignalTypePtr);
59 /** Generate the pixmap, based on the current state of
60 * image_ (clipped, rotated, scaled etc).
61 * Uses the params to decide on color, grayscale etc.
62 * Returns true if the pixmap is created.
64 bool setPixmap(GParams const & params);
66 /// Clip the image using params.
67 void clip(GParams const & params);
69 /// Rotate the image using params.
70 void rotate(GParams const & params);
72 /// Scale the image using params.
73 void scale(GParams const & params);
75 /// Internal callbacks.
76 void statusCB(string const &);
78 void errorCB(string const &);
81 /// Access to the class is through newImage() and clone.
84 xformsGImage(xformsGImage const &);
86 /// The xforms container.
89 /// The pixmap itself.
92 /// Is the pixmap initialized?
102 PixmapStatus pixmap_status_;
104 /// Emit this signal when the loading process is finished.
105 GImage::SignalTypePtr on_finish_;
110 #endif // XFORMS_GRAPHICSIMAGE_H