xref: /aoo42x/main/vcl/unx/headless/svpgdi.hxx (revision 5aaf853b)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SVP_SVPGDI_HXX
25 
26 #include <basebmp/bitmapdevice.hxx>
27 #include <basebmp/color.hxx>
28 
29 #include <salgdi.hxx>
30 #include <sallayout.hxx>
31 
32 class ServerFont;
33 
34 class SvpSalGraphics : public SalGraphics
35 {
36     basebmp::BitmapDeviceSharedPtr       m_aDevice;
37     basebmp::BitmapDeviceSharedPtr       m_aOrigDevice;
38     basebmp::BitmapDeviceSharedPtr       m_aClipMap;
39 
40     bool                                 m_bUseLineColor;
41     basebmp::Color                       m_aLineColor;
42     bool                                 m_bUseFillColor;
43     basebmp::Color                       m_aFillColor;
44     basebmp::Color                       m_aTextColor;
45 
46     basebmp::DrawMode                    m_aDrawMode;
47 
48     ServerFont*                          m_pServerFont[ MAX_FALLBACK ];
49     sal_uInt32                           m_eTextFmt;
50 
51 protected:
52     virtual bool drawAlphaBitmap( const SalTwoRect&, const SalBitmap& rSourceBitmap, const SalBitmap& rAlphaBitmap );
53     virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency );
54 
55 public:
56     SvpSalGraphics();
57     virtual	~SvpSalGraphics();
58 
59     const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aDevice; }
60     void setDevice( basebmp::BitmapDeviceSharedPtr& rDevice );
61 
62     // overload all pure virtual methods
63     virtual void			GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
64     virtual sal_uInt16			GetBitCount();
65     virtual long			GetGraphicsWidth() const;
66 
67     virtual void			ResetClipRegion();
68     virtual bool            setClipRegion( const Region& );
69 
70     virtual void			SetLineColor();
71     virtual void			SetLineColor( SalColor nSalColor );
72     virtual void			SetFillColor();
73 
74     virtual void                        SetFillColor( SalColor nSalColor );
75 
76     virtual void			SetXORMode( bool bSet, bool );
77 
78     virtual void			SetROPLineColor( SalROPColor nROPColor );
79     virtual void			SetROPFillColor( SalROPColor nROPColor );
80 
81     virtual void			SetTextColor( SalColor nSalColor );
82     virtual sal_uInt16                  SetFont( ImplFontSelectData*, int nFallbackLevel );
83     virtual void			GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
84     virtual sal_uLong			GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs );
85     virtual const ImplFontCharMap* GetImplFontCharMap() const;
86     virtual void			GetDevFontList( ImplDevFontList* );
87     virtual void			GetDevFontSubstList( OutputDevice* );
88     virtual bool			AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
89     virtual sal_Bool			CreateFontSubset( const rtl::OUString& rToFile,
90                                               const ImplFontData*,
91                                               sal_Int32* pGlyphIDs,
92                                               sal_uInt8* pEncoding,
93                                               sal_Int32* pWidths,
94                                               int nGlyphs,
95                                               FontSubsetInfo& rInfo
96                                               );
97     virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded );
98     virtual const void*	GetEmbedFontData( const ImplFontData*,
99                                           const sal_Ucs* pUnicodes,
100                                           sal_Int32* pWidths,
101                                           FontSubsetInfo& rInfo,
102                                           long* pDataLen );
103     virtual void			FreeEmbedFontData( const void* pData, long nDataLen );
104     virtual void            GetGlyphWidths( const ImplFontData*,
105                                             bool bVertical,
106                                             Int32Vector& rWidths,
107                                             Ucs2UIntMap& rUnicodeEnc );
108     virtual sal_Bool			GetGlyphBoundRect( long nIndex, Rectangle& );
109     virtual sal_Bool			GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
110     virtual SalLayout*		GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
111     virtual void			DrawServerFontLayout( const ServerFontLayout& );
112     virtual bool            supportsOperation( OutDevSupportType ) const;
113     virtual void			drawPixel( long nX, long nY );
114     virtual void			drawPixel( long nX, long nY, SalColor nSalColor );
115     virtual void			drawLine( long nX1, long nY1, long nX2, long nY2 );
116     virtual void			drawRect( long nX, long nY, long nWidth, long nHeight );
117     virtual bool            drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency );
118     virtual bool            drawPolyLine(
119         const ::basegfx::B2DPolygon&,
120         double fTransparency,
121         const ::basegfx::B2DVector& rLineWidths,
122         basegfx::B2DLineJoin,
123         com::sun::star::drawing::LineCap);
124     virtual void			drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry );
125     virtual void			drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry );
126     virtual void			drawPolyPolygon( sal_uInt32 nPoly,
127                                              const sal_uInt32* pPoints,
128                                              PCONSTSALPOINT* pPtAry );
129     virtual sal_Bool		drawPolyLineBezier( sal_uLong nPoints,
130                                                 const SalPoint* pPtAry,
131                                                 const sal_uInt8* pFlgAry );
132     virtual sal_Bool		drawPolygonBezier( sal_uLong nPoints,
133                                                const SalPoint* pPtAry,
134                                                const sal_uInt8* pFlgAry );
135     virtual sal_Bool		drawPolyPolygonBezier( sal_uInt32 nPoly,
136                                                    const sal_uInt32* pPoints,
137                                                    const SalPoint* const* pPtAry,
138                                                    const sal_uInt8* const* pFlgAry );
139 
140     virtual void			copyArea( long nDestX,
141                                       long nDestY,
142                                       long nSrcX,
143                                       long nSrcY,
144                                       long nSrcWidth,
145                                       long nSrcHeight,
146                                       sal_uInt16 nFlags );
147     virtual void			copyBits( const SalTwoRect* pPosAry,
148                                       SalGraphics* pSrcGraphics );
149     virtual void			drawBitmap( const SalTwoRect* pPosAry,
150                                         const SalBitmap& rSalBitmap );
151     virtual void			drawBitmap( const SalTwoRect* pPosAry,
152                                         const SalBitmap& rSalBitmap,
153                                         SalColor nTransparentColor );
154     virtual void			drawBitmap( const SalTwoRect* pPosAry,
155                                         const SalBitmap& rSalBitmap,
156                                         const SalBitmap& rTransparentBitmap );
157     virtual void			drawMask( const SalTwoRect* pPosAry,
158                                       const SalBitmap& rSalBitmap,
159                                       SalColor nMaskColor );
160     virtual SalBitmap*		getBitmap( long nX, long nY, long nWidth, long nHeight );
161     virtual SalColor		getPixel( long nX, long nY );
162     virtual void			invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags );
163     virtual void			invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags );
164 
165     virtual sal_Bool			drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize );
166 
167     virtual SystemGraphicsData GetGraphicsData() const;
168     virtual SystemFontData     GetSysFontData( int nFallbacklevel ) const;
169 };
170 
171 #endif
172 
173