1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: svpgdi.hxx,v $
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 _SVP_SVPGDI_HXX
33 #include <vcl/salgdi.hxx>
34 #include <vcl/sallayout.hxx>
35 #include <basebmp/bitmapdevice.hxx>
36 #include <basebmp/color.hxx>
40 class SvpSalGraphics
: public SalGraphics
42 basebmp::BitmapDeviceSharedPtr m_aDevice
;
43 basebmp::BitmapDeviceSharedPtr m_aOrigDevice
;
44 basebmp::BitmapDeviceSharedPtr m_aClipMap
;
47 basebmp::Color m_aLineColor
;
49 basebmp::Color m_aFillColor
;
50 basebmp::Color m_aTextColor
;
52 basebmp::DrawMode m_aDrawMode
;
54 ServerFont
* m_pServerFont
[ MAX_FALLBACK
];
55 sal_uInt32 m_eTextFmt
;
58 virtual bool drawAlphaBitmap( const SalTwoRect
&, const SalBitmap
& rSourceBitmap
, const SalBitmap
& rAlphaBitmap
);
59 virtual bool drawAlphaRect( long nX
, long nY
, long nWidth
, long nHeight
, sal_uInt8 nTransparency
);
63 virtual ~SvpSalGraphics();
65 const basebmp::BitmapDeviceSharedPtr
& getDevice() const { return m_aDevice
; }
66 void setDevice( basebmp::BitmapDeviceSharedPtr
& rDevice
);
68 // overload all pure virtual methods
69 virtual void GetResolution( sal_Int32
& rDPIX
, sal_Int32
& rDPIY
);
70 virtual USHORT
GetBitCount();
71 virtual long GetGraphicsWidth() const;
73 virtual void ResetClipRegion();
74 virtual void BeginSetClipRegion( ULONG nCount
);
75 virtual BOOL
unionClipRegion( long nX
, long nY
, long nWidth
, long nHeight
);
76 virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon
& );
77 virtual void EndSetClipRegion();
79 virtual void SetLineColor();
80 virtual void SetLineColor( SalColor nSalColor
);
81 virtual void SetFillColor();
83 virtual void SetFillColor( SalColor nSalColor
);
85 virtual void SetXORMode( bool bSet
, bool );
87 virtual void SetROPLineColor( SalROPColor nROPColor
);
88 virtual void SetROPFillColor( SalROPColor nROPColor
);
90 virtual void SetTextColor( SalColor nSalColor
);
91 virtual USHORT
SetFont( ImplFontSelectData
*, int nFallbackLevel
);
92 virtual void GetFontMetric( ImplFontMetricData
* );
93 virtual ULONG
GetKernPairs( ULONG nPairs
, ImplKernPairData
* pKernPairs
);
94 virtual ImplFontCharMap
* GetImplFontCharMap() const;
95 virtual void GetDevFontList( ImplDevFontList
* );
96 virtual void GetDevFontSubstList( OutputDevice
* );
97 virtual bool AddTempDevFont( ImplDevFontList
*, const String
& rFileURL
, const String
& rFontName
);
98 virtual BOOL
CreateFontSubset( const rtl::OUString
& rToFile
,
100 sal_Int32
* pGlyphIDs
,
101 sal_uInt8
* pEncoding
,
104 FontSubsetInfo
& rInfo
106 virtual const Ucs2SIntMap
* GetFontEncodingVector( const ImplFontData
*, const Ucs2OStrMap
** ppNonEncoded
);
107 virtual const void* GetEmbedFontData( const ImplFontData
*,
108 const sal_Ucs
* pUnicodes
,
110 FontSubsetInfo
& rInfo
,
112 virtual void FreeEmbedFontData( const void* pData
, long nDataLen
);
113 virtual void GetGlyphWidths( const ImplFontData
*,
115 Int32Vector
& rWidths
,
116 Ucs2UIntMap
& rUnicodeEnc
);
117 virtual BOOL
GetGlyphBoundRect( long nIndex
, Rectangle
& );
118 virtual BOOL
GetGlyphOutline( long nIndex
, ::basegfx::B2DPolyPolygon
& );
119 virtual SalLayout
* GetTextLayout( ImplLayoutArgs
&, int nFallbackLevel
);
120 virtual void DrawServerFontLayout( const ServerFontLayout
& );
121 virtual bool supportsOperation( OutDevSupportType
) const;
122 virtual void drawPixel( long nX
, long nY
);
123 virtual void drawPixel( long nX
, long nY
, SalColor nSalColor
);
124 virtual void drawLine( long nX1
, long nY1
, long nX2
, long nY2
);
125 virtual void drawRect( long nX
, long nY
, long nWidth
, long nHeight
);
126 virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon
&, double fTransparency
);
127 virtual bool drawPolyLine( const ::basegfx::B2DPolygon
&, const ::basegfx::B2DVector
& rLineWidths
, basegfx::B2DLineJoin
);
128 virtual void drawPolyLine( ULONG nPoints
, const SalPoint
* pPtAry
);
129 virtual void drawPolygon( ULONG nPoints
, const SalPoint
* pPtAry
);
130 virtual void drawPolyPolygon( sal_uInt32 nPoly
,
131 const sal_uInt32
* pPoints
,
132 PCONSTSALPOINT
* pPtAry
);
133 virtual sal_Bool
drawPolyLineBezier( ULONG nPoints
,
134 const SalPoint
* pPtAry
,
135 const BYTE
* pFlgAry
);
136 virtual sal_Bool
drawPolygonBezier( ULONG nPoints
,
137 const SalPoint
* pPtAry
,
138 const BYTE
* pFlgAry
);
139 virtual sal_Bool
drawPolyPolygonBezier( sal_uInt32 nPoly
,
140 const sal_uInt32
* pPoints
,
141 const SalPoint
* const* pPtAry
,
142 const BYTE
* const* pFlgAry
);
144 virtual void copyArea( long nDestX
,
151 virtual void copyBits( const SalTwoRect
* pPosAry
,
152 SalGraphics
* pSrcGraphics
);
153 virtual void drawBitmap( const SalTwoRect
* pPosAry
,
154 const SalBitmap
& rSalBitmap
);
155 virtual void drawBitmap( const SalTwoRect
* pPosAry
,
156 const SalBitmap
& rSalBitmap
,
157 SalColor nTransparentColor
);
158 virtual void drawBitmap( const SalTwoRect
* pPosAry
,
159 const SalBitmap
& rSalBitmap
,
160 const SalBitmap
& rTransparentBitmap
);
161 virtual void drawMask( const SalTwoRect
* pPosAry
,
162 const SalBitmap
& rSalBitmap
,
163 SalColor nMaskColor
);
164 virtual SalBitmap
* getBitmap( long nX
, long nY
, long nWidth
, long nHeight
);
165 virtual SalColor
getPixel( long nX
, long nY
);
166 virtual void invert( long nX
, long nY
, long nWidth
, long nHeight
, SalInvert nFlags
);
167 virtual void invert( ULONG nPoints
, const SalPoint
* pPtAry
, SalInvert nFlags
);
169 virtual BOOL
drawEPS( long nX
, long nY
, long nWidth
, long nHeight
, void* pPtr
, ULONG nSize
);
171 virtual SystemGraphicsData
GetGraphicsData() const;
172 virtual SystemFontData
GetSysFontData( int nFallbacklevel
) const;