• 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., 59 Temple Place - Suite 330, Boston, MA  
00017  * 02111-1307, USA.
00018  */
00019 
00020 #ifndef GR_UNIXGNOMEIMAGE_H
00021 #define GR_UNIXGNOMEIMAGE_H
00022 
00023 #include <gdk-pixbuf/gdk-pixbuf.h>
00024 
00025 #include "gr_CairoGraphics.h"
00026 
00027 class ABI_EXPORT GR_UnixImage : public GR_CairoRasterImage
00028 {
00029 public:
00030     GR_UnixImage(const char* pszName);
00031     GR_UnixImage(const char* pszName, GdkPixbuf * pPixbif);
00032     GR_UnixImage(const char* pszName, GRType imageType);
00033     virtual ~GR_UnixImage();
00034 
00035     virtual bool        convertToBuffer(UT_ByteBuf** ppBB) const;
00036     virtual bool        convertFromBuffer(const UT_ByteBuf* pBB, 
00037                                           const std::string & mimetype, 
00038                                           UT_sint32 iDisplayWidth, 
00039                                           UT_sint32 iDisplayHeight);
00040     bool                saveToPNG(const char * szFile);
00041     virtual bool hasAlpha (void) const;
00042     virtual UT_sint32  rowStride (void) const;
00043     virtual GR_Image::GRType getType(void) const;
00044     GdkPixbuf *         getData(void) const { return m_image; }
00045     void setData(GdkPixbuf *data)
00046     { m_image = data;}
00047     virtual void        scaleImageTo(GR_Graphics * pG, const UT_Rect & rec);
00048     virtual bool isTransparentAt(UT_sint32 x, UT_sint32 y);
00049     void scale (UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight);
00050     virtual void cairoSetSource(cairo_t *, double x, double y);
00051 protected:
00052     virtual GR_UnixImage *makeSubimage(const std::string & n,
00053                                               UT_sint32 x, UT_sint32 y,
00054                                               UT_sint32 w, UT_sint32 h) const;
00055 private:
00056     GdkPixbuf * m_image;
00057     GR_Image::GRType m_ImageType;
00058 };
00059 
00060 #endif /* GR_UNIXGNOMEIMAGE_H */

Generated on Sat Dec 3 2011 for AbiWord by  doxygen 1.7.1