00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ 00002 /* AbiWord 00003 * Copyright (C) 2004-6 Tomas Frydrych <dr.tomas@yahoo.co.uk> 00004 * Copyright (C) 2007 Martin Sevior<msevior@physics.unimelb.edu.au> 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00019 * 02110-1301 USA. 00020 */ 00021 00022 #ifndef GR_UNIX_PANGOPIXMAPGRAPHICS_H 00023 #define GR_UNIX_PANGOPIXMAPGRAPHICS_H 00024 00025 #include "gr_UnixCairoGraphics.h" 00026 00027 class ABI_EXPORT GR_UnixPixmapAllocInfo : public GR_AllocInfo 00028 { 00029 public: 00030 GR_UnixPixmapAllocInfo(GdkPixmap * pix) 00031 : m_pix(pix){} 00032 virtual GR_GraphicsId getType() const {return GRID_UNIX_PANGO_PIXMAP;} 00033 virtual bool isPrinterGraphics() const {return false;} 00034 00035 GdkPixmap * m_pix; 00036 }; 00037 00038 // 00039 // Class to draw into offscreen Pixbuf 00040 // 00041 class ABI_EXPORT GR_UnixPangoPixmapGraphics : public GR_UnixCairoGraphics 00042 { 00043 friend class GR_UnixImage; 00044 public: 00045 virtual ~GR_UnixPangoPixmapGraphics(); 00046 00047 static UT_uint32 s_getClassId() {return GRID_UNIX_PANGO_PIXMAP;} 00048 virtual UT_uint32 getClassId() {return s_getClassId();} 00049 static const char * graphicsDescriptor(){return "Unix Pango Pixmap";} 00050 static GR_Graphics * graphicsAllocator(GR_AllocInfo&); 00051 virtual bool canQuickPrint(void) const 00052 { return true;} 00053 virtual void scroll(UT_sint32, UT_sint32) {} 00054 virtual void scroll(UT_sint32 /*x_dest*/, UT_sint32 /*y_dest*/, 00055 UT_sint32 /*x_src*/, UT_sint32 /*y_src*/, 00056 UT_sint32 /*width*/, UT_sint32 /*height*/) {} 00057 00058 virtual void setCursor(GR_Graphics::Cursor ){}; 00059 virtual GR_Graphics::Cursor getCursor(void) const; 00060 virtual bool queryProperties(GR_Graphics::Properties gp) const; 00061 00062 protected: 00063 GR_UnixPangoPixmapGraphics(GdkPixmap * pix); 00064 virtual GdkDrawable * _getDrawable(void) 00065 { return static_cast<GdkDrawable *>(m_pPixmap);} 00066 GdkPixmap * m_pPixmap; 00067 }; 00068 00069 #endif