LCOV - code coverage report
Current view: top level - include/canvas/base - canvasbase.hxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 138 0.0 %
Date: 2014-04-14 Functions: 0 253 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             : #ifndef INCLUDED_CANVAS_BASE_CANVASBASE_HXX
      21             : #define INCLUDED_CANVAS_BASE_CANVASBASE_HXX
      22             : 
      23             : #include <com/sun/star/uno/Reference.hxx>
      24             : #include <com/sun/star/rendering/XCanvas.hpp>
      25             : #include <com/sun/star/rendering/TextDirection.hpp>
      26             : #include <osl/mutex.hxx>
      27             : #include <canvas/verifyinput.hxx>
      28             : 
      29             : 
      30             : namespace canvas
      31             : {
      32             :     /** Helper template to handle XCanvas method forwarding to CanvasHelper
      33             : 
      34             :         Use this helper to handle the XCanvas part of your
      35             :         implementation. In theory, we could have provided CanvasHelper
      36             :         and CanvasBase as a single template, but that would duplicate
      37             :         a lot of code now residing in CanvasHelper only.
      38             : 
      39             :         This template basically interposes itself between the full
      40             :         interface you implement (i.e. not restricted to XCanvas. The
      41             :         problem with UNO partial interface implementation actually is,
      42             :         that you cannot do it the plain way, since deriving from a
      43             :         common base subclass always introduces the whole set of pure
      44             :         virtuals, that your baseclass helper just overrided) and your
      45             :         implementation class. You then only have to implement the
      46             :         functionality <em>besides</em> XCanvas.
      47             : 
      48             :         <pre>
      49             :         Example:
      50             :         typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::rendering::XSpriteCanvas,
      51             :                                                    ::com::sun::star::lang::XInitialization,
      52             :                                                   ::com::sun::star::lang::XServiceInfo,
      53             :                                                   ::com::sun::star::lang::XServiceName > CanvasBase_Base;
      54             :         typedef ::canvas::internal::CanvasBase< CanvasBase_Base, CanvasHelper > ExampleCanvas_Base;
      55             : 
      56             :         class ExampleCanvas : public ExampleCanvas_Base,
      57             :                               public SpriteSurface,
      58             :                                public RepaintTarget
      59             :         {
      60             :         };
      61             :         </pre>
      62             : 
      63             :         @tpl Base
      64             :         Base class to use, most probably one of the
      65             :         WeakComponentImplHelperN templates with the appropriate
      66             :         interfaces. At least XCanvas should be among them (why else
      67             :         would you use this template, then?). Base class must have an
      68             :         Base( const Mutex& ) constructor (like the
      69             :         WeakComponentImplHelperN templates have). As the very least,
      70             :         the base class must be derived from uno::XInterface, as some
      71             :         error reporting mechanisms rely on that.
      72             : 
      73             :         @tpl CanvasHelper
      74             :         Canvas helper implementation for the backend in question. This
      75             :         object will be held as a member of this template class, and
      76             :         basically gets forwarded all XCanvas API calls. Furthermore,
      77             :         everytime the canvas API semantically changes the content of
      78             :         the canvas, CanvasHelper::modifying() will get called
      79             :         (<em>before</em> the actual modification takes place).
      80             : 
      81             :         @tpl Mutex
      82             :         Lock strategy to use. Defaults to using the
      83             :         OBaseMutex-provided lock.  Everytime one of the methods is
      84             :         entered, an object of type Mutex is created with m_aMutex as
      85             :         the sole parameter, and destroyed again when the method scope
      86             :         is left.
      87             : 
      88             :         @tpl UnambiguousBase
      89             :         Optional unambiguous base class for XInterface of Base. It's
      90             :         sometimes necessary to specify this parameter, e.g. if Base
      91             :         derives from multiple UNO interface (were each provides its
      92             :         own version of XInterface, making the conversion ambiguous)
      93             :      */
      94             :     template< class Base,
      95             :               class CanvasHelper,
      96             :               class Mutex=::osl::MutexGuard,
      97             :               class UnambiguousBase=::com::sun::star::uno::XInterface > class CanvasBase :
      98             :             public Base
      99             :     {
     100             :     public:
     101             :         typedef Base            BaseType;
     102             :         typedef CanvasHelper    HelperType;
     103             :         typedef Mutex           MutexType;
     104             :         typedef UnambiguousBase UnambiguousBaseType;
     105             : 
     106             :         /** Create CanvasBase
     107             :          */
     108           0 :         CanvasBase() :
     109             :             maCanvasHelper(),
     110           0 :             mbSurfaceDirty( true )
     111             :         {
     112           0 :         }
     113             : 
     114           0 :         virtual void disposeThis() SAL_OVERRIDE
     115             :         {
     116           0 :             MutexType aGuard( BaseType::m_aMutex );
     117             : 
     118           0 :             maCanvasHelper.disposing();
     119             : 
     120             :             // pass on to base class
     121           0 :             BaseType::disposeThis();
     122           0 :         }
     123             : 
     124             :         // XCanvas
     125           0 :         virtual void SAL_CALL clear() throw (::com::sun::star::uno::RuntimeException) SAL_OVERRIDE
     126             :         {
     127           0 :             MutexType aGuard( BaseType::m_aMutex );
     128             : 
     129           0 :             mbSurfaceDirty = true;
     130           0 :             maCanvasHelper.modifying();
     131             : 
     132           0 :             maCanvasHelper.clear();
     133           0 :         }
     134             : 
     135           0 :         virtual void SAL_CALL drawPoint( const ::com::sun::star::geometry::RealPoint2D&     aPoint,
     136             :                                          const ::com::sun::star::rendering::ViewState&      viewState,
     137             :                                          const ::com::sun::star::rendering::RenderState&    renderState ) throw (::com::sun::star::lang::IllegalArgumentException,
     138             :                                                                                                                  ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE
     139             :         {
     140           0 :             tools::verifyArgs(aPoint, viewState, renderState,
     141             :                               BOOST_CURRENT_FUNCTION,
     142           0 :                               static_cast< UnambiguousBaseType* >(this));
     143             : 
     144           0 :             MutexType aGuard( BaseType::m_aMutex );
     145             : 
     146           0 :             mbSurfaceDirty = true;
     147           0 :             maCanvasHelper.modifying();
     148             : 
     149           0 :             maCanvasHelper.drawPoint( this, aPoint, viewState, renderState );
     150           0 :         }
     151             : 
     152           0 :         virtual void SAL_CALL drawLine( const ::com::sun::star::geometry::RealPoint2D&  aStartPoint,
     153             :                                         const ::com::sun::star::geometry::RealPoint2D&  aEndPoint,
     154             :                                         const ::com::sun::star::rendering::ViewState&   viewState,
     155             :                                         const ::com::sun::star::rendering::RenderState& renderState ) throw (::com::sun::star::lang::IllegalArgumentException,
     156             :                                                                                                              ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE
     157             :         {
     158           0 :             tools::verifyArgs(aStartPoint, aEndPoint, viewState, renderState,
     159             :                               BOOST_CURRENT_FUNCTION,
     160           0 :                               static_cast< UnambiguousBaseType* >(this));
     161             : 
     162           0 :             MutexType aGuard( BaseType::m_aMutex );
     163             : 
     164           0 :             mbSurfaceDirty = true;
     165           0 :             maCanvasHelper.modifying();
     166             : 
     167           0 :             maCanvasHelper.drawLine( this, aStartPoint, aEndPoint, viewState, renderState );
     168           0 :         }
     169             : 
     170           0 :         virtual void SAL_CALL drawBezier( const ::com::sun::star::geometry::RealBezierSegment2D&    aBezierSegment,
     171             :                                           const ::com::sun::star::geometry::RealPoint2D&            aEndPoint,
     172             :                                           const ::com::sun::star::rendering::ViewState&             viewState,
     173             :                                           const ::com::sun::star::rendering::RenderState&           renderState ) throw (::com::sun::star::lang::IllegalArgumentException,
     174             :                                                                                                                          ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE
     175             :         {
     176           0 :             tools::verifyArgs(aBezierSegment, aEndPoint, viewState, renderState,
     177             :                               BOOST_CURRENT_FUNCTION,
     178           0 :                               static_cast< UnambiguousBaseType* >(this));
     179             : 
     180           0 :             MutexType aGuard( BaseType::m_aMutex );
     181             : 
     182           0 :             mbSurfaceDirty = true;
     183           0 :             maCanvasHelper.modifying();
     184             : 
     185           0 :             maCanvasHelper.drawBezier( this, aBezierSegment, aEndPoint, viewState, renderState );
     186           0 :         }
     187             : 
     188             :         virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > SAL_CALL
     189           0 :             drawPolyPolygon( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon,
     190             :                              const ::com::sun::star::rendering::ViewState&                                          viewState,
     191             :                              const ::com::sun::star::rendering::RenderState&                                        renderState ) throw (::com::sun::star::lang::IllegalArgumentException,
     192             :                                                                                                                                          ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE
     193             :         {
     194           0 :             tools::verifyArgs(xPolyPolygon, viewState, renderState,
     195             :                               BOOST_CURRENT_FUNCTION,
     196           0 :                               static_cast< UnambiguousBaseType* >(this));
     197             : 
     198           0 :             MutexType aGuard( BaseType::m_aMutex );
     199             : 
     200           0 :             mbSurfaceDirty = true;
     201           0 :             maCanvasHelper.modifying();
     202             : 
     203           0 :             return maCanvasHelper.drawPolyPolygon( this, xPolyPolygon, viewState, renderState );
     204             :         }
     205             : 
     206             :         virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > SAL_CALL
     207           0 :             strokePolyPolygon( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >&   xPolyPolygon,
     208             :                                const ::com::sun::star::rendering::ViewState&                                            viewState,
     209             :                                const ::com::sun::star::rendering::RenderState&                                          renderState,
     210             :                                const ::com::sun::star::rendering::StrokeAttributes&                                     strokeAttributes ) throw (::com::sun::star::lang::IllegalArgumentException,
     211             :                                                                                                                                                   ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE
     212             :         {
     213           0 :             tools::verifyArgs(xPolyPolygon, viewState, renderState, strokeAttributes,
     214             :                               BOOST_CURRENT_FUNCTION,
     215           0 :                               static_cast< UnambiguousBaseType* >(this));
     216             : 
     217           0 :             MutexType aGuard( BaseType::m_aMutex );
     218             : 
     219           0 :             mbSurfaceDirty = true;
     220           0 :             maCanvasHelper.modifying();
     221             : 
     222           0 :             return maCanvasHelper.strokePolyPolygon( this, xPolyPolygon, viewState, renderState, strokeAttributes );
     223             :         }
     224             : 
     225             :         virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > SAL_CALL
     226           0 :             strokeTexturedPolyPolygon( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >&   xPolyPolygon,
     227             :                                        const ::com::sun::star::rendering::ViewState&                                            viewState,
     228             :                                        const ::com::sun::star::rendering::RenderState&                                          renderState,
     229             :                                        const ::com::sun::star::uno::Sequence< ::com::sun::star::rendering::Texture >&           textures,
     230             :                                        const ::com::sun::star::rendering::StrokeAttributes&                                     strokeAttributes ) throw (::com::sun::star::lang::IllegalArgumentException,
     231             :                                                                                                                                                           ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE
     232             :         {
     233           0 :             tools::verifyArgs(xPolyPolygon, viewState, renderState, strokeAttributes,
     234             :                               BOOST_CURRENT_FUNCTION,
     235           0 :                               static_cast< UnambiguousBaseType* >(this));
     236             : 
     237           0 :             MutexType aGuard( BaseType::m_aMutex );
     238             : 
     239           0 :             mbSurfaceDirty = true;
     240           0 :             maCanvasHelper.modifying();
     241             : 
     242           0 :             return maCanvasHelper.strokeTexturedPolyPolygon( this, xPolyPolygon, viewState, renderState, textures, strokeAttributes );
     243             :         }
     244             : 
     245             :         virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > SAL_CALL
     246           0 :             strokeTextureMappedPolyPolygon( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >&  xPolyPolygon,
     247             :                                             const ::com::sun::star::rendering::ViewState&                                           viewState,
     248             :                                             const ::com::sun::star::rendering::RenderState&                                         renderState,
     249             :                                             const ::com::sun::star::uno::Sequence< ::com::sun::star::rendering::Texture >&          textures,
     250             :                                             const ::com::sun::star::uno::Reference< ::com::sun::star::geometry::XMapping2D >&       xMapping,
     251             :                                             const ::com::sun::star::rendering::StrokeAttributes&                                    strokeAttributes ) throw (::com::sun::star::lang::IllegalArgumentException,
     252             :                                                                                                                                                               ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE
     253             :         {
     254           0 :             tools::verifyArgs(xPolyPolygon, viewState, renderState, textures, xMapping, strokeAttributes,
     255             :                               BOOST_CURRENT_FUNCTION,
     256           0 :                               static_cast< UnambiguousBaseType* >(this));
     257             : 
     258           0 :             MutexType aGuard( BaseType::m_aMutex );
     259             : 
     260           0 :             mbSurfaceDirty = true;
     261           0 :             maCanvasHelper.modifying();
     262             : 
     263           0 :             return maCanvasHelper.strokeTextureMappedPolyPolygon( this, xPolyPolygon, viewState, renderState, textures, xMapping, strokeAttributes );
     264             :         }
     265             : 
     266             :         virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >   SAL_CALL
     267           0 :             queryStrokeShapes( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >&   xPolyPolygon,
     268             :                                const ::com::sun::star::rendering::ViewState&                                            viewState,
     269             :                                const ::com::sun::star::rendering::RenderState&                                          renderState,
     270             :                                const ::com::sun::star::rendering::StrokeAttributes&                                     strokeAttributes ) throw (::com::sun::star::lang::IllegalArgumentException,
     271             :                                                                                                                                                   ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE
     272             :         {
     273           0 :             tools::verifyArgs(xPolyPolygon, viewState, renderState, strokeAttributes,
     274             :                               BOOST_CURRENT_FUNCTION,
     275           0 :                               static_cast< UnambiguousBaseType* >(this));
     276             : 
     277           0 :             MutexType aGuard( BaseType::m_aMutex );
     278             : 
     279           0 :             mbSurfaceDirty = true;
     280           0 :             maCanvasHelper.modifying();
     281             : 
     282           0 :             return maCanvasHelper.queryStrokeShapes( this, xPolyPolygon, viewState, renderState, strokeAttributes );
     283             :         }
     284             : 
     285             :         virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > SAL_CALL
     286           0 :             fillPolyPolygon( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon,
     287             :                              const ::com::sun::star::rendering::ViewState&                                          viewState,
     288             :                              const ::com::sun::star::rendering::RenderState&                                        renderState ) throw (::com::sun::star::lang::IllegalArgumentException,
     289             :                                                                                                                                          ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE
     290             :         {
     291           0 :             tools::verifyArgs(xPolyPolygon, viewState, renderState,
     292             :                               BOOST_CURRENT_FUNCTION,
     293           0 :                               static_cast< UnambiguousBaseType* >(this));
     294             : 
     295           0 :             MutexType aGuard( BaseType::m_aMutex );
     296             : 
     297           0 :             mbSurfaceDirty = true;
     298           0 :             maCanvasHelper.modifying();
     299             : 
     300           0 :             return maCanvasHelper.fillPolyPolygon( this, xPolyPolygon, viewState, renderState );
     301             :         }
     302             : 
     303             :         virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > SAL_CALL
     304           0 :             fillTexturedPolyPolygon( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >& xPolyPolygon,
     305             :                                      const ::com::sun::star::rendering::ViewState&                                          viewState,
     306             :                                      const ::com::sun::star::rendering::RenderState&                                        renderState,
     307             :                                      const ::com::sun::star::uno::Sequence< ::com::sun::star::rendering::Texture >&         textures ) throw (::com::sun::star::lang::IllegalArgumentException,
     308             :                                                                                                                                               ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE
     309             :         {
     310           0 :             tools::verifyArgs(xPolyPolygon, viewState, renderState, textures,
     311             :                               BOOST_CURRENT_FUNCTION,
     312           0 :                               static_cast< UnambiguousBaseType* >(this));
     313             : 
     314           0 :             MutexType aGuard( BaseType::m_aMutex );
     315             : 
     316           0 :             mbSurfaceDirty = true;
     317           0 :             maCanvasHelper.modifying();
     318             : 
     319           0 :             return maCanvasHelper.fillTexturedPolyPolygon( this, xPolyPolygon, viewState, renderState, textures );
     320             :         }
     321             : 
     322             :         virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > SAL_CALL
     323           0 :             fillTextureMappedPolyPolygon( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >&    xPolyPolygon,
     324             :                                           const ::com::sun::star::rendering::ViewState&                                             viewState,
     325             :                                           const ::com::sun::star::rendering::RenderState&                                           renderState,
     326             :                                           const ::com::sun::star::uno::Sequence< ::com::sun::star::rendering::Texture >&            textures,
     327             :                                           const ::com::sun::star::uno::Reference< ::com::sun::star::geometry::XMapping2D >&         xMapping ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE
     328             :         {
     329           0 :             tools::verifyArgs(xPolyPolygon, viewState, renderState, textures, xMapping,
     330             :                               BOOST_CURRENT_FUNCTION,
     331           0 :                               static_cast< UnambiguousBaseType* >(this));
     332             : 
     333           0 :             MutexType aGuard( BaseType::m_aMutex );
     334             : 
     335           0 :             mbSurfaceDirty = true;
     336           0 :             maCanvasHelper.modifying();
     337             : 
     338           0 :             return maCanvasHelper.fillTextureMappedPolyPolygon( this, xPolyPolygon, viewState, renderState, textures, xMapping );
     339             :         }
     340             : 
     341             : 
     342             :         virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvasFont > SAL_CALL
     343           0 :             createFont( const ::com::sun::star::rendering::FontRequest&                                     fontRequest,
     344             :                         const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >&    extraFontProperties,
     345             :                         const ::com::sun::star::geometry::Matrix2D&                                         fontMatrix ) throw (::com::sun::star::lang::IllegalArgumentException,
     346             :                                                                                                                                 ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE
     347             :         {
     348           0 :             tools::verifyArgs(fontRequest,
     349             :                               // dummy, to keep argPos in sync
     350             :                               fontRequest,
     351             :                               fontMatrix,
     352             :                               BOOST_CURRENT_FUNCTION,
     353           0 :                               static_cast< UnambiguousBaseType* >(this));
     354             : 
     355           0 :             MutexType aGuard( BaseType::m_aMutex );
     356             : 
     357           0 :             return maCanvasHelper.createFont( this, fontRequest, extraFontProperties, fontMatrix );
     358             :         }
     359             : 
     360             : 
     361             :         virtual ::com::sun::star::uno::Sequence< ::com::sun::star::rendering::FontInfo > SAL_CALL
     362           0 :             queryAvailableFonts( const ::com::sun::star::rendering::FontInfo&                                       aFilter,
     363             :                                  const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >&   aFontProperties ) throw (::com::sun::star::lang::IllegalArgumentException,
     364             :                                                                                                                                              ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE
     365             :         {
     366           0 :             tools::verifyArgs(aFilter,
     367             :                               BOOST_CURRENT_FUNCTION,
     368           0 :                               static_cast< UnambiguousBaseType* >(this));
     369             : 
     370           0 :             MutexType aGuard( BaseType::m_aMutex );
     371             : 
     372           0 :             return maCanvasHelper.queryAvailableFonts( this, aFilter, aFontProperties );
     373             :         }
     374             : 
     375             : 
     376             :         virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > SAL_CALL
     377           0 :             drawText( const ::com::sun::star::rendering::StringContext&                                     text,
     378             :                       const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvasFont >&   xFont,
     379             :                       const ::com::sun::star::rendering::ViewState&                                         viewState,
     380             :                       const ::com::sun::star::rendering::RenderState&                                       renderState,
     381             :                       sal_Int8                                                                              textDirection ) throw (::com::sun::star::lang::IllegalArgumentException,
     382             :                                                                                                                                    ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE
     383             :         {
     384           0 :             tools::verifyArgs(xFont, viewState, renderState,
     385             :                               BOOST_CURRENT_FUNCTION,
     386           0 :                               static_cast< UnambiguousBaseType* >(this));
     387           0 :             tools::verifyRange( textDirection,
     388             :                                 ::com::sun::star::rendering::TextDirection::WEAK_LEFT_TO_RIGHT,
     389           0 :                                 ::com::sun::star::rendering::TextDirection::STRONG_RIGHT_TO_LEFT );
     390             : 
     391           0 :             MutexType aGuard( BaseType::m_aMutex );
     392             : 
     393           0 :             mbSurfaceDirty = true;
     394           0 :             maCanvasHelper.modifying();
     395             : 
     396           0 :             return maCanvasHelper.drawText( this, text, xFont, viewState, renderState, textDirection );
     397             :         }
     398             : 
     399             : 
     400             :         virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > SAL_CALL
     401           0 :             drawTextLayout( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XTextLayout >& laidOutText,
     402             :                             const ::com::sun::star::rendering::ViewState&                                       viewState,
     403             :                             const ::com::sun::star::rendering::RenderState&                                     renderState ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE
     404             :         {
     405           0 :             tools::verifyArgs(laidOutText, viewState, renderState,
     406             :                               BOOST_CURRENT_FUNCTION,
     407           0 :                               static_cast< UnambiguousBaseType* >(this));
     408             : 
     409           0 :             MutexType aGuard( BaseType::m_aMutex );
     410             : 
     411           0 :             mbSurfaceDirty = true;
     412           0 :             maCanvasHelper.modifying();
     413             : 
     414           0 :             return maCanvasHelper.drawTextLayout( this, laidOutText, viewState, renderState );
     415             :         }
     416             : 
     417             : 
     418             :         virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > SAL_CALL
     419           0 :             drawBitmap( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap >& xBitmap,
     420             :                         const ::com::sun::star::rendering::ViewState&                                   viewState,
     421             :                         const ::com::sun::star::rendering::RenderState&                                 renderState ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE
     422             :         {
     423           0 :             tools::verifyArgs(xBitmap, viewState, renderState,
     424             :                               BOOST_CURRENT_FUNCTION,
     425           0 :                               static_cast< UnambiguousBaseType* >(this));
     426             : 
     427           0 :             MutexType aGuard( BaseType::m_aMutex );
     428             : 
     429           0 :             mbSurfaceDirty = true;
     430           0 :             maCanvasHelper.modifying();
     431             : 
     432           0 :             return maCanvasHelper.drawBitmap( this, xBitmap, viewState, renderState );
     433             :         }
     434             : 
     435             :         virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCachedPrimitive > SAL_CALL
     436           0 :             drawBitmapModulated( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap >&    xBitmap,
     437             :                                  const ::com::sun::star::rendering::ViewState&                                      viewState,
     438             :                                  const ::com::sun::star::rendering::RenderState&                                    renderState ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE
     439             :         {
     440           0 :             tools::verifyArgs(xBitmap, viewState, renderState,
     441             :                               BOOST_CURRENT_FUNCTION,
     442           0 :                               static_cast< UnambiguousBaseType* >(this));
     443             : 
     444           0 :             MutexType aGuard( BaseType::m_aMutex );
     445             : 
     446           0 :             mbSurfaceDirty = true;
     447           0 :             maCanvasHelper.modifying();
     448             : 
     449           0 :             return maCanvasHelper.drawBitmapModulated( this, xBitmap, viewState, renderState );
     450             :         }
     451             : 
     452             :         virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >   SAL_CALL
     453           0 :             getDevice() throw (::com::sun::star::uno::RuntimeException) SAL_OVERRIDE
     454             :         {
     455           0 :             MutexType aGuard( BaseType::m_aMutex );
     456             : 
     457           0 :             return maCanvasHelper.getDevice();
     458             :         }
     459             : 
     460             :     protected:
     461           0 :         ~CanvasBase() {} // we're a ref-counted UNO class. _We_ destroy ourselves.
     462             : 
     463             :         HelperType          maCanvasHelper;
     464             :         mutable bool        mbSurfaceDirty;
     465             : 
     466             :     private:
     467             :         CanvasBase( const CanvasBase& );
     468             :         CanvasBase& operator=( const CanvasBase& );
     469             :     };
     470             : }
     471             : 
     472             : #endif // INCLUDED_CANVAS_BASE_CANVASBASE_HXX
     473             : 
     474             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10