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 _VCLCANVAS_CANVAS_HXX_
30 : : #define _VCLCANVAS_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/XServiceName.hpp>
37 : : #include <com/sun/star/util/XUpdatable.hpp>
38 : : #include <com/sun/star/rendering/XBitmapCanvas.hpp>
39 : : #include <com/sun/star/rendering/XIntegerBitmap.hpp>
40 : : #include <com/sun/star/rendering/XGraphicDevice.hpp>
41 : : #include <com/sun/star/rendering/XBufferController.hpp>
42 : :
43 : : #include <cppuhelper/compbase7.hxx>
44 : : #include <comphelper/uno3.hxx>
45 : :
46 : : #include <canvas/base/disambiguationhelper.hxx>
47 : : #include <canvas/base/integerbitmapbase.hxx>
48 : : #include <canvas/base/graphicdevicebase.hxx>
49 : :
50 : : #include "canvashelper.hxx"
51 : : #include "impltools.hxx"
52 : : #include "devicehelper.hxx"
53 : : #include "repainttarget.hxx"
54 : :
55 : : #define CANVAS_SERVICE_NAME "com.sun.star.rendering.Canvas.VCL"
56 : : #define CANVAS_IMPLEMENTATION_NAME "com.sun.star.comp.rendering.Canvas.VCL"
57 : :
58 : : namespace vclcanvas
59 : : {
60 : : typedef ::cppu::WeakComponentImplHelper7< ::com::sun::star::rendering::XBitmapCanvas,
61 : : ::com::sun::star::rendering::XIntegerBitmap,
62 : : ::com::sun::star::rendering::XGraphicDevice,
63 : : ::com::sun::star::lang::XMultiServiceFactory,
64 : : ::com::sun::star::util::XUpdatable,
65 : : ::com::sun::star::beans::XPropertySet,
66 : : ::com::sun::star::lang::XServiceName > GraphicDeviceBase_Base;
67 : : typedef ::canvas::GraphicDeviceBase< ::canvas::DisambiguationHelper< GraphicDeviceBase_Base >,
68 : : DeviceHelper,
69 : : tools::LocalGuard,
70 : : ::cppu::OWeakObject > CanvasBase_Base;
71 : : typedef ::canvas::IntegerBitmapBase< CanvasBase_Base,
72 : : CanvasHelper,
73 : : tools::LocalGuard,
74 : : ::cppu::OWeakObject > CanvasBaseT;
75 : :
76 : : /** Product of this component's factory.
77 : :
78 : : The Canvas object combines the actual Window canvas with
79 : : the XGraphicDevice interface. This is because there's a
80 : : one-to-one relation between them, anyway, since each window
81 : : can have exactly one canvas and one associated
82 : : XGraphicDevice. And to avoid messing around with circular
83 : : references, this is implemented as one single object.
84 : : */
85 : : class Canvas : public CanvasBaseT,
86 : : public RepaintTarget
87 : : {
88 : : public:
89 : : Canvas( const ::com::sun::star::uno::Sequence<
90 : : ::com::sun::star::uno::Any >& aArguments,
91 : : const ::com::sun::star::uno::Reference<
92 : : ::com::sun::star::uno::XComponentContext >& rxContext );
93 : :
94 : : void initialize();
95 : :
96 : : /// For resource tracking
97 : : ~Canvas();
98 : :
99 : : /// Dispose all internal references
100 : : virtual void disposeThis();
101 : :
102 : : // Forwarding the XComponent implementation to the
103 : : // cppu::ImplHelper templated base
104 : : // Classname Base doing refcounting Base implementing the XComponent interface
105 : : // | | |
106 : : // V V V
107 : 0 : DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( Canvas, GraphicDeviceBase_Base, ::cppu::WeakComponentImplHelperBase );
108 : :
109 : : // XServiceName
110 : : virtual ::rtl::OUString SAL_CALL getServiceName( ) throw (::com::sun::star::uno::RuntimeException);
111 : :
112 : : // RepaintTarget
113 : : virtual bool repaint( const GraphicObjectSharedPtr& rGrf,
114 : : const com::sun::star::rendering::ViewState& viewState,
115 : : const com::sun::star::rendering::RenderState& renderState,
116 : : const ::Point& rPt,
117 : : const ::Size& rSz,
118 : : const GraphicAttr& rAttr ) const;
119 : :
120 : : private:
121 : : ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > maArguments;
122 : : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxComponentContext;
123 : : };
124 : :
125 : : typedef ::rtl::Reference< Canvas > CanvasRef;
126 : : }
127 : :
128 : : #endif
129 : :
130 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|