LibreOffice Module canvas (master) 1
spritehelper.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 <vcl/bitmapex.hxx>
23
26#include <vclwrapper.hxx>
27
28#include "backbuffer.hxx"
29
30
31namespace vclcanvas
32{
33 /* Definition of SpriteHelper class */
34
41 {
42 public:
44
45 // make CanvasCustomSpriteHelper::init visible for name lookup
46 using ::canvas::CanvasCustomSpriteHelper::init;
47
64 void init( const css::geometry::RealSize2D& rSpriteSize,
65 const ::canvas::SpriteSurface::Reference& rOwningSpriteCanvas,
66 const BackBufferSharedPtr& rBackBuffer,
67 const BackBufferSharedPtr& rBackBufferMask,
68 bool bShowSpriteBounds );
69
70 void disposing();
71
86 void redraw( OutputDevice& rOutDev,
87 const ::basegfx::B2DPoint& rPos,
88 bool& bSurfacesDirty,
89 bool bBufferedUpdate ) const;
90
91 private:
92 virtual ::basegfx::B2DPolyPolygon polyPolygonFromXPolyPolygon2D(
93 css::uno::Reference< css::rendering::XPolyPolygon2D >& xPoly ) const override;
94
95 // for the redraw
98
100 mutable ::canvas::vcltools::VCLObject<BitmapEx> maContent;
101
104
105 };
106}
107
108/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class for an XSprite helper implementation - to be used in concert with CanvasCustomSpriteBase.
Helper class for canvas sprites.
void init(const css::geometry::RealSize2D &rSpriteSize, const ::canvas::SpriteSurface::Reference &rOwningSpriteCanvas, const BackBufferSharedPtr &rBackBuffer, const BackBufferSharedPtr &rBackBufferMask, bool bShowSpriteBounds)
Late-init the sprite helper.
void redraw(OutputDevice &rOutDev, const ::basegfx::B2DPoint &rPos, bool &bSurfacesDirty, bool bBufferedUpdate) const
Repaint sprite content to associated sprite canvas.
mutable ::canvas::vcltools::VCLObject< BitmapEx > maContent
Cached bitmap for the current sprite content.
virtual ::basegfx::B2DPolyPolygon polyPolygonFromXPolyPolygon2D(css::uno::Reference< css::rendering::XPolyPolygon2D > &xPoly) const override
Called to convert an API polygon to a basegfx polygon.
BackBufferSharedPtr mpBackBuffer
bool mbShowSpriteBounds
When true, line sprite corners in red.
BackBufferSharedPtr mpBackBufferMask
std::shared_ptr< BackBuffer > BackBufferSharedPtr
Definition: backbuffer.hxx:47