X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fgraphics%2FGraphicsImageXPM.h;h=01b720d40b36cab4cfd1e97967b5857c39d68102;hb=f643df79a890ec4bc2eb05a3fd3d349ba3994f96;hp=c58560f4cb13f99b6e33d9eb97f7da17e9b57e36;hpb=607ad8d3a778a23013f5c5a9382e9af3cb64350d;p=lyx.git diff --git a/src/graphics/GraphicsImageXPM.h b/src/graphics/GraphicsImageXPM.h index c58560f4cb..01b720d40b 100644 --- a/src/graphics/GraphicsImageXPM.h +++ b/src/graphics/GraphicsImageXPM.h @@ -5,9 +5,9 @@ * Read the file COPYING * * \author Baruch Even - * \author Angus Leeming + * \author Angus Leeming * - * An instantiation of GImage that makes use of libXPM to load and store + * An instantiation of Image that makes use of libXPM to load and store * the image in memory. */ @@ -24,7 +24,7 @@ namespace grfx { -class GImageXPM : public GImage +class ImageXPM : public Image { public: /// Access to this class is through this static method. @@ -34,46 +34,48 @@ public: static FormatList loadableFormats(); /// - ~GImageXPM(); + ~ImageXPM(); /// Create a copy - GImage * clone() const; + Image * clone() const; /// Pixmap getPixmap() const; /// Get the image width unsigned int getWidth() const; - + /// Get the image height unsigned int getHeight() const; + bool isDrawable() const; + /** Load the image file into memory. - * In this case (GImageXPM), the process is blocking. + * In this case (ImageXPM), the process is blocking. */ - void load(string const & filename, SignalTypePtr); + void load(string const & filename); /** Generate the pixmap, based on the current state of the * xpm_image_ (clipped, rotated, scaled etc). * Uses the params to decide on color, grayscale etc. * Returns true if the pixmap is created. */ - bool setPixmap(GParams const & params); + bool setPixmap(Params const & params); /// Clip the image using params. - void clip(GParams const & params); - + void clip(Params const & params); + /// Rotate the image using params. - void rotate(GParams const & params); - + void rotate(Params const & params); + /// Scale the image using params. - void scale(GParams const & params); + void scale(Params const & params); private: /// Access to the class is through newImage() and clone. - GImageXPM(); + ImageXPM(); /// - GImageXPM(GImageXPM const &); + ImageXPM(ImageXPM const &); /** Contains the data read from file. * This class is a wrapper for a XpmImage struct, but all views @@ -82,7 +84,7 @@ private: * c_color together with g_color and m_color entries for each c_color * entry when it is first stored. */ - class Data + class Data { public: /// Default c-tor. Initialise everything to zero. @@ -113,26 +115,26 @@ private: */ XpmImage get() const; - int width() const { return width_; } - int height() const { return height_; } - int cpp() const { return cpp_; } - int ncolors() const { return ncolors_; } + unsigned int width() const { return width_; } + unsigned int height() const { return height_; } + unsigned int cpp() const { return cpp_; } + unsigned int ncolors() const { return ncolors_; } unsigned int const * data() const { return data_.get(); } XpmColor const * colorTable() const { return colorTable_.get(); } private: - int width_; - int height_; - int cpp_; - int ncolors_; + unsigned int width_; + unsigned int height_; + unsigned int cpp_; + unsigned int ncolors_; lyx::shared_c_ptr data_; lyx::shared_c_ptr colorTable_; unsigned int color_none_id() const; }; - + Data image_; /// The pixmap itself. @@ -147,7 +149,7 @@ private: /// PIXMAP_SUCCESS }; - + PixmapStatus pixmap_status_; };