LibreOffice Module canvas (master) 1
dx_canvascustomsprite.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
23#include <comphelper/uno3.hxx>
24
25#include <com/sun/star/lang/XServiceInfo.hpp>
26#include <com/sun/star/lang/XComponent.hpp>
27#include <com/sun/star/rendering/XCustomSprite.hpp>
28#include <com/sun/star/rendering/XIntegerBitmap.hpp>
29#include <com/sun/star/rendering/XPolyPolygon2D.hpp>
30
34
37
38#include "dx_sprite.hxx"
39#include "dx_surfacebitmap.hxx"
41#include "dx_spritehelper.hxx"
42#include "dx_spritecanvas.hxx"
43
44
45namespace dxcanvas
46{
47 typedef ::cppu::WeakComponentImplHelper< css::rendering::XCustomSprite,
48 css::rendering::XBitmapCanvas,
49 css::rendering::XIntegerBitmap,
50 css::lang::XServiceInfo > CanvasCustomSpriteBase_Base;
68 class CanvasCustomSpriteSpriteBase_Base : public ::canvas::BaseMutexHelper< CanvasCustomSpriteBase_Base >,
69 public Sprite
70 {
71 };
72
76 ::osl::MutexGuard,
78
79 /* Definition of CanvasCustomSprite class */
80
82 {
83 public:
98 CanvasCustomSprite( const css::geometry::RealSize2D& rSpriteSize,
99 const SpriteCanvasRef& rRefDevice,
100 const IDXRenderModuleSharedPtr& rRenderModule,
101 const std::shared_ptr<canvas::ISurfaceProxyManager>& rSurfaceProxy,
102 bool bShowSpriteBounds );
103
104 virtual void disposeThis() override;
105
106 // Forwarding the XComponent implementation to the
107 // cppu::ImplHelper templated base
108 // Classname Base doing refcount Base implementing the XComponent interface
109 // | | |
110 // V V V
112
113 // XServiceInfo
114 virtual OUString SAL_CALL getImplementationName() override;
115 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
116 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
117
118 // Sprite
119 virtual void redraw() const override;
120
121 private:
127 };
128}
129
130/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class, initializing its own baseclass with m_aMutex.
Helper template to handle XCustomSprite method forwarding to CanvasCustomSpriteHelper.
Helper class for basic canvas functionality.
CanvasCustomSprite(const css::geometry::RealSize2D &rSpriteSize, const SpriteCanvasRef &rRefDevice, const IDXRenderModuleSharedPtr &rRenderModule, const std::shared_ptr< canvas::ISurfaceProxyManager > &rSurfaceProxy, bool bShowSpriteBounds)
Create a custom sprite.
virtual void disposeThis() override
Object is being disposed.
SpriteCanvasRef mpSpriteCanvas
MUST hold here, too, since BitmapCanvasHelper only contains a raw pointer (without refcounting)
DXSurfaceBitmapSharedPtr mpSurface
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void redraw() const override
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Helper class for canvas sprites.
Specialization of canvas::Sprite interface, to also provide redraw methods.
Definition: dx_sprite.hxx:30
::cppu::WeakComponentImplHelper< css::rendering::XCustomSprite, css::rendering::XBitmapCanvas, css::rendering::XIntegerBitmap, css::lang::XServiceInfo > CanvasCustomSpriteBase_Base
std::shared_ptr< DXSurfaceBitmap > DXSurfaceBitmapSharedPtr
std::shared_ptr< IDXRenderModule > IDXRenderModuleSharedPtr
::canvas::CanvasCustomSpriteBase< CanvasCustomSpriteSpriteBase_Base, SpriteHelper, BitmapCanvasHelper, ::osl::MutexGuard, ::cppu::OWeakObject > CanvasCustomSpriteBaseT
unsigned char sal_Bool
#define DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS(classname, baseclass, implhelper)