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/XServiceInfo.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
32#include <comphelper/uno3.hxx>
33
38
39#include "canvashelper.hxx"
40#include "impltools.hxx"
41#include "devicehelper.hxx"
42#include "repainttarget.hxx"
43
44namespace vclcanvas
45{
46 typedef ::cppu::WeakComponentImplHelper< css::rendering::XBitmapCanvas,
47 css::rendering::XIntegerBitmap,
48 css::rendering::XGraphicDevice,
49 css::lang::XMultiServiceFactory,
50 css::util::XUpdatable,
51 css::beans::XPropertySet,
52 css::lang::XServiceName,
53 css::lang::XServiceInfo > GraphicDeviceBase_Base;
54 typedef ::canvas::GraphicDeviceBase< ::canvas::BaseMutexHelper< GraphicDeviceBase_Base >,
64
74 class Canvas : public CanvasBaseT,
75 public RepaintTarget
76 {
77 public:
78 Canvas( const css::uno::Sequence<
79 css::uno::Any >& aArguments,
80 const css::uno::Reference<
81 css::uno::XComponentContext >& rxContext );
82
83 void initialize();
84
86 virtual ~Canvas() override;
87
89 virtual void disposeThis() override;
90
91 // Forwarding the XComponent implementation to the
92 // cppu::ImplHelper templated base
93 // Classname Base doing refcounting Base implementing the XComponent interface
94 // | | |
95 // V V V
96 DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( Canvas, GraphicDeviceBase_Base, ::cppu::WeakComponentImplHelperBase )
97
98 // XServiceName
99 virtual OUString SAL_CALL getServiceName( ) override;
100
101 OUString SAL_CALL getImplementationName() override;
102 sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override;
103 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
104
105 // RepaintTarget
106 virtual bool repaint( const GraphicObjectSharedPtr& rGrf,
107 const css::rendering::ViewState& viewState,
108 const css::rendering::RenderState& renderState,
109 const ::Point& rPt,
110 const ::Size& rSz,
111 const GraphicAttr& rAttr ) const override;
112
113 private:
114 css::uno::Sequence< css::uno::Any > maArguments;
115 };
116}
117
118/* 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:76
OUString SAL_CALL getImplementationName() override
Definition: canvas.cxx:100
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: canvas.cxx:108
sal_Bool SAL_CALL supportsService(OUString const &ServiceName) override
Definition: canvas.cxx:104
virtual OUString SAL_CALL getServiceName() override
Definition: canvas.cxx:95
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:82
virtual void disposeThis() override
Dispose all internal references.
Definition: canvas.cxx:87
void initialize()
Definition: canvas.cxx:42
css::uno::Sequence< css::uno::Any > maArguments
Definition: canvas.hxx:114
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:57
std::shared_ptr< GraphicObject > GraphicObjectSharedPtr
::canvas::IntegerBitmapBase< canvas::BitmapCanvasBase2< CanvasBase_Base, CanvasHelper, tools::LocalGuard, ::cppu::OWeakObject > > CanvasBaseT
Definition: canvas.hxx:63
::cppu::WeakComponentImplHelper< css::rendering::XBitmapCanvas, css::rendering::XIntegerBitmap, css::rendering::XGraphicDevice, css::lang::XMultiServiceFactory, css::util::XUpdatable, css::beans::XPropertySet, css::lang::XServiceName, css::lang::XServiceInfo > GraphicDeviceBase_Base
Definition: canvas.hxx:53
unsigned char sal_Bool
#define DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS(classname, baseclass, implhelper)