LCOV - code coverage report
Current view: top level - libreoffice/toolkit/source/awt - vclxgraphics.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 262 0.0 %
Date: 2012-12-27 Functions: 0 41 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       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/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      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 .
      18             :  */
      19             : 
      20             : 
      21             : #include <toolkit/awt/vclxgraphics.hxx>
      22             : #include <toolkit/awt/vclxdevice.hxx>
      23             : #include <toolkit/helper/macros.hxx>
      24             : #include <toolkit/helper/vclunohelper.hxx>
      25             : #include <cppuhelper/typeprovider.hxx>
      26             : #include <rtl/uuid.h>
      27             : 
      28             : #include <vcl/svapp.hxx>
      29             : #include <vcl/outdev.hxx>
      30             : #include <vcl/gradient.hxx>
      31             : #include <tools/debug.hxx>
      32             : 
      33             : 
      34             : //  ----------------------------------------------------
      35             : //  class VCLXGraphics
      36             : //  ----------------------------------------------------
      37             : 
      38             : // ::com::sun::star::uno::XInterface
      39           0 : ::com::sun::star::uno::Any VCLXGraphics::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
      40             : {
      41             :     ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
      42             :                                         (static_cast< ::com::sun::star::awt::XGraphics* >(this)),
      43             :                                         (static_cast< ::com::sun::star::lang::XTypeProvider* >(this)),
      44           0 :                                         (static_cast< ::com::sun::star::lang::XUnoTunnel* >(this)) );
      45           0 :     return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ));
      46             : }
      47             : 
      48             : // ::com::sun::star::lang::XUnoTunnel
      49           0 : IMPL_XUNOTUNNEL( VCLXGraphics )
      50             : 
      51             : // ::com::sun::star::lang::XTypeProvider
      52           0 : IMPL_XTYPEPROVIDER_START( VCLXGraphics )
      53           0 :     getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics>* ) NULL )
      54           0 : IMPL_XTYPEPROVIDER_END
      55             : 
      56           0 : VCLXGraphics::VCLXGraphics()
      57             : {
      58           0 :     mpOutputDevice = NULL;
      59           0 :     mpClipRegion = NULL;
      60           0 : }
      61             : 
      62           0 : VCLXGraphics::~VCLXGraphics()
      63             : {
      64           0 :     VCLXGraphicsList_impl* pLst = mpOutputDevice ? mpOutputDevice->GetUnoGraphicsList() : NULL;
      65           0 :     if ( pLst )
      66             :     {
      67           0 :         for( VCLXGraphicsList_impl::iterator it = pLst->begin(); it != pLst->end(); ++it )
      68             :         {
      69           0 :             if( *it == this ) {
      70           0 :                 pLst->erase( it );
      71           0 :                 break;
      72             :             }
      73             :         }
      74             :     }
      75             : 
      76           0 :     delete mpClipRegion;
      77           0 : }
      78             : 
      79           0 : void VCLXGraphics::SetOutputDevice( OutputDevice* pOutDev )
      80             : {
      81           0 :     mpOutputDevice = pOutDev;
      82           0 :     mxDevice = NULL;
      83           0 : }
      84             : 
      85           0 : void VCLXGraphics::Init( OutputDevice* pOutDev )
      86             : {
      87             :     DBG_ASSERT( !mpOutputDevice, "VCLXGraphics::Init allready has pOutDev !" );
      88           0 :     mpOutputDevice  = pOutDev;
      89             : 
      90           0 :     maFont          = mpOutputDevice->GetFont();
      91           0 :     maTextColor     = COL_BLACK;
      92           0 :     maTextFillColor = COL_TRANSPARENT;
      93           0 :     maLineColor     = COL_BLACK;
      94           0 :     maFillColor     = COL_WHITE;
      95           0 :     meRasterOp      = ROP_OVERPAINT;
      96           0 :     mpClipRegion    = NULL;
      97             : 
      98             :     // Register at OutputDevice
      99           0 :     VCLXGraphicsList_impl* pLst = mpOutputDevice->GetUnoGraphicsList();
     100           0 :     if ( !pLst )
     101           0 :         pLst = mpOutputDevice->CreateUnoGraphicsList();
     102           0 :     pLst->push_back( this );
     103           0 : }
     104             : 
     105           0 : void VCLXGraphics::InitOutputDevice( sal_uInt16 nFlags )
     106             : {
     107           0 :     if(mpOutputDevice)
     108             :     {
     109           0 :         SolarMutexGuard aVclGuard;
     110             : 
     111           0 :         if ( nFlags & INITOUTDEV_FONT )
     112             :         {
     113           0 :             mpOutputDevice->SetFont( maFont );
     114           0 :             mpOutputDevice->SetTextColor( maTextColor );
     115           0 :             mpOutputDevice->SetTextFillColor( maTextFillColor );
     116             :         }
     117             : 
     118           0 :         if ( nFlags & INITOUTDEV_COLORS )
     119             :         {
     120           0 :             mpOutputDevice->SetLineColor( maLineColor );
     121           0 :             mpOutputDevice->SetFillColor( maFillColor );
     122             :         }
     123             : 
     124           0 :         if ( nFlags & INITOUTDEV_RASTEROP )
     125             :         {
     126           0 :             mpOutputDevice->SetRasterOp( meRasterOp );
     127             :         }
     128             : 
     129           0 :         if ( nFlags & INITOUTDEV_CLIPREGION )
     130             :         {
     131           0 :             if( mpClipRegion )
     132           0 :                 mpOutputDevice->SetClipRegion( *mpClipRegion );
     133             :             else
     134           0 :                 mpOutputDevice->SetClipRegion();
     135           0 :         }
     136             :     }
     137           0 : }
     138             : 
     139           0 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > VCLXGraphics::getDevice() throw(::com::sun::star::uno::RuntimeException)
     140             : {
     141           0 :     SolarMutexGuard aGuard;
     142             : 
     143           0 :     if( !mxDevice.is() && mpOutputDevice )
     144             :     {
     145           0 :         VCLXDevice* pDev = new VCLXDevice;
     146           0 :         pDev->SetOutputDevice( mpOutputDevice );
     147           0 :         mxDevice = pDev;
     148             :     }
     149           0 :     return mxDevice;
     150             : }
     151             : 
     152           0 : ::com::sun::star::awt::SimpleFontMetric VCLXGraphics::getFontMetric() throw(::com::sun::star::uno::RuntimeException)
     153             : {
     154           0 :     SolarMutexGuard aGuard;
     155             : 
     156           0 :     ::com::sun::star::awt::SimpleFontMetric aM;
     157           0 :     if( mpOutputDevice )
     158             :     {
     159           0 :         mpOutputDevice->SetFont( maFont );
     160           0 :         aM = VCLUnoHelper::CreateFontMetric( mpOutputDevice->GetFontMetric() );
     161             :     }
     162           0 :     return aM;
     163             : }
     164             : 
     165           0 : void VCLXGraphics::setFont( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont >& rxFont ) throw(::com::sun::star::uno::RuntimeException)
     166             : {
     167           0 :     SolarMutexGuard aGuard;
     168             : 
     169           0 :     maFont = VCLUnoHelper::CreateFont( rxFont );
     170           0 : }
     171             : 
     172           0 : void VCLXGraphics::selectFont( const ::com::sun::star::awt::FontDescriptor& rDescription ) throw(::com::sun::star::uno::RuntimeException)
     173             : {
     174           0 :     SolarMutexGuard aGuard;
     175             : 
     176           0 :     maFont = VCLUnoHelper::CreateFont( rDescription, Font() );
     177           0 : }
     178             : 
     179           0 : void VCLXGraphics::setTextColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException)
     180             : {
     181           0 :     SolarMutexGuard aGuard;
     182             : 
     183           0 :     maTextColor = Color( (sal_uInt32)nColor );
     184           0 : }
     185             : 
     186           0 : void VCLXGraphics::setTextFillColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException)
     187             : {
     188           0 :     SolarMutexGuard aGuard;
     189             : 
     190           0 :     maTextFillColor = Color( (sal_uInt32)nColor );
     191           0 : }
     192             : 
     193           0 : void VCLXGraphics::setLineColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException)
     194             : {
     195           0 :     SolarMutexGuard aGuard;
     196             : 
     197           0 :     maLineColor = Color( (sal_uInt32)nColor );
     198           0 : }
     199             : 
     200           0 : void VCLXGraphics::setFillColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException)
     201             : {
     202           0 :     SolarMutexGuard aGuard;
     203             : 
     204           0 :     maFillColor = Color( (sal_uInt32)nColor );
     205           0 : }
     206             : 
     207           0 : void VCLXGraphics::setRasterOp( ::com::sun::star::awt::RasterOperation eROP ) throw(::com::sun::star::uno::RuntimeException)
     208             : {
     209           0 :     SolarMutexGuard aGuard;
     210             : 
     211           0 :     meRasterOp = (RasterOp)eROP;
     212           0 : }
     213             : 
     214           0 : void VCLXGraphics::setClipRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& rxRegion ) throw(::com::sun::star::uno::RuntimeException)
     215             : {
     216           0 :     SolarMutexGuard aGuard;
     217             : 
     218           0 :     delete mpClipRegion;
     219           0 :     if ( rxRegion.is() )
     220           0 :         mpClipRegion = new Region( VCLUnoHelper::GetRegion( rxRegion ) );
     221             :     else
     222           0 :         mpClipRegion = NULL;
     223           0 : }
     224             : 
     225           0 : void VCLXGraphics::intersectClipRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& rxRegion ) throw(::com::sun::star::uno::RuntimeException)
     226             : {
     227           0 :     SolarMutexGuard aGuard;
     228             : 
     229           0 :     if ( rxRegion.is() )
     230             :     {
     231           0 :         Region aRegion( VCLUnoHelper::GetRegion( rxRegion ) );
     232           0 :         if ( !mpClipRegion )
     233           0 :             mpClipRegion = new Region( aRegion );
     234             :         else
     235           0 :             mpClipRegion->Intersect( aRegion );
     236           0 :     }
     237           0 : }
     238             : 
     239           0 : void VCLXGraphics::push(  ) throw(::com::sun::star::uno::RuntimeException)
     240             : {
     241           0 :     SolarMutexGuard aGuard;
     242             : 
     243             : 
     244           0 :     if( mpOutputDevice )
     245           0 :         mpOutputDevice->Push();
     246           0 : }
     247             : 
     248           0 : void VCLXGraphics::pop(  ) throw(::com::sun::star::uno::RuntimeException)
     249             : {
     250           0 :     SolarMutexGuard aGuard;
     251             : 
     252             : 
     253           0 :     if( mpOutputDevice )
     254           0 :         mpOutputDevice->Pop();
     255           0 : }
     256             : 
     257           0 : void VCLXGraphics::copy( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice >& rxSource, sal_Int32 nSourceX, sal_Int32 nSourceY, sal_Int32 nSourceWidth, sal_Int32 nSourceHeight, sal_Int32 nDestX, sal_Int32 nDestY, sal_Int32 nDestWidth, sal_Int32 nDestHeight ) throw(::com::sun::star::uno::RuntimeException)
     258             : {
     259           0 :     SolarMutexGuard aGuard;
     260             : 
     261           0 :     if ( mpOutputDevice )
     262             :     {
     263           0 :         VCLXDevice* pFromDev = VCLXDevice::GetImplementation( rxSource );
     264             :         DBG_ASSERT( pFromDev, "VCLXGraphics::copy - invalid device" );
     265           0 :         if ( pFromDev )
     266             :         {
     267           0 :             InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP );
     268             :             mpOutputDevice->DrawOutDev( Point( nDestX, nDestY ), Size( nDestWidth, nDestHeight ),
     269           0 :                                     Point( nSourceX, nSourceY ), Size( nSourceWidth, nSourceHeight ), *pFromDev->GetOutputDevice() );
     270             :         }
     271           0 :     }
     272           0 : }
     273             : 
     274           0 : void VCLXGraphics::draw( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDisplayBitmap >& rxBitmapHandle, sal_Int32 nSourceX, sal_Int32 nSourceY, sal_Int32 nSourceWidth, sal_Int32 nSourceHeight, sal_Int32 nDestX, sal_Int32 nDestY, sal_Int32 nDestWidth, sal_Int32 nDestHeight ) throw(::com::sun::star::uno::RuntimeException)
     275             : {
     276           0 :     SolarMutexGuard aGuard;
     277             : 
     278           0 :     if( mpOutputDevice )
     279             :     {
     280           0 :         InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP);
     281           0 :         ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap > xBitmap( rxBitmapHandle, ::com::sun::star::uno::UNO_QUERY );
     282           0 :         BitmapEx aBmpEx = VCLUnoHelper::GetBitmap( xBitmap );
     283             : 
     284           0 :         Point aPos(nDestX - nSourceX, nDestY - nSourceY);
     285           0 :           Size aSz = aBmpEx.GetSizePixel();
     286             : 
     287           0 :         if(nDestWidth != nSourceWidth)
     288             :         {
     289           0 :             float zoomX = (float)nDestWidth / (float)nSourceWidth;
     290           0 :             aSz.Width() = (long) ((float)aSz.Width() * zoomX);
     291             :         }
     292             : 
     293           0 :         if(nDestHeight != nSourceHeight)
     294             :         {
     295           0 :             float zoomY = (float)nDestHeight / (float)nSourceHeight;
     296           0 :             aSz.Height() = (long) ((float)aSz.Height() * zoomY);
     297             :         }
     298             : 
     299           0 :         if(nSourceX || nSourceY || aSz.Width() != nSourceWidth || aSz.Height() != nSourceHeight)
     300           0 :             mpOutputDevice->IntersectClipRegion(Region(Rectangle(nDestX, nDestY, nDestX + nDestWidth - 1, nDestY + nDestHeight - 1)));
     301             : 
     302           0 :         mpOutputDevice->DrawBitmapEx( aPos, aSz, aBmpEx );
     303           0 :     }
     304           0 : }
     305             : 
     306           0 : void VCLXGraphics::drawPixel( sal_Int32 x, sal_Int32 y ) throw(::com::sun::star::uno::RuntimeException)
     307             : {
     308           0 :     SolarMutexGuard aGuard;
     309             : 
     310           0 :     if( mpOutputDevice )
     311             :     {
     312           0 :         InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
     313           0 :         mpOutputDevice->DrawPixel( Point( x, y ) );
     314           0 :     }
     315           0 : }
     316             : 
     317           0 : void VCLXGraphics::drawLine( sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, sal_Int32 y2 ) throw(::com::sun::star::uno::RuntimeException)
     318             : {
     319           0 :     SolarMutexGuard aGuard;
     320             : 
     321           0 :     if( mpOutputDevice )
     322             :     {
     323           0 :         InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
     324           0 :         mpOutputDevice->DrawLine( Point( x1, y1 ), Point( x2, y2 ) );
     325           0 :     }
     326           0 : }
     327             : 
     328           0 : void VCLXGraphics::drawRect( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 height ) throw(::com::sun::star::uno::RuntimeException)
     329             : {
     330           0 :     SolarMutexGuard aGuard;
     331             : 
     332           0 :     if( mpOutputDevice )
     333             :     {
     334           0 :         InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
     335           0 :         mpOutputDevice->DrawRect( Rectangle( Point( x, y ), Size( width, height ) ) );
     336           0 :     }
     337           0 : }
     338             : 
     339           0 : void VCLXGraphics::drawRoundedRect( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 height, sal_Int32 nHorzRound, sal_Int32 nVertRound ) throw(::com::sun::star::uno::RuntimeException)
     340             : {
     341           0 :     SolarMutexGuard aGuard;
     342             : 
     343           0 :     if( mpOutputDevice )
     344             :     {
     345           0 :         InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
     346           0 :         mpOutputDevice->DrawRect( Rectangle( Point( x, y ), Size( width, height ) ), nHorzRound, nVertRound );
     347           0 :     }
     348           0 : }
     349             : 
     350           0 : void VCLXGraphics::drawPolyLine( const ::com::sun::star::uno::Sequence< sal_Int32 >& DataX, const ::com::sun::star::uno::Sequence< sal_Int32 >& DataY ) throw(::com::sun::star::uno::RuntimeException)
     351             : {
     352           0 :     SolarMutexGuard aGuard;
     353             : 
     354           0 :     if( mpOutputDevice )
     355             :     {
     356           0 :         InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
     357           0 :         mpOutputDevice->DrawPolyLine( VCLUnoHelper::CreatePolygon( DataX, DataY ) );
     358           0 :     }
     359           0 : }
     360             : 
     361           0 : void VCLXGraphics::drawPolygon( const ::com::sun::star::uno::Sequence< sal_Int32 >& DataX, const ::com::sun::star::uno::Sequence< sal_Int32 >& DataY ) throw(::com::sun::star::uno::RuntimeException)
     362             : {
     363           0 :     SolarMutexGuard aGuard;
     364             : 
     365           0 :     if( mpOutputDevice )
     366             :     {
     367           0 :         InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
     368           0 :         mpOutputDevice->DrawPolygon( VCLUnoHelper::CreatePolygon( DataX, DataY ) );
     369           0 :     }
     370           0 : }
     371             : 
     372           0 : void VCLXGraphics::drawPolyPolygon( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< sal_Int32 > >& DataX, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< sal_Int32 > >& DataY ) throw(::com::sun::star::uno::RuntimeException)
     373             : {
     374           0 :     SolarMutexGuard aGuard;
     375             : 
     376           0 :     if( mpOutputDevice )
     377             :     {
     378           0 :         InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
     379           0 :         sal_uInt16 nPolys = (sal_uInt16) DataX.getLength();
     380           0 :         PolyPolygon aPolyPoly( nPolys );
     381           0 :         for ( sal_uInt16 n = 0; n < nPolys; n++ )
     382           0 :             aPolyPoly[n] = VCLUnoHelper::CreatePolygon( DataX.getConstArray()[n], DataY.getConstArray()[n] );
     383             : 
     384           0 :         mpOutputDevice->DrawPolyPolygon( aPolyPoly );
     385           0 :     }
     386           0 : }
     387             : 
     388           0 : void VCLXGraphics::drawEllipse( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 height ) throw(::com::sun::star::uno::RuntimeException)
     389             : {
     390           0 :     SolarMutexGuard aGuard;
     391             : 
     392           0 :     if( mpOutputDevice )
     393             :     {
     394           0 :         InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
     395           0 :         mpOutputDevice->DrawEllipse( Rectangle( Point( x, y ), Size( width, height ) ) );
     396           0 :     }
     397           0 : }
     398             : 
     399           0 : void VCLXGraphics::drawArc( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 height, sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, sal_Int32 y2 ) throw(::com::sun::star::uno::RuntimeException)
     400             : {
     401           0 :     SolarMutexGuard aGuard;
     402             : 
     403           0 :     if( mpOutputDevice )
     404             :     {
     405           0 :         InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
     406           0 :         mpOutputDevice->DrawArc( Rectangle( Point( x, y ), Size( width, height ) ), Point( x1, y1 ), Point( x2, y2 ) );
     407           0 :     }
     408           0 : }
     409             : 
     410           0 : void VCLXGraphics::drawPie( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 height, sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, sal_Int32 y2 ) throw(::com::sun::star::uno::RuntimeException)
     411             : {
     412           0 :     SolarMutexGuard aGuard;
     413             : 
     414           0 :     if( mpOutputDevice )
     415             :     {
     416           0 :         InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
     417           0 :         mpOutputDevice->DrawPie( Rectangle( Point( x, y ), Size( width, height ) ), Point( x1, y1 ), Point( x2, y2 ) );
     418           0 :     }
     419           0 : }
     420             : 
     421           0 : void VCLXGraphics::drawChord( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 height, sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, sal_Int32 y2 ) throw(::com::sun::star::uno::RuntimeException)
     422             : {
     423           0 :     SolarMutexGuard aGuard;
     424             : 
     425           0 :     if( mpOutputDevice )
     426             :     {
     427           0 :         InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
     428           0 :         mpOutputDevice->DrawChord( Rectangle( Point( x, y ), Size( width, height ) ), Point( x1, y1 ), Point( x2, y2 ) );
     429           0 :     }
     430           0 : }
     431             : 
     432           0 : void VCLXGraphics::drawGradient( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 height, const ::com::sun::star::awt::Gradient& rGradient ) throw(::com::sun::star::uno::RuntimeException)
     433             : {
     434           0 :     SolarMutexGuard aGuard;
     435             : 
     436           0 :     if( mpOutputDevice )
     437             :     {
     438           0 :         InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
     439           0 :         Gradient aGradient((GradientStyle)rGradient.Style, rGradient.StartColor, rGradient.EndColor);
     440           0 :         aGradient.SetAngle(rGradient.Angle);
     441           0 :         aGradient.SetBorder(rGradient.Border);
     442           0 :         aGradient.SetOfsX(rGradient.XOffset);
     443           0 :         aGradient.SetOfsY(rGradient.YOffset);
     444           0 :         aGradient.SetStartIntensity(rGradient.StartIntensity);
     445           0 :         aGradient.SetEndIntensity(rGradient.EndIntensity);
     446           0 :         aGradient.SetSteps(rGradient.StepCount);
     447           0 :         mpOutputDevice->DrawGradient( Rectangle( Point( x, y ), Size( width, height ) ), aGradient );
     448           0 :     }
     449           0 : }
     450             : 
     451           0 : void VCLXGraphics::drawText( sal_Int32 x, sal_Int32 y, const ::rtl::OUString& rText ) throw(::com::sun::star::uno::RuntimeException)
     452             : {
     453           0 :     SolarMutexGuard aGuard;
     454             : 
     455           0 :     if( mpOutputDevice )
     456             :     {
     457           0 :         InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS |INITOUTDEV_FONT);
     458           0 :         mpOutputDevice->DrawText( Point( x, y ), rText );
     459           0 :     }
     460           0 : }
     461             : 
     462           0 : void VCLXGraphics::drawTextArray( sal_Int32 x, sal_Int32 y, const ::rtl::OUString& rText, const ::com::sun::star::uno::Sequence< sal_Int32 >& rLongs ) throw(::com::sun::star::uno::RuntimeException)
     463             : {
     464           0 :     SolarMutexGuard aGuard;
     465             : 
     466           0 :     if( mpOutputDevice )
     467             :     {
     468           0 :         InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS|INITOUTDEV_FONT );
     469           0 :         mpOutputDevice->DrawTextArray( Point( x, y ), rText, rLongs.getConstArray() );
     470           0 :     }
     471           0 : }
     472             : 
     473             : 
     474             : 
     475             : 
     476             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10