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