xref: /trunk/main/vcl/unx/headless/svppspgraphics.hxx (revision 5aaf853b)
10d63794cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
30d63794cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
40d63794cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
50d63794cSAndrew Rist  * distributed with this work for additional information
60d63794cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
70d63794cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
80d63794cSAndrew Rist  * "License"); you may not use this file except in compliance
90d63794cSAndrew Rist  * with the License.  You may obtain a copy of the License at
100d63794cSAndrew Rist  *
110d63794cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
120d63794cSAndrew Rist  *
130d63794cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
140d63794cSAndrew Rist  * software distributed under the License is distributed on an
150d63794cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
160d63794cSAndrew Rist  * KIND, either express or implied.  See the License for the
170d63794cSAndrew Rist  * specific language governing permissions and limitations
180d63794cSAndrew Rist  * under the License.
190d63794cSAndrew Rist  *
200d63794cSAndrew Rist  *************************************************************/
210d63794cSAndrew Rist 
220d63794cSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SVP_PSPGRAPHICS_HXX
25cdf0e10cSrcweir #define _SVP_PSPGRAPHICS_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include "vcl/fontmanager.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include "sallayout.hxx"
31cdf0e10cSrcweir #include "salgdi.hxx"
32cdf0e10cSrcweir 
33cdf0e10cSrcweir namespace psp { struct JobData; class PrinterGfx; }
34cdf0e10cSrcweir 
35cdf0e10cSrcweir class ServerFont;
36cdf0e10cSrcweir class ImplDevFontAttributes;
37cdf0e10cSrcweir class SalInfoPrinter;
38cdf0e10cSrcweir 
39cdf0e10cSrcweir class PspGraphics : public SalGraphics
40cdf0e10cSrcweir {
41cdf0e10cSrcweir     psp::JobData*				m_pJobData;
42cdf0e10cSrcweir     psp::PrinterGfx*			m_pPrinterGfx;
43cdf0e10cSrcweir     String*						m_pPhoneNr;
44cdf0e10cSrcweir     bool						m_bSwallowFaxNo;
45cdf0e10cSrcweir     String						m_aPhoneCollection;
46cdf0e10cSrcweir     bool						m_bPhoneCollectionActive;
47cdf0e10cSrcweir 
48cdf0e10cSrcweir     ServerFont*					m_pServerFont[ MAX_FALLBACK ];
49cdf0e10cSrcweir     bool						m_bFontVertical;
50cdf0e10cSrcweir     SalInfoPrinter*             m_pInfoPrinter;
51cdf0e10cSrcweir 
52cdf0e10cSrcweir protected:
53cdf0e10cSrcweir     virtual bool drawAlphaBitmap( const SalTwoRect&, const SalBitmap& rSourceBitmap, const SalBitmap& rAlphaBitmap );
54cdf0e10cSrcweir     virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency );
55cdf0e10cSrcweir 
56cdf0e10cSrcweir public:
57cdf0e10cSrcweir     PspGraphics( psp::JobData* pJob, psp::PrinterGfx* pGfx, String* pPhone, bool bSwallow, SalInfoPrinter* pInfoPrinter )
58cdf0e10cSrcweir             : m_pJobData( pJob ),
59cdf0e10cSrcweir               m_pPrinterGfx( pGfx ),
60cdf0e10cSrcweir               m_pPhoneNr( pPhone ),
61cdf0e10cSrcweir               m_bSwallowFaxNo( bSwallow ),
62cdf0e10cSrcweir               m_bPhoneCollectionActive( false ),
63cdf0e10cSrcweir               m_bFontVertical( false ),
64cdf0e10cSrcweir               m_pInfoPrinter( pInfoPrinter )
65cdf0e10cSrcweir     { for( int i = 0; i < MAX_FALLBACK; i++ ) m_pServerFont[i] = 0; }
66cdf0e10cSrcweir     virtual ~PspGraphics();
67cdf0e10cSrcweir 
68cdf0e10cSrcweir     // helper methods for sharing with X11SalGraphics
69cdf0e10cSrcweir     static const void* DoGetEmbedFontData( psp::fontID aFont, const sal_Ucs* pUnicodes, sal_Int32* pWidths, FontSubsetInfo& rInfo, long* pDataLen );
70cdf0e10cSrcweir     static void DoFreeEmbedFontData( const void* pData, long nLen );
71cdf0e10cSrcweir     static const Ucs2SIntMap* DoGetFontEncodingVector( psp::fontID aFont, const Ucs2OStrMap** pNonEncoded );
72cdf0e10cSrcweir     static void DoGetGlyphWidths( psp::fontID aFont,
73cdf0e10cSrcweir                                   bool bVertical,
74cdf0e10cSrcweir                                   Int32Vector& rWidths,
75cdf0e10cSrcweir                                   Ucs2UIntMap& rUnicodeEnc );
76cdf0e10cSrcweir     static ImplDevFontAttributes Info2DevFontAttributes( const psp::FastPrintFontInfo& );
77cdf0e10cSrcweir     static void AnnounceFonts( ImplDevFontList*, const psp::FastPrintFontInfo& );
78cdf0e10cSrcweir     static FontWidth	ToFontWidth (psp::width::type eWidth);
79cdf0e10cSrcweir     static FontWeight	ToFontWeight (psp::weight::type eWeight);
80cdf0e10cSrcweir     static FontPitch	ToFontPitch (psp::pitch::type ePitch);
81cdf0e10cSrcweir     static FontItalic	ToFontItalic (psp::italic::type eItalic);
82cdf0e10cSrcweir     static FontFamily	ToFontFamily (psp::family::type eFamily);
83cdf0e10cSrcweir 
84cdf0e10cSrcweir     // overload all pure virtual methods
85cdf0e10cSrcweir     virtual void			GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
86cdf0e10cSrcweir     virtual sal_uInt16			GetBitCount();
87cdf0e10cSrcweir     virtual long			GetGraphicsWidth() const;
88cdf0e10cSrcweir 
89cdf0e10cSrcweir     virtual void			ResetClipRegion();
90cdf0e10cSrcweir     virtual bool            setClipRegion( const Region& );
91cdf0e10cSrcweir 
92cdf0e10cSrcweir     virtual void			SetLineColor();
93cdf0e10cSrcweir     virtual void			SetLineColor( SalColor nSalColor );
94cdf0e10cSrcweir     virtual void			SetFillColor();
95cdf0e10cSrcweir     virtual void          	SetFillColor( SalColor nSalColor );
96cdf0e10cSrcweir     virtual void			SetXORMode( bool bSet, bool );
97cdf0e10cSrcweir     virtual void			SetROPLineColor( SalROPColor nROPColor );
98cdf0e10cSrcweir     virtual void			SetROPFillColor( SalROPColor nROPColor );
99cdf0e10cSrcweir 
100cdf0e10cSrcweir     virtual void			SetTextColor( SalColor nSalColor );
101cdf0e10cSrcweir     virtual sal_uInt16          SetFont( ImplFontSelectData*, int nFallbackLevel );
102cdf0e10cSrcweir     virtual void			GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
103cdf0e10cSrcweir     virtual sal_uLong			GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs );
104cdf0e10cSrcweir     virtual const ImplFontCharMap* GetImplFontCharMap() const;
105cdf0e10cSrcweir     virtual void			GetDevFontList( ImplDevFontList* );
106cdf0e10cSrcweir     virtual void			GetDevFontSubstList( OutputDevice* );
107cdf0e10cSrcweir     virtual bool			AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
108cdf0e10cSrcweir     virtual sal_Bool			CreateFontSubset( const rtl::OUString& rToFile,
109cdf0e10cSrcweir                                               const ImplFontData*,
110cdf0e10cSrcweir                                               sal_Int32* pGlyphIDs,
111cdf0e10cSrcweir                                               sal_uInt8* pEncoding,
112cdf0e10cSrcweir                                               sal_Int32* pWidths,
113cdf0e10cSrcweir                                               int nGlyphs,
114cdf0e10cSrcweir                                               FontSubsetInfo& rInfo
115cdf0e10cSrcweir                                               );
116cdf0e10cSrcweir     virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded );
117cdf0e10cSrcweir     virtual const void*	GetEmbedFontData( const ImplFontData*,
118cdf0e10cSrcweir                                           const sal_Ucs* pUnicodes,
119cdf0e10cSrcweir                                           sal_Int32* pWidths,
120cdf0e10cSrcweir                                           FontSubsetInfo& rInfo,
121cdf0e10cSrcweir                                           long* pDataLen );
122cdf0e10cSrcweir     virtual void			FreeEmbedFontData( const void* pData, long nDataLen );
123cdf0e10cSrcweir     virtual void            GetGlyphWidths( const ImplFontData*,
124cdf0e10cSrcweir                                             bool bVertical,
125cdf0e10cSrcweir                                             Int32Vector& rWidths,
126cdf0e10cSrcweir                                             Ucs2UIntMap& rUnicodeEnc );
127cdf0e10cSrcweir     virtual sal_Bool			GetGlyphBoundRect( long nIndex, Rectangle& );
128cdf0e10cSrcweir     virtual sal_Bool			GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
129cdf0e10cSrcweir     virtual SalLayout*		GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
130cdf0e10cSrcweir     virtual void			DrawServerFontLayout( const ServerFontLayout& );
131cdf0e10cSrcweir     virtual bool            supportsOperation( OutDevSupportType ) const;
132cdf0e10cSrcweir     virtual void			drawPixel( long nX, long nY );
133cdf0e10cSrcweir     virtual void			drawPixel( long nX, long nY, SalColor nSalColor );
134cdf0e10cSrcweir     virtual void			drawLine( long nX1, long nY1, long nX2, long nY2 );
135cdf0e10cSrcweir     virtual void			drawRect( long nX, long nY, long nWidth, long nHeight );
136cdf0e10cSrcweir     virtual void			drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry );
137cdf0e10cSrcweir     virtual void			drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry );
138cdf0e10cSrcweir     virtual bool            drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency );
139*5aaf853bSArmin Le Grand     virtual bool            drawPolyLine(
140*5aaf853bSArmin Le Grand         const ::basegfx::B2DPolygon&,
141*5aaf853bSArmin Le Grand         double fTransparency,
142*5aaf853bSArmin Le Grand         const ::basegfx::B2DVector& rLineWidths,
143*5aaf853bSArmin Le Grand         basegfx::B2DLineJoin,
144*5aaf853bSArmin Le Grand         com::sun::star::drawing::LineCap);
145cdf0e10cSrcweir     virtual void			drawPolyPolygon( sal_uInt32 nPoly,
146cdf0e10cSrcweir                                              const sal_uInt32* pPoints,
147cdf0e10cSrcweir                                              PCONSTSALPOINT* pPtAry );
148cdf0e10cSrcweir     virtual sal_Bool		drawPolyLineBezier( sal_uLong nPoints,
149cdf0e10cSrcweir                                                 const SalPoint* pPtAry,
150cdf0e10cSrcweir                                                 const sal_uInt8* pFlgAry );
151cdf0e10cSrcweir     virtual sal_Bool		drawPolygonBezier( sal_uLong nPoints,
152cdf0e10cSrcweir                                                const SalPoint* pPtAry,
153cdf0e10cSrcweir                                                const sal_uInt8* pFlgAry );
154cdf0e10cSrcweir     virtual sal_Bool		drawPolyPolygonBezier( sal_uInt32 nPoly,
155cdf0e10cSrcweir                                                    const sal_uInt32* pPoints,
156cdf0e10cSrcweir                                                    const SalPoint* const* pPtAry,
157cdf0e10cSrcweir                                                    const sal_uInt8* const* pFlgAry );
158cdf0e10cSrcweir 
159cdf0e10cSrcweir     virtual void			copyArea( long nDestX,
160cdf0e10cSrcweir                                       long nDestY,
161cdf0e10cSrcweir                                       long nSrcX,
162cdf0e10cSrcweir                                       long nSrcY,
163cdf0e10cSrcweir                                       long nSrcWidth,
164cdf0e10cSrcweir                                       long nSrcHeight,
165cdf0e10cSrcweir                                       sal_uInt16 nFlags );
166cdf0e10cSrcweir     virtual void			copyBits( const SalTwoRect* pPosAry,
167cdf0e10cSrcweir                                       SalGraphics* pSrcGraphics );
168cdf0e10cSrcweir     virtual void			drawBitmap( const SalTwoRect* pPosAry,
169cdf0e10cSrcweir                                         const SalBitmap& rSalBitmap );
170cdf0e10cSrcweir     virtual void			drawBitmap( const SalTwoRect* pPosAry,
171cdf0e10cSrcweir                                         const SalBitmap& rSalBitmap,
172cdf0e10cSrcweir                                         SalColor nTransparentColor );
173cdf0e10cSrcweir     virtual void			drawBitmap( const SalTwoRect* pPosAry,
174cdf0e10cSrcweir                                         const SalBitmap& rSalBitmap,
175cdf0e10cSrcweir                                         const SalBitmap& rTransparentBitmap );
176cdf0e10cSrcweir     virtual void			drawMask( const SalTwoRect* pPosAry,
177cdf0e10cSrcweir                                       const SalBitmap& rSalBitmap,
178cdf0e10cSrcweir                                       SalColor nMaskColor );
179cdf0e10cSrcweir     virtual SalBitmap*		getBitmap( long nX, long nY, long nWidth, long nHeight );
180cdf0e10cSrcweir     virtual SalColor		getPixel( long nX, long nY );
181cdf0e10cSrcweir     virtual void			invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags );
182cdf0e10cSrcweir     virtual void			invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags );
183cdf0e10cSrcweir 
184cdf0e10cSrcweir     virtual sal_Bool			drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize );
185cdf0e10cSrcweir     virtual bool            filterText( const String& rOrigText, String& rNewText, xub_StrLen nIndex, xub_StrLen& rLen, xub_StrLen& rCutStart, xub_StrLen& rCutStop );
186cdf0e10cSrcweir 
187cdf0e10cSrcweir     virtual SystemGraphicsData 		GetGraphicsData() const;
188cdf0e10cSrcweir     virtual SystemFontData          GetSysFontData( int nFallbacklevel ) const;
189cdf0e10cSrcweir };
190cdf0e10cSrcweir 
191cdf0e10cSrcweir #endif // _SVP_PSPGRAPHICS_HXX
192cdf0e10cSrcweir 
193