xref: /aoo42x/main/vcl/unx/headless/svpgdi.hxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef _SVP_SVPGDI_HXX
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir #include <basebmp/bitmapdevice.hxx>
31*cdf0e10cSrcweir #include <basebmp/color.hxx>
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir #include <salgdi.hxx>
34*cdf0e10cSrcweir #include <sallayout.hxx>
35*cdf0e10cSrcweir 
36*cdf0e10cSrcweir class ServerFont;
37*cdf0e10cSrcweir 
38*cdf0e10cSrcweir class SvpSalGraphics : public SalGraphics
39*cdf0e10cSrcweir {
40*cdf0e10cSrcweir     basebmp::BitmapDeviceSharedPtr       m_aDevice;
41*cdf0e10cSrcweir     basebmp::BitmapDeviceSharedPtr       m_aOrigDevice;
42*cdf0e10cSrcweir     basebmp::BitmapDeviceSharedPtr       m_aClipMap;
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir     bool                                 m_bUseLineColor;
45*cdf0e10cSrcweir     basebmp::Color                       m_aLineColor;
46*cdf0e10cSrcweir     bool                                 m_bUseFillColor;
47*cdf0e10cSrcweir     basebmp::Color                       m_aFillColor;
48*cdf0e10cSrcweir     basebmp::Color                       m_aTextColor;
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir     basebmp::DrawMode                    m_aDrawMode;
51*cdf0e10cSrcweir 
52*cdf0e10cSrcweir     ServerFont*                          m_pServerFont[ MAX_FALLBACK ];
53*cdf0e10cSrcweir     sal_uInt32                           m_eTextFmt;
54*cdf0e10cSrcweir 
55*cdf0e10cSrcweir protected:
56*cdf0e10cSrcweir     virtual bool drawAlphaBitmap( const SalTwoRect&, const SalBitmap& rSourceBitmap, const SalBitmap& rAlphaBitmap );
57*cdf0e10cSrcweir     virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency );
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir public:
60*cdf0e10cSrcweir     SvpSalGraphics();
61*cdf0e10cSrcweir     virtual	~SvpSalGraphics();
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir     const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aDevice; }
64*cdf0e10cSrcweir     void setDevice( basebmp::BitmapDeviceSharedPtr& rDevice );
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir     // overload all pure virtual methods
67*cdf0e10cSrcweir     virtual void			GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
68*cdf0e10cSrcweir     virtual sal_uInt16			GetBitCount();
69*cdf0e10cSrcweir     virtual long			GetGraphicsWidth() const;
70*cdf0e10cSrcweir 
71*cdf0e10cSrcweir     virtual void			ResetClipRegion();
72*cdf0e10cSrcweir     virtual bool            setClipRegion( const Region& );
73*cdf0e10cSrcweir 
74*cdf0e10cSrcweir     virtual void			SetLineColor();
75*cdf0e10cSrcweir     virtual void			SetLineColor( SalColor nSalColor );
76*cdf0e10cSrcweir     virtual void			SetFillColor();
77*cdf0e10cSrcweir 
78*cdf0e10cSrcweir     virtual void                        SetFillColor( SalColor nSalColor );
79*cdf0e10cSrcweir 
80*cdf0e10cSrcweir     virtual void			SetXORMode( bool bSet, bool );
81*cdf0e10cSrcweir 
82*cdf0e10cSrcweir     virtual void			SetROPLineColor( SalROPColor nROPColor );
83*cdf0e10cSrcweir     virtual void			SetROPFillColor( SalROPColor nROPColor );
84*cdf0e10cSrcweir 
85*cdf0e10cSrcweir     virtual void			SetTextColor( SalColor nSalColor );
86*cdf0e10cSrcweir     virtual sal_uInt16                  SetFont( ImplFontSelectData*, int nFallbackLevel );
87*cdf0e10cSrcweir     virtual void			GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
88*cdf0e10cSrcweir     virtual sal_uLong			GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs );
89*cdf0e10cSrcweir     virtual const ImplFontCharMap* GetImplFontCharMap() const;
90*cdf0e10cSrcweir     virtual void			GetDevFontList( ImplDevFontList* );
91*cdf0e10cSrcweir     virtual void			GetDevFontSubstList( OutputDevice* );
92*cdf0e10cSrcweir     virtual bool			AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
93*cdf0e10cSrcweir     virtual sal_Bool			CreateFontSubset( const rtl::OUString& rToFile,
94*cdf0e10cSrcweir                                               const ImplFontData*,
95*cdf0e10cSrcweir                                               sal_Int32* pGlyphIDs,
96*cdf0e10cSrcweir                                               sal_uInt8* pEncoding,
97*cdf0e10cSrcweir                                               sal_Int32* pWidths,
98*cdf0e10cSrcweir                                               int nGlyphs,
99*cdf0e10cSrcweir                                               FontSubsetInfo& rInfo
100*cdf0e10cSrcweir                                               );
101*cdf0e10cSrcweir     virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded );
102*cdf0e10cSrcweir     virtual const void*	GetEmbedFontData( const ImplFontData*,
103*cdf0e10cSrcweir                                           const sal_Ucs* pUnicodes,
104*cdf0e10cSrcweir                                           sal_Int32* pWidths,
105*cdf0e10cSrcweir                                           FontSubsetInfo& rInfo,
106*cdf0e10cSrcweir                                           long* pDataLen );
107*cdf0e10cSrcweir     virtual void			FreeEmbedFontData( const void* pData, long nDataLen );
108*cdf0e10cSrcweir     virtual void            GetGlyphWidths( const ImplFontData*,
109*cdf0e10cSrcweir                                             bool bVertical,
110*cdf0e10cSrcweir                                             Int32Vector& rWidths,
111*cdf0e10cSrcweir                                             Ucs2UIntMap& rUnicodeEnc );
112*cdf0e10cSrcweir     virtual sal_Bool			GetGlyphBoundRect( long nIndex, Rectangle& );
113*cdf0e10cSrcweir     virtual sal_Bool			GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
114*cdf0e10cSrcweir     virtual SalLayout*		GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
115*cdf0e10cSrcweir     virtual void			DrawServerFontLayout( const ServerFontLayout& );
116*cdf0e10cSrcweir     virtual bool            supportsOperation( OutDevSupportType ) const;
117*cdf0e10cSrcweir     virtual void			drawPixel( long nX, long nY );
118*cdf0e10cSrcweir     virtual void			drawPixel( long nX, long nY, SalColor nSalColor );
119*cdf0e10cSrcweir     virtual void			drawLine( long nX1, long nY1, long nX2, long nY2 );
120*cdf0e10cSrcweir     virtual void			drawRect( long nX, long nY, long nWidth, long nHeight );
121*cdf0e10cSrcweir     virtual bool            drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency );
122*cdf0e10cSrcweir     virtual bool            drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin );
123*cdf0e10cSrcweir     virtual void			drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry );
124*cdf0e10cSrcweir     virtual void			drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry );
125*cdf0e10cSrcweir     virtual void			drawPolyPolygon( sal_uInt32 nPoly,
126*cdf0e10cSrcweir                                              const sal_uInt32* pPoints,
127*cdf0e10cSrcweir                                              PCONSTSALPOINT* pPtAry );
128*cdf0e10cSrcweir     virtual sal_Bool		drawPolyLineBezier( sal_uLong nPoints,
129*cdf0e10cSrcweir                                                 const SalPoint* pPtAry,
130*cdf0e10cSrcweir                                                 const sal_uInt8* pFlgAry );
131*cdf0e10cSrcweir     virtual sal_Bool		drawPolygonBezier( sal_uLong nPoints,
132*cdf0e10cSrcweir                                                const SalPoint* pPtAry,
133*cdf0e10cSrcweir                                                const sal_uInt8* pFlgAry );
134*cdf0e10cSrcweir     virtual sal_Bool		drawPolyPolygonBezier( sal_uInt32 nPoly,
135*cdf0e10cSrcweir                                                    const sal_uInt32* pPoints,
136*cdf0e10cSrcweir                                                    const SalPoint* const* pPtAry,
137*cdf0e10cSrcweir                                                    const sal_uInt8* const* pFlgAry );
138*cdf0e10cSrcweir 
139*cdf0e10cSrcweir     virtual void			copyArea( long nDestX,
140*cdf0e10cSrcweir                                       long nDestY,
141*cdf0e10cSrcweir                                       long nSrcX,
142*cdf0e10cSrcweir                                       long nSrcY,
143*cdf0e10cSrcweir                                       long nSrcWidth,
144*cdf0e10cSrcweir                                       long nSrcHeight,
145*cdf0e10cSrcweir                                       sal_uInt16 nFlags );
146*cdf0e10cSrcweir     virtual void			copyBits( const SalTwoRect* pPosAry,
147*cdf0e10cSrcweir                                       SalGraphics* pSrcGraphics );
148*cdf0e10cSrcweir     virtual void			drawBitmap( const SalTwoRect* pPosAry,
149*cdf0e10cSrcweir                                         const SalBitmap& rSalBitmap );
150*cdf0e10cSrcweir     virtual void			drawBitmap( const SalTwoRect* pPosAry,
151*cdf0e10cSrcweir                                         const SalBitmap& rSalBitmap,
152*cdf0e10cSrcweir                                         SalColor nTransparentColor );
153*cdf0e10cSrcweir     virtual void			drawBitmap( const SalTwoRect* pPosAry,
154*cdf0e10cSrcweir                                         const SalBitmap& rSalBitmap,
155*cdf0e10cSrcweir                                         const SalBitmap& rTransparentBitmap );
156*cdf0e10cSrcweir     virtual void			drawMask( const SalTwoRect* pPosAry,
157*cdf0e10cSrcweir                                       const SalBitmap& rSalBitmap,
158*cdf0e10cSrcweir                                       SalColor nMaskColor );
159*cdf0e10cSrcweir     virtual SalBitmap*		getBitmap( long nX, long nY, long nWidth, long nHeight );
160*cdf0e10cSrcweir     virtual SalColor		getPixel( long nX, long nY );
161*cdf0e10cSrcweir     virtual void			invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags );
162*cdf0e10cSrcweir     virtual void			invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags );
163*cdf0e10cSrcweir 
164*cdf0e10cSrcweir     virtual sal_Bool			drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize );
165*cdf0e10cSrcweir 
166*cdf0e10cSrcweir     virtual SystemGraphicsData GetGraphicsData() const;
167*cdf0e10cSrcweir     virtual SystemFontData     GetSysFontData( int nFallbacklevel ) const;
168*cdf0e10cSrcweir };
169*cdf0e10cSrcweir 
170*cdf0e10cSrcweir #endif
171*cdf0e10cSrcweir 
172