LibreOffice Module canvas (master) 1
dx_canvasbitmap.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/lang/XServiceInfo.hpp>
23#include <com/sun/star/rendering/XBitmapCanvas.hpp>
24#include <com/sun/star/rendering/XIntegerBitmap.hpp>
25#include <com/sun/star/beans/XFastPropertySet.hpp>
31
32#include "dx_bitmapprovider.hxx"
34#include "dx_devicehelper.hxx"
35#include "dx_impltools.hxx"
36#include "dx_ibitmap.hxx"
37
38
39/* Definition of CanvasBitmap class */
40
41namespace dxcanvas
42{
43 typedef ::cppu::WeakComponentImplHelper< css::rendering::XBitmapCanvas,
44 css::rendering::XIntegerBitmap,
45 css::lang::XServiceInfo,
46 css::beans::XFastPropertySet > CanvasBitmapBase_Base;
51 ::osl::MutexGuard,
53
55 {
56 public:
65 CanvasBitmap( const IBitmapSharedPtr& rSurface,
66 const DeviceRef& rDevice );
67
69 virtual void disposeThis() override;
70
71 // XServiceInfo
72 virtual OUString SAL_CALL getImplementationName( ) override;
73 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
74 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
75
76 // BitmapProvider
77 virtual IBitmapSharedPtr getBitmap() const override { return mpBitmap; }
78
79 virtual css::uno::Any SAL_CALL getFastPropertyValue(sal_Int32 nHandle) override;
80 virtual void SAL_CALL setFastPropertyValue(sal_Int32, const css::uno::Any&) override {}
81
82 private:
88 };
89}
90
91/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Helper template to handle XIntegerBitmap method forwarding to BitmapCanvasHelper.
Helper class for basic canvas functionality.
virtual OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL setFastPropertyValue(sal_Int32, const css::uno::Any &) override
virtual css::uno::Any SAL_CALL getFastPropertyValue(sal_Int32 nHandle) override
CanvasBitmap(const IBitmapSharedPtr &rSurface, const DeviceRef &rDevice)
Create a canvas bitmap for the given surface.
IBitmapSharedPtr mpBitmap
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
DeviceRef mpDevice
MUST hold here, too, since CanvasHelper only contains a raw pointer (without refcounting)
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual IBitmapSharedPtr getBitmap() const override
virtual void disposeThis() override
Dispose all internal references.
std::shared_ptr< IBitmap > IBitmapSharedPtr
Definition: dx_ibitmap.hxx:58
::cppu::WeakComponentImplHelper< css::rendering::XBitmapCanvas, css::rendering::XIntegerBitmap, css::lang::XServiceInfo, css::beans::XFastPropertySet > CanvasBitmapBase_Base
::canvas::IntegerBitmapBase< canvas::BitmapCanvasBase2< ::canvas::BaseMutexHelper< CanvasBitmapBase_Base >, BitmapCanvasHelper, ::osl::MutexGuard, ::cppu::OWeakObject > > CanvasBitmap_Base
unsigned char sal_Bool