LibreOffice Module canvas (master) 1
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/rendering/XBitmapCanvas.hpp>
27#include <com/sun/star/rendering/XCustomSprite.hpp>
28#include <com/sun/star/rendering/XIntegerBitmap.hpp>
29
33
34#include "sprite.hxx"
35#include "canvashelper.hxx"
36#include "spritehelper.hxx"
37#include "impltools.hxx"
38#include "repainttarget.hxx"
39
40
41namespace vclcanvas
42{
43 typedef ::cppu::WeakComponentImplHelper< css::rendering::XCustomSprite,
44 css::rendering::XBitmapCanvas,
45 css::rendering::XIntegerBitmap,
46 css::lang::XServiceInfo > CanvasCustomSpriteBase_Base;
64 class CanvasCustomSpriteSpriteBase_Base : public ::canvas::BaseMutexHelper< CanvasCustomSpriteBase_Base >,
65 public Sprite
66 {
67 };
68
74
75 /* Definition of CanvasCustomSprite class */
76
78 public RepaintTarget
79 {
80 public:
81 CanvasCustomSprite( const css::geometry::RealSize2D& rSpriteSize,
82 css::rendering::XGraphicDevice& rDevice,
83 const ::canvas::SpriteSurface::Reference& rOwningSpriteCanvas,
84 const OutDevProviderSharedPtr& rOutDevProvider,
85 bool bShowSpriteBounds );
86
87 // Forwarding the XComponent implementation to the
88 // cppu::ImplHelper templated base
89 // Classname Base doing refcount Base implementing the XComponent interface
90 // | | |
91 // V V V
93
94 // XServiceInfo
95 virtual OUString SAL_CALL getImplementationName() override;
96 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
97 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
98
99 // Sprite
100 virtual void redraw( OutputDevice& rOutDev,
101 bool bBufferedUpdate ) const override;
102 virtual void redraw( OutputDevice& rOutDev,
103 const ::basegfx::B2DPoint& rPos,
104 bool bBufferedUpdate ) const override;
105
106 // RepaintTarget
107 virtual bool repaint( const GraphicObjectSharedPtr& rGrf,
108 const css::rendering::ViewState& viewState,
109 const css::rendering::RenderState& renderState,
110 const ::Point& rPt,
111 const ::Size& rSz,
112 const GraphicAttr& rAttr ) const override;
113 };
114}
115
116/* 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.
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual OUString SAL_CALL getImplementationName() override
virtual void redraw(OutputDevice &rOutDev, bool bBufferedUpdate) const override
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 sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
CanvasCustomSprite(const css::geometry::RealSize2D &rSpriteSize, css::rendering::XGraphicDevice &rDevice, const ::canvas::SpriteSurface::Reference &rOwningSpriteCanvas, const OutDevProviderSharedPtr &rOutDevProvider, bool bShowSpriteBounds)
Helper class for basic canvas functionality.
Helper class for canvas sprites.
Specialization of canvas::Sprite interface, to also provide redraw methods.
::canvas::CanvasCustomSpriteBase< CanvasCustomSpriteSpriteBase_Base, SpriteHelper, CanvasHelper, tools::LocalGuard, ::cppu::OWeakObject > CanvasCustomSpriteBaseT
std::shared_ptr< OutDevProvider > OutDevProviderSharedPtr
std::shared_ptr< GraphicObject > GraphicObjectSharedPtr
::cppu::WeakComponentImplHelper< css::rendering::XCustomSprite, css::rendering::XBitmapCanvas, css::rendering::XIntegerBitmap, css::lang::XServiceInfo > CanvasCustomSpriteBase_Base
unsigned char sal_Bool
#define DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS(classname, baseclass, implhelper)