1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef _SV_GCACH_XPEER_HXX 29 #define _SV_GCACH_XPEER_HXX 30 31 #include <tools/prex.h> 32 #include <X11/extensions/Xrender.h> 33 #include <tools/postx.h> 34 35 #include <glyphcache.hxx> 36 37 class SalDisplay; 38 struct MultiScreenGlyph; 39 40 class X11GlyphPeer 41 : public GlyphCachePeer 42 { 43 public: 44 X11GlyphPeer(); 45 virtual ~X11GlyphPeer(); 46 47 Pixmap GetPixmap( ServerFont&, int nGlyphIndex, int nScreen ); 48 const RawBitmap* GetRawBitmap( ServerFont&, int nGlyphIndex ); 49 bool ForcedAntialiasing( const ServerFont&, int nScreen ) const; 50 51 GlyphSet GetGlyphSet( ServerFont&, int nScreen ); 52 Glyph GetGlyphId( ServerFont&, int nGlyphIndex ); 53 54 protected: 55 void InitAntialiasing(); 56 57 virtual void RemovingFont( ServerFont& ); 58 virtual void RemovingGlyph( ServerFont&, GlyphData&, int nGlyphIndex ); 59 60 MultiScreenGlyph* PrepareForMultiscreen( ExtGlyphData& ) const; 61 void SetRenderGlyph( GlyphData&, Glyph ) const; 62 void SetRawBitmap( GlyphData&, const RawBitmap* ) const; 63 void SetPixmap( GlyphData&, Pixmap, int nScreen ) const; 64 Glyph GetRenderGlyph( const GlyphData& ) const; 65 const RawBitmap* GetRawBitmap( const GlyphData& ) const; 66 Pixmap GetPixmap( const GlyphData&, int nScreen ) const; 67 68 private: 69 Display* mpDisplay; 70 71 // thirty-two screens should be enough for everyone... 72 static const int MAX_GCACH_SCREENS = 32; 73 int mnMaxScreens; 74 int mnDefaultScreen; 75 int mnExtByteCount; 76 RawBitmap maRawBitmap; 77 sal_uInt32 mnForcedAA; 78 sal_uInt32 mnUsingXRender; 79 }; 80 81 class X11GlyphCache : public GlyphCache 82 { 83 public: 84 X11GlyphPeer& GetPeer() { return reinterpret_cast<X11GlyphPeer&>( mrPeer ); } 85 static X11GlyphCache& GetInstance(); 86 static void KillInstance(); 87 88 private: 89 X11GlyphCache( X11GlyphPeer& ); 90 }; 91 92 #endif // _SV_GCACH_XPEER_HXX 93