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