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