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_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 ); 535f27b83cSArmin Le Grand virtual bool drawTransformedBitmap( 545f27b83cSArmin Le Grand const basegfx::B2DPoint& rNull, 555f27b83cSArmin Le Grand const basegfx::B2DPoint& rX, 565f27b83cSArmin Le Grand const basegfx::B2DPoint& rY, 575f27b83cSArmin Le Grand const SalBitmap& rSourceBitmap, 585f27b83cSArmin Le Grand const SalBitmap* pAlphaBitmap); 59cdf0e10cSrcweir virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency ); 60cdf0e10cSrcweir 61cdf0e10cSrcweir public: 62cdf0e10cSrcweir SvpSalGraphics(); 63cdf0e10cSrcweir virtual ~SvpSalGraphics(); 64cdf0e10cSrcweir getDevice() const65cdf0e10cSrcweir const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aDevice; } 66cdf0e10cSrcweir void setDevice( basebmp::BitmapDeviceSharedPtr& rDevice ); 67cdf0e10cSrcweir 68cdf0e10cSrcweir // overload all pure virtual methods 69cdf0e10cSrcweir virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ); 70cdf0e10cSrcweir virtual sal_uInt16 GetBitCount(); 71cdf0e10cSrcweir virtual long GetGraphicsWidth() const; 72cdf0e10cSrcweir 73cdf0e10cSrcweir virtual void ResetClipRegion(); 74cdf0e10cSrcweir virtual bool setClipRegion( const Region& ); 75cdf0e10cSrcweir 76cdf0e10cSrcweir virtual void SetLineColor(); 77cdf0e10cSrcweir virtual void SetLineColor( SalColor nSalColor ); 78cdf0e10cSrcweir virtual void SetFillColor(); 79cdf0e10cSrcweir 80cdf0e10cSrcweir virtual void SetFillColor( SalColor nSalColor ); 81cdf0e10cSrcweir 82cdf0e10cSrcweir virtual void SetXORMode( bool bSet, bool ); 83cdf0e10cSrcweir 84cdf0e10cSrcweir virtual void SetROPLineColor( SalROPColor nROPColor ); 85cdf0e10cSrcweir virtual void SetROPFillColor( SalROPColor nROPColor ); 86cdf0e10cSrcweir 87cdf0e10cSrcweir virtual void SetTextColor( SalColor nSalColor ); 88cdf0e10cSrcweir virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); 89cdf0e10cSrcweir virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); 90cdf0e10cSrcweir virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs ); 91cdf0e10cSrcweir virtual const ImplFontCharMap* GetImplFontCharMap() const; 92cdf0e10cSrcweir virtual void GetDevFontList( ImplDevFontList* ); 93cdf0e10cSrcweir virtual void GetDevFontSubstList( OutputDevice* ); 94cdf0e10cSrcweir virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ); 95cdf0e10cSrcweir virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile, 96cdf0e10cSrcweir const ImplFontData*, 97248a599fSHerbert Dürr sal_GlyphId* pGlyphIds, 98cdf0e10cSrcweir sal_uInt8* pEncoding, 99cdf0e10cSrcweir sal_Int32* pWidths, 100cdf0e10cSrcweir int nGlyphs, 101cdf0e10cSrcweir FontSubsetInfo& rInfo 102cdf0e10cSrcweir ); 103cdf0e10cSrcweir virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded ); 104cdf0e10cSrcweir virtual const void* GetEmbedFontData( const ImplFontData*, 105cdf0e10cSrcweir const sal_Ucs* pUnicodes, 106cdf0e10cSrcweir sal_Int32* pWidths, 107cdf0e10cSrcweir FontSubsetInfo& rInfo, 108cdf0e10cSrcweir long* pDataLen ); 109cdf0e10cSrcweir virtual void FreeEmbedFontData( const void* pData, long nDataLen ); 110cdf0e10cSrcweir virtual void GetGlyphWidths( const ImplFontData*, 111cdf0e10cSrcweir bool bVertical, 112cdf0e10cSrcweir Int32Vector& rWidths, 113cdf0e10cSrcweir Ucs2UIntMap& rUnicodeEnc ); 114248a599fSHerbert Dürr virtual bool GetGlyphBoundRect( sal_GlyphId, Rectangle& ); 115248a599fSHerbert Dürr virtual bool GetGlyphOutline( sal_GlyphId, ::basegfx::B2DPolyPolygon& ); 116cdf0e10cSrcweir virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); 117cdf0e10cSrcweir virtual void DrawServerFontLayout( const ServerFontLayout& ); 118cdf0e10cSrcweir virtual bool supportsOperation( OutDevSupportType ) const; 119cdf0e10cSrcweir virtual void drawPixel( long nX, long nY ); 120cdf0e10cSrcweir virtual void drawPixel( long nX, long nY, SalColor nSalColor ); 121cdf0e10cSrcweir virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ); 122cdf0e10cSrcweir virtual void drawRect( long nX, long nY, long nWidth, long nHeight ); 123cdf0e10cSrcweir virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); 1245aaf853bSArmin Le Grand virtual bool drawPolyLine( 1255aaf853bSArmin Le Grand const ::basegfx::B2DPolygon&, 1265aaf853bSArmin Le Grand double fTransparency, 1275aaf853bSArmin Le Grand const ::basegfx::B2DVector& rLineWidths, 1285aaf853bSArmin Le Grand basegfx::B2DLineJoin, 1295aaf853bSArmin Le Grand com::sun::star::drawing::LineCap); 130*54ae6a37SHerbert Dürr virtual void drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ); 131*54ae6a37SHerbert Dürr virtual void drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ); 132cdf0e10cSrcweir virtual void drawPolyPolygon( sal_uInt32 nPoly, 133cdf0e10cSrcweir const sal_uInt32* pPoints, 134cdf0e10cSrcweir PCONSTSALPOINT* pPtAry ); 135*54ae6a37SHerbert Dürr virtual sal_Bool drawPolyLineBezier( sal_uInt32 nPoints, 136cdf0e10cSrcweir const SalPoint* pPtAry, 137cdf0e10cSrcweir const sal_uInt8* pFlgAry ); 138*54ae6a37SHerbert Dürr virtual sal_Bool drawPolygonBezier( sal_uInt32 nPoints, 139cdf0e10cSrcweir const SalPoint* pPtAry, 140cdf0e10cSrcweir const sal_uInt8* pFlgAry ); 141cdf0e10cSrcweir virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, 142cdf0e10cSrcweir const sal_uInt32* pPoints, 143cdf0e10cSrcweir const SalPoint* const* pPtAry, 144cdf0e10cSrcweir const sal_uInt8* const* pFlgAry ); 145cdf0e10cSrcweir 146cdf0e10cSrcweir virtual void copyArea( long nDestX, 147cdf0e10cSrcweir long nDestY, 148cdf0e10cSrcweir long nSrcX, 149cdf0e10cSrcweir long nSrcY, 150cdf0e10cSrcweir long nSrcWidth, 151cdf0e10cSrcweir long nSrcHeight, 152cdf0e10cSrcweir sal_uInt16 nFlags ); 1535f27b83cSArmin Le Grand virtual void copyBits( const SalTwoRect& rPosAry, 154cdf0e10cSrcweir SalGraphics* pSrcGraphics ); 1555f27b83cSArmin Le Grand virtual void drawBitmap( const SalTwoRect& rPosAry, 156cdf0e10cSrcweir const SalBitmap& rSalBitmap ); 1575f27b83cSArmin Le Grand virtual void drawBitmap( const SalTwoRect& rPosAry, 158cdf0e10cSrcweir const SalBitmap& rSalBitmap, 159cdf0e10cSrcweir SalColor nTransparentColor ); 1605f27b83cSArmin Le Grand virtual void drawBitmap( const SalTwoRect& rPosAry, 161cdf0e10cSrcweir const SalBitmap& rSalBitmap, 162cdf0e10cSrcweir const SalBitmap& rTransparentBitmap ); 1635f27b83cSArmin Le Grand virtual void drawMask( const SalTwoRect& rPosAry, 164cdf0e10cSrcweir const SalBitmap& rSalBitmap, 165cdf0e10cSrcweir SalColor nMaskColor ); 166cdf0e10cSrcweir virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight ); 167cdf0e10cSrcweir virtual SalColor getPixel( long nX, long nY ); 168cdf0e10cSrcweir virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags ); 169*54ae6a37SHerbert Dürr virtual void invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags ); 170cdf0e10cSrcweir 171cdf0e10cSrcweir virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize ); 172cdf0e10cSrcweir 173cdf0e10cSrcweir virtual SystemGraphicsData GetGraphicsData() const; 174cdf0e10cSrcweir virtual SystemFontData GetSysFontData( int nFallbacklevel ) const; 175cdf0e10cSrcweir }; 176cdf0e10cSrcweir 177cdf0e10cSrcweir #endif 178cdf0e10cSrcweir 179