LibreOffice Module canvas (master)  1
canvas.hxx
Go to the documentation of this file.
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_SOURCE_VCL_CANVAS_HXX
21 #define INCLUDED_CANVAS_SOURCE_VCL_CANVAS_HXX
22 
23 #include <com/sun/star/uno/XComponentContext.hpp>
24 #include <com/sun/star/beans/XPropertySet.hpp>
25 #include <com/sun/star/lang/XServiceName.hpp>
26 #include <com/sun/star/util/XUpdatable.hpp>
27 #include <com/sun/star/rendering/XBitmapCanvas.hpp>
28 #include <com/sun/star/rendering/XIntegerBitmap.hpp>
29 #include <com/sun/star/rendering/XGraphicDevice.hpp>
30 
31 #include <cppuhelper/compbase.hxx>
32 #include <comphelper/uno3.hxx>
33 
34 #include <base/basemutexhelper.hxx>
38 
39 #include "canvashelper.hxx"
40 #include "impltools.hxx"
41 #include "devicehelper.hxx"
42 #include "repainttarget.hxx"
43 
44 #define CANVAS_SERVICE_NAME "com.sun.star.rendering.Canvas.VCL"
45 #define CANVAS_IMPLEMENTATION_NAME "com.sun.star.comp.rendering.Canvas.VCL"
46 
47 namespace vclcanvas
48 {
49  typedef ::cppu::WeakComponentImplHelper< css::rendering::XBitmapCanvas,
50  css::rendering::XIntegerBitmap,
51  css::rendering::XGraphicDevice,
52  css::lang::XMultiServiceFactory,
53  css::util::XUpdatable,
54  css::beans::XPropertySet,
55  css::lang::XServiceName > GraphicDeviceBase_Base;
56  typedef ::canvas::GraphicDeviceBase< ::canvas::BaseMutexHelper< GraphicDeviceBase_Base >,
60  typedef ::canvas::IntegerBitmapBase<
64  tools::LocalGuard,
66 
76  class Canvas : public CanvasBaseT,
77  public RepaintTarget
78  {
79  public:
80  Canvas( const css::uno::Sequence<
81  css::uno::Any >& aArguments,
82  const css::uno::Reference<
83  css::uno::XComponentContext >& rxContext );
84 
85  void initialize();
86 
88  virtual ~Canvas() override;
89 
91  virtual void disposeThis() override;
92 
93  // Forwarding the XComponent implementation to the
94  // cppu::ImplHelper templated base
95  // Classname Base doing refcounting Base implementing the XComponent interface
96  // | | |
97  // V V V
98  DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( Canvas, GraphicDeviceBase_Base, ::cppu::WeakComponentImplHelperBase )
99 
100  // XServiceName
101  virtual OUString SAL_CALL getServiceName( ) override;
102 
103  // RepaintTarget
104  virtual bool repaint( const GraphicObjectSharedPtr& rGrf,
105  const css::rendering::ViewState& viewState,
106  const css::rendering::RenderState& renderState,
107  const ::Point& rPt,
108  const ::Size& rSz,
109  const GraphicAttr& rAttr ) const override;
110 
111  private:
112  css::uno::Sequence< css::uno::Any > maArguments;
113  };
114 }
115 
116 #endif
117 
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::cppu::WeakComponentImplHelper< css::rendering::XBitmapCanvas, css::rendering::XIntegerBitmap, css::rendering::XGraphicDevice, css::lang::XMultiServiceFactory, css::util::XUpdatable, css::beans::XPropertySet, css::lang::XServiceName > GraphicDeviceBase_Base
Definition: canvas.hxx:55
::canvas::IntegerBitmapBase< canvas::BitmapCanvasBase2< CanvasBase_Base, CanvasHelper, tools::LocalGuard,::cppu::OWeakObject > > CanvasBaseT
Definition: canvas.hxx:65
Canvas(const css::uno::Sequence< css::uno::Any > &aArguments, const css::uno::Reference< css::uno::XComponentContext > &rxContext)
::canvas::GraphicDeviceBase< ::canvas::BaseMutexHelper< GraphicDeviceBase_Base >, DeviceHelper, tools::LocalGuard,::cppu::OWeakObject > CanvasBase_Base
Definition: canvas.hxx:59
virtual bool repaint(const GraphicObjectSharedPtr &rGrf, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, const ::Point &rPt, const ::Size &rSz, const GraphicAttr &rAttr) const override
#define DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS(classname, baseclass, implhelper)
Helper class for basic canvas functionality.
Sequence< PropertyValue > aArguments
std::shared_ptr< GraphicObject > GraphicObjectSharedPtr
Product of this component's factory.
Definition: canvas.hxx:76
virtual void disposeThis() override
Dispose all internal references.
Definition: canvas.cxx:107
Target interface for XCachedPrimitive implementations.
virtual OUString SAL_CALL getServiceName() override
Definition: canvas.cxx:115
virtual ~Canvas() override
For resource tracking.
Definition: canvas.cxx:102
css::uno::Sequence< css::uno::Any > maArguments
Definition: canvas.hxx:112
void initialize()
Definition: canvas.cxx:62