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