LCOV - code coverage report
Current view: top level - libreoffice/canvas/source/cairo - cairo_canvasbitmap.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 4 0.0 %
Date: 2012-12-27 Functions: 0 12 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 _CAIROCANVAS_CANVASBITMAP_HXX
      21             : #define _CAIROCANVAS_CANVASBITMAP_HXX
      22             : 
      23             : #include <cppuhelper/compbase4.hxx>
      24             : 
      25             : #include <com/sun/star/lang/XServiceInfo.hpp>
      26             : #include <com/sun/star/rendering/XBitmapCanvas.hpp>
      27             : #include <com/sun/star/rendering/XIntegerBitmap.hpp>
      28             : #include <com/sun/star/beans/XFastPropertySet.hpp>
      29             : #include <comphelper/uno3.hxx>
      30             : 
      31             : #include <basegfx/vector/b2isize.hxx>
      32             : 
      33             : #include <boost/shared_ptr.hpp>
      34             : 
      35             : #include <canvas/base/integerbitmapbase.hxx>
      36             : 
      37             : #include "cairo_cairo.hxx"
      38             : #include "cairo_canvashelper.hxx"
      39             : #include "cairo_repainttarget.hxx"
      40             : #include "cairo_spritecanvas.hxx"
      41             : 
      42             : 
      43             : /* Definition of CanvasBitmap class */
      44             : 
      45             : namespace cairocanvas
      46             : {
      47             :     typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::rendering::XBitmapCanvas,
      48             :                                               ::com::sun::star::rendering::XIntegerBitmap,
      49             :                                               ::com::sun::star::lang::XServiceInfo,
      50             :                                               ::com::sun::star::beans::XFastPropertySet >   CanvasBitmapBase_Base;
      51           0 :     class CanvasBitmapSpriteSurface_Base :
      52             :         public ::canvas::DisambiguationHelper<CanvasBitmapBase_Base>,
      53             :         public SurfaceProvider
      54             :     {
      55             :     };
      56             : 
      57             :     typedef ::canvas::IntegerBitmapBase<
      58             :           CanvasBitmapSpriteSurface_Base,
      59             :           CanvasHelper,
      60             :           ::osl::MutexGuard,
      61             :           ::cppu::OWeakObject >                         CanvasBitmap_Base;
      62             : 
      63           0 :     class CanvasBitmap : public CanvasBitmap_Base,
      64             :                          public RepaintTarget
      65             :     {
      66             :     public:
      67             :         /** Create a canvas bitmap for the given surface
      68             : 
      69             :             @param rSize
      70             :             Size of the bitmap
      71             : 
      72             :             @param rDevice
      73             :             Reference device, with which bitmap should be compatible
      74             :         */
      75             :         CanvasBitmap( const ::basegfx::B2ISize& rSize,
      76             :                       const SurfaceProviderRef& rDevice,
      77             :                       ::com::sun::star::rendering::XGraphicDevice* pDevice,
      78             :                       bool                      bHasAlpha );
      79             : 
      80             :         /// Dispose all internal references
      81             :         virtual void disposeThis();
      82             : 
      83             :         // Forwarding the XComponent implementation to the
      84             :         // cppu::ImplHelper templated base
      85             :         //                                    Classname     Base doing refcounting        Base implementing the XComponent interface
      86             :         //                                       |                 |                            |
      87             :         //                                       V                 V                            V
      88           0 :         DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( CanvasBitmap, CanvasBitmapBase_Base, ::cppu::WeakComponentImplHelperBase );
      89             : 
      90             :         // XServiceInfo
      91             :         virtual OUString SAL_CALL getImplementationName(  ) throw (::com::sun::star::uno::RuntimeException);
      92             :         virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
      93             :         virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames(  ) throw (::com::sun::star::uno::RuntimeException);
      94             : 
      95             :         // SurfaceProvider
      96             :         virtual SurfaceSharedPtr getSurface();
      97             :         virtual SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize, Content aContent = CAIRO_CONTENT_COLOR_ALPHA );
      98             :         virtual SurfaceSharedPtr createSurface( ::Bitmap& rBitmap );
      99             :         virtual SurfaceSharedPtr changeSurface( bool bHasAlpha, bool bCopyContent );
     100             :         virtual OutputDevice* getOutputDevice();
     101             : 
     102             :         // RepaintTarget
     103             :         virtual bool repaint( const SurfaceSharedPtr&                         pSurface,
     104             :                               const ::com::sun::star::rendering::ViewState&   viewState,
     105             :                               const ::com::sun::star::rendering::RenderState& renderState );
     106             : 
     107             :         // XFastPropertySet
     108             :         // used to retrieve BitmapEx pointer or X Pixmap handles for this bitmap
     109             :         // handle values have these meanings:
     110             :         // 0 ... get pointer to BitmapEx
     111             :         // 1 ... get X pixmap handle to rgb content
     112             :         // 2 ... get X pitmap handle to alpha mask
     113             :         // returned any contains either BitmapEx pointer or array of three Any value
     114             :         //     1st a bool value: true - free the pixmap after used by XFreePixmap, false do nothing, the pixmap is used internally in the canvas
     115             :         //     2nd the pixmap handle
     116             :         //     3rd the pixmap depth
     117             :         virtual ::com::sun::star::uno::Any SAL_CALL getFastPropertyValue(sal_Int32 nHandle)  throw (::com::sun::star::uno::RuntimeException);
     118           0 :         virtual void SAL_CALL setFastPropertyValue(sal_Int32, const ::com::sun::star::uno::Any&)  throw (::com::sun::star::uno::RuntimeException) {}
     119             : 
     120             :     private:
     121             :         SurfaceProviderRef        mpSurfaceProvider;
     122             :         ::cairo::SurfaceSharedPtr mpBufferSurface;
     123             :         ::cairo::CairoSharedPtr   mpBufferCairo;
     124             : 
     125             :         const ::basegfx::B2ISize  maSize;
     126             :         const bool                mbHasAlpha;
     127             :     };
     128             : }
     129             : 
     130             : #endif /* _CAIROCANVAS_CANVASBITMAP_HXX */
     131             : 
     132             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10