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