xref: /trunk/main/vcl/inc/salgdi.hxx (revision 86e1cf34)
1161f4cd1SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3161f4cd1SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4161f4cd1SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5161f4cd1SAndrew Rist  * distributed with this work for additional information
6161f4cd1SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7161f4cd1SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8161f4cd1SAndrew Rist  * "License"); you may not use this file except in compliance
9161f4cd1SAndrew Rist  * with the License.  You may obtain a copy of the License at
10161f4cd1SAndrew Rist  *
11161f4cd1SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12161f4cd1SAndrew Rist  *
13161f4cd1SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14161f4cd1SAndrew Rist  * software distributed under the License is distributed on an
15161f4cd1SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16161f4cd1SAndrew Rist  * KIND, either express or implied.  See the License for the
17161f4cd1SAndrew Rist  * specific language governing permissions and limitations
18161f4cd1SAndrew Rist  * under the License.
19161f4cd1SAndrew Rist  *
20161f4cd1SAndrew Rist  *************************************************************/
21161f4cd1SAndrew Rist 
22161f4cd1SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SV_SALGDI_HXX
25cdf0e10cSrcweir #define _SV_SALGDI_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "tools/string.hxx"
28cdf0e10cSrcweir #include "rtl/ustring.hxx"
29cdf0e10cSrcweir #include "vcl/sv.h"
30cdf0e10cSrcweir #include "vcl/dllapi.h"
31cdf0e10cSrcweir #include "vcl/salgtype.hxx"
32248a599fSHerbert Dürr #include "salglyphid.hxx"
33cdf0e10cSrcweir #include "vos/thread.hxx"
34cdf0e10cSrcweir #include "vcl/outdev.hxx"
35cdf0e10cSrcweir #include "vcl/salnativewidgets.hxx"
36cdf0e10cSrcweir 
37cdf0e10cSrcweir #include <map>
38cdf0e10cSrcweir 
39cdf0e10cSrcweir class ImplDevFontList;
40cdf0e10cSrcweir class SalBitmap;
41cdf0e10cSrcweir class ImplFontSelectData;
42cdf0e10cSrcweir class ImplFontMetricData;
43cdf0e10cSrcweir struct ImplKernPairData;
44cdf0e10cSrcweir class ImplFontData;
45cdf0e10cSrcweir class ImplFontCharMap;
46cdf0e10cSrcweir class SalLayout;
47cdf0e10cSrcweir class ImplLayoutArgs;
48cdf0e10cSrcweir class Rectangle;
49cdf0e10cSrcweir class FontSubsetInfo;
50cdf0e10cSrcweir class OutputDevice;
51cdf0e10cSrcweir class ServerFontLayout;
52cdf0e10cSrcweir struct SystemGraphicsData;
53cdf0e10cSrcweir struct SystemFontData;
54cdf0e10cSrcweir 
55cdf0e10cSrcweir namespace basegfx {
56cdf0e10cSrcweir     class B2DVector;
57cdf0e10cSrcweir     class B2DPolygon;
58cdf0e10cSrcweir     class B2DPolyPolygon;
59cdf0e10cSrcweir }
60cdf0e10cSrcweir 
61cdf0e10cSrcweir // ---------------------
62cdf0e10cSrcweir // - SalGraphics-Codes -
63cdf0e10cSrcweir // ---------------------
64cdf0e10cSrcweir 
65cdf0e10cSrcweir #define SAL_SETFONT_REMOVEANDMATCHNEW       ((sal_uInt16)0x0001)
66cdf0e10cSrcweir #define SAL_SETFONT_USEDRAWTEXT             ((sal_uInt16)0x0002)
67cdf0e10cSrcweir #define SAL_SETFONT_USEDRAWTEXTARRAY        ((sal_uInt16)0x0004)
68cdf0e10cSrcweir #define SAL_SETFONT_UNICODE                 ((sal_uInt16)0x0008)
69cdf0e10cSrcweir #define SAL_SETFONT_BADFONT                 ((sal_uInt16)0x1000)
70cdf0e10cSrcweir 
71cdf0e10cSrcweir #define SAL_COPYAREA_WINDOWINVALIDATE       ((sal_uInt16)0x0001)
72cdf0e10cSrcweir 
73cdf0e10cSrcweir // -------------------
74cdf0e10cSrcweir // - common typedefs -
75cdf0e10cSrcweir // -------------------
76cdf0e10cSrcweir 
77cdf0e10cSrcweir typedef sal_Unicode sal_Ucs; // TODO: use sal_UCS4 instead of sal_Unicode
78cdf0e10cSrcweir typedef std::map< sal_Ucs, sal_Int32 >    Ucs2SIntMap;
79cdf0e10cSrcweir typedef std::map< sal_Ucs, sal_uInt32 >   Ucs2UIntMap;
80cdf0e10cSrcweir typedef std::map< sal_Ucs, rtl::OString > Ucs2OStrMap;
81cdf0e10cSrcweir typedef std::vector< sal_Int32 > Int32Vector;
82cdf0e10cSrcweir 
83cdf0e10cSrcweir // ---------------
84cdf0e10cSrcweir // - SalGraphics -
85cdf0e10cSrcweir // ---------------
86cdf0e10cSrcweir 
87cdf0e10cSrcweir // note: if you add any new methods to class SalGraphics using coordinates
88cdf0e10cSrcweir //       make sure they have a corresponding protected pure virtual method
89cdf0e10cSrcweir //       which has to be implemented by the platform dependent part.
90cdf0e10cSrcweir //       Add a method that performs coordinate mirroring if required, (see
91cdf0e10cSrcweir //       existing methods as sample) and then calls the equivalent pure method.
92cdf0e10cSrcweir 
93cdf0e10cSrcweir // note: all positions are in pixel and relative to
94cdf0e10cSrcweir // the top/left-position of the virtual output area
95cdf0e10cSrcweir 
96cdf0e10cSrcweir class VCL_PLUGIN_PUBLIC SalGraphics
97cdf0e10cSrcweir {
98cdf0e10cSrcweir 	int						m_nLayout; // 0: mirroring off, 1: mirror x-axis
99cdf0e10cSrcweir 
100cdf0e10cSrcweir protected:
1015f27b83cSArmin Le Grand     /// bitfield
102cdf0e10cSrcweir     // flags which hold the SetAntialiasing() value from OutputDevice
1035f27b83cSArmin Le Grand     bool                    m_bAntiAliasB2DDraw : 1;
104cdf0e10cSrcweir 
105cdf0e10cSrcweir public:
106cdf0e10cSrcweir     // get/set AA
setAntiAliasB2DDraw(bool bNew)107cdf0e10cSrcweir     void setAntiAliasB2DDraw(bool bNew) { m_bAntiAliasB2DDraw = bNew; }
getAntiAliasB2DDraw() const108cdf0e10cSrcweir     bool getAntiAliasB2DDraw() const { return m_bAntiAliasB2DDraw; }
109cdf0e10cSrcweir 
110cdf0e10cSrcweir     SalGraphics();
111cdf0e10cSrcweir     virtual ~SalGraphics();
112cdf0e10cSrcweir 
113cdf0e10cSrcweir protected:
114cdf0e10cSrcweir     virtual bool        setClipRegion( const Region& ) = 0;
115cdf0e10cSrcweir     // draw --> LineColor and FillColor and RasterOp and ClipRegion
116cdf0e10cSrcweir     virtual void		drawPixel( long nX, long nY ) = 0;
117cdf0e10cSrcweir     virtual void		drawPixel( long nX, long nY, SalColor nSalColor ) = 0;
118cdf0e10cSrcweir     virtual void		drawLine( long nX1, long nY1, long nX2, long nY2 ) = 0;
119cdf0e10cSrcweir     virtual void		drawRect( long nX, long nY, long nWidth, long nHeight ) = 0;
12054ae6a37SHerbert Dürr     virtual void		drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) = 0;
12154ae6a37SHerbert Dürr     virtual void		drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) = 0;
122cdf0e10cSrcweir     virtual void		drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ) = 0;
123cdf0e10cSrcweir     virtual bool        drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ) = 0;
1245aaf853bSArmin Le Grand     virtual bool        drawPolyLine(
1255aaf853bSArmin Le Grand         const ::basegfx::B2DPolygon&,
1265aaf853bSArmin Le Grand         double fTransparency,
1275aaf853bSArmin Le Grand         const ::basegfx::B2DVector& rLineWidths,
1285aaf853bSArmin Le Grand         basegfx::B2DLineJoin,
1295aaf853bSArmin Le Grand         com::sun::star::drawing::LineCap) = 0;
13054ae6a37SHerbert Dürr     virtual sal_Bool	drawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) = 0;
13154ae6a37SHerbert Dürr     virtual sal_Bool	drawPolygonBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) = 0;
132cdf0e10cSrcweir     virtual sal_Bool	drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, const sal_uInt8* const* pFlgAry ) = 0;
133cdf0e10cSrcweir 
134cdf0e10cSrcweir     // CopyArea --> No RasterOp, but ClipRegion
135cdf0e10cSrcweir     virtual void		copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,
136cdf0e10cSrcweir                                   long nSrcHeight, sal_uInt16 nFlags ) = 0;
137cdf0e10cSrcweir 
138cdf0e10cSrcweir     // CopyBits and DrawBitmap --> RasterOp and ClipRegion
139cdf0e10cSrcweir     // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
1405f27b83cSArmin Le Grand     virtual void		copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) = 0;
1415f27b83cSArmin Le Grand     virtual void		drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap ) = 0;
1425f27b83cSArmin Le Grand     virtual void		drawBitmap( const SalTwoRect& rPosAry,
143cdf0e10cSrcweir                                     const SalBitmap& rSalBitmap,
144cdf0e10cSrcweir                                     SalColor nTransparentColor ) = 0;
1455f27b83cSArmin Le Grand     virtual void		drawBitmap( const SalTwoRect& rPosAry,
146cdf0e10cSrcweir                                     const SalBitmap& rSalBitmap,
147cdf0e10cSrcweir                                     const SalBitmap& rMaskBitmap ) = 0;
1485f27b83cSArmin Le Grand     virtual void		drawMask( const SalTwoRect& rPosAry,
149cdf0e10cSrcweir                                   const SalBitmap& rSalBitmap,
150cdf0e10cSrcweir                                   SalColor nMaskColor ) = 0;
151cdf0e10cSrcweir 
152cdf0e10cSrcweir     virtual SalBitmap*	getBitmap( long nX, long nY, long nWidth, long nHeight ) = 0;
153cdf0e10cSrcweir     virtual SalColor	getPixel( long nX, long nY ) = 0;
154cdf0e10cSrcweir 
155cdf0e10cSrcweir     // invert --> ClipRegion (only Windows or VirDevs)
156cdf0e10cSrcweir     virtual void		invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags) = 0;
15754ae6a37SHerbert Dürr     virtual void		invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags ) = 0;
158cdf0e10cSrcweir 
159cdf0e10cSrcweir     virtual sal_Bool		drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize ) = 0;
160cdf0e10cSrcweir 
161cdf0e10cSrcweir     // native widget rendering methods that require mirroring
162cdf0e10cSrcweir     virtual sal_Bool        hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
163cdf0e10cSrcweir                                               const Point& aPos, sal_Bool& rIsInside );
164cdf0e10cSrcweir     virtual sal_Bool        drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
165cdf0e10cSrcweir                                            ControlState nState, const ImplControlValue& aValue,
166cdf0e10cSrcweir                                            const rtl::OUString& aCaption );
167cdf0e10cSrcweir     virtual sal_Bool        drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
168cdf0e10cSrcweir                                                ControlState nState, const ImplControlValue& aValue,
169cdf0e10cSrcweir                                                const rtl::OUString& aCaption );
170cdf0e10cSrcweir     virtual sal_Bool        getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
171cdf0e10cSrcweir                                                 const ImplControlValue& aValue, const rtl::OUString& aCaption,
172cdf0e10cSrcweir                                                 Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion );
173cdf0e10cSrcweir 
174cdf0e10cSrcweir     /** Render bitmap with alpha channel
175cdf0e10cSrcweir 
176cdf0e10cSrcweir         @param rSourceBitmap
177cdf0e10cSrcweir         Source bitmap to blit
178cdf0e10cSrcweir 
179cdf0e10cSrcweir         @param rAlphaBitmap
180cdf0e10cSrcweir         Alpha channel to use for blitting
181cdf0e10cSrcweir 
182cdf0e10cSrcweir         @return true, if the operation succeeded, and false
183cdf0e10cSrcweir         otherwise. In this case, clients should try to emulate alpha
184cdf0e10cSrcweir         compositing themselves
185cdf0e10cSrcweir      */
186cdf0e10cSrcweir     virtual bool		drawAlphaBitmap( const SalTwoRect&,
187cdf0e10cSrcweir                                          const SalBitmap& rSourceBitmap,
188cdf0e10cSrcweir                                          const SalBitmap& rAlphaBitmap ) = 0;
1895f27b83cSArmin Le Grand 
1905f27b83cSArmin Le Grand     /** draw transformed bitmap (maybe with alpha) where Null, X, Y define the coordinate system */
1915f27b83cSArmin Le Grand     virtual bool drawTransformedBitmap(
1925f27b83cSArmin Le Grand         const basegfx::B2DPoint& rNull,
1935f27b83cSArmin Le Grand         const basegfx::B2DPoint& rX,
1945f27b83cSArmin Le Grand         const basegfx::B2DPoint& rY,
1955f27b83cSArmin Le Grand         const SalBitmap& rSourceBitmap,
1965f27b83cSArmin Le Grand         const SalBitmap* pAlphaBitmap) = 0;
1975f27b83cSArmin Le Grand 
198cdf0e10cSrcweir     /** Render solid rectangle with given transparency
199cdf0e10cSrcweir 
200cdf0e10cSrcweir         @param nTransparency
201cdf0e10cSrcweir         Transparency value (0-255) to use. 0 blits and opaque, 255 a
202cdf0e10cSrcweir         fully transparent rectangle
203cdf0e10cSrcweir      */
204cdf0e10cSrcweir     virtual bool		drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency ) = 0;
205cdf0e10cSrcweir 
206cdf0e10cSrcweir public:
207cdf0e10cSrcweir     // public SalGraphics methods, the interface to the independent vcl part
208cdf0e10cSrcweir 
209cdf0e10cSrcweir     // get device resolution
210cdf0e10cSrcweir     virtual void			GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) = 0;
211cdf0e10cSrcweir     // get the depth of the device
212cdf0e10cSrcweir     virtual sal_uInt16			GetBitCount() = 0;
213cdf0e10cSrcweir     // get the width of the device
214cdf0e10cSrcweir     virtual long			GetGraphicsWidth() const = 0;
215cdf0e10cSrcweir 
216cdf0e10cSrcweir     // set the clip region to empty
217cdf0e10cSrcweir     virtual void			ResetClipRegion() = 0;
218cdf0e10cSrcweir 
219cdf0e10cSrcweir     // set the line color to transparent (= don't draw lines)
220cdf0e10cSrcweir     virtual void			SetLineColor() = 0;
221cdf0e10cSrcweir     // set the line color to a specific color
222cdf0e10cSrcweir     virtual void			SetLineColor( SalColor nSalColor ) = 0;
223cdf0e10cSrcweir     // set the fill color to transparent (= don't fill)
224cdf0e10cSrcweir     virtual void			SetFillColor() = 0;
225cdf0e10cSrcweir     // set the fill color to a specific color, shapes will be
226cdf0e10cSrcweir     // filled accordingly
227cdf0e10cSrcweir     virtual void          	SetFillColor( SalColor nSalColor ) = 0;
228cdf0e10cSrcweir     // enable/disable XOR drawing
229cdf0e10cSrcweir     virtual void			SetXORMode( bool bSet, bool bInvertOnly ) = 0;
230cdf0e10cSrcweir     // set line color for raster operations
231cdf0e10cSrcweir     virtual void			SetROPLineColor( SalROPColor nROPColor ) = 0;
232cdf0e10cSrcweir     // set fill color for raster operations
233cdf0e10cSrcweir     virtual void			SetROPFillColor( SalROPColor nROPColor ) = 0;
234cdf0e10cSrcweir     // set the text color to a specific color
235cdf0e10cSrcweir     virtual void			SetTextColor( SalColor nSalColor ) = 0;
236cdf0e10cSrcweir     // set the font
237cdf0e10cSrcweir     virtual sal_uInt16         SetFont( ImplFontSelectData*, int nFallbackLevel ) = 0;
238cdf0e10cSrcweir     // release the fonts
ReleaseFonts()239cdf0e10cSrcweir     void                   ReleaseFonts() { SetFont( NULL, 0 ); }
240cdf0e10cSrcweir     // get the current font's metrics
241cdf0e10cSrcweir     virtual void			GetFontMetric( ImplFontMetricData*, int nFallbackLevel = 0 ) = 0;
242cdf0e10cSrcweir 
243cdf0e10cSrcweir     // get kernign pairs of the current font
244cdf0e10cSrcweir     // return only PairCount if (pKernPairs == NULL)
245cdf0e10cSrcweir     virtual sal_uLong			GetKernPairs( sal_uLong nMaxPairCount, ImplKernPairData* ) = 0;
246cdf0e10cSrcweir     // get the repertoire of the current font
247cdf0e10cSrcweir     virtual const ImplFontCharMap* GetImplFontCharMap() const = 0;
248cdf0e10cSrcweir     // graphics must fill supplied font list
249cdf0e10cSrcweir     virtual void			GetDevFontList( ImplDevFontList* ) = 0;
250cdf0e10cSrcweir     // graphics should call ImplAddDevFontSubstitute on supplied
251cdf0e10cSrcweir     // OutputDevice for all its device specific preferred font substitutions
252cdf0e10cSrcweir     virtual void			GetDevFontSubstList( OutputDevice* ) = 0;
253cdf0e10cSrcweir     virtual bool			AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ) = 0;
254cdf0e10cSrcweir     // CreateFontSubset: a method to get a subset of glyhps of a font
255cdf0e10cSrcweir     // inside a new valid font file
256*86e1cf34SPedro Giffuni     // returns sal_True if creation of subset was successful
257cdf0e10cSrcweir     // parameters: rToFile: contains a osl file URL to write the subset to
258cdf0e10cSrcweir     //             pFont: describes from which font to create a subset
259cdf0e10cSrcweir     //             pGlyphIDs: the glyph ids to be extracted
260cdf0e10cSrcweir     //             pEncoding: the character code corresponding to each glyph
261cdf0e10cSrcweir     //             pWidths: the advance widths of the correspoding glyphs (in PS font units)
262cdf0e10cSrcweir     //             nGlyphs: the number of glyphs
263cdf0e10cSrcweir     //             rInfo: additional outgoing information
264cdf0e10cSrcweir     // implementation note: encoding 0 with glyph id 0 should be added implicitly
265cdf0e10cSrcweir     // as "undefined character"
266cdf0e10cSrcweir     virtual sal_Bool			CreateFontSubset( const rtl::OUString& rToFile,
267cdf0e10cSrcweir                                               const ImplFontData* pFont,
268248a599fSHerbert Dürr                                               sal_GlyphId* pGlyphIds,
269cdf0e10cSrcweir                                               sal_uInt8* pEncoding,
270cdf0e10cSrcweir                                               sal_Int32* pWidths,
271cdf0e10cSrcweir                                               int nGlyphs,
272cdf0e10cSrcweir                                               FontSubsetInfo& rInfo // out parameter
273cdf0e10cSrcweir                                               ) = 0;
274cdf0e10cSrcweir 
275cdf0e10cSrcweir     // GetFontEncodingVector: a method to get the encoding map Unicode
276cdf0e10cSrcweir 	// to font encoded character; this is only used for type1 fonts and
277cdf0e10cSrcweir     // may return NULL in case of unknown encoding vector
278cdf0e10cSrcweir     // if ppNonEncoded is set and non encoded characters (that is type1
279cdf0e10cSrcweir     // glyphs with only a name) exist it is set to the corresponding
280cdf0e10cSrcweir     // map for non encoded glyphs; the encoding vector contains -1
281cdf0e10cSrcweir     // as encoding for these cases
282cdf0e10cSrcweir     virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded ) = 0;
283cdf0e10cSrcweir 
284cdf0e10cSrcweir     // GetEmbedFontData: gets the font data for a font marked
285cdf0e10cSrcweir     // embeddable by GetDevFontList or NULL in case of error
286cdf0e10cSrcweir     // parameters: pFont: describes the font in question
287cdf0e10cSrcweir     //             pUnicodes: contains the Unicodes assigned to
288cdf0e10cSrcweir     //             code points 0 to 255; must contain at least 256 members
289cdf0e10cSrcweir     //             pWidths: the widths of all glyphs from char code 0 to 255
290cdf0e10cSrcweir     //                      pWidths MUST support at least 256 members;
291cdf0e10cSrcweir     //             rInfo: additional outgoing information
292cdf0e10cSrcweir     //             pDataLen: out parameter, contains the byte length of the returned buffer
293cdf0e10cSrcweir     virtual const void* GetEmbedFontData( const ImplFontData* pFont,
294cdf0e10cSrcweir                                           const sal_Ucs* pUnicodes,
295cdf0e10cSrcweir                                           sal_Int32* pWidths,
296cdf0e10cSrcweir                                           FontSubsetInfo& rInfo,
297cdf0e10cSrcweir                                           long* pDataLen ) = 0;
298cdf0e10cSrcweir     // frees the font data again
299cdf0e10cSrcweir     virtual void			FreeEmbedFontData( const void* pData, long nDataLen ) = 0;
300cdf0e10cSrcweir 
301cdf0e10cSrcweir     // get the same widths as in CreateFontSubset and GetEmbedFontData
302cdf0e10cSrcweir     // in case of an embeddable font also fill the mapping
303cdf0e10cSrcweir     // between unicode and glyph id
304cdf0e10cSrcweir     // leave widths vector and mapping untouched in case of failure
305cdf0e10cSrcweir     virtual void            GetGlyphWidths( const ImplFontData* pFont,
306cdf0e10cSrcweir                                             bool bVertical,
307cdf0e10cSrcweir                                             Int32Vector& rWidths,
308cdf0e10cSrcweir                                             Ucs2UIntMap& rUnicodeEnc ) = 0;
309cdf0e10cSrcweir 
310248a599fSHerbert Dürr     virtual bool                    GetGlyphBoundRect( sal_GlyphId, Rectangle& ) = 0;
311248a599fSHerbert Dürr     virtual bool                    GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& ) = 0;
312cdf0e10cSrcweir 
313cdf0e10cSrcweir     virtual SalLayout*              GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) = 0;
314cdf0e10cSrcweir     virtual void					 DrawServerFontLayout( const ServerFontLayout& ) = 0;
315cdf0e10cSrcweir     /** Filter text from DrawText commands in a device specific manner
316cdf0e10cSrcweir         <p>
317cdf0e10cSrcweir         This function allows a device (or rather the corresponding SalGraphics
318cdf0e10cSrcweir         implementation) to prevent text portions from being drawn. This currently
319cdf0e10cSrcweir         is used only for filtering out the fax number in a document that is printed
320cdf0e10cSrcweir         to one of psprint's specialized "fax" printers.
321cdf0e10cSrcweir         </p>
322cdf0e10cSrcweir 
323cdf0e10cSrcweir         @param rOrigText
324cdf0e10cSrcweir         The original text
325cdf0e10cSrcweir 
326cdf0e10cSrcweir         @param rNewText
327cdf0e10cSrcweir         A String that will be filled with the adjusted version
328cdf0e10cSrcweir 
329cdf0e10cSrcweir         @param nIndex
330cdf0e10cSrcweir         The index inside <code>rOrigText</code> that marks the first draw character
331cdf0e10cSrcweir 
332cdf0e10cSrcweir         @param rLen
333cdf0e10cSrcweir         in: length of text beginning at <code>nIndex</code> to be drawn
334cdf0e10cSrcweir         out: length of <code>rNewText</code> containing the substituted text
335cdf0e10cSrcweir 
336cdf0e10cSrcweir         @param rCutStart
337cdf0e10cSrcweir         out: index at which the cutout portion of <code>rOrigText</code> begins
338cdf0e10cSrcweir 
339cdf0e10cSrcweir         @param rCutStop
340cdf0e10cSrcweir         out: index at which the cutout portion of <code>rOrigText</code> ends
341cdf0e10cSrcweir 
342cdf0e10cSrcweir         @returns
343cdf0e10cSrcweir         true: a substitution has taken place and rNewText rLen, rCutStart and rCutStop have been filled accordingly
344cdf0e10cSrcweir         false: no substitution has taken place, rNewText, rLen, rCutStart, rCutStop remain unchanged
345cdf0e10cSrcweir      */
346cdf0e10cSrcweir     virtual bool            filterText( const String& rOrigText, String& rNewText, xub_StrLen nIndex, xub_StrLen& rLen, xub_StrLen& rCutStart, xub_StrLen& rCutStop );
347cdf0e10cSrcweir 
348cdf0e10cSrcweir     virtual bool            supportsOperation( OutDevSupportType ) const = 0;
349cdf0e10cSrcweir 
350cdf0e10cSrcweir     // mirroring specifica
GetLayout()351cdf0e10cSrcweir 	int						GetLayout() { return m_nLayout; }
SetLayout(int aLayout)352cdf0e10cSrcweir 	void					SetLayout( int aLayout ) { m_nLayout = aLayout;}
353cdf0e10cSrcweir 
354cdf0e10cSrcweir 	void					mirror( long& nX, const OutputDevice *pOutDev, bool bBack = false ) const;
355cdf0e10cSrcweir 	void					mirror( long& nX, long& nWidth, const OutputDevice *pOutDev, bool bBack = false ) const;
356cdf0e10cSrcweir 	sal_Bool					mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev, bool bBack = false ) const;
357cdf0e10cSrcweir     void                    mirror( Rectangle& rRect, const OutputDevice*, bool bBack = false ) const;
358cdf0e10cSrcweir     void                    mirror( Region& rRgn, const OutputDevice *pOutDev, bool bBack = false ) const;
359cdf0e10cSrcweir     void                    mirror( ControlType,const ImplControlValue&,const OutputDevice*,bool bBack = false) const;
360cdf0e10cSrcweir 	basegfx::B2DPoint       mirror( const basegfx::B2DPoint& i_rPoint, const OutputDevice *pOutDev, bool bBack = false ) const;
361cdf0e10cSrcweir 	basegfx::B2DPolygon     mirror( const basegfx::B2DPolygon& i_rPoly, const OutputDevice *pOutDev, bool bBack = false ) const;
362cdf0e10cSrcweir 	basegfx::B2DPolyPolygon mirror( const basegfx::B2DPolyPolygon& i_rPoly, const OutputDevice *pOutDev, bool bBack = false ) const;
363cdf0e10cSrcweir 
364cdf0e10cSrcweir     // non virtual methods; these do possible coordinate mirroring and
365cdf0e10cSrcweir     // then delegate to protected virtual methods
366cdf0e10cSrcweir     bool                    SetClipRegion( const Region&, const OutputDevice *pOutDev );
367cdf0e10cSrcweir 
368cdf0e10cSrcweir     // draw --> LineColor and FillColor and RasterOp and ClipRegion
369cdf0e10cSrcweir     void                    DrawPixel( long nX, long nY, const OutputDevice *pOutDev );
370cdf0e10cSrcweir     void                    DrawPixel( long nX, long nY, SalColor nSalColor, const OutputDevice *pOutDev );
371cdf0e10cSrcweir     void                    DrawLine( long nX1, long nY1, long nX2, long nY2, const OutputDevice *pOutDev );
372cdf0e10cSrcweir     void                    DrawRect( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev );
37354ae6a37SHerbert Dürr     void                    DrawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev );
37454ae6a37SHerbert Dürr     void                    DrawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev );
375cdf0e10cSrcweir     void                    DrawPolyPolygon( sal_uInt32 nPoly,
376cdf0e10cSrcweir                                              const sal_uInt32* pPoints,
377cdf0e10cSrcweir                                              PCONSTSALPOINT* pPtAry,
378cdf0e10cSrcweir                                              const OutputDevice *pOutDev );
379cdf0e10cSrcweir     bool                    DrawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency, const OutputDevice* );
3805aaf853bSArmin Le Grand 
3815aaf853bSArmin Le Grand     bool DrawPolyLine(
3825aaf853bSArmin Le Grand         const basegfx::B2DPolygon& i_rPolygon,
3835aaf853bSArmin Le Grand         double i_fTransparency,
3845aaf853bSArmin Le Grand         const basegfx::B2DVector& i_rLineWidth,
3855aaf853bSArmin Le Grand         basegfx::B2DLineJoin i_eLineJoin,
3865aaf853bSArmin Le Grand         com::sun::star::drawing::LineCap i_eLineCap,
3875aaf853bSArmin Le Grand         const OutputDevice* i_pOutDev);
3885aaf853bSArmin Le Grand 
38954ae6a37SHerbert Dürr     sal_Bool                DrawPolyLineBezier( sal_uInt32 nPoints,
390cdf0e10cSrcweir                                                 const SalPoint* pPtAry,
391cdf0e10cSrcweir                                                 const sal_uInt8* pFlgAry,
392cdf0e10cSrcweir                                                 const OutputDevice *pOutDev );
39354ae6a37SHerbert Dürr     sal_Bool                DrawPolygonBezier( sal_uInt32 nPoints,
394cdf0e10cSrcweir                                                const SalPoint* pPtAry,
395cdf0e10cSrcweir                                                const sal_uInt8* pFlgAry,
396cdf0e10cSrcweir                                                const OutputDevice *pOutDev );
397cdf0e10cSrcweir     sal_Bool                DrawPolyPolygonBezier( sal_uInt32 nPoly,
398cdf0e10cSrcweir                                                    const sal_uInt32* pPoints,
399cdf0e10cSrcweir                                                    const SalPoint* const* pPtAry,
400cdf0e10cSrcweir                                                    const sal_uInt8* const* pFlgAry,
401cdf0e10cSrcweir                                                    const OutputDevice *pOutDev );
402cdf0e10cSrcweir 
403cdf0e10cSrcweir     // CopyArea --> No RasterOp, but ClipRegion
404cdf0e10cSrcweir     void                    CopyArea( long nDestX,
405cdf0e10cSrcweir                                       long nDestY,
406cdf0e10cSrcweir                                       long nSrcX,
407cdf0e10cSrcweir                                       long nSrcY,
408cdf0e10cSrcweir                                       long nSrcWidth,
409cdf0e10cSrcweir                                       long nSrcHeight,
410cdf0e10cSrcweir                                       sal_uInt16 nFlags,
411cdf0e10cSrcweir                                       const OutputDevice *pOutDev );
412cdf0e10cSrcweir 
413cdf0e10cSrcweir     // CopyBits and DrawBitmap --> RasterOp and ClipRegion
414cdf0e10cSrcweir     // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
4155f27b83cSArmin Le Grand     void                    CopyBits( const SalTwoRect& rPosAry,
416cdf0e10cSrcweir                                       SalGraphics* pSrcGraphics,
417cdf0e10cSrcweir                                       const OutputDevice *pOutDev,
418cdf0e10cSrcweir                                       const OutputDevice *pSrcOutDev );
4195f27b83cSArmin Le Grand     void                    DrawBitmap( const SalTwoRect& rPosAry,
420cdf0e10cSrcweir                                         const SalBitmap& rSalBitmap,
421cdf0e10cSrcweir                                         const OutputDevice *pOutDev );
4225f27b83cSArmin Le Grand     void                    DrawBitmap( const SalTwoRect& rPosAry,
423cdf0e10cSrcweir                                         const SalBitmap& rSalBitmap,
424cdf0e10cSrcweir                                         SalColor nTransparentColor,
425cdf0e10cSrcweir                                         const OutputDevice *pOutDev );
4265f27b83cSArmin Le Grand     void                    DrawBitmap( const SalTwoRect& rPosAry,
427cdf0e10cSrcweir                                         const SalBitmap& rSalBitmap,
428cdf0e10cSrcweir                                         const SalBitmap& rTransparentBitmap,
429cdf0e10cSrcweir                                         const OutputDevice *pOutDev );
430cdf0e10cSrcweir 
4315f27b83cSArmin Le Grand     void                    DrawMask( const SalTwoRect& rPosAry,
432cdf0e10cSrcweir                                       const SalBitmap& rSalBitmap,
433cdf0e10cSrcweir                                       SalColor nMaskColor,
434cdf0e10cSrcweir                                       const OutputDevice *pOutDev );
435cdf0e10cSrcweir 
436cdf0e10cSrcweir     SalBitmap*              GetBitmap( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev );
437cdf0e10cSrcweir     SalColor                GetPixel( long nX, long nY, const OutputDevice *pOutDev );
438cdf0e10cSrcweir 
439cdf0e10cSrcweir     // invert --> ClipRegion (only Windows)
440cdf0e10cSrcweir     void                    Invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags, const OutputDevice *pOutDev );
44154ae6a37SHerbert Dürr     void                    Invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags, const OutputDevice *pOutDev );
442cdf0e10cSrcweir 
443cdf0e10cSrcweir     sal_Bool                    DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize, const OutputDevice *pOutDev );
444cdf0e10cSrcweir 
445cdf0e10cSrcweir     //-------------------------------------
446cdf0e10cSrcweir     //  Native Widget Rendering functions
447cdf0e10cSrcweir     //-------------------------------------
448cdf0e10cSrcweir 
449cdf0e10cSrcweir     // Query the platform layer for control support
450cdf0e10cSrcweir     virtual sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart );
451cdf0e10cSrcweir 
452cdf0e10cSrcweir     // Query the native control to determine if it was acted upon
453cdf0e10cSrcweir     sal_Bool HitTestNativeControl( ControlType nType,
454cdf0e10cSrcweir 									  ControlPart nPart,
455cdf0e10cSrcweir 									  const Rectangle& rControlRegion,
456cdf0e10cSrcweir 									  const Point& aPos,
457cdf0e10cSrcweir                                       sal_Bool& rIsInside,
458cdf0e10cSrcweir                                       const OutputDevice *pOutDev );
459cdf0e10cSrcweir 
460cdf0e10cSrcweir     // Request rendering of a particular control and/or part
461cdf0e10cSrcweir     sal_Bool DrawNativeControl( ControlType nType,
462cdf0e10cSrcweir 									ControlPart nPart,
463cdf0e10cSrcweir 									const Rectangle& rControlRegion,
464cdf0e10cSrcweir 									ControlState nState,
465cdf0e10cSrcweir 									const ImplControlValue& aValue,
466cdf0e10cSrcweir 									const rtl::OUString& aCaption,
467cdf0e10cSrcweir                                     const OutputDevice *pOutDev );
468cdf0e10cSrcweir 
469cdf0e10cSrcweir     // Request rendering of a caption string for a control
470cdf0e10cSrcweir     sal_Bool DrawNativeControlText( ControlType nType,
471cdf0e10cSrcweir 										ControlPart nPart,
472cdf0e10cSrcweir 										const Rectangle& rControlRegion,
473cdf0e10cSrcweir 										ControlState nState,
474cdf0e10cSrcweir 										const ImplControlValue& aValue,
475cdf0e10cSrcweir 										const rtl::OUString& aCaption,
476cdf0e10cSrcweir                                         const OutputDevice *pOutDev );
477cdf0e10cSrcweir 
478cdf0e10cSrcweir     // Query the native control's actual drawing region (including adornment)
479cdf0e10cSrcweir     sal_Bool GetNativeControlRegion( ControlType nType,
480cdf0e10cSrcweir 										 ControlPart nPart,
481cdf0e10cSrcweir 										 const Rectangle& rControlRegion,
482cdf0e10cSrcweir 										 ControlState nState,
483cdf0e10cSrcweir 										 const ImplControlValue& aValue,
484cdf0e10cSrcweir 										 const rtl::OUString& aCaption,
485cdf0e10cSrcweir 										 Rectangle &rNativeBoundingRegion,
486cdf0e10cSrcweir 										 Rectangle &rNativeContentRegion,
487cdf0e10cSrcweir                                          const OutputDevice *pOutDev );
488cdf0e10cSrcweir 
489cdf0e10cSrcweir     static void AddDevFontSubstitute( OutputDevice* pOutDev,
490cdf0e10cSrcweir                                       const String& rFontName,
491cdf0e10cSrcweir                                       const String& rReplaceFontName,
492cdf0e10cSrcweir                                       sal_uInt16 nFlags = 0 );
493cdf0e10cSrcweir 
494cdf0e10cSrcweir     bool DrawAlphaBitmap( const SalTwoRect&,
495cdf0e10cSrcweir                           const SalBitmap& rSourceBitmap,
496cdf0e10cSrcweir                           const SalBitmap& rAlphaBitmap,
497cdf0e10cSrcweir                           const OutputDevice *pOutDev );
498cdf0e10cSrcweir 
4995f27b83cSArmin Le Grand     bool DrawTransformedBitmap(
5005f27b83cSArmin Le Grand         const basegfx::B2DPoint& rNull,
5015f27b83cSArmin Le Grand         const basegfx::B2DPoint& rX,
5025f27b83cSArmin Le Grand         const basegfx::B2DPoint& rY,
5035f27b83cSArmin Le Grand         const SalBitmap& rSourceBitmap,
5045f27b83cSArmin Le Grand         const SalBitmap* pAlphaBitmap,
5055f27b83cSArmin Le Grand         const OutputDevice* pOutDev );
5065f27b83cSArmin Le Grand 
507cdf0e10cSrcweir     bool DrawAlphaRect( long nX, long nY, long nWidth, long nHeight,
508cdf0e10cSrcweir                         sal_uInt8 nTransparency, const OutputDevice *pOutDev );
509cdf0e10cSrcweir 
510cdf0e10cSrcweir     virtual SystemGraphicsData   GetGraphicsData() const = 0;
511cdf0e10cSrcweir     virtual SystemFontData       GetSysFontData( int nFallbacklevel ) const = 0;
512cdf0e10cSrcweir };
513cdf0e10cSrcweir 
514cdf0e10cSrcweir #endif // _SV_SALGDI_HXX
515