fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / canvas / source / vcl / spritecanvashelper.hxx
blob7a598e2da8687b4ff278058e73465fbd94f284d7
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 #ifndef _VCLCANVAS_SPRITECANVASHELPER_HXX_
21 #define _VCLCANVAS_SPRITECANVASHELPER_HXX_
23 #include <com/sun/star/rendering/XSpriteCanvas.hpp>
24 #include <com/sun/star/rendering/XIntegerBitmap.hpp>
26 #include <vcl/virdev.hxx>
28 #include <canvas/spriteredrawmanager.hxx>
29 #include <canvas/elapsedtime.hxx>
30 #include <canvas/vclwrapper.hxx>
31 #include "canvashelper.hxx"
32 #include "impltools.hxx"
35 namespace vclcanvas
37 class SpriteCanvas;
39 class SpriteCanvasHelper : public CanvasHelper
41 public:
42 SpriteCanvasHelper();
44 void init( const OutDevProviderSharedPtr& rOutDev,
45 SpriteCanvas& rOwningSpriteCanvas,
46 ::canvas::SpriteRedrawManager& rManager,
47 bool bProtect,
48 bool bHaveAlpha );
50 /// Dispose all internal references
51 void disposing();
53 // XSpriteCanvas
54 ::com::sun::star::uno::Reference<
55 ::com::sun::star::rendering::XAnimatedSprite > createSpriteFromAnimation(
56 const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XAnimation >& animation );
58 ::com::sun::star::uno::Reference<
59 ::com::sun::star::rendering::XAnimatedSprite > createSpriteFromBitmaps(
60 const ::com::sun::star::uno::Sequence<
61 ::com::sun::star::uno::Reference<
62 ::com::sun::star::rendering::XBitmap > >& animationBitmaps,
63 sal_Int8 interpolationMode );
65 ::com::sun::star::uno::Reference<
66 ::com::sun::star::rendering::XCustomSprite > createCustomSprite(
67 const ::com::sun::star::geometry::RealSize2D& spriteSize );
69 ::com::sun::star::uno::Reference<
70 ::com::sun::star::rendering::XSprite > createClonedSprite(
71 const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XSprite >& original );
73 /** Actually perform the screen update
75 @param bUpdateAll
76 sal_True, if everything must be updated, not only changed
77 sprites
79 @param io_bSurfaceDirty
80 In/out parameter, whether backbuffer surface is dirty (if
81 yes, we're performing a full update, anyway)
83 sal_Bool updateScreen( sal_Bool bUpdateAll,
84 bool& io_bSurfaceDirty );
86 // SpriteRedrawManager functor calls
87 // -------------------------------------------------
89 /** Gets called for simple background repaints
91 void backgroundPaint( const ::basegfx::B2DRange& rUpdateRect );
93 /** Gets called when area can be handled by scrolling.
95 Called method must copy screen content from rMoveStart to
96 rMoveEnd, and restore the background in the uncovered
97 areas.
99 @param rMoveStart
100 Source rect of the scroll
102 @param rMoveEnd
103 Dest rect of the scroll
105 @param rUpdateArea
106 All info necessary, should rMoveStart be partially or
107 fully outside the outdev
109 void scrollUpdate( const ::basegfx::B2DRange& rMoveStart,
110 const ::basegfx::B2DRange& rMoveEnd,
111 const ::canvas::SpriteRedrawManager::UpdateArea& rUpdateArea );
113 void opaqueUpdate( const ::basegfx::B2DRange& rTotalArea,
114 const ::std::vector< ::canvas::Sprite::Reference >& rSortedUpdateSprites );
116 void genericUpdate( const ::basegfx::B2DRange& rTotalArea,
117 const ::std::vector< ::canvas::Sprite::Reference >& rSortedUpdateSprites );
119 ::com::sun::star::uno::Any isUnsafeScrolling() const
121 return ::com::sun::star::uno::makeAny(mbIsUnsafeScrolling);
123 void enableUnsafeScrolling( const ::com::sun::star::uno::Any& rAny )
125 mbIsUnsafeScrolling = rAny.get<bool>();
128 ::com::sun::star::uno::Any isSpriteBounds() const
130 return ::com::sun::star::uno::makeAny(mbShowSpriteBounds);
132 void enableSpriteBounds( const ::com::sun::star::uno::Any& rAny )
134 mbShowSpriteBounds = rAny.get<bool>();
137 private:
138 void renderFrameCounter( OutputDevice& rOutDev );
139 void renderSpriteCount( OutputDevice& rOutDev );
140 void renderMemUsage( OutputDevice& rOutDev );
142 /// Set from the SpriteCanvas: instance coordinating sprite redraw
143 ::canvas::SpriteRedrawManager* mpRedrawManager;
145 /// Set from the init method. used to generate sprites
146 SpriteCanvas* mpOwningSpriteCanvas;
148 /** Background compositing surface.
150 Typically, sprites will be composited in the background,
151 before pushing them to screen. This happens here.
153 ::canvas::vcltools::VCLObject< VirtualDevice > maVDev;
155 /// For the frame counter timings
156 ::canvas::tools::ElapsedTime maLastUpdate;
158 /// When true, canvas displays debug info on each frame
159 bool mbShowFrameInfo;
161 /// When true, canvas creates all new sprites with red lines in the corners
162 bool mbShowSpriteBounds;
164 /// When true, canvas uses the scroll optimization (direct scrolls in front buffer)
165 bool mbIsUnsafeScrolling;
169 #endif /* _VCLCANVAS_SPRITECANVASHELPER_HXX_ */
171 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */