• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

gr_UnixImage.h

Go to the documentation of this file.
00001 /* AbiWord
00002  * Copyright (C) 2001-2002 Dom Lachowicz
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017  * 02110-1301 USA.
00018  */
00019 
00020 #ifndef GR_UNIXGNOMEIMAGE_H
00021 #define GR_UNIXGNOMEIMAGE_H
00022 
00023 #include "ut_compiler.h"
00024 
00025 ABI_W_NO_CONST_QUAL
00026 #include <gdk-pixbuf/gdk-pixbuf.h>
00027 ABI_W_POP
00028 
00029 #include "gr_CairoGraphics.h"
00030 
00031 class ABI_EXPORT GR_UnixImage : public GR_CairoRasterImage
00032 {
00033 public:
00034     GR_UnixImage(const char* pszName);
00035     GR_UnixImage(const char* pszName, GdkPixbuf * pPixbif);
00036     GR_UnixImage(const char* pszName, GRType imageType);
00037     virtual ~GR_UnixImage();
00038 
00039     virtual bool        convertToBuffer(UT_ConstByteBufPtr & ppBB) const;
00040     virtual bool        convertFromBuffer(const UT_ConstByteBufPtr& pBB,
00041                                           const std::string & mimetype,
00042                                           UT_sint32 iDisplayWidth,
00043                                           UT_sint32 iDisplayHeight);
00044     bool                saveToPNG(const char * szFile);
00045     virtual bool hasAlpha (void) const;
00046     virtual UT_sint32  rowStride (void) const;
00047     virtual GR_Image::GRType getType(void) const;
00048     GdkPixbuf *         getData(void) const { return m_image; }
00049     void setData(GdkPixbuf *data)
00050     { m_image = data;}
00051     virtual void        scaleImageTo(GR_Graphics * pG, const UT_Rect & rec);
00052     virtual bool isTransparentAt(UT_sint32 x, UT_sint32 y);
00053     void scale (UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight);
00054     virtual void cairoSetSource(cairo_t *);
00055 protected:
00056     virtual GR_UnixImage *makeSubimage(const std::string & n,
00057                                               UT_sint32 x, UT_sint32 y,
00058                                               UT_sint32 w, UT_sint32 h) const;
00059 private:
00060     GdkPixbuf * m_image;
00061     GR_Image::GRType m_ImageType;
00062 };
00063 
00064 #endif /* GR_UNIXGNOMEIMAGE_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1