LCOV - code coverage report
Current view: top level - vcl/inc/headless - svpgdi.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 1 1 100.0 %
Date: 2012-08-25 Functions: 1 1 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #ifndef _SVP_SVPGDI_HXX
      30                 :            : #define _SVP_SVPGDI_HXX
      31                 :            : 
      32                 :            : #include <basebmp/bitmapdevice.hxx>
      33                 :            : #include <basebmp/color.hxx>
      34                 :            : 
      35                 :            : #include <salgdi.hxx>
      36                 :            : #include <sallayout.hxx>
      37                 :            : 
      38                 :            : class ServerFont;
      39                 :            : 
      40                 :            : class SvpSalGraphics : public SalGraphics
      41                 :            : {
      42                 :            :     basebmp::BitmapDeviceSharedPtr       m_aDevice;
      43                 :            :     basebmp::BitmapDeviceSharedPtr       m_aOrigDevice;
      44                 :            : 
      45                 :            :     bool                                 m_bUseLineColor;
      46                 :            :     basebmp::Color                       m_aLineColor;
      47                 :            :     bool                                 m_bUseFillColor;
      48                 :            :     basebmp::Color                       m_aFillColor;
      49                 :            :     basebmp::Color                       m_aTextColor;
      50                 :            : 
      51                 :            :     basebmp::DrawMode                    m_aDrawMode;
      52                 :            : 
      53                 :            :     ServerFont*                          m_pServerFont[ MAX_FALLBACK ];
      54                 :            :     sal_uInt32                           m_eTextFmt;
      55                 :            : 
      56                 :            :     basebmp::BitmapDeviceSharedPtr       m_aClipMap;
      57                 :            : 
      58                 :            : protected:
      59                 :            :     Region                               m_aClipRegion;
      60                 :            :     basegfx::B2IVector                   GetSize() { return m_aOrigDevice->getSize(); }
      61                 :            : private:
      62                 :            :     bool                                 m_bClipSetup;
      63                 :            :     struct ClipUndoHandle {
      64                 :            :         SvpSalGraphics                &m_rGfx;
      65                 :            :         basebmp::BitmapDeviceSharedPtr m_aDevice;
      66                 :    2333016 :         ClipUndoHandle( SvpSalGraphics *pGfx ) : m_rGfx( *pGfx ) {}
      67                 :            :         ~ClipUndoHandle();
      68                 :            :     };
      69                 :            :     bool isClippedSetup( const basegfx::B2IBox &aRange, ClipUndoHandle &rUndo );
      70                 :            :     void ensureClip();
      71                 :            : 
      72                 :            : protected:
      73                 :            :     virtual bool drawAlphaBitmap( const SalTwoRect&, const SalBitmap& rSourceBitmap, const SalBitmap& rAlphaBitmap );
      74                 :            :     virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency );
      75                 :            : 
      76                 :            : public:
      77                 :            :     SvpSalGraphics();
      78                 :            :     virtual ~SvpSalGraphics();
      79                 :            : 
      80                 :            :     const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aDevice; }
      81                 :            :     void setDevice( basebmp::BitmapDeviceSharedPtr& rDevice );
      82                 :            : 
      83                 :            :     // overload all pure virtual methods
      84                 :            :     virtual void            GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
      85                 :            :     virtual sal_uInt16          GetBitCount() const;
      86                 :            :     virtual long            GetGraphicsWidth() const;
      87                 :            : 
      88                 :            :     virtual void            ResetClipRegion();
      89                 :            :     virtual bool            setClipRegion( const Region& );
      90                 :            : 
      91                 :            :     virtual void            SetLineColor();
      92                 :            :     virtual void            SetLineColor( SalColor nSalColor );
      93                 :            :     virtual void            SetFillColor();
      94                 :            :     virtual void            SetFillColor( SalColor nSalColor );
      95                 :            : 
      96                 :            :     virtual void            SetXORMode( bool bSet, bool );
      97                 :            : 
      98                 :            :     virtual void            SetROPLineColor( SalROPColor nROPColor );
      99                 :            :     virtual void            SetROPFillColor( SalROPColor nROPColor );
     100                 :            : 
     101                 :            :     virtual void            SetTextColor( SalColor nSalColor );
     102                 :            :     virtual sal_uInt16                  SetFont( FontSelectPattern*, int nFallbackLevel );
     103                 :            :     virtual void            GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
     104                 :            :     virtual sal_uLong           GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs );
     105                 :            :     virtual const ImplFontCharMap* GetImplFontCharMap() const;
     106                 :            :     virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
     107                 :            :     virtual void            GetDevFontList( ImplDevFontList* );
     108                 :            :     virtual void            GetDevFontSubstList( OutputDevice* );
     109                 :            :     virtual bool            AddTempDevFont( ImplDevFontList*, const rtl::OUString& rFileURL, const rtl::OUString& rFontName );
     110                 :            :     virtual sal_Bool            CreateFontSubset( const rtl::OUString& rToFile,
     111                 :            :                                               const PhysicalFontFace*,
     112                 :            :                                               sal_Int32* pGlyphIDs,
     113                 :            :                                               sal_uInt8* pEncoding,
     114                 :            :                                               sal_Int32* pWidths,
     115                 :            :                                               int nGlyphs,
     116                 :            :                                               FontSubsetInfo& rInfo
     117                 :            :                                               );
     118                 :            :     virtual const Ucs2SIntMap* GetFontEncodingVector( const PhysicalFontFace*, const Ucs2OStrMap** ppNonEncoded );
     119                 :            :     virtual const void* GetEmbedFontData( const PhysicalFontFace*,
     120                 :            :                                           const sal_Ucs* pUnicodes,
     121                 :            :                                           sal_Int32* pWidths,
     122                 :            :                                           FontSubsetInfo& rInfo,
     123                 :            :                                           long* pDataLen );
     124                 :            :     virtual void            FreeEmbedFontData( const void* pData, long nDataLen );
     125                 :            :     virtual void            GetGlyphWidths( const PhysicalFontFace*,
     126                 :            :                                             bool bVertical,
     127                 :            :                                             Int32Vector& rWidths,
     128                 :            :                                             Ucs2UIntMap& rUnicodeEnc );
     129                 :            :     virtual sal_Bool            GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& );
     130                 :            :     virtual sal_Bool            GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& );
     131                 :            :     virtual SalLayout*      GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
     132                 :            :     virtual void            DrawServerFontLayout( const ServerFontLayout& );
     133                 :            :     virtual bool            supportsOperation( OutDevSupportType ) const;
     134                 :            :     virtual void            drawPixel( long nX, long nY );
     135                 :            :     virtual void            drawPixel( long nX, long nY, SalColor nSalColor );
     136                 :            :     virtual void            drawLine( long nX1, long nY1, long nX2, long nY2 );
     137                 :            :     virtual void            drawRect( long nX, long nY, long nWidth, long nHeight );
     138                 :            :     virtual bool            drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency );
     139                 :            :     virtual bool            drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin );
     140                 :            :     virtual void            drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry );
     141                 :            :     virtual void            drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry );
     142                 :            :     virtual void            drawPolyPolygon( sal_uInt32 nPoly,
     143                 :            :                                              const sal_uInt32* pPoints,
     144                 :            :                                              PCONSTSALPOINT* pPtAry );
     145                 :            :     virtual sal_Bool        drawPolyLineBezier( sal_uLong nPoints,
     146                 :            :                                                 const SalPoint* pPtAry,
     147                 :            :                                                 const sal_uInt8* pFlgAry );
     148                 :            :     virtual sal_Bool        drawPolygonBezier( sal_uLong nPoints,
     149                 :            :                                                const SalPoint* pPtAry,
     150                 :            :                                                const sal_uInt8* pFlgAry );
     151                 :            :     virtual sal_Bool        drawPolyPolygonBezier( sal_uInt32 nPoly,
     152                 :            :                                                    const sal_uInt32* pPoints,
     153                 :            :                                                    const SalPoint* const* pPtAry,
     154                 :            :                                                    const sal_uInt8* const* pFlgAry );
     155                 :            : 
     156                 :            :     virtual void            copyArea( long nDestX,
     157                 :            :                                       long nDestY,
     158                 :            :                                       long nSrcX,
     159                 :            :                                       long nSrcY,
     160                 :            :                                       long nSrcWidth,
     161                 :            :                                       long nSrcHeight,
     162                 :            :                                       sal_uInt16 nFlags );
     163                 :            :     virtual void            copyBits( const SalTwoRect* pPosAry,
     164                 :            :                                       SalGraphics* pSrcGraphics );
     165                 :            :     virtual void            drawBitmap( const SalTwoRect* pPosAry,
     166                 :            :                                         const SalBitmap& rSalBitmap );
     167                 :            :     virtual void            drawBitmap( const SalTwoRect* pPosAry,
     168                 :            :                                         const SalBitmap& rSalBitmap,
     169                 :            :                                         SalColor nTransparentColor );
     170                 :            :     virtual void            drawBitmap( const SalTwoRect* pPosAry,
     171                 :            :                                         const SalBitmap& rSalBitmap,
     172                 :            :                                         const SalBitmap& rTransparentBitmap );
     173                 :            :     virtual void            drawMask( const SalTwoRect* pPosAry,
     174                 :            :                                       const SalBitmap& rSalBitmap,
     175                 :            :                                       SalColor nMaskColor );
     176                 :            :     virtual SalBitmap*      getBitmap( long nX, long nY, long nWidth, long nHeight );
     177                 :            :     virtual SalColor        getPixel( long nX, long nY );
     178                 :            :     virtual void            invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags );
     179                 :            :     virtual void            invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags );
     180                 :            : 
     181                 :            :     virtual sal_Bool            drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize );
     182                 :            : 
     183                 :            :     virtual SystemGraphicsData GetGraphicsData() const;
     184                 :            :     virtual SystemFontData     GetSysFontData( int nFallbacklevel ) const;
     185                 :            : };
     186                 :            : 
     187                 :            : #endif
     188                 :            : 
     189                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10