Move setting of LD_LIBRARY_PATH closer to invocation of cppunittester
[LibreOffice.git] / canvas / source / vcl / spritehelper.hxx
blob41d9883f6ffea5e1d7f9226ee6bd765af8de6e61
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include <vcl/bitmapex.hxx>
24 #include <base/canvascustomspritehelper.hxx>
25 #include <base/spritesurface.hxx>
26 #include <vclwrapper.hxx>
28 #include "backbuffer.hxx"
31 namespace vclcanvas
33 /* Definition of SpriteHelper class */
35 /** Helper class for canvas sprites.
37 This class implements all sprite-related functionality, like
38 that available on the XSprite interface.
40 class SpriteHelper : public ::canvas::CanvasCustomSpriteHelper
42 public:
43 SpriteHelper();
45 // make CanvasCustomSpriteHelper::init visible for name lookup
46 using ::canvas::CanvasCustomSpriteHelper::init;
48 /** Late-init the sprite helper
50 @param rSpriteSize
51 Size of the sprite
53 @param rSpriteCanvas
54 Sprite canvas this sprite is part of. Object stores
55 ref-counted reference to it, thus, don't forget to pass on
56 disposing()!
58 @param rBackBuffer
59 Buffer of the sprite content (non-alpha part)
61 @param rBackBufferMask
62 Buffer of the sprite content (alpha part)
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 );
70 void disposing();
72 /** Repaint sprite content to associated sprite canvas
74 @param rPos
75 Output position (sprite's own position is disregarded)
77 @param io_bSurfacesDirty
78 When true, the referenced sprite surfaces (backBuffer and
79 backBufferMask) have been modified since last call.
81 @param bBufferedUpdate
82 When true, the redraw does <em>not</em> happen directly on
83 the front buffer, but within a VDev. Used to speed up
84 drawing.
86 void redraw( OutputDevice& rOutDev,
87 const ::basegfx::B2DPoint& rPos,
88 bool& bSurfacesDirty,
89 bool bBufferedUpdate ) const;
91 private:
92 virtual ::basegfx::B2DPolyPolygon polyPolygonFromXPolyPolygon2D(
93 css::uno::Reference< css::rendering::XPolyPolygon2D >& xPoly ) const override;
95 // for the redraw
96 BackBufferSharedPtr mpBackBuffer;
97 BackBufferSharedPtr mpBackBufferMask;
99 /// Cached bitmap for the current sprite content
100 mutable ::canvas::vcltools::VCLObject<BitmapEx> maContent;
102 /// When true, line sprite corners in red
103 bool mbShowSpriteBounds;
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */