xref: /aoo42x/main/vcl/unx/headless/svpgdi.hxx (revision 0d63794c)
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( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin );
119     virtual void			drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry );
120     virtual void			drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry );
121     virtual void			drawPolyPolygon( sal_uInt32 nPoly,
122                                              const sal_uInt32* pPoints,
123                                              PCONSTSALPOINT* pPtAry );
124     virtual sal_Bool		drawPolyLineBezier( sal_uLong nPoints,
125                                                 const SalPoint* pPtAry,
126                                                 const sal_uInt8* pFlgAry );
127     virtual sal_Bool		drawPolygonBezier( sal_uLong nPoints,
128                                                const SalPoint* pPtAry,
129                                                const sal_uInt8* pFlgAry );
130     virtual sal_Bool		drawPolyPolygonBezier( sal_uInt32 nPoly,
131                                                    const sal_uInt32* pPoints,
132                                                    const SalPoint* const* pPtAry,
133                                                    const sal_uInt8* const* pFlgAry );
134 
135     virtual void			copyArea( long nDestX,
136                                       long nDestY,
137                                       long nSrcX,
138                                       long nSrcY,
139                                       long nSrcWidth,
140                                       long nSrcHeight,
141                                       sal_uInt16 nFlags );
142     virtual void			copyBits( const SalTwoRect* pPosAry,
143                                       SalGraphics* pSrcGraphics );
144     virtual void			drawBitmap( const SalTwoRect* pPosAry,
145                                         const SalBitmap& rSalBitmap );
146     virtual void			drawBitmap( const SalTwoRect* pPosAry,
147                                         const SalBitmap& rSalBitmap,
148                                         SalColor nTransparentColor );
149     virtual void			drawBitmap( const SalTwoRect* pPosAry,
150                                         const SalBitmap& rSalBitmap,
151                                         const SalBitmap& rTransparentBitmap );
152     virtual void			drawMask( const SalTwoRect* pPosAry,
153                                       const SalBitmap& rSalBitmap,
154                                       SalColor nMaskColor );
155     virtual SalBitmap*		getBitmap( long nX, long nY, long nWidth, long nHeight );
156     virtual SalColor		getPixel( long nX, long nY );
157     virtual void			invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags );
158     virtual void			invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags );
159 
160     virtual sal_Bool			drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize );
161 
162     virtual SystemGraphicsData GetGraphicsData() const;
163     virtual SystemFontData     GetSysFontData( int nFallbacklevel ) const;
164 };
165 
166 #endif
167 
168