LCOV - code coverage report
Current view: top level - canvas/source/cairo - cairo_canvas.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 2 0.0 %
Date: 2012-08-25 Functions: 0 9 0.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 _CAIROCANVAS_CANVAS_HXX_
      30                 :            : #define _CAIROCANVAS_CANVAS_HXX_
      31                 :            : 
      32                 :            : #include <rtl/ref.hxx>
      33                 :            : 
      34                 :            : #include <com/sun/star/uno/XComponentContext.hpp>
      35                 :            : #include <com/sun/star/beans/XPropertySet.hpp>
      36                 :            : #include <com/sun/star/lang/XInitialization.hpp>
      37                 :            : #include <com/sun/star/lang/XServiceInfo.hpp>
      38                 :            : #include <com/sun/star/lang/XServiceName.hpp>
      39                 :            : #include <com/sun/star/awt/XWindowListener.hpp>
      40                 :            : #include <com/sun/star/util/XUpdatable.hpp>
      41                 :            : #include <com/sun/star/rendering/XSpriteCanvas.hpp>
      42                 :            : #include <com/sun/star/rendering/XIntegerBitmap.hpp>
      43                 :            : #include <com/sun/star/rendering/XGraphicDevice.hpp>
      44                 :            : #include <com/sun/star/rendering/XBufferController.hpp>
      45                 :            : 
      46                 :            : #include <cppuhelper/compbase7.hxx>
      47                 :            : #include <comphelper/uno3.hxx>
      48                 :            : 
      49                 :            : #include <canvas/base/spritecanvasbase.hxx>
      50                 :            : #include <canvas/base/disambiguationhelper.hxx>
      51                 :            : #include <canvas/base/bufferedgraphicdevicebase.hxx>
      52                 :            : 
      53                 :            : #include <basegfx/vector/b2isize.hxx>
      54                 :            : 
      55                 :            : #include "cairo_devicehelper.hxx"
      56                 :            : #include "cairo_repainttarget.hxx"
      57                 :            : #include "cairo_surfaceprovider.hxx"
      58                 :            : #include "cairo_spritecanvashelper.hxx"
      59                 :            : 
      60                 :            : #define CANVAS_SERVICE_NAME        "com.sun.star.rendering.Canvas.Cairo"
      61                 :            : #define CANVAS_IMPLEMENTATION_NAME "com.sun.star.comp.rendering.Canvas.Cairo"
      62                 :            : 
      63                 :            : namespace cairocanvas
      64                 :            : {
      65                 :            :     typedef ::cppu::WeakComponentImplHelper7< ::com::sun::star::rendering::XBitmapCanvas,
      66                 :            :                                                 ::com::sun::star::rendering::XIntegerBitmap,
      67                 :            :                                                 ::com::sun::star::rendering::XGraphicDevice,
      68                 :            :                                                 ::com::sun::star::lang::XMultiServiceFactory,
      69                 :            :                                                 ::com::sun::star::util::XUpdatable,
      70                 :            :                                                 ::com::sun::star::beans::XPropertySet,
      71                 :            :                                                 ::com::sun::star::lang::XServiceName >  GraphicDeviceBase_Base;
      72                 :            :     typedef ::canvas::GraphicDeviceBase< ::canvas::DisambiguationHelper< GraphicDeviceBase_Base >,
      73                 :            :                                                  DeviceHelper,
      74                 :            :                                                  ::osl::MutexGuard,
      75                 :            :                                                  ::cppu::OWeakObject > CanvasBase_Base;
      76                 :            : 
      77                 :            :     /** Mixin SurfaceProvider
      78                 :            : 
      79                 :            :         Have to mixin the SurfaceProvider before deriving from
      80                 :            :         ::canvas::CanvasBase, as this template should already
      81                 :            :         implement some of those interface methods.
      82                 :            : 
      83                 :            :         The reason why this appears kinda convoluted is the fact that
      84                 :            :         we cannot specify non-IDL types as WeakComponentImplHelperN
      85                 :            :         template args, and furthermore, don't want to derive
      86                 :            :         ::canvas::CanvasBase directly from
      87                 :            :         SurfaceProvider (because derivees of
      88                 :            :         ::canvas::CanvasBase have to explicitly forward the
      89                 :            :         XInterface methods (e.g. via DECLARE_UNO3_AGG_DEFAULTS)
      90                 :            :         anyway).
      91                 :            :      */
      92                 :          0 :     class CanvasBaseSurfaceProvider_Base : public CanvasBase_Base,
      93                 :            :                                            public SurfaceProvider
      94                 :            :     {
      95                 :            :     };
      96                 :            : 
      97                 :            :     typedef ::canvas::IntegerBitmapBase< CanvasBaseSurfaceProvider_Base,
      98                 :            :                                          CanvasHelper,
      99                 :            :                                          ::osl::MutexGuard,
     100                 :            :                                          ::cppu::OWeakObject >          CanvasBaseT;
     101                 :            : 
     102                 :            :     /** Product of this component's factory.
     103                 :            : 
     104                 :            :         The Canvas object combines the actual Window canvas with
     105                 :            :         the XGraphicDevice interface. This is because there's a
     106                 :            :         one-to-one relation between them, anyway, since each window
     107                 :            :         can have exactly one canvas and one associated
     108                 :            :         XGraphicDevice. And to avoid messing around with circular
     109                 :            :         references, this is implemented as one single object.
     110                 :            :      */
     111                 :            :     class Canvas : public CanvasBaseT,
     112                 :            :                    public RepaintTarget
     113                 :            :     {
     114                 :            :     public:
     115                 :            :         Canvas( const ::com::sun::star::uno::Sequence<
     116                 :            :                   ::com::sun::star::uno::Any >&               aArguments,
     117                 :            :                 const ::com::sun::star::uno::Reference<
     118                 :            :                   ::com::sun::star::uno::XComponentContext >& rxContext );
     119                 :            : 
     120                 :            :         void initialize();
     121                 :            : 
     122                 :            :         /// For resource tracking
     123                 :            :         ~Canvas();
     124                 :            : 
     125                 :            :         /// Dispose all internal references
     126                 :            :         virtual void disposeThis();
     127                 :            : 
     128                 :            :         // Forwarding the XComponent implementation to the
     129                 :            :         // cppu::ImplHelper templated base
     130                 :            :         //                          Classname     Base doing refcounting        Base implementing the XComponent interface
     131                 :            :         //                            |                 |                            |
     132                 :            :         //                            V                 V                            V
     133                 :          0 :         DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( Canvas, GraphicDeviceBase_Base, ::cppu::WeakComponentImplHelperBase );
     134                 :            : 
     135                 :            :         // XServiceName
     136                 :            :         virtual ::rtl::OUString SAL_CALL getServiceName(  ) throw (::com::sun::star::uno::RuntimeException);
     137                 :            : 
     138                 :            :         // RepaintTarget
     139                 :            :         virtual bool repaint( const ::cairo::SurfaceSharedPtr& pSurface,
     140                 :            :                   const ::com::sun::star::rendering::ViewState& viewState,
     141                 :            :                   const ::com::sun::star::rendering::RenderState&   renderState );
     142                 :            : 
     143                 :            :         // SurfaceProvider
     144                 :            :         virtual SurfaceSharedPtr getSurface();
     145                 :            :         virtual SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize, Content aContent = CAIRO_CONTENT_COLOR_ALPHA );
     146                 :            :         virtual SurfaceSharedPtr createSurface( ::Bitmap& rBitmap );
     147                 :            :         virtual SurfaceSharedPtr changeSurface( bool bHasAlpha, bool bCopyContent );
     148                 :            :         virtual OutputDevice* getOutputDevice();
     149                 :            : 
     150                 :            :      private:
     151                 :            :         ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >                maArguments;
     152                 :            :         ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxComponentContext;
     153                 :            :     };
     154                 :            : 
     155                 :            :     typedef ::rtl::Reference< Canvas > CanvasRef;
     156                 :            : }
     157                 :            : 
     158                 :            : #endif
     159                 :            : 
     160                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10