1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: canvas.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _VCLCANVAS_CANVAS_HXX_
32 #define _VCLCANVAS_CANVAS_HXX_
34 #include <rtl/ref.hxx>
36 #include <com/sun/star/uno/XComponentContext.hpp>
37 #include <com/sun/star/beans/XPropertySet.hpp>
38 #include <com/sun/star/lang/XServiceName.hpp>
39 #include <com/sun/star/util/XUpdatable.hpp>
40 #include <com/sun/star/rendering/XBitmapCanvas.hpp>
41 #include <com/sun/star/rendering/XIntegerBitmap.hpp>
42 #include <com/sun/star/rendering/XGraphicDevice.hpp>
43 #include <com/sun/star/rendering/XBufferController.hpp>
44 #include <com/sun/star/rendering/XParametricPolyPolygon2DFactory.hpp>
46 #include <cppuhelper/compbase7.hxx>
47 #include <comphelper/uno3.hxx>
49 #include <canvas/base/basemutexhelper.hxx>
50 #include <canvas/base/integerbitmapbase.hxx>
51 #include <canvas/base/graphicdevicebase.hxx>
53 #include "canvashelper.hxx"
54 #include "impltools.hxx"
55 #include "devicehelper.hxx"
56 #include "repainttarget.hxx"
58 #define CANVAS_SERVICE_NAME "com.sun.star.rendering.Canvas.VCL"
59 #define CANVAS_IMPLEMENTATION_NAME "com.sun.star.comp.rendering.Canvas.VCL"
63 typedef ::cppu::WeakComponentImplHelper7
< ::com::sun::star::rendering::XBitmapCanvas
,
64 ::com::sun::star::rendering::XIntegerBitmap
,
65 ::com::sun::star::rendering::XGraphicDevice
,
66 ::com::sun::star::rendering::XParametricPolyPolygon2DFactory
,
67 ::com::sun::star::util::XUpdatable
,
68 ::com::sun::star::beans::XPropertySet
,
69 ::com::sun::star::lang::XServiceName
> GraphicDeviceBase_Base
;
70 typedef ::canvas::GraphicDeviceBase
< ::canvas::BaseMutexHelper
< GraphicDeviceBase_Base
>,
73 ::cppu::OWeakObject
> CanvasBase_Base
;
74 typedef ::canvas::IntegerBitmapBase
< CanvasBase_Base
,
77 ::cppu::OWeakObject
> CanvasBaseT
;
79 /** Product of this component's factory.
81 The Canvas object combines the actual Window canvas with
82 the XGraphicDevice interface. This is because there's a
83 one-to-one relation between them, anyway, since each window
84 can have exactly one canvas and one associated
85 XGraphicDevice. And to avoid messing around with circular
86 references, this is implemented as one single object.
88 class Canvas
: public CanvasBaseT
,
92 Canvas( const ::com::sun::star::uno::Sequence
<
93 ::com::sun::star::uno::Any
>& aArguments
,
94 const ::com::sun::star::uno::Reference
<
95 ::com::sun::star::uno::XComponentContext
>& rxContext
);
99 /// For resource tracking
102 #if defined __SUNPRO_CC
103 using CanvasBaseT::disposing
;
106 /// Dispose all internal references
107 virtual void SAL_CALL
disposing();
109 // Forwarding the XComponent implementation to the
110 // cppu::ImplHelper templated base
111 // Classname Base doing refcounting Base implementing the XComponent interface
114 DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( Canvas
, GraphicDeviceBase_Base
, ::cppu::WeakComponentImplHelperBase
);
117 virtual ::rtl::OUString SAL_CALL
getServiceName( ) throw (::com::sun::star::uno::RuntimeException
);
120 virtual bool repaint( const GraphicObjectSharedPtr
& rGrf
,
121 const com::sun::star::rendering::ViewState
& viewState
,
122 const com::sun::star::rendering::RenderState
& renderState
,
125 const GraphicAttr
& rAttr
) const;
128 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
> maArguments
;
129 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> mxComponentContext
;
132 typedef ::rtl::Reference
< Canvas
> CanvasRef
;