1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef _NULLCANVAS_SPRITEHELPER_HXX
29 #define _NULLCANVAS_SPRITEHELPER_HXX
31 #include <com/sun/star/rendering/XCustomSprite.hpp>
33 #include <canvas/base/canvascustomspritehelper.hxx>
35 #include <basegfx/point/b2dpoint.hxx>
36 #include <basegfx/vector/b2isize.hxx>
37 #include <basegfx/matrix/b2dhommatrix.hxx>
39 #include "null_spritecanvas.hxx"
44 /* Definition of SpriteHelper class */
46 /** Helper class for canvas sprites.
48 This class implements all sprite-related functionality, like
49 that available on the XSprite interface.
51 class SpriteHelper
: public ::canvas::CanvasCustomSpriteHelper
54 /** Create sprite helper
58 // make CanvasCustomSpriteHelper::init visible for name lookup
59 using ::canvas::CanvasCustomSpriteHelper::init
;
61 /** Late-init the sprite helper
67 Sprite canvas this sprite is part of. Object stores
68 ref-counted reference to it, thus, don't forget to pass on
75 The surface of the sprite (not the DX texture, but the
76 persistent target of content rendering)
78 @param bShowSpriteBounds
79 When true, little debug bound rects for sprites are shown
81 void init( const ::com::sun::star::geometry::RealSize2D
& rSpriteSize
,
82 const SpriteCanvasRef
& rSpriteCanvas
);
86 /** Repaint sprite content via hardware to associated sprite
89 @param io_bSurfaceDirty
90 Input/output parameter, whether the sprite content is
91 dirty or not. If texture was updated, set to false
93 void redraw( bool& io_bSurfaceDirty
) const;
96 virtual ::basegfx::B2DPolyPolygon
polyPolygonFromXPolyPolygon2D(
97 ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XPolyPolygon2D
>& xPoly
) const;
100 SpriteCanvasRef mpSpriteCanvas
;
101 mutable bool mbTextureDirty
; // when true, texture needs update
105 #endif /* _NULLCANVAS_SPRITEHELPER_HXX */