xref: /trunk/main/vcl/unx/headless/svpgdi.hxx (revision cdf0e10c)
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 _SVP_SVPGDI_HXX
29 
30 #include <basebmp/bitmapdevice.hxx>
31 #include <basebmp/color.hxx>
32 
33 #include <salgdi.hxx>
34 #include <sallayout.hxx>
35 
36 class ServerFont;
37 
38 class SvpSalGraphics : public SalGraphics
39 {
40     basebmp::BitmapDeviceSharedPtr       m_aDevice;
41     basebmp::BitmapDeviceSharedPtr       m_aOrigDevice;
42     basebmp::BitmapDeviceSharedPtr       m_aClipMap;
43 
44     bool                                 m_bUseLineColor;
45     basebmp::Color                       m_aLineColor;
46     bool                                 m_bUseFillColor;
47     basebmp::Color                       m_aFillColor;
48     basebmp::Color                       m_aTextColor;
49 
50     basebmp::DrawMode                    m_aDrawMode;
51 
52     ServerFont*                          m_pServerFont[ MAX_FALLBACK ];
53     sal_uInt32                           m_eTextFmt;
54 
55 protected:
56     virtual bool drawAlphaBitmap( const SalTwoRect&, const SalBitmap& rSourceBitmap, const SalBitmap& rAlphaBitmap );
57     virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency );
58 
59 public:
60     SvpSalGraphics();
61     virtual	~SvpSalGraphics();
62 
63     const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aDevice; }
64     void setDevice( basebmp::BitmapDeviceSharedPtr& rDevice );
65 
66     // overload all pure virtual methods
67     virtual void			GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
68     virtual sal_uInt16			GetBitCount();
69     virtual long			GetGraphicsWidth() const;
70 
71     virtual void			ResetClipRegion();
72     virtual bool            setClipRegion( const Region& );
73 
74     virtual void			SetLineColor();
75     virtual void			SetLineColor( SalColor nSalColor );
76     virtual void			SetFillColor();
77 
78     virtual void                        SetFillColor( SalColor nSalColor );
79 
80     virtual void			SetXORMode( bool bSet, bool );
81 
82     virtual void			SetROPLineColor( SalROPColor nROPColor );
83     virtual void			SetROPFillColor( SalROPColor nROPColor );
84 
85     virtual void			SetTextColor( SalColor nSalColor );
86     virtual sal_uInt16                  SetFont( ImplFontSelectData*, int nFallbackLevel );
87     virtual void			GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
88     virtual sal_uLong			GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs );
89     virtual const ImplFontCharMap* GetImplFontCharMap() const;
90     virtual void			GetDevFontList( ImplDevFontList* );
91     virtual void			GetDevFontSubstList( OutputDevice* );
92     virtual bool			AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
93     virtual sal_Bool			CreateFontSubset( const rtl::OUString& rToFile,
94                                               const ImplFontData*,
95                                               sal_Int32* pGlyphIDs,
96                                               sal_uInt8* pEncoding,
97                                               sal_Int32* pWidths,
98                                               int nGlyphs,
99                                               FontSubsetInfo& rInfo
100                                               );
101     virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded );
102     virtual const void*	GetEmbedFontData( const ImplFontData*,
103                                           const sal_Ucs* pUnicodes,
104                                           sal_Int32* pWidths,
105                                           FontSubsetInfo& rInfo,
106                                           long* pDataLen );
107     virtual void			FreeEmbedFontData( const void* pData, long nDataLen );
108     virtual void            GetGlyphWidths( const ImplFontData*,
109                                             bool bVertical,
110                                             Int32Vector& rWidths,
111                                             Ucs2UIntMap& rUnicodeEnc );
112     virtual sal_Bool			GetGlyphBoundRect( long nIndex, Rectangle& );
113     virtual sal_Bool			GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
114     virtual SalLayout*		GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
115     virtual void			DrawServerFontLayout( const ServerFontLayout& );
116     virtual bool            supportsOperation( OutDevSupportType ) const;
117     virtual void			drawPixel( long nX, long nY );
118     virtual void			drawPixel( long nX, long nY, SalColor nSalColor );
119     virtual void			drawLine( long nX1, long nY1, long nX2, long nY2 );
120     virtual void			drawRect( long nX, long nY, long nWidth, long nHeight );
121     virtual bool            drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency );
122     virtual bool            drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin );
123     virtual void			drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry );
124     virtual void			drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry );
125     virtual void			drawPolyPolygon( sal_uInt32 nPoly,
126                                              const sal_uInt32* pPoints,
127                                              PCONSTSALPOINT* pPtAry );
128     virtual sal_Bool		drawPolyLineBezier( sal_uLong nPoints,
129                                                 const SalPoint* pPtAry,
130                                                 const sal_uInt8* pFlgAry );
131     virtual sal_Bool		drawPolygonBezier( sal_uLong nPoints,
132                                                const SalPoint* pPtAry,
133                                                const sal_uInt8* pFlgAry );
134     virtual sal_Bool		drawPolyPolygonBezier( sal_uInt32 nPoly,
135                                                    const sal_uInt32* pPoints,
136                                                    const SalPoint* const* pPtAry,
137                                                    const sal_uInt8* const* pFlgAry );
138 
139     virtual void			copyArea( long nDestX,
140                                       long nDestY,
141                                       long nSrcX,
142                                       long nSrcY,
143                                       long nSrcWidth,
144                                       long nSrcHeight,
145                                       sal_uInt16 nFlags );
146     virtual void			copyBits( const SalTwoRect* pPosAry,
147                                       SalGraphics* pSrcGraphics );
148     virtual void			drawBitmap( const SalTwoRect* pPosAry,
149                                         const SalBitmap& rSalBitmap );
150     virtual void			drawBitmap( const SalTwoRect* pPosAry,
151                                         const SalBitmap& rSalBitmap,
152                                         SalColor nTransparentColor );
153     virtual void			drawBitmap( const SalTwoRect* pPosAry,
154                                         const SalBitmap& rSalBitmap,
155                                         const SalBitmap& rTransparentBitmap );
156     virtual void			drawMask( const SalTwoRect* pPosAry,
157                                       const SalBitmap& rSalBitmap,
158                                       SalColor nMaskColor );
159     virtual SalBitmap*		getBitmap( long nX, long nY, long nWidth, long nHeight );
160     virtual SalColor		getPixel( long nX, long nY );
161     virtual void			invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags );
162     virtual void			invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags );
163 
164     virtual sal_Bool			drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize );
165 
166     virtual SystemGraphicsData GetGraphicsData() const;
167     virtual SystemFontData     GetSysFontData( int nFallbacklevel ) const;
168 };
169 
170 #endif
171 
172