1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir #ifndef SD_PRESENTER_PRESENTER_CANVAS_HXX 29*cdf0e10cSrcweir #define SD_PRESENTER_PRESENTER_CANVAS_HXX 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #include "CanvasUpdateRequester.hxx" 32*cdf0e10cSrcweir #include <basegfx/range/b2drectangle.hxx> 33*cdf0e10cSrcweir #include <com/sun/star/awt/Point.hpp> 34*cdf0e10cSrcweir #include <com/sun/star/awt/XWindow.hpp> 35*cdf0e10cSrcweir #include <com/sun/star/awt/XWindowListener.hpp> 36*cdf0e10cSrcweir #include <com/sun/star/geometry/AffineMatrix2D.hpp> 37*cdf0e10cSrcweir #include <com/sun/star/lang/XInitialization.hpp> 38*cdf0e10cSrcweir #include <com/sun/star/lang/IllegalArgumentException.hpp> 39*cdf0e10cSrcweir #include <com/sun/star/rendering/XSpriteCanvas.hpp> 40*cdf0e10cSrcweir #include <com/sun/star/rendering/VolatileContentDestroyedException.hpp> 41*cdf0e10cSrcweir #include <cppuhelper/basemutex.hxx> 42*cdf0e10cSrcweir #include <cppuhelper/compbase4.hxx> 43*cdf0e10cSrcweir #include <boost/noncopyable.hpp> 44*cdf0e10cSrcweir #include <boost/shared_ptr.hpp> 45*cdf0e10cSrcweir 46*cdf0e10cSrcweir namespace css = ::com::sun::star; 47*cdf0e10cSrcweir 48*cdf0e10cSrcweir namespace sd { namespace presenter { 49*cdf0e10cSrcweir 50*cdf0e10cSrcweir namespace { 51*cdf0e10cSrcweir typedef ::cppu::WeakComponentImplHelper4 < 52*cdf0e10cSrcweir css::rendering::XSpriteCanvas, 53*cdf0e10cSrcweir css::rendering::XBitmap, 54*cdf0e10cSrcweir css::awt::XWindowListener, 55*cdf0e10cSrcweir css::lang::XInitialization 56*cdf0e10cSrcweir > PresenterCanvasInterfaceBase; 57*cdf0e10cSrcweir } 58*cdf0e10cSrcweir 59*cdf0e10cSrcweir /** Wrapper around a shared canvas that forwards most of its methods to the 60*cdf0e10cSrcweir shared canvas. Most notable differences are: 61*cdf0e10cSrcweir 1. The transformation of the ViewState of forwarded calls is modified by adding 62*cdf0e10cSrcweir an offset. 63*cdf0e10cSrcweir 2. The clip polygon of the ViewState of forwarded calls is intersected 64*cdf0e10cSrcweir with a clip rectangle that can be set via SetClip(). 65*cdf0e10cSrcweir 3. Calls to updateScreen() are collected. One call to the updateScreen() 66*cdf0e10cSrcweir method of the shared canvas is made asynchronously. 67*cdf0e10cSrcweir 68*cdf0e10cSrcweir The canvas can use different canvases for sharing and for sprite 69*cdf0e10cSrcweir construction. This allows the shared canvas to be a canvas of sprite itself. 70*cdf0e10cSrcweir */ 71*cdf0e10cSrcweir class PresenterCanvas 72*cdf0e10cSrcweir : private ::boost::noncopyable, 73*cdf0e10cSrcweir private ::cppu::BaseMutex, 74*cdf0e10cSrcweir public PresenterCanvasInterfaceBase 75*cdf0e10cSrcweir { 76*cdf0e10cSrcweir public: 77*cdf0e10cSrcweir /** This constructor is used when a PresenterCanvas object is created as 78*cdf0e10cSrcweir a service. 79*cdf0e10cSrcweir */ 80*cdf0e10cSrcweir PresenterCanvas (void); 81*cdf0e10cSrcweir 82*cdf0e10cSrcweir /** This constructor is used when a PresenterCanvas object is created 83*cdf0e10cSrcweir directly, typically by the PresenterCanvasFactory. 84*cdf0e10cSrcweir @param rxUpdateCanvas 85*cdf0e10cSrcweir This canvas is used to call updateScreen() at and to create 86*cdf0e10cSrcweir sprites. In the typical case this canvas is identical to the 87*cdf0e10cSrcweir rxSharedCanvas argument. 88*cdf0e10cSrcweir @param rxUpdateWindow 89*cdf0e10cSrcweir The window that belongs to the canvas given by the 90*cdf0e10cSrcweir rxUpdateCanvas argument. 91*cdf0e10cSrcweir @param rxSharedCanvas 92*cdf0e10cSrcweir The canvas that is wrapped by the new instance of this class. 93*cdf0e10cSrcweir Typically this is a regular XSpriteCanvas and then is identical 94*cdf0e10cSrcweir to the one given by the rxUpdateCanvas argument. It may be the 95*cdf0e10cSrcweir canvas of a sprite which does not support the XSpriteCanvas 96*cdf0e10cSrcweir interface. In that case the canvas that created the sprite can 97*cdf0e10cSrcweir be given as rxUpdateCanvas argument to allow to create further 98*cdf0e10cSrcweir sprites and to have proper calls to updateScreen(). 99*cdf0e10cSrcweir @param rxSharedWindow 100*cdf0e10cSrcweir The window that belongs to the canvas given by the 101*cdf0e10cSrcweir rxSharedCanvas argument. 102*cdf0e10cSrcweir @param rxWindow 103*cdf0e10cSrcweir The window that is represented by the new PresenterCanvas 104*cdf0e10cSrcweir object. It is expected to be a direct decendent of 105*cdf0e10cSrcweir rxSharedWindow. Its position inside rxSharedWindow defines the 106*cdf0e10cSrcweir offset of the canvas implemented by the new PresenterCanvas 107*cdf0e10cSrcweir object and rxSharedCanvas. 108*cdf0e10cSrcweir */ 109*cdf0e10cSrcweir PresenterCanvas ( 110*cdf0e10cSrcweir const css::uno::Reference<css::rendering::XSpriteCanvas>& rxUpdateCanvas, 111*cdf0e10cSrcweir const css::uno::Reference<css::awt::XWindow>& rxUpdateWindow, 112*cdf0e10cSrcweir const css::uno::Reference<css::rendering::XCanvas>& rxSharedCanvas, 113*cdf0e10cSrcweir const css::uno::Reference<css::awt::XWindow>& rxSharedWindow, 114*cdf0e10cSrcweir const css::uno::Reference<css::awt::XWindow>& rxWindow); 115*cdf0e10cSrcweir virtual ~PresenterCanvas (void); 116*cdf0e10cSrcweir 117*cdf0e10cSrcweir virtual void SAL_CALL disposing (void) 118*cdf0e10cSrcweir throw (css::uno::RuntimeException); 119*cdf0e10cSrcweir 120*cdf0e10cSrcweir css::awt::Point GetOffset (const css::uno::Reference<css::awt::XWindow>& rxBaseWindow); 121*cdf0e10cSrcweir 122*cdf0e10cSrcweir /** Merge the given view state with the view state that translates the 123*cdf0e10cSrcweir (virtual) child canvas to the shared canvas. 124*cdf0e10cSrcweir */ 125*cdf0e10cSrcweir css::rendering::ViewState MergeViewState ( 126*cdf0e10cSrcweir const css::rendering::ViewState& rViewState, 127*cdf0e10cSrcweir const css::awt::Point& raOffset); 128*cdf0e10cSrcweir 129*cdf0e10cSrcweir css::uno::Reference<css::rendering::XCanvas> GetSharedCanvas (void) const; 130*cdf0e10cSrcweir 131*cdf0e10cSrcweir /** This method is typically called by CanvasPane objects to set the 132*cdf0e10cSrcweir repaint rectangle of a windowPaint() call as clip rectangle. When 133*cdf0e10cSrcweir no or an empty rectangle is given then the window bounds are used 134*cdf0e10cSrcweir instead. 135*cdf0e10cSrcweir @param rClipRectangle 136*cdf0e10cSrcweir A valid rectangle is used to clip the view state clip polygon. 137*cdf0e10cSrcweir When an empty rectangle is given then the view state clip 138*cdf0e10cSrcweir polygons are clipped against the window bounds. 139*cdf0e10cSrcweir */ 140*cdf0e10cSrcweir void SetClip (const css::awt::Rectangle& rClipRectangle); 141*cdf0e10cSrcweir 142*cdf0e10cSrcweir /** Called by custom sprites to update their clip polygon so that they 143*cdf0e10cSrcweir are clipped at the borders of the canvas. This method has to be 144*cdf0e10cSrcweir called after each change of the sprite location so that the bounds 145*cdf0e10cSrcweir of the canvas can be transformed into the coordinate system of the 146*cdf0e10cSrcweir sprite. 147*cdf0e10cSrcweir */ 148*cdf0e10cSrcweir css::uno::Reference<css::rendering::XPolyPolygon2D> UpdateSpriteClip ( 149*cdf0e10cSrcweir const css::uno::Reference<css::rendering::XPolyPolygon2D>& rxOriginalClip, 150*cdf0e10cSrcweir const css::geometry::RealPoint2D& rLocation, 151*cdf0e10cSrcweir const css::geometry::RealSize2D& rSize); 152*cdf0e10cSrcweir 153*cdf0e10cSrcweir 154*cdf0e10cSrcweir // XInitialization 155*cdf0e10cSrcweir 156*cdf0e10cSrcweir virtual void SAL_CALL initialize ( 157*cdf0e10cSrcweir const css::uno::Sequence<css::uno::Any>& rArguments) 158*cdf0e10cSrcweir throw(css::uno::Exception, css::uno::RuntimeException); 159*cdf0e10cSrcweir 160*cdf0e10cSrcweir 161*cdf0e10cSrcweir // XCanvas 162*cdf0e10cSrcweir 163*cdf0e10cSrcweir virtual void SAL_CALL clear (void) 164*cdf0e10cSrcweir throw (css::uno::RuntimeException); 165*cdf0e10cSrcweir 166*cdf0e10cSrcweir virtual void SAL_CALL drawPoint ( 167*cdf0e10cSrcweir const css::geometry::RealPoint2D& aPoint, 168*cdf0e10cSrcweir const css::rendering::ViewState& aViewState, 169*cdf0e10cSrcweir const css::rendering::RenderState& aRenderState) 170*cdf0e10cSrcweir throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); 171*cdf0e10cSrcweir 172*cdf0e10cSrcweir virtual void SAL_CALL drawLine ( 173*cdf0e10cSrcweir const css::geometry::RealPoint2D& aStartPoint, 174*cdf0e10cSrcweir const css::geometry::RealPoint2D& aEndPoint, 175*cdf0e10cSrcweir const css::rendering::ViewState& aViewState, 176*cdf0e10cSrcweir const css::rendering::RenderState& aRenderState) 177*cdf0e10cSrcweir throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); 178*cdf0e10cSrcweir 179*cdf0e10cSrcweir virtual void SAL_CALL drawBezier ( 180*cdf0e10cSrcweir const css::geometry::RealBezierSegment2D& aBezierSegment, 181*cdf0e10cSrcweir const css::geometry::RealPoint2D& aEndPoint, 182*cdf0e10cSrcweir const css::rendering::ViewState& aViewState, 183*cdf0e10cSrcweir const css::rendering::RenderState& aRenderState) 184*cdf0e10cSrcweir throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); 185*cdf0e10cSrcweir 186*cdf0e10cSrcweir virtual css::uno::Reference<css::rendering::XCachedPrimitive> SAL_CALL drawPolyPolygon ( 187*cdf0e10cSrcweir const css::uno::Reference< css::rendering::XPolyPolygon2D >& xPolyPolygon, 188*cdf0e10cSrcweir const css::rendering::ViewState& aViewState, 189*cdf0e10cSrcweir const css::rendering::RenderState& aRenderState) 190*cdf0e10cSrcweir throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); 191*cdf0e10cSrcweir 192*cdf0e10cSrcweir virtual css::uno::Reference<css::rendering::XCachedPrimitive> SAL_CALL strokePolyPolygon ( 193*cdf0e10cSrcweir const css::uno::Reference< css::rendering::XPolyPolygon2D >& xPolyPolygon, 194*cdf0e10cSrcweir const css::rendering::ViewState& aViewState, 195*cdf0e10cSrcweir const css::rendering::RenderState& aRenderState, 196*cdf0e10cSrcweir const css::rendering::StrokeAttributes& aStrokeAttributes) 197*cdf0e10cSrcweir throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); 198*cdf0e10cSrcweir 199*cdf0e10cSrcweir virtual css::uno::Reference<css::rendering::XCachedPrimitive> SAL_CALL 200*cdf0e10cSrcweir strokeTexturedPolyPolygon ( 201*cdf0e10cSrcweir const css::uno::Reference< css::rendering::XPolyPolygon2D >& xPolyPolygon, 202*cdf0e10cSrcweir const css::rendering::ViewState& aViewState, 203*cdf0e10cSrcweir const css::rendering::RenderState& aRenderState, 204*cdf0e10cSrcweir const css::uno::Sequence< css::rendering::Texture >& aTextures, 205*cdf0e10cSrcweir const css::rendering::StrokeAttributes& aStrokeAttributes) 206*cdf0e10cSrcweir throw (css::lang::IllegalArgumentException, 207*cdf0e10cSrcweir css::rendering::VolatileContentDestroyedException, 208*cdf0e10cSrcweir css::uno::RuntimeException); 209*cdf0e10cSrcweir 210*cdf0e10cSrcweir virtual css::uno::Reference<css::rendering::XCachedPrimitive> SAL_CALL 211*cdf0e10cSrcweir strokeTextureMappedPolyPolygon( 212*cdf0e10cSrcweir const css::uno::Reference<css::rendering::XPolyPolygon2D >& xPolyPolygon, 213*cdf0e10cSrcweir const css::rendering::ViewState& aViewState, 214*cdf0e10cSrcweir const css::rendering::RenderState& aRenderState, 215*cdf0e10cSrcweir const css::uno::Sequence<css::rendering::Texture>& aTextures, 216*cdf0e10cSrcweir const css::uno::Reference<css::geometry::XMapping2D>& xMapping, 217*cdf0e10cSrcweir const css::rendering::StrokeAttributes& aStrokeAttributes) 218*cdf0e10cSrcweir throw (css::lang::IllegalArgumentException, 219*cdf0e10cSrcweir css::rendering::VolatileContentDestroyedException, 220*cdf0e10cSrcweir css::uno::RuntimeException); 221*cdf0e10cSrcweir 222*cdf0e10cSrcweir virtual css::uno::Reference<css::rendering::XPolyPolygon2D> SAL_CALL 223*cdf0e10cSrcweir queryStrokeShapes( 224*cdf0e10cSrcweir const css::uno::Reference<css::rendering::XPolyPolygon2D>& xPolyPolygon, 225*cdf0e10cSrcweir const css::rendering::ViewState& aViewState, 226*cdf0e10cSrcweir const css::rendering::RenderState& aRenderState, 227*cdf0e10cSrcweir const css::rendering::StrokeAttributes& aStrokeAttributes) 228*cdf0e10cSrcweir throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); 229*cdf0e10cSrcweir 230*cdf0e10cSrcweir virtual css::uno::Reference<css::rendering::XCachedPrimitive> SAL_CALL 231*cdf0e10cSrcweir fillPolyPolygon( 232*cdf0e10cSrcweir const css::uno::Reference<css::rendering::XPolyPolygon2D>& xPolyPolygon, 233*cdf0e10cSrcweir const css::rendering::ViewState& aViewState, 234*cdf0e10cSrcweir const css::rendering::RenderState& aRenderState) 235*cdf0e10cSrcweir throw (css::lang::IllegalArgumentException, 236*cdf0e10cSrcweir css::uno::RuntimeException); 237*cdf0e10cSrcweir 238*cdf0e10cSrcweir virtual css::uno::Reference<css::rendering::XCachedPrimitive> SAL_CALL 239*cdf0e10cSrcweir fillTexturedPolyPolygon( 240*cdf0e10cSrcweir const css::uno::Reference<css::rendering::XPolyPolygon2D>& xPolyPolygon, 241*cdf0e10cSrcweir const css::rendering::ViewState& aViewState, 242*cdf0e10cSrcweir const css::rendering::RenderState& aRenderState, 243*cdf0e10cSrcweir const css::uno::Sequence<css::rendering::Texture>& xTextures) 244*cdf0e10cSrcweir throw (css::lang::IllegalArgumentException, 245*cdf0e10cSrcweir css::rendering::VolatileContentDestroyedException, 246*cdf0e10cSrcweir css::uno::RuntimeException); 247*cdf0e10cSrcweir 248*cdf0e10cSrcweir virtual css::uno::Reference<css::rendering::XCachedPrimitive> SAL_CALL 249*cdf0e10cSrcweir fillTextureMappedPolyPolygon( 250*cdf0e10cSrcweir const css::uno::Reference< css::rendering::XPolyPolygon2D >& xPolyPolygon, 251*cdf0e10cSrcweir const css::rendering::ViewState& aViewState, 252*cdf0e10cSrcweir const css::rendering::RenderState& aRenderState, 253*cdf0e10cSrcweir const css::uno::Sequence< css::rendering::Texture >& xTextures, 254*cdf0e10cSrcweir const css::uno::Reference< css::geometry::XMapping2D >& xMapping) 255*cdf0e10cSrcweir throw (css::lang::IllegalArgumentException, 256*cdf0e10cSrcweir css::rendering::VolatileContentDestroyedException, 257*cdf0e10cSrcweir css::uno::RuntimeException); 258*cdf0e10cSrcweir 259*cdf0e10cSrcweir virtual css::uno::Reference<css::rendering::XCanvasFont> SAL_CALL 260*cdf0e10cSrcweir createFont( 261*cdf0e10cSrcweir const css::rendering::FontRequest& aFontRequest, 262*cdf0e10cSrcweir const css::uno::Sequence< css::beans::PropertyValue >& aExtraFontProperties, 263*cdf0e10cSrcweir const css::geometry::Matrix2D& aFontMatrix) 264*cdf0e10cSrcweir throw (css::lang::IllegalArgumentException, 265*cdf0e10cSrcweir css::uno::RuntimeException); 266*cdf0e10cSrcweir 267*cdf0e10cSrcweir virtual css::uno::Sequence<css::rendering::FontInfo> SAL_CALL 268*cdf0e10cSrcweir queryAvailableFonts( 269*cdf0e10cSrcweir const css::rendering::FontInfo& aFilter, 270*cdf0e10cSrcweir const css::uno::Sequence< css::beans::PropertyValue >& aFontProperties) 271*cdf0e10cSrcweir throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); 272*cdf0e10cSrcweir 273*cdf0e10cSrcweir virtual css::uno::Reference<css::rendering::XCachedPrimitive> SAL_CALL 274*cdf0e10cSrcweir drawText( 275*cdf0e10cSrcweir const css::rendering::StringContext& aText, 276*cdf0e10cSrcweir const css::uno::Reference< css::rendering::XCanvasFont >& xFont, 277*cdf0e10cSrcweir const css::rendering::ViewState& aViewState, 278*cdf0e10cSrcweir const css::rendering::RenderState& aRenderState, 279*cdf0e10cSrcweir ::sal_Int8 nTextDirection) 280*cdf0e10cSrcweir throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); 281*cdf0e10cSrcweir 282*cdf0e10cSrcweir virtual css::uno::Reference<css::rendering::XCachedPrimitive> SAL_CALL 283*cdf0e10cSrcweir drawTextLayout( 284*cdf0e10cSrcweir const css::uno::Reference< css::rendering::XTextLayout >& xLayoutetText, 285*cdf0e10cSrcweir const css::rendering::ViewState& aViewState, 286*cdf0e10cSrcweir const css::rendering::RenderState& aRenderState) 287*cdf0e10cSrcweir throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); 288*cdf0e10cSrcweir 289*cdf0e10cSrcweir virtual css::uno::Reference<css::rendering::XCachedPrimitive> SAL_CALL 290*cdf0e10cSrcweir drawBitmap( 291*cdf0e10cSrcweir const css::uno::Reference< css::rendering::XBitmap >& xBitmap, 292*cdf0e10cSrcweir const css::rendering::ViewState& aViewState, 293*cdf0e10cSrcweir const css::rendering::RenderState& aRenderState) 294*cdf0e10cSrcweir throw (css::lang::IllegalArgumentException, 295*cdf0e10cSrcweir css::rendering::VolatileContentDestroyedException, 296*cdf0e10cSrcweir css::uno::RuntimeException); 297*cdf0e10cSrcweir 298*cdf0e10cSrcweir virtual css::uno::Reference<css::rendering::XCachedPrimitive> SAL_CALL 299*cdf0e10cSrcweir drawBitmapModulated( 300*cdf0e10cSrcweir const css::uno::Reference< css::rendering::XBitmap>& xBitmap, 301*cdf0e10cSrcweir const css::rendering::ViewState& aViewState, 302*cdf0e10cSrcweir const css::rendering::RenderState& aRenderState) 303*cdf0e10cSrcweir throw (css::lang::IllegalArgumentException, 304*cdf0e10cSrcweir css::rendering::VolatileContentDestroyedException, 305*cdf0e10cSrcweir css::uno::RuntimeException); 306*cdf0e10cSrcweir 307*cdf0e10cSrcweir virtual css::uno::Reference<css::rendering::XGraphicDevice> SAL_CALL 308*cdf0e10cSrcweir getDevice (void) 309*cdf0e10cSrcweir throw (css::uno::RuntimeException); 310*cdf0e10cSrcweir 311*cdf0e10cSrcweir 312*cdf0e10cSrcweir // XBitmapCanvas 313*cdf0e10cSrcweir 314*cdf0e10cSrcweir void SAL_CALL copyRect( 315*cdf0e10cSrcweir const css::uno::Reference< css::rendering::XBitmapCanvas >& sourceCanvas, 316*cdf0e10cSrcweir const css::geometry::RealRectangle2D& sourceRect, 317*cdf0e10cSrcweir const css::rendering::ViewState& sourceViewState, 318*cdf0e10cSrcweir const css::rendering::RenderState& sourceRenderState, 319*cdf0e10cSrcweir const css::geometry::RealRectangle2D& destRect, 320*cdf0e10cSrcweir const css::rendering::ViewState& destViewState, 321*cdf0e10cSrcweir const css::rendering::RenderState& destRenderState) 322*cdf0e10cSrcweir throw (css::lang::IllegalArgumentException, 323*cdf0e10cSrcweir css::rendering::VolatileContentDestroyedException, 324*cdf0e10cSrcweir css::uno::RuntimeException); 325*cdf0e10cSrcweir 326*cdf0e10cSrcweir 327*cdf0e10cSrcweir // XSpriteCanvas 328*cdf0e10cSrcweir 329*cdf0e10cSrcweir css::uno::Reference< css::rendering::XAnimatedSprite > SAL_CALL 330*cdf0e10cSrcweir createSpriteFromAnimation ( 331*cdf0e10cSrcweir const css::uno::Reference< css::rendering::XAnimation >& animation) 332*cdf0e10cSrcweir throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); 333*cdf0e10cSrcweir 334*cdf0e10cSrcweir css::uno::Reference< css::rendering::XAnimatedSprite > SAL_CALL 335*cdf0e10cSrcweir createSpriteFromBitmaps ( 336*cdf0e10cSrcweir const css::uno::Sequence< 337*cdf0e10cSrcweir css::uno::Reference< css::rendering::XBitmap > >& animationBitmaps, 338*cdf0e10cSrcweir ::sal_Int8 interpolationMode) 339*cdf0e10cSrcweir throw (css::lang::IllegalArgumentException, 340*cdf0e10cSrcweir css::rendering::VolatileContentDestroyedException, 341*cdf0e10cSrcweir css::uno::RuntimeException); 342*cdf0e10cSrcweir 343*cdf0e10cSrcweir css::uno::Reference< css::rendering::XCustomSprite > SAL_CALL 344*cdf0e10cSrcweir createCustomSprite ( 345*cdf0e10cSrcweir const css::geometry::RealSize2D& spriteSize) 346*cdf0e10cSrcweir throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); 347*cdf0e10cSrcweir 348*cdf0e10cSrcweir css::uno::Reference< css::rendering::XSprite > SAL_CALL 349*cdf0e10cSrcweir createClonedSprite ( 350*cdf0e10cSrcweir const css::uno::Reference< css::rendering::XSprite >& original) 351*cdf0e10cSrcweir throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); 352*cdf0e10cSrcweir 353*cdf0e10cSrcweir ::sal_Bool SAL_CALL updateScreen (::sal_Bool bUpdateAll) 354*cdf0e10cSrcweir throw (css::uno::RuntimeException); 355*cdf0e10cSrcweir 356*cdf0e10cSrcweir 357*cdf0e10cSrcweir // XEventListener 358*cdf0e10cSrcweir 359*cdf0e10cSrcweir virtual void SAL_CALL disposing (const css::lang::EventObject& rEvent) 360*cdf0e10cSrcweir throw (css::uno::RuntimeException); 361*cdf0e10cSrcweir 362*cdf0e10cSrcweir 363*cdf0e10cSrcweir // XWindowListener 364*cdf0e10cSrcweir 365*cdf0e10cSrcweir virtual void SAL_CALL windowResized (const css::awt::WindowEvent& rEvent) 366*cdf0e10cSrcweir throw (css::uno::RuntimeException); 367*cdf0e10cSrcweir 368*cdf0e10cSrcweir virtual void SAL_CALL windowMoved (const css::awt::WindowEvent& rEvent) 369*cdf0e10cSrcweir throw (css::uno::RuntimeException); 370*cdf0e10cSrcweir 371*cdf0e10cSrcweir virtual void SAL_CALL windowShown (const css::lang::EventObject& rEvent) 372*cdf0e10cSrcweir throw (css::uno::RuntimeException); 373*cdf0e10cSrcweir 374*cdf0e10cSrcweir virtual void SAL_CALL windowHidden (const css::lang::EventObject& rEvent) 375*cdf0e10cSrcweir throw (css::uno::RuntimeException); 376*cdf0e10cSrcweir 377*cdf0e10cSrcweir 378*cdf0e10cSrcweir // XBitmap 379*cdf0e10cSrcweir 380*cdf0e10cSrcweir virtual css::geometry::IntegerSize2D SAL_CALL getSize (void) 381*cdf0e10cSrcweir throw (css::uno::RuntimeException); 382*cdf0e10cSrcweir 383*cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasAlpha (void) 384*cdf0e10cSrcweir throw (css::uno::RuntimeException); 385*cdf0e10cSrcweir 386*cdf0e10cSrcweir virtual css::uno::Reference<css::rendering::XBitmapCanvas> SAL_CALL queryBitmapCanvas (void) 387*cdf0e10cSrcweir throw (css::uno::RuntimeException); 388*cdf0e10cSrcweir 389*cdf0e10cSrcweir virtual css::uno::Reference<css::rendering::XBitmap> SAL_CALL getScaledBitmap( 390*cdf0e10cSrcweir const css::geometry::RealSize2D& rNewSize, 391*cdf0e10cSrcweir sal_Bool bFast) 392*cdf0e10cSrcweir throw (css::uno::RuntimeException, 393*cdf0e10cSrcweir css::lang::IllegalArgumentException, 394*cdf0e10cSrcweir css::rendering::VolatileContentDestroyedException); 395*cdf0e10cSrcweir 396*cdf0e10cSrcweir private: 397*cdf0e10cSrcweir css::uno::Reference<css::rendering::XSpriteCanvas> mxUpdateCanvas; 398*cdf0e10cSrcweir css::uno::Reference<css::awt::XWindow> mxUpdateWindow; 399*cdf0e10cSrcweir css::uno::Reference<css::rendering::XCanvas> mxSharedCanvas; 400*cdf0e10cSrcweir css::uno::Reference<css::awt::XWindow> mxSharedWindow; 401*cdf0e10cSrcweir 402*cdf0e10cSrcweir /** The window for which a canvas is emulated. 403*cdf0e10cSrcweir */ 404*cdf0e10cSrcweir css::uno::Reference<css::awt::XWindow> mxWindow; 405*cdf0e10cSrcweir 406*cdf0e10cSrcweir /** Offset of the emulated canvas with respect to the shared canvas. 407*cdf0e10cSrcweir */ 408*cdf0e10cSrcweir css::awt::Point maOffset; 409*cdf0e10cSrcweir 410*cdf0e10cSrcweir /** The UpdateRequester is used by updateScreen() to schedule 411*cdf0e10cSrcweir updateScreen() calls at the shared canvas. 412*cdf0e10cSrcweir */ 413*cdf0e10cSrcweir ::boost::shared_ptr<CanvasUpdateRequester> mpUpdateRequester; 414*cdf0e10cSrcweir 415*cdf0e10cSrcweir /** The clip rectangle as given to SetClip(). 416*cdf0e10cSrcweir */ 417*cdf0e10cSrcweir css::awt::Rectangle maClipRectangle; 418*cdf0e10cSrcweir 419*cdf0e10cSrcweir /** When this flag is true (it is set to true after every call to 420*cdf0e10cSrcweir updateScreen()) then the next call to MergeViewState updates the 421*cdf0e10cSrcweir maOffset member. A possible optimization would set this flag only 422*cdf0e10cSrcweir to true when one of the windows between mxWindow and mxSharedWindow 423*cdf0e10cSrcweir changes its position. 424*cdf0e10cSrcweir */ 425*cdf0e10cSrcweir bool mbOffsetUpdatePending; 426*cdf0e10cSrcweir 427*cdf0e10cSrcweir ::basegfx::B2DRectangle GetClipRectangle ( 428*cdf0e10cSrcweir const css::geometry::AffineMatrix2D& rViewTransform, 429*cdf0e10cSrcweir const css::awt::Point& rOffset); 430*cdf0e10cSrcweir 431*cdf0e10cSrcweir css::rendering::ViewState MergeViewState (const css::rendering::ViewState& rViewState); 432*cdf0e10cSrcweir 433*cdf0e10cSrcweir /** This method throws a DisposedException when the object has already been 434*cdf0e10cSrcweir disposed. 435*cdf0e10cSrcweir */ 436*cdf0e10cSrcweir void ThrowIfDisposed (void) 437*cdf0e10cSrcweir throw (css::lang::DisposedException); 438*cdf0e10cSrcweir }; 439*cdf0e10cSrcweir 440*cdf0e10cSrcweir 441*cdf0e10cSrcweir 442*cdf0e10cSrcweir } } // end of namespace ::sd::presenter 443*cdf0e10cSrcweir 444*cdf0e10cSrcweir #endif 445