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_Image.h" 00026 00027 class ABI_EXPORT GR_UnixImage : public GR_RasterImage 00028 { 00029 friend class GR_UnixPangoGraphics; 00030 public: 00031 GR_UnixImage(const char* pszName); 00032 GR_UnixImage(const char* pszName, GdkPixbuf * pPixbif); 00033 GR_UnixImage(const char* pszName, GRType imageType); 00034 virtual ~GR_UnixImage(); 00035 00036 virtual bool convertToBuffer(UT_ByteBuf** ppBB) const; 00037 virtual bool convertFromBuffer(const UT_ByteBuf* pBB, UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight); 00038 bool saveToPNG(const char * szFile); 00039 virtual bool hasAlpha (void) const; 00040 virtual UT_sint32 rowStride (void) const; 00041 virtual GR_Image::GRType getType(void) const; 00042 GdkPixbuf * getData(void) const { return m_image; } 00043 virtual GR_Image * createImageSegment(GR_Graphics * pG, const UT_Rect & rec); 00044 virtual void scaleImageTo(GR_Graphics * pG, const UT_Rect & rec); 00045 virtual bool isTransparentAt(UT_sint32 x, UT_sint32 y); 00046 void scale (UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight); 00047 00048 private: 00049 GdkPixbuf * m_image; 00050 GR_Image::GRType m_ImageType; 00051 }; 00052 00053 #endif /* GR_UNIXGNOMEIMAGE_H */
1.5.5