1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef _VCL_GENPSPGRAPHICS_H
21 #define _VCL_GENPSPGRAPHICS_H
24 #include "vcl/fontmanager.hxx"
26 #include "vclpluginapi.h"
28 #include "vcl/vclenum.hxx"
29 #include <sallayout.hxx>
31 namespace psp
{ struct JobData
; class PrinterGfx
; }
34 class ImplDevFontAttributes
;
37 class VCL_DLLPUBLIC GenPspGraphics
: public SalGraphics
40 psp::JobData
* m_pJobData
;
41 psp::PrinterGfx
* m_pPrinterGfx
;
42 rtl::OUString
* m_pPhoneNr
;
44 rtl::OUString m_aPhoneCollection
;
45 bool m_bPhoneCollectionActive
;
47 ServerFont
* m_pServerFont
[ MAX_FALLBACK
];
49 SalInfoPrinter
* m_pInfoPrinter
;
52 virtual ~GenPspGraphics();
54 void Init( psp::JobData
* pJob
, psp::PrinterGfx
* pGfx
,
55 rtl::OUString
* pPhone
, bool bSwallow
,
56 SalInfoPrinter
* pInfoPrinter
);
59 static const void * DoGetEmbedFontData ( psp::fontID aFont
, const sal_Ucs
* pUnicodes
,
60 sal_Int32
* pWidths
, FontSubsetInfo
& rInfo
,
62 static void DoFreeEmbedFontData( const void* pData
, long nLen
);
64 // helper methods for sharing with X11SalGraphics
65 static const Ucs2SIntMap
* DoGetFontEncodingVector( psp::fontID aFont
, const Ucs2OStrMap
** pNonEncoded
);
66 static void DoGetGlyphWidths( psp::fontID aFont
,
69 Ucs2UIntMap
& rUnicodeEnc
);
71 static ImplDevFontAttributes
Info2DevFontAttributes( const psp::FastPrintFontInfo
& );
72 static void AnnounceFonts( ImplDevFontList
*, const psp::FastPrintFontInfo
& );
74 // overload all pure virtual methods
75 virtual void GetResolution( sal_Int32
& rDPIX
, sal_Int32
& rDPIY
);
76 virtual sal_uInt16
GetBitCount() const;
77 virtual long GetGraphicsWidth() const;
79 virtual void ResetClipRegion();
80 virtual bool setClipRegion( const Region
& );
82 virtual void SetLineColor();
83 virtual void SetLineColor( SalColor nSalColor
);
84 virtual void SetFillColor();
85 virtual void SetFillColor( SalColor nSalColor
);
86 virtual void SetXORMode( bool bSet
, bool );
87 virtual void SetROPLineColor( SalROPColor nROPColor
);
88 virtual void SetROPFillColor( SalROPColor nROPColor
);
90 virtual void SetTextColor( SalColor nSalColor
);
91 virtual sal_uInt16
SetFont( FontSelectPattern
*, int nFallbackLevel
);
92 virtual void GetFontMetric( ImplFontMetricData
*, int nFallbackLevel
);
93 virtual sal_uLong
GetKernPairs( sal_uLong nMaxPairs
, ImplKernPairData
* );
94 virtual const ImplFontCharMap
* GetImplFontCharMap() const;
95 virtual bool GetImplFontCapabilities(vcl::FontCapabilities
&rFontCapabilities
) const;
96 virtual void GetDevFontList( ImplDevFontList
* );
97 // graphics must drop any cached font info
98 virtual void ClearDevFontCache();
99 virtual void GetDevFontSubstList( OutputDevice
* );
100 virtual bool AddTempDevFont( ImplDevFontList
*, const rtl::OUString
& rFileURL
, const rtl::OUString
& rFontName
);
102 virtual sal_Bool
CreateFontSubset( const rtl::OUString
& rToFile
,
103 const PhysicalFontFace
*,
104 sal_Int32
* pGlyphIDs
,
105 sal_uInt8
* pEncoding
,
108 FontSubsetInfo
& rInfo
110 virtual const Ucs2SIntMap
* GetFontEncodingVector( const PhysicalFontFace
*, const Ucs2OStrMap
** ppNonEncoded
);
111 virtual const void* GetEmbedFontData( const PhysicalFontFace
*,
112 const sal_Ucs
* pUnicodes
,
114 FontSubsetInfo
& rInfo
,
116 virtual void FreeEmbedFontData( const void* pData
, long nDataLen
);
117 virtual void GetGlyphWidths( const PhysicalFontFace
*,
119 Int32Vector
& rWidths
,
120 Ucs2UIntMap
& rUnicodeEnc
);
121 virtual sal_Bool
GetGlyphBoundRect( sal_GlyphId nIndex
, Rectangle
& );
122 virtual sal_Bool
GetGlyphOutline( sal_GlyphId nIndex
, ::basegfx::B2DPolyPolygon
& );
123 virtual SalLayout
* GetTextLayout( ImplLayoutArgs
&, int nFallbackLevel
);
124 virtual void DrawServerFontLayout( const ServerFontLayout
& );
125 virtual bool supportsOperation( OutDevSupportType
) const;
126 virtual void drawPixel( long nX
, long nY
);
127 virtual void drawPixel( long nX
, long nY
, SalColor nSalColor
);
128 virtual void drawLine( long nX1
, long nY1
, long nX2
, long nY2
);
129 virtual void drawRect( long nX
, long nY
, long nWidth
, long nHeight
);
130 virtual void drawPolyLine( sal_uIntPtr nPoints
, const SalPoint
* pPtAry
);
131 virtual void drawPolygon( sal_uIntPtr nPoints
, const SalPoint
* pPtAry
);
132 virtual void drawPolyPolygon( sal_uInt32 nPoly
,
133 const sal_uInt32
* pPoints
,
134 PCONSTSALPOINT
* pPtAry
);
135 virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon
&, double fTransparency
);
136 virtual bool drawPolyLine(
137 const basegfx::B2DPolygon
&,
138 double fTransparency
,
139 const basegfx::B2DVector
& rLineWidths
,
140 basegfx::B2DLineJoin
,
141 com::sun::star::drawing::LineCap
);
142 virtual sal_Bool
drawPolyLineBezier( sal_uIntPtr nPoints
,
143 const SalPoint
* pPtAry
,
144 const sal_uInt8
* pFlgAry
);
145 virtual sal_Bool
drawPolygonBezier( sal_uIntPtr nPoints
,
146 const SalPoint
* pPtAry
,
147 const sal_uInt8
* pFlgAry
);
148 virtual sal_Bool
drawPolyPolygonBezier( sal_uInt32 nPoly
,
149 const sal_uInt32
* pPoints
,
150 const SalPoint
* const* pPtAry
,
151 const sal_uInt8
* const* pFlgAry
);
152 virtual void copyArea( long nDestX
,
159 virtual void copyBits( const SalTwoRect
* pPosAry
,
160 SalGraphics
* pSrcGraphics
);
161 virtual void drawBitmap( const SalTwoRect
* pPosAry
,
162 const SalBitmap
& rSalBitmap
);
163 virtual void drawBitmap( const SalTwoRect
* pPosAry
,
164 const SalBitmap
& rSalBitmap
,
165 SalColor nTransparentColor
);
166 virtual void drawBitmap( const SalTwoRect
* pPosAry
,
167 const SalBitmap
& rSalBitmap
,
168 const SalBitmap
& rTransparentBitmap
);
169 virtual void drawMask( const SalTwoRect
* pPosAry
,
170 const SalBitmap
& rSalBitmap
,
171 SalColor nMaskColor
);
172 virtual SalBitmap
* getBitmap( long nX
, long nY
, long nWidth
, long nHeight
);
173 virtual SalColor
getPixel( long nX
, long nY
);
174 virtual void invert( long nX
, long nY
, long nWidth
, long nHeight
, SalInvert nFlags
);
175 virtual void invert( sal_uIntPtr nPoints
, const SalPoint
* pPtAry
, SalInvert nFlags
);
177 virtual sal_Bool
drawEPS( long nX
, long nY
, long nWidth
, long nHeight
, void* pPtr
, sal_uIntPtr nSize
);
178 virtual bool filterText( const rtl::OUString
& rOrigText
, rtl::OUString
& rNewText
, xub_StrLen nIndex
, xub_StrLen
& rLen
, xub_StrLen
& rCutStart
, xub_StrLen
& rCutStop
);
180 virtual bool drawAlphaBitmap( const SalTwoRect
&,
181 const SalBitmap
& rSourceBitmap
,
182 const SalBitmap
& rAlphaBitmap
);
183 virtual bool drawAlphaRect( long nX
, long nY
, long nWidth
, long nHeight
, sal_uInt8 nTransparency
);
185 virtual SystemGraphicsData
GetGraphicsData() const;
186 virtual SystemFontData
GetSysFontData( int nFallbacklevel
) const;
189 #endif // _VCL_GENPSPGRAPHICS_H
191 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */