diff options
Diffstat (limited to 'slideshow/source/engine/transitions/slidetransitionfactory.cxx')
-rw-r--r-- | slideshow/source/engine/transitions/slidetransitionfactory.cxx | 168 |
1 files changed, 84 insertions, 84 deletions
diff --git a/slideshow/source/engine/transitions/slidetransitionfactory.cxx b/slideshow/source/engine/transitions/slidetransitionfactory.cxx index 76996a6098c5..0de2f471590a 100644 --- a/slideshow/source/engine/transitions/slidetransitionfactory.cxx +++ b/slideshow/source/engine/transitions/slidetransitionfactory.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -85,7 +85,7 @@ void fillPage( const ::cppcanvas::CanvasSharedPtr& rDestinationCanvas, const ::cppcanvas::CanvasSharedPtr pDevicePixelCanvas( rDestinationCanvas->clone() ); pDevicePixelCanvas->setTransformation( ::basegfx::B2DHomMatrix() ); - + // TODO(F2): Properly respect clip here. // Might have to be transformed, too. const ::basegfx::B2DHomMatrix aViewTransform( @@ -139,7 +139,7 @@ public: ScreenUpdater& rScreenUpdater, const uno::Reference< presentation::XTransitionFactory>& xFactory, - const SoundPlayerSharedPtr& pSoundPlayer, + const SoundPlayerSharedPtr& pSoundPlayer, EventMultiplexer& rEventMultiplexer) : SlideChangeBase( leavingSlide_, pEnteringSlide, @@ -185,7 +185,7 @@ public: bool addTransition( const UnoViewSharedPtr& rView ) { uno::Reference<presentation::XTransition> rTransition = mxFactory->createTransition( - mnTransitionType, + mnTransitionType, mnTransitionSubType, rView->getUnoView(), getLeavingBitmap(ViewEntry(rView))->getXBitmap(), @@ -198,7 +198,7 @@ public: return true; } - + virtual bool operator()( double t ) { std::for_each(maTransitions.begin(), @@ -295,7 +295,7 @@ public: } } -private: +private: // One transition object per view std::vector< TransitionViewPair* > maTransitions; @@ -338,19 +338,19 @@ public: bDirectionForward, true ) {} - + virtual void performIn( const ::cppcanvas::CustomSpriteSharedPtr& rSprite, const ViewEntry& rViewEntry, const ::cppcanvas::CanvasSharedPtr& rDestinationCanvas, double t ); - + virtual void performOut( const ::cppcanvas::CustomSpriteSharedPtr& rSprite, const ViewEntry& rViewEntry, const ::cppcanvas::CanvasSharedPtr& rDestinationCanvas, double t ); - + private: ClippingFunctor maClippingFunctor; }; @@ -366,8 +366,8 @@ void ClippedSlideChange::performIn( // that, getEnteringSizePixel() _guarantees_ to cover the whole // slide bitmap. There's a catch, though: this removes any effect // of the view transformation (e.g. rotation) from the transition. - rSprite->setClipPixel( - maClippingFunctor( t, + rSprite->setClipPixel( + maClippingFunctor( t, getEnteringSlideSizePixel(rViewEntry.mpView) ) ); } @@ -404,19 +404,19 @@ public: maFadeColor( rFadeColor ), mbFirstTurn( true ) {} - + virtual void performIn( const ::cppcanvas::CustomSpriteSharedPtr& rSprite, const ViewEntry& rViewEntry, const ::cppcanvas::CanvasSharedPtr& rDestinationCanvas, double t ); - + virtual void performOut( const ::cppcanvas::CustomSpriteSharedPtr& rSprite, const ViewEntry& rViewEntry, const ::cppcanvas::CanvasSharedPtr& rDestinationCanvas, double t ); - + private: const boost::optional< RGBColor > maFadeColor; bool mbFirstTurn; @@ -431,7 +431,7 @@ void FadingSlideChange::performIn( ENSURE_OR_THROW( rSprite, "FadingSlideChange::performIn(): Invalid sprite" ); - + if( maFadeColor ) // After half of the active time, fade in new slide rSprite->setAlpha( t > 0.5 ? 2.0*(t-0.5) : 0.0 ); @@ -452,21 +452,21 @@ void FadingSlideChange::performOut( ENSURE_OR_THROW( rDestinationCanvas, "FadingSlideChange::performOut(): Invalid dest canvas" ); - + // only needed for color fades if( maFadeColor ) { if( mbFirstTurn ) { mbFirstTurn = false; - + // clear page to given fade color. 'Leaving' slide is // painted atop of that, but slowly fading out. fillPage( rDestinationCanvas, getEnteringSlideSizePixel( rViewEntry.mpView ), *maFadeColor ); } - + // Until half of the active time, fade out old // slide. After half of the active time, old slide // will be invisible. @@ -561,23 +561,23 @@ class MovingSlideChange : public SlideChangeBase { /// Direction vector for leaving slide, const ::basegfx::B2DVector maLeavingDirection; - + /// Direction vector for entering slide, const ::basegfx::B2DVector maEnteringDirection; - + bool mbFirstPerformCall; - + public: /** Create a new SlideChanger, for the given entering slide bitmaps, which performes a moving slide change effect - + @param rLeavingDirection Direction vector. The move is performed along this direction vector, starting at a position where the leaving slide is fully visible, and ending at a position where the leaving slide is just not visible. The vector must have unit length. - + @param rEnteringDirection Direction vector. The move is performed along this direction vector, starting at a position where the @@ -611,13 +611,13 @@ public: maEnteringDirection( rEnteringDirection ), mbFirstPerformCall( true ) {} - + virtual void performIn( const ::cppcanvas::CustomSpriteSharedPtr& rSprite, const ViewEntry& rViewEntry, const ::cppcanvas::CanvasSharedPtr& rDestinationCanvas, double t ); - + virtual void performOut( const ::cppcanvas::CustomSpriteSharedPtr& rSprite, const ViewEntry& rViewEntry, @@ -632,20 +632,20 @@ void MovingSlideChange::performIn( double t ) { // intro sprite moves: - + ENSURE_OR_THROW( rSprite, "MovingSlideChange::performIn(): Invalid sprite" ); ENSURE_OR_THROW( rDestinationCanvas, "MovingSlideChange::performIn(): Invalid dest canvas" ); - - if (mbFirstPerformCall && maLeavingDirection.equalZero()) + + if (mbFirstPerformCall && maLeavingDirection.equalZero()) { mbFirstPerformCall = false; renderBitmap( getLeavingBitmap(rViewEntry), rDestinationCanvas ); } - + // TODO(F1): This does not account for non-translational // transformations! If the canvas is rotated, we still // move the sprite unrotated (which might or might not @@ -654,12 +654,12 @@ void MovingSlideChange::performIn( rDestinationCanvas->getTransformation() ); const basegfx::B2DPoint aPageOrigin( aViewTransform * basegfx::B2DPoint() ); - + // move sprite rSprite->movePixel( aPageOrigin + - ((t - 1.0) * - ::basegfx::B2DSize( getEnteringSlideSizePixel(rViewEntry.mpView) ) * + ((t - 1.0) * + ::basegfx::B2DSize( getEnteringSlideSizePixel(rViewEntry.mpView) ) * maEnteringDirection) ); } @@ -670,20 +670,20 @@ void MovingSlideChange::performOut( double t ) { // outro sprite moves: - + ENSURE_OR_THROW( rSprite, "MovingSlideChange::performOut(): Invalid sprite" ); ENSURE_OR_THROW( rDestinationCanvas, "MovingSlideChange::performOut(): Invalid dest canvas" ); - - if (mbFirstPerformCall && maEnteringDirection.equalZero()) + + if (mbFirstPerformCall && maEnteringDirection.equalZero()) { mbFirstPerformCall = false; renderBitmap( getEnteringBitmap(rViewEntry), rDestinationCanvas ); } - + // TODO(F1): This does not account for non-translational // transformations! If the canvas is rotated, we still // move the sprite unrotated (which might or might not @@ -692,11 +692,11 @@ void MovingSlideChange::performOut( rDestinationCanvas->getTransformation() ); const basegfx::B2DPoint aPageOrigin( aViewTransform * basegfx::B2DPoint() ); - + // move sprite rSprite->movePixel( - aPageOrigin + (t * - ::basegfx::B2DSize( getEnteringSlideSizePixel(rViewEntry.mpView) ) * + aPageOrigin + (t * + ::basegfx::B2DSize( getEnteringSlideSizePixel(rViewEntry.mpView) ) * maLeavingDirection) ); } @@ -722,7 +722,7 @@ NumberAnimationSharedPtr createPushWipeTransition( // wipes. leavingSlide = leavingSlide_; } - + // setup direction vector bool bComb( false ); ::basegfx::B2DVector aDirection; @@ -730,55 +730,55 @@ NumberAnimationSharedPtr createPushWipeTransition( { default: OSL_ENSURE( - false, + false, "createPushWipeTransition(): Unexpected transition " "subtype for animations::TransitionType::PUSHWIPE " "transitions" ); return NumberAnimationSharedPtr(); - + case animations::TransitionSubType::FROMTOP: aDirection = ::basegfx::B2DVector( 0.0, 1.0 ); break; - + case animations::TransitionSubType::FROMBOTTOM: aDirection = ::basegfx::B2DVector( 0.0, -1.0 ); break; - + case animations::TransitionSubType::FROMLEFT: aDirection = ::basegfx::B2DVector( 1.0, 0.0 ); break; - + case animations::TransitionSubType::FROMRIGHT: aDirection = ::basegfx::B2DVector( -1.0, 0.0 ); break; - + case animations::TransitionSubType::FROMBOTTOMRIGHT: aDirection = ::basegfx::B2DVector( -1.0, -1.0 ); break; - + case animations::TransitionSubType::FROMBOTTOMLEFT: aDirection = ::basegfx::B2DVector( 1.0, -1.0 ); break; - + case animations::TransitionSubType::FROMTOPRIGHT: aDirection = ::basegfx::B2DVector( -1.0, 1.0 ); break; - + case animations::TransitionSubType::FROMTOPLEFT: aDirection = ::basegfx::B2DVector( 1.0, 1.0 ); break; - + case animations::TransitionSubType::COMBHORIZONTAL: aDirection = ::basegfx::B2DVector( 1.0, 0.0 ); bComb = true; break; - + case animations::TransitionSubType::COMBVERTICAL: aDirection = ::basegfx::B2DVector( 0.0, 1.0 ); bComb = true; break; } - + if( bComb ) { return NumberAnimationSharedPtr( @@ -788,19 +788,19 @@ NumberAnimationSharedPtr createPushWipeTransition( rViewContainer, rScreenUpdater, rEventMultiplexer, - aDirection, + aDirection, 24 /* comb with 12 stripes */ )); } else { - return NumberAnimationSharedPtr( + return NumberAnimationSharedPtr( new MovingSlideChange( leavingSlide, pEnteringSlide, pSoundPlayer, rViewContainer, rScreenUpdater, rEventMultiplexer, - aDirection, + aDirection, aDirection )); } } @@ -822,53 +822,53 @@ NumberAnimationSharedPtr createSlideWipeTransition( { default: OSL_ENSURE( - false, + false, "createSlideWipeTransition(): Unexpected transition " "subtype for animations::TransitionType::SLIDEWIPE " "transitions" ); return NumberAnimationSharedPtr(); - + case animations::TransitionSubType::FROMTOP: aInDirection = ::basegfx::B2DVector( 0.0, 1.0 ); break; - + case animations::TransitionSubType::FROMRIGHT: aInDirection = ::basegfx::B2DVector( -1.0, 0.0 ); break; - + case animations::TransitionSubType::FROMLEFT: aInDirection = ::basegfx::B2DVector( 1.0, 0.0 ); break; - + case animations::TransitionSubType::FROMBOTTOM: aInDirection = ::basegfx::B2DVector( 0.0, -1.0 ); break; - + case animations::TransitionSubType::FROMBOTTOMRIGHT: aInDirection = ::basegfx::B2DVector( -1.0, -1.0 ); break; - + case animations::TransitionSubType::FROMBOTTOMLEFT: aInDirection = ::basegfx::B2DVector( 1.0, -1.0 ); break; - + case animations::TransitionSubType::FROMTOPRIGHT: aInDirection = ::basegfx::B2DVector( -1.0, 1.0 ); break; - + case animations::TransitionSubType::FROMTOPLEFT: aInDirection = ::basegfx::B2DVector( 1.0, 1.0 ); break; } - + if( bTransitionDirection ) { // normal, 'forward' slide wipe effect. Since the old // content is still on screen (and does not move), we omit // the 'leaving' slide. // ======================================================= - - return NumberAnimationSharedPtr( + + return NumberAnimationSharedPtr( new MovingSlideChange( boost::optional<SlideSharedPtr>() /* no slide */, pEnteringSlide, @@ -885,8 +885,8 @@ NumberAnimationSharedPtr createSlideWipeTransition( // means, that the new slide is in the back, statically, // and the old one is moving off in the foreground. // ======================================================= - - return NumberAnimationSharedPtr( + + return NumberAnimationSharedPtr( new MovingSlideChange( leavingSlide, pEnteringSlide, pSoundPlayer, @@ -907,10 +907,10 @@ NumberAnimationSharedPtr createPluginTransition( ScreenUpdater& rScreenUpdater, const uno::Reference< presentation::XTransitionFactory>& xFactory, - const SoundPlayerSharedPtr& pSoundPlayer, + const SoundPlayerSharedPtr& pSoundPlayer, EventMultiplexer& rEventMultiplexer) { - PluginSlideChange* pTransition = + PluginSlideChange* pTransition = new PluginSlideChange( nTransitionType, nTransitionSubType, @@ -956,12 +956,12 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition( } return NumberAnimationSharedPtr(); } - + ENSURE_OR_THROW( pEnteringSlide, "TransitionFactory::createSlideTransition(): Invalid entering slide" ); - - if( xOptionalFactory.is() && + + if( xOptionalFactory.is() && xOptionalFactory->hasTransition(nTransitionType, nTransitionSubType) ) { // #i82460# - optional plugin factory claims this transition. delegate. @@ -981,7 +981,7 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition( return pTransition; } - const TransitionInfo* pTransitionInfo( + const TransitionInfo* pTransitionInfo( getTransitionInfo( nTransitionType, nTransitionSubType ) ); if( pTransitionInfo != NULL ) @@ -997,12 +997,12 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition( nTransitionSubType ); return NumberAnimationSharedPtr(); - + case TransitionInfo::TRANSITION_CLIP_POLYPOLYGON: { // generate parametric poly-polygon - ParametricPolyPolygonSharedPtr pPoly( - ParametricPolyPolygonFactory::createClipPolyPolygon( + ParametricPolyPolygonSharedPtr pPoly( + ParametricPolyPolygonFactory::createClipPolyPolygon( nTransitionType, nTransitionSubType ) ); // create a clip transition from that @@ -1016,14 +1016,14 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition( bTransitionDirection, pSoundPlayer )); } - + case TransitionInfo::TRANSITION_SPECIAL: { switch( nTransitionType ) { default: OSL_ENSURE( - false, + false, "TransitionFactory::createSlideTransition(): " "Unexpected transition type for " "TRANSITION_SPECIAL transitions" ); @@ -1036,7 +1036,7 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition( const TransitionInfo* pRandomTransitionInfo( getRandomTransitionInfo() ); - + ENSURE_OR_THROW( pRandomTransitionInfo != NULL, "TransitionFactory::createSlideTransition(): " @@ -1150,8 +1150,8 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition( break; } } - - // No animation generated, maybe no table entry for given + + // No animation generated, maybe no table entry for given // transition? OSL_TRACE( "TransitionFactory::createSlideTransition(): " @@ -1162,7 +1162,7 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition( false, "TransitionFactory::createSlideTransition(): " "Unknown type/subtype combination encountered" ); - + return NumberAnimationSharedPtr(); } |