diff options
Diffstat (limited to 'slideshow/source/engine/animationnodes')
32 files changed, 577 insertions, 577 deletions
diff --git a/slideshow/source/engine/animationnodes/animationaudionode.cxx b/slideshow/source/engine/animationnodes/animationaudionode.cxx index 64c91e2a2519..a03336650459 100644 --- a/slideshow/source/engine/animationnodes/animationaudionode.cxx +++ b/slideshow/source/engine/animationnodes/animationaudionode.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 @@ -46,7 +46,7 @@ namespace slideshow { namespace internal { AnimationAudioNode::AnimationAudioNode( - const uno::Reference< animations::XAnimationNode >& xNode, + const uno::Reference< animations::XAnimationNode >& xNode, const BaseContainerNodeSharedPtr& rParent, const NodeContext& rContext ) : BaseNode( xNode, rParent, rContext ), @@ -55,10 +55,10 @@ AnimationAudioNode::AnimationAudioNode( mpPlayer() { mxAudioNode->getSource() >>= maSoundURL; - + OSL_ENSURE( maSoundURL.getLength(), "could not extract sound source URL/empty URL string" ); - + ENSURE_OR_THROW( getContext().mxComponentContext.is(), "Invalid component context" ); } @@ -73,21 +73,21 @@ void AnimationAudioNode::dispose() void AnimationAudioNode::activate_st() { createPlayer(); - + AnimationEventHandlerSharedPtr aHandler( boost::dynamic_pointer_cast<AnimationEventHandler>( getSelf() ) ); OSL_ENSURE( aHandler, "could not cast self to AnimationEventHandler?" ); getContext().mrEventMultiplexer.addCommandStopAudioHandler( aHandler ); - - if (mpPlayer && mpPlayer->startPlayback()) + + if (mpPlayer && mpPlayer->startPlayback()) { // TODO(F2): Handle end time attribute, too - if( getXAnimationNode()->getDuration().hasValue() ) + if( getXAnimationNode()->getDuration().hasValue() ) { scheduleDeactivationEvent(); } - else + else { // no node duration. Take inherent media time, then scheduleDeactivationEvent( @@ -96,7 +96,7 @@ void AnimationAudioNode::activate_st() "AnimationAudioNode::deactivate with delay") ); } } - else + else { // deactivate ASAP: scheduleDeactivationEvent( @@ -115,14 +115,14 @@ void AnimationAudioNode::deactivate_st( NodeState /*eDestState*/ ) OSL_ENSURE( aHandler, "could not cas self to AnimationEventHandler?" ); getContext().mrEventMultiplexer.removeCommandStopAudioHandler( aHandler ); - + // force-end sound - if (mpPlayer) + if (mpPlayer) { mpPlayer->stopPlayback(); resetPlayer(); } - + // notify _after_ state change: getContext().mrEventQueue.addEvent( makeEvent( boost::bind( &EventMultiplexer::notifyAudioStopped, @@ -143,14 +143,14 @@ void AnimationAudioNode::createPlayer() const { if (mpPlayer) return; - - try + + try { mpPlayer = SoundPlayer::create( getContext().mrEventMultiplexer, maSoundURL, getContext().mxComponentContext ); } - catch( lang::NoSupportException& ) + catch( lang::NoSupportException& ) { // catch possible exceptions from SoundPlayer, // since being not able to playback the sound @@ -161,7 +161,7 @@ void AnimationAudioNode::createPlayer() const void AnimationAudioNode::resetPlayer() const { - if (mpPlayer) + if (mpPlayer) { mpPlayer->stopPlayback(); mpPlayer->dispose(); diff --git a/slideshow/source/engine/animationnodes/animationaudionode.hxx b/slideshow/source/engine/animationnodes/animationaudionode.hxx index ab2877a99784..35397557d0e2 100644 --- a/slideshow/source/engine/animationnodes/animationaudionode.hxx +++ b/slideshow/source/engine/animationnodes/animationaudionode.hxx @@ -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 @@ -37,7 +37,7 @@ namespace slideshow { namespace internal { /** Audio node. - + This animation node contains an audio effect. Duration and start/stop behaviour is affected by the referenced audio file. @@ -47,27 +47,27 @@ class AnimationAudioNode : public BaseNode, public AnimationEventHandler public: AnimationAudioNode( ::com::sun::star::uno::Reference< - ::com::sun::star::animations::XAnimationNode> const& xNode, + ::com::sun::star::animations::XAnimationNode> const& xNode, ::boost::shared_ptr<BaseContainerNode> const& pParent, NodeContext const& rContext ); - + protected: virtual void dispose(); - + private: virtual void activate_st(); virtual void deactivate_st( NodeState eDestState ); virtual bool hasPendingAnimation() const; - + /// overriden, because we need to deal with STOPAUDIO commands virtual bool handleAnimationEvent( const AnimationNodeSharedPtr& rNode ); - + private: - ::com::sun::star::uno::Reference< + ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAudio > mxAudioNode; ::rtl::OUString maSoundURL; mutable SoundPlayerSharedPtr mpPlayer; - + void createPlayer() const; void resetPlayer() const; }; diff --git a/slideshow/source/engine/animationnodes/animationbasenode.cxx b/slideshow/source/engine/animationnodes/animationbasenode.cxx index 9125cc6bcac5..ee979e60e659 100644 --- a/slideshow/source/engine/animationnodes/animationbasenode.cxx +++ b/slideshow/source/engine/animationnodes/animationbasenode.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 @@ -55,7 +55,7 @@ namespace slideshow { namespace internal { AnimationBaseNode::AnimationBaseNode( - const uno::Reference< animations::XAnimationNode >& xNode, + const uno::Reference< animations::XAnimationNode >& xNode, const BaseContainerNodeSharedPtr& rParent, const NodeContext& rContext ) : BaseNode( xNode, rParent, rContext ), @@ -70,13 +70,13 @@ AnimationBaseNode::AnimationBaseNode( { // extract native node targets // =========================== - + // plain shape target uno::Reference< drawing::XShape > xShape( mxAnimateNode->getTarget(), uno::UNO_QUERY ); - + // distinguish 5 cases: - // + // // - plain shape target // (NodeContext.mpMasterShapeSubset full set) // @@ -100,7 +100,7 @@ AnimationBaseNode::AnimationBaseNode( } else { - // cases 2 & 3: subset shape + // cases 2 & 3: subset shape mpShapeSubset = rContext.mpMasterShapeSubset; } } @@ -108,9 +108,9 @@ AnimationBaseNode::AnimationBaseNode( { // no parent-provided shape, try to extract // from XAnimationNode - cases 4 and 5 - + if( xShape.is() ) - { + { mpShape = lookupAttributableShape( getContext().mpSubsettableShapeManager, xShape ); } @@ -118,18 +118,18 @@ AnimationBaseNode::AnimationBaseNode( { // no shape provided. Maybe a ParagraphTarget? presentation::ParagraphTarget aTarget; - + if( !(mxAnimateNode->getTarget() >>= aTarget) ) ENSURE_OR_THROW( false, "could not extract any target information" ); - + xShape = aTarget.Shape; - + ENSURE_OR_THROW( xShape.is(), "invalid shape in ParagraphTarget" ); - + mpShape = lookupAttributableShape( getContext().mpSubsettableShapeManager, xShape ); - + // NOTE: For shapes with ParagraphTarget, we ignore // the SubItem property. We implicitely assume that it // is set to ONLY_TEXT. @@ -140,14 +140,14 @@ AnimationBaseNode::AnimationBaseNode( presentation::ShapeAnimationSubType::AS_WHOLE, "ParagraphTarget given, but subitem not AS_TEXT or AS_WHOLE? " "Make up your mind, I'll ignore the subitem." ); - + // okay, found a ParagraphTarget with a valid XShape. Does the shape // provide the given paragraph? - const DocTreeNode& rTreeNode( + const DocTreeNode& rTreeNode( mpShape->getTreeNodeSupplier().getTreeNode( - aTarget.Paragraph, + aTarget.Paragraph, DocTreeNode::NODETYPE_LOGICAL_PARAGRAPH ) ); - + // CAUTION: the creation of the subset shape // _must_ stay in the node constructor, since // Slide::prefetchShow() initializes shape @@ -157,7 +157,7 @@ AnimationBaseNode::AnimationBaseNode( new ShapeSubset( mpShape, rTreeNode, mpSubsetManager )); - + // Override NodeContext, and flag this node as // a special independent subset one. This is // important when applying initial attributes: @@ -172,7 +172,7 @@ AnimationBaseNode::AnimationBaseNode( // the slide is initially shown, and become // visible only when the effect starts. mbIsIndependentSubset = true; - + // already enable subset right here, the // setup of initial shape attributes of // course needs the subset shape @@ -189,12 +189,12 @@ void AnimationBaseNode::dispose() mpActivity->dispose(); mpActivity.reset(); } - + maAttributeLayerHolder.reset(); mxAnimateNode.clear(); mpShape.reset(); mpShapeSubset.reset(); - + BaseNode::dispose(); } @@ -205,12 +205,12 @@ bool AnimationBaseNode::init_st() mpActivity->dispose(); mpActivity.reset(); } - + // note: actually disposing the activity too early might cause problems, // because on dequeued() it calls endAnimation(pAnim->end()), thus ending // animation _after_ last screen update. // review that end() is properly called (which calls endAnimation(), too). - + try { // TODO(F2): For restart functionality, we must regenerate activities, // since they are not able to reset their state (or implement _that_) @@ -220,7 +220,7 @@ bool AnimationBaseNode::init_st() OSL_ENSURE( false, rtl::OUStringToOString( comphelper::anyToString(cppu::getCaughtException()), RTL_TEXTENCODING_UTF8 ) ); - // catch and ignore. We later handle empty activities, but for + // catch and ignore. We later handle empty activities, but for // other nodes to function properly, the core functionality of // this node must remain up and running. } @@ -228,7 +228,7 @@ bool AnimationBaseNode::init_st() } bool AnimationBaseNode::resolve_st() -{ +{ // enable shape subset for automatically generated // subsets. Independent subsets are already setup // during construction time. Doing it only here @@ -247,17 +247,17 @@ void AnimationBaseNode::activate_st() { // create new attribute layer maAttributeLayerHolder.createAttributeLayer( getShape() ); - + ENSURE_OR_THROW( maAttributeLayerHolder.get(), "Could not generate shape attribute layer" ); - + // TODO(Q2): This affects the way mpActivity // works, but is performed here because of // locality (we're fiddling with the additive mode // here, anyway, and it's the only place where we // do). OTOH, maybe the complete additive mode // setup should be moved to the activities. - + // for simple by-animations, the SMIL spec // requires us to emulate "0,by-value" value list // behaviour, with additive mode forced to "sum", @@ -276,7 +276,7 @@ void AnimationBaseNode::activate_st() // determine whether an // Activity::getUnderlyingValue() yields the // DOM value, or already a summed-up conglomerate) - // + // // Note that this poses problems with our // hybrid activity duration (time or min number of frames), // since if activities @@ -291,7 +291,7 @@ void AnimationBaseNode::activate_st() maAttributeLayerHolder.get()->setAdditiveMode( mxAnimateNode->getAdditive() ); } - + // fake normal animation behaviour, even if we // show nothing. This is the appropriate way to // handle errors on Activity generation, because @@ -302,7 +302,7 @@ void AnimationBaseNode::activate_st() // supply Activity (and the underlying Animation) with // it's AttributeLayer, to perform the animation on mpActivity->setTargets( getShape(), maAttributeLayerHolder.get() ); - + // add to activities queue getContext().mrActivitiesQueue.addActivity( mpActivity ); } @@ -319,7 +319,7 @@ void AnimationBaseNode::deactivate_st( NodeState eDestState ) if (mpActivity) mpActivity->end(); } - + if (isDependentSubsettedShape()) { // for dependent subsets, remove subset shape // from layer, re-integrate subsetted part @@ -330,7 +330,7 @@ void AnimationBaseNode::deactivate_st( NodeState eDestState ) // will effectively re-integrate the subsetted // part into the original shape (whose // animation will hopefully have ended, too) - + // this statement will save a whole lot of // sprites for iterated text effects, since // those sprites will only exist during the @@ -339,26 +339,26 @@ void AnimationBaseNode::deactivate_st( NodeState eDestState ) mpShapeSubset->disableSubsetShape(); } } - + if (eDestState == ENDED) { - + // no shape anymore, no layer needed: maAttributeLayerHolder.reset(); - + if (! isDependentSubsettedShape()) { - + // for all other shapes, removing the // attribute layer quite possibly changes // shape display. Thus, force update AttributableShapeSharedPtr const pShape( getShape() ); - + // don't anybody dare to check against // pShape->isVisible() here, removing the // attribute layer might actually make the // shape invisible! getContext().mpSubsettableShapeManager->notifyShapeUpdate( pShape ); } - + if (mpActivity) { // kill activity, if still running mpActivity->dispose(); @@ -369,7 +369,7 @@ void AnimationBaseNode::deactivate_st( NodeState eDestState ) bool AnimationBaseNode::hasPendingAnimation() const { - // TODO(F1): This might not always be true. Are there 'inactive' + // TODO(F1): This might not always be true. Are there 'inactive' // animation nodes? return true; } @@ -378,7 +378,7 @@ bool AnimationBaseNode::hasPendingAnimation() const void AnimationBaseNode::showState() const { BaseNode::showState(); - + VERBOSE_TRACE( "AnimationBaseNode info: independent subset=%s", mbIsIndependentSubset ? "y" : "n" ); } @@ -388,17 +388,17 @@ ActivitiesFactory::CommonParameters AnimationBaseNode::fillCommonParameters() const { double nDuration = 0.0; - + // TODO(F3): Duration/End handling is barely there if( !(mxAnimateNode->getDuration() >>= nDuration) ) { mxAnimateNode->getEnd() >>= nDuration; // Wah. } - + // minimal duration we fallback to (avoid 0 here!) nDuration = ::std::max( 0.001, nDuration ); - + const bool bAutoReverse( mxAnimateNode->getAutoReverse() ); - + boost::optional<double> aRepeats; double nRepeats = 0; if( (mxAnimateNode->getRepeatCount() >>= nRepeats) ) { @@ -411,7 +411,7 @@ AnimationBaseNode::fillCommonParameters() const // active duration. Thus, calc repeat // count with already adapted simple // duration (twice the specified duration) - + // convert duration back to repeat counts if( bAutoReverse ) aRepeats.reset( nRepeats / (2.0 * nDuration) ); @@ -421,7 +421,7 @@ AnimationBaseNode::fillCommonParameters() const else { // no double value for both values - Timing::INDEFINITE? animations::Timing eTiming; - + if( !(mxAnimateNode->getRepeatDuration() >>= eTiming) || eTiming != animations::Timing_INDEFINITE ) { @@ -435,7 +435,7 @@ AnimationBaseNode::fillCommonParameters() const } } } - + // calc accel/decel: double nAcceleration = 0.0; double nDeceleration = 0.0; @@ -450,7 +450,7 @@ AnimationBaseNode::fillCommonParameters() const nDeceleration = std::max( nDeceleration, xAnimationNode->getDecelerate() ); } - + EventSharedPtr pEndEvent; if (pSelf) { pEndEvent = makeEvent( diff --git a/slideshow/source/engine/animationnodes/animationbasenode.hxx b/slideshow/source/engine/animationnodes/animationbasenode.hxx index b15047d78c4f..aac9f3a0c3fe 100644 --- a/slideshow/source/engine/animationnodes/animationbasenode.hxx +++ b/slideshow/source/engine/animationnodes/animationbasenode.hxx @@ -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 @@ -41,7 +41,7 @@ namespace slideshow { namespace internal { /** Common base class for all leaf animation nodes. - + This class basically holds the target shape */ class AnimationBaseNode : public BaseNode @@ -49,36 +49,36 @@ class AnimationBaseNode : public BaseNode public: AnimationBaseNode( ::com::sun::star::uno::Reference< - ::com::sun::star::animations::XAnimationNode> const& xNode, + ::com::sun::star::animations::XAnimationNode> const& xNode, ::boost::shared_ptr<BaseContainerNode> const& pParent, NodeContext const& rContext ); - + #if defined(VERBOSE) && defined(DBG_UTIL) virtual void showState() const; #endif - + protected: virtual void dispose(); - + ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimate> const& getXAnimateNode() const { return mxAnimateNode; } - + /// Create parameter struct for ActivitiesFactory ActivitiesFactory::CommonParameters fillCommonParameters() const; ::basegfx::B2DVector const& getSlideSize() const { return maSlideSize; } AttributableShapeSharedPtr getShape() const; - + private: virtual bool hasPendingAnimation() const; - + private: // state transition callbacks virtual bool init_st(); virtual bool resolve_st(); virtual void activate_st(); virtual void deactivate_st( NodeState eDestState ); virtual AnimationActivitySharedPtr createActivity() const = 0; - + private: /** Returns true, if this is a subset animation, and the subset is autogenerated (e.g. from an @@ -86,20 +86,20 @@ private: */ bool isDependentSubsettedShape() const { return mpShapeSubset && !mbIsIndependentSubset; } - + ShapeAttributeLayerHolder const & getAttributeLayerHolder() const { return maAttributeLayerHolder; } - + private: ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimate> mxAnimateNode; ShapeAttributeLayerHolder maAttributeLayerHolder; ::basegfx::B2DVector maSlideSize; AnimationActivitySharedPtr mpActivity; - + /// When valid, this node has a plain target shape AttributableShapeSharedPtr mpShape; - /// When valid, this is a subsetted target shape + /// When valid, this is a subsetted target shape ShapeSubsetSharedPtr mpShapeSubset; SubsettableShapeManagerSharedPtr mpSubsetManager; bool mbIsIndependentSubset; diff --git a/slideshow/source/engine/animationnodes/animationcolornode.cxx b/slideshow/source/engine/animationnodes/animationcolornode.cxx index 6f1536d8ebee..5bd25ec26aba 100644 --- a/slideshow/source/engine/animationnodes/animationcolornode.cxx +++ b/slideshow/source/engine/animationnodes/animationcolornode.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 @@ -47,7 +47,7 @@ namespace internal { namespace { /** Little wrapper for HSL to RGB mapping. - + This class implements the HSLColorAnimation interface, internally converting to RGB and forwarding to ColorAnimation. @@ -62,7 +62,7 @@ public: mpAnimation, "HSLWrapper::HSLWrapper(): Invalid color animation delegate" ); } - + virtual void prefetch( const AnimatableShapeSharedPtr&, const ShapeAttributeLayerSharedPtr& ) {} @@ -72,22 +72,22 @@ public: { mpAnimation->start( rShape, rAttrLayer ); } - + virtual void end() { mpAnimation->end(); } - + virtual bool operator()( const HSLColor& rColor ) { return (*mpAnimation)( RGBColor( rColor ) ); } - + virtual HSLColor getUnderlyingValue() const { return HSLColor( mpAnimation->getUnderlyingValue() ); } - + private: ColorAnimationSharedPtr mpAnimation; }; @@ -97,39 +97,39 @@ private: AnimationActivitySharedPtr AnimationColorNode::createActivity() const { ActivitiesFactory::CommonParameters aParms( fillCommonParameters() ); - + switch( mxColorNode->getColorInterpolation() ) { case animations::AnimationColorSpace::RGB: return ActivitiesFactory::createAnimateActivity( aParms, - AnimationFactory::createColorPropertyAnimation( + AnimationFactory::createColorPropertyAnimation( mxColorNode->getAttributeName(), getShape(), getContext().mpSubsettableShapeManager, getSlideSize() ), getXAnimateNode() ); - + case animations::AnimationColorSpace::HSL: // Wrap a plain ColorAnimation with the HSL // wrapper, which implements the HSLColorAnimation - // interface, and internally converts HSL to RGB color + // interface, and internally converts HSL to RGB color return ActivitiesFactory::createAnimateActivity( aParms, HSLColorAnimationSharedPtr( new HSLWrapper( - AnimationFactory::createColorPropertyAnimation( + AnimationFactory::createColorPropertyAnimation( mxColorNode->getAttributeName(), getShape(), getContext().mpSubsettableShapeManager, getSlideSize() ))), mxColorNode ); - + default: ENSURE_OR_THROW( false, "AnimationColorNode::createColorActivity(): " "Unexpected color space" ); } - + return AnimationActivitySharedPtr(); } diff --git a/slideshow/source/engine/animationnodes/animationcolornode.hxx b/slideshow/source/engine/animationnodes/animationcolornode.hxx index 68c1dc856823..dfa9f60cfa82 100644 --- a/slideshow/source/engine/animationnodes/animationcolornode.hxx +++ b/slideshow/source/engine/animationnodes/animationcolornode.hxx @@ -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 @@ -40,20 +40,20 @@ class AnimationColorNode : public AnimationBaseNode public: AnimationColorNode( ::com::sun::star::uno::Reference< - ::com::sun::star::animations::XAnimationNode> const& xNode, + ::com::sun::star::animations::XAnimationNode> const& xNode, ::boost::shared_ptr<BaseContainerNode> const& pParent, NodeContext const& rContext ) : AnimationBaseNode( xNode, pParent, rContext ), mxColorNode( xNode, ::com::sun::star::uno::UNO_QUERY_THROW ) {} - + #if defined(VERBOSE) && defined(DBG_UTIL) virtual const char* getDescription() const { return "AnimationColorNode"; } #endif - + private: virtual AnimationActivitySharedPtr createActivity() const; - - ::com::sun::star::uno::Reference< + + ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimateColor > mxColorNode; }; diff --git a/slideshow/source/engine/animationnodes/animationcommandnode.cxx b/slideshow/source/engine/animationnodes/animationcommandnode.cxx index 69a41ab13978..6717b5fd7a38 100644 --- a/slideshow/source/engine/animationnodes/animationcommandnode.cxx +++ b/slideshow/source/engine/animationnodes/animationcommandnode.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 @@ -49,10 +49,10 @@ namespace slideshow { namespace internal { namespace EffectCommands = com::sun::star::presentation::EffectCommands; - -AnimationCommandNode::AnimationCommandNode( uno::Reference<animations::XAnimationNode> const& xNode, + +AnimationCommandNode::AnimationCommandNode( uno::Reference<animations::XAnimationNode> const& xNode, ::boost::shared_ptr<BaseContainerNode> const& pParent, - NodeContext const& rContext ) : + NodeContext const& rContext ) : BaseNode( xNode, pParent, rContext ), mpShape(), mxCommandNode( xNode, ::com::sun::star::uno::UNO_QUERY_THROW ) @@ -78,12 +78,12 @@ void AnimationCommandNode::activate_st() // the command is an ole verb. case EffectCommands::VERB: break; // the command starts playing on a media object - case EffectCommands::PLAY: + case EffectCommands::PLAY: { double fMediaTime=0.0; beans::PropertyValue aMediaTime; if( (mxCommandNode->getParameter() >>= aMediaTime) && - aMediaTime.Name.equalsAsciiL( + aMediaTime.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("MediaTime") )) { aMediaTime.Value >>= fMediaTime; @@ -119,7 +119,7 @@ void AnimationCommandNode::activate_st() getContext().mrEventMultiplexer.notifyCommandStopAudio( getSelf() ); break; } - + // deactivate ASAP: scheduleDeactivationEvent( makeEvent( boost::bind( &AnimationNode::deactivate, getSelf() ), diff --git a/slideshow/source/engine/animationnodes/animationcommandnode.hxx b/slideshow/source/engine/animationnodes/animationcommandnode.hxx index 2c1b6aff2bee..94b10fd44e93 100644 --- a/slideshow/source/engine/animationnodes/animationcommandnode.hxx +++ b/slideshow/source/engine/animationnodes/animationcommandnode.hxx @@ -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 @@ -46,20 +46,20 @@ class AnimationCommandNode : public BaseNode public: AnimationCommandNode( ::com::sun::star::uno::Reference< - ::com::sun::star::animations::XAnimationNode> const& xNode, + ::com::sun::star::animations::XAnimationNode> const& xNode, ::boost::shared_ptr<BaseContainerNode> const& pParent, NodeContext const& rContext ); - + protected: virtual void dispose(); - + private: virtual void activate_st(); virtual bool hasPendingAnimation() const; - + private: ExternalMediaShapeSharedPtr mpShape; - ::com::sun::star::uno::Reference< + ::com::sun::star::uno::Reference< ::com::sun::star::animations::XCommand > mxCommandNode; bool mbIsPaused; }; diff --git a/slideshow/source/engine/animationnodes/animationnodefactory.cxx b/slideshow/source/engine/animationnodes/animationnodefactory.cxx index c4a205cf6588..7e2f3bb4d59e 100644 --- a/slideshow/source/engine/animationnodes/animationnodefactory.cxx +++ b/slideshow/source/engine/animationnodes/animationnodefactory.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 @@ -87,13 +87,13 @@ public: NodeCreator( BaseContainerNodeSharedPtr& rParent, const NodeContext& rContext ) : mrParent( rParent ), mrContext( rContext ) {} - + void operator()( const uno::Reference< animations::XAnimationNode >& xChildNode ) const { createChild( xChildNode, mrContext ); } - + protected: void createChild( const uno::Reference< animations::XAnimationNode >& xChildNode, @@ -102,23 +102,23 @@ protected: BaseNodeSharedPtr pChild( implCreateAnimationNode( xChildNode, mrParent, rContext ) ); - + OSL_ENSURE( pChild, "NodeCreator::operator(): child creation failed" ); - - // TODO(Q1): This yields circular references, which, it seems, is + + // TODO(Q1): This yields circular references, which, it seems, is // unavoidable here if( pChild ) mrParent->appendChildNode( pChild ); } - + BaseContainerNodeSharedPtr& mrParent; const NodeContext& mrContext; }; /** Same as NodeCreator, only that NodeContext's SubsetShape is cloned for every child node. - + This is used for iterated animation node generation */ class CloningNodeCreator : private NodeCreator @@ -127,12 +127,12 @@ public: CloningNodeCreator( BaseContainerNodeSharedPtr& rParent, const NodeContext& rContext ) : NodeCreator( rParent, rContext ) {} - + void operator()( const uno::Reference< animations::XAnimationNode >& xChildNode ) const { NodeContext aContext( mrContext ); - + // TODO(Q1): There's a catch here. If you clone a // subset whose actual subsetting has already been // realized (i.e. if enableSubsetShape() has been @@ -143,12 +143,12 @@ public: // triggered here (we either clone, XOR we enable // subset initially), but one might consider // reworking DrawShape/ShapeSubset to avoid this. - + // clone ShapeSubset, since each node needs their // own version of the ShapeSubset (otherwise, // e.g. activity counting does not work - subset // would be removed after first animation node - // disables it). + // disables it). // // NOTE: this is only a problem for animation // nodes that explicitely call @@ -158,15 +158,15 @@ public: // normalize things, which does the right thing // here: the subset is only removed after _the // last_ animation node releases the shared ptr. - aContext.mpMasterShapeSubset.reset( + aContext.mpMasterShapeSubset.reset( new ShapeSubset( *aContext.mpMasterShapeSubset ) ); - + createChild( xChildNode, aContext ); } }; /** Create animation nodes for text iterations - + This method clones the animation nodes below xIterNode for every iterated shape entity. */ @@ -177,9 +177,9 @@ bool implCreateIteratedNodes( { ENSURE_OR_THROW( xIterNode.is(), "implCreateIteratedNodes(): Invalid node" ); - + const double nIntervalTimeout( xIterNode->getIterateInterval() ); - + // valid iterate interval? We're ruling out monstrous // values here, to avoid pseudo 'hangs' in the // presentation @@ -188,28 +188,28 @@ bool implCreateIteratedNodes( { return false; // not an active iteration } - + if( ::basegfx::fTools::equalZero( nIntervalTimeout ) ) OSL_TRACE( "implCreateIteratedNodes(): " "iterate interval close to zero, there's " "no point in defining such an effect " "(visually equivalent to whole-shape effect)" ); - + // Determine target shape (or subset) // ================================== - + // TODO(E1): I'm not too sure what to expect here... ENSURE_OR_RETURN_FALSE( xIterNode->getTarget().hasValue(), "implCreateIteratedNodes(): no target on ITERATE node" ); - + uno::Reference< drawing::XShape > xTargetShape( xIterNode->getTarget(), uno::UNO_QUERY ); - + presentation::ParagraphTarget aTarget; sal_Int16 nSubItem( xIterNode->getSubItem() ); bool bParagraphTarget( false ); - + if( !xTargetShape.is() ) { // no shape provided. Maybe a ParagraphTarget? @@ -218,48 +218,48 @@ bool implCreateIteratedNodes( false, "implCreateIteratedNodes(): could not extract any " "target information" ); - + xTargetShape = aTarget.Shape; - + ENSURE_OR_RETURN_FALSE( xTargetShape.is(), "implCreateIteratedNodes(): invalid shape in ParagraphTarget" ); - + // we've a paragraph target to iterate over, thus, // the whole animation container refers only to // the text nSubItem = presentation::ShapeAnimationSubType::ONLY_TEXT; - + bParagraphTarget = true; } - + // Lookup shape, and fill NodeContext // ================================== - - AttributableShapeSharedPtr pTargetShape( + + AttributableShapeSharedPtr pTargetShape( lookupAttributableShape( rContext.maContext.mpSubsettableShapeManager, xTargetShape ) ); - + const DocTreeNodeSupplier& rTreeNodeSupplier( pTargetShape->getTreeNodeSupplier() ); - + ShapeSubsetSharedPtr pTargetSubset; - + NodeContext aContext( rContext ); - + // paragraph targets already need a subset as the // master shape (they're representing only a single // paragraph) if( bParagraphTarget ) { - ENSURE_OR_RETURN_FALSE( + ENSURE_OR_RETURN_FALSE( aTarget.Paragraph >= 0 && rTreeNodeSupplier.getNumberOfTreeNodes( DocTreeNode::NODETYPE_LOGICAL_PARAGRAPH ) > aTarget.Paragraph, "implCreateIteratedNodes(): paragraph index out of range" ); - - pTargetSubset.reset( - new ShapeSubset( + + pTargetSubset.reset( + new ShapeSubset( pTargetShape, // retrieve index aTarget.Paragraph of // type PARAGRAPH from this shape @@ -267,13 +267,13 @@ bool implCreateIteratedNodes( aTarget.Paragraph, DocTreeNode::NODETYPE_LOGICAL_PARAGRAPH ), rContext.maContext.mpSubsettableShapeManager ) ); - + // iterate target is not the whole shape, but only // the selected paragraph - subset _must_ be // independent, to be able to affect visibility // independent of master shape aContext.mbIsIndependentSubset = true; - + // already enable parent subset right here, to // make potentially generated subsets subtract // their content from the parent subset (and not @@ -288,18 +288,18 @@ bool implCreateIteratedNodes( } else { - pTargetSubset.reset( + pTargetSubset.reset( new ShapeSubset( pTargetShape, rContext.maContext.mpSubsettableShapeManager )); } - + aContext.mpMasterShapeSubset = pTargetSubset; uno::Reference< animations::XAnimationNode > xNode( xIterNode, uno::UNO_QUERY_THROW ); - + // Generate subsets // ================ - + if( bParagraphTarget || nSubItem != presentation::ShapeAnimationSubType::ONLY_TEXT ) { @@ -310,7 +310,7 @@ bool implCreateIteratedNodes( // method). For ONLY_TEXT effects, // we skip this part, to animate // only the text. - // + // // OR // // prepend with subset animation for full @@ -320,15 +320,15 @@ bool implCreateIteratedNodes( // ONLY_TEXT, if a paragraph is referenced as the // master of an iteration effect. NodeCreator aCreator( rParent, aContext ); - if( !::anim::for_each_childNode( xNode, + if( !::anim::for_each_childNode( xNode, aCreator ) ) { ENSURE_OR_RETURN_FALSE( - false, + false, "implCreateIteratedNodes(): iterated child node creation failed" ); - } + } } - + // TODO(F2): This does not do the correct // thing. Having nSubItem be set to ONLY_BACKGROUND // should result in the text staying unanimated in the @@ -341,31 +341,31 @@ bool implCreateIteratedNodes( { // determine type of subitem iteration (logical // text unit to animate) - DocTreeNode::NodeType eIterateNodeType( + DocTreeNode::NodeType eIterateNodeType( DocTreeNode::NODETYPE_LOGICAL_CHARACTER_CELL ); - + switch( xIterNode->getIterateType() ) { case presentation::TextAnimationType::BY_PARAGRAPH: eIterateNodeType = DocTreeNode::NODETYPE_LOGICAL_PARAGRAPH; break; - + case presentation::TextAnimationType::BY_WORD: eIterateNodeType = DocTreeNode::NODETYPE_LOGICAL_WORD; break; - + case presentation::TextAnimationType::BY_LETTER: eIterateNodeType = DocTreeNode::NODETYPE_LOGICAL_CHARACTER_CELL; break; - + default: ENSURE_OR_THROW( false, "implCreateIteratedNodes(): " "Unexpected IterateType on XIterateContainer"); break; } - - if( bParagraphTarget && + + if( bParagraphTarget && eIterateNodeType != DocTreeNode::NODETYPE_LOGICAL_WORD && eIterateNodeType != DocTreeNode::NODETYPE_LOGICAL_CHARACTER_CELL ) { @@ -378,7 +378,7 @@ bool implCreateIteratedNodes( { // setup iteration parameters // -------------------------- - + // iterate target is the whole shape (or the // whole parent subshape), thus, can save // loads of subset shapes by generating them @@ -388,7 +388,7 @@ bool implCreateIteratedNodes( // master shape and subset (since the iterated // effects are all the same). aContext.mbIsIndependentSubset = false; - + // determine number of nodes for given subitem // type sal_Int32 nTreeNodes( 0 ); @@ -405,26 +405,26 @@ bool implCreateIteratedNodes( else { // generate normal subset - nTreeNodes = rTreeNodeSupplier.getNumberOfTreeNodes( + nTreeNodes = rTreeNodeSupplier.getNumberOfTreeNodes( eIterateNodeType ); } - - + + // iterate node, generate copies of the children for each subset // ------------------------------------------------------------- - + // NodeContext::mnStartDelay contains additional node delay. // This will make the duplicated nodes for each iteration start // increasingly later. - aContext.mnStartDelay = nIntervalTimeout; - + aContext.mnStartDelay = nIntervalTimeout; + for( sal_Int32 i=0; i<nTreeNodes; ++i ) { // create subset with the corresponding tree nodes if( bParagraphTarget ) { // create subsets relative to paragraph subset - aContext.mpMasterShapeSubset.reset( + aContext.mpMasterShapeSubset.reset( new ShapeSubset( pTargetSubset, rTreeNodeSupplier.getSubsetTreeNode( @@ -435,27 +435,27 @@ bool implCreateIteratedNodes( else { // create subsets from main shape - aContext.mpMasterShapeSubset.reset( + aContext.mpMasterShapeSubset.reset( new ShapeSubset( pTargetSubset, rTreeNodeSupplier.getTreeNode( i, eIterateNodeType ) ) ); } - + CloningNodeCreator aCreator( rParent, aContext ); - if( !::anim::for_each_childNode( xNode, + if( !::anim::for_each_childNode( xNode, aCreator ) ) { ENSURE_OR_RETURN_FALSE( false, "implCreateIteratedNodes(): " "iterated child node creation failed" ); } - + aContext.mnStartDelay += nIntervalTimeout; } } } - + // done with iterate child generation return true; } @@ -467,10 +467,10 @@ BaseNodeSharedPtr implCreateAnimationNode( { ENSURE_OR_THROW( xNode.is(), "implCreateAnimationNode(): invalid XAnimationNode" ); - + BaseNodeSharedPtr pCreatedNode; BaseContainerNodeSharedPtr pCreatedContainer; - + // create the internal node, corresponding to xNode switch( xNode->getType() ) { @@ -478,12 +478,12 @@ BaseNodeSharedPtr implCreateAnimationNode( OSL_ENSURE( false, "implCreateAnimationNode(): " "CUSTOM not yet implemented" ); return pCreatedNode; - + case animations::AnimationNodeType::PAR: pCreatedNode = pCreatedContainer = BaseContainerNodeSharedPtr( new ParallelTimeContainer( xNode, rParent, rContext ) ); break; - + case animations::AnimationNodeType::ITERATE: // map iterate container to ParallelTimeContainer. // the iterating functionality is to be found @@ -491,72 +491,72 @@ BaseNodeSharedPtr implCreateAnimationNode( pCreatedNode = pCreatedContainer = BaseContainerNodeSharedPtr( new ParallelTimeContainer( xNode, rParent, rContext ) ); break; - + case animations::AnimationNodeType::SEQ: pCreatedNode = pCreatedContainer = BaseContainerNodeSharedPtr( new SequentialTimeContainer( xNode, rParent, rContext ) ); break; - + case animations::AnimationNodeType::ANIMATE: pCreatedNode.reset( new PropertyAnimationNode( xNode, rParent, rContext ) ); break; - + case animations::AnimationNodeType::SET: pCreatedNode.reset( new AnimationSetNode( xNode, rParent, rContext ) ); break; - + case animations::AnimationNodeType::ANIMATEMOTION: pCreatedNode.reset( new AnimationPathMotionNode( xNode, rParent, rContext ) ); break; - + case animations::AnimationNodeType::ANIMATECOLOR: pCreatedNode.reset( new AnimationColorNode( xNode, rParent, rContext ) ); break; - + case animations::AnimationNodeType::ANIMATETRANSFORM: pCreatedNode.reset( new AnimationTransformNode( xNode, rParent, rContext ) ); break; - + case animations::AnimationNodeType::TRANSITIONFILTER: pCreatedNode.reset( new AnimationTransitionFilterNode( xNode, rParent, rContext ) ); break; - + case animations::AnimationNodeType::AUDIO: pCreatedNode.reset( new AnimationAudioNode( xNode, rParent, rContext ) ); break; - + case animations::AnimationNodeType::COMMAND: pCreatedNode.reset( new AnimationCommandNode( xNode, rParent, rContext ) ); break; - + default: OSL_ENSURE( false, "implCreateAnimationNode(): " "invalid AnimationNodeType" ); return pCreatedNode; } - - // TODO(Q1): This yields circular references, which, it seems, is + + // TODO(Q1): This yields circular references, which, it seems, is // unavoidable here - - // HACK: node objects need shared_ptr to themselves, + + // HACK: node objects need shared_ptr to themselves, // which we pass them here. pCreatedNode->setSelf( pCreatedNode ); - - // if we've got a container node object, recursively add + + // if we've got a container node object, recursively add // its children if( pCreatedContainer ) { uno::Reference< animations::XIterateContainer > xIterNode( xNode, uno::UNO_QUERY ); - + // when this node is an XIterateContainer with // active iterations, this method will generate // the appropriate children @@ -570,7 +570,7 @@ BaseNodeSharedPtr implCreateAnimationNode( // node attribute are incomplete for iteration // children. implCreateIteratedNodes( xIterNode, - pCreatedContainer, + pCreatedContainer, rContext ); } else @@ -584,8 +584,8 @@ BaseNodeSharedPtr implCreateAnimationNode( return BaseNodeSharedPtr(); } } - } - + } + return pCreatedNode; } @@ -599,9 +599,9 @@ AnimationNodeSharedPtr AnimationNodeFactory::createAnimationNode( ENSURE_OR_THROW( xNode.is(), "AnimationNodeFactory::createAnimationNode(): invalid XAnimationNode" ); - + return BaseNodeSharedPtr( implCreateAnimationNode( - xNode, + xNode, BaseContainerNodeSharedPtr(), // no parent NodeContext( rContext, rSlideSize ))); diff --git a/slideshow/source/engine/animationnodes/animationpathmotionnode.cxx b/slideshow/source/engine/animationnodes/animationpathmotionnode.cxx index d0ffe8b59da4..7e90f3abf692 100644 --- a/slideshow/source/engine/animationnodes/animationpathmotionnode.cxx +++ b/slideshow/source/engine/animationnodes/animationpathmotionnode.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 @@ -50,7 +50,7 @@ AnimationActivitySharedPtr AnimationPathMotionNode::createActivity() const rtl::OUString aString; ENSURE_OR_THROW( (mxPathMotionNode->getPath() >>= aString), "no string-based SVG:d path found" ); - + ActivitiesFactory::CommonParameters const aParms( fillCommonParameters() ); return ActivitiesFactory::createSimpleActivity( aParms, diff --git a/slideshow/source/engine/animationnodes/animationpathmotionnode.hxx b/slideshow/source/engine/animationnodes/animationpathmotionnode.hxx index 02fbc99fab83..c0e11d81863c 100644 --- a/slideshow/source/engine/animationnodes/animationpathmotionnode.hxx +++ b/slideshow/source/engine/animationnodes/animationpathmotionnode.hxx @@ -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 @@ -38,25 +38,25 @@ class AnimationPathMotionNode : public AnimationBaseNode { public: AnimationPathMotionNode( - const ::com::sun::star::uno::Reference< - ::com::sun::star::animations::XAnimationNode >& xNode, + const ::com::sun::star::uno::Reference< + ::com::sun::star::animations::XAnimationNode >& xNode, const BaseContainerNodeSharedPtr& rParent, const NodeContext& rContext ) : AnimationBaseNode( xNode, rParent, rContext ), mxPathMotionNode( xNode, ::com::sun::star::uno::UNO_QUERY_THROW ) {} - + #if defined(VERBOSE) && defined(DBG_UTIL) virtual const char* getDescription() const { return "AnimationPathMotionNode"; } #endif - + protected: virtual void dispose(); - + private: virtual AnimationActivitySharedPtr createActivity() const; - - ::com::sun::star::uno::Reference< + + ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimateMotion > mxPathMotionNode; }; diff --git a/slideshow/source/engine/animationnodes/animationsetnode.cxx b/slideshow/source/engine/animationnodes/animationsetnode.cxx index b09e5d041889..5bf744ecb8ff 100644 --- a/slideshow/source/engine/animationnodes/animationsetnode.cxx +++ b/slideshow/source/engine/animationnodes/animationsetnode.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 @@ -57,7 +57,7 @@ AnimationActivitySharedPtr AnimationSetNode::createActivity() const uno::Reference<animations::XAnimate> const xAnimateNode = getXAnimateNode(); rtl::OUString const attrName( xAnimateNode->getAttributeName() ); AttributableShapeSharedPtr const pShape( getShape() ); - + // make deactivation a two-step procedure. Normally, we // could solely rely on // BaseNode::scheduleDeactivationEvent() to deactivate() @@ -68,7 +68,7 @@ AnimationActivitySharedPtr AnimationSetNode::createActivity() const // sequentiality by letting only the set activity schedule // the deactivation event (and AnimationBaseNode // takes care for the fact when mpActivity should be zero). - + // AnimationBaseNode::fillCommonParameters() has set up // immediate deactivation as default when activity ends, but if (! isIndefiniteTiming( xAnimateNode->getDuration() )) { @@ -81,7 +81,7 @@ AnimationActivitySharedPtr AnimationSetNode::createActivity() const pSelf ), "AnimationSetNode::implScheduleDeactivationEvent"); } - + switch (AnimationFactory::classifyAttributeName( attrName )) { default: case AnimationFactory::CLASS_UNKNOWN_PROPERTY: @@ -89,22 +89,22 @@ AnimationActivitySharedPtr AnimationSetNode::createActivity() const false, "AnimationSetNode::createSetActivity(): " "Unexpected attribute class" ); break; - + case AnimationFactory::CLASS_NUMBER_PROPERTY: { NumberAnimation::ValueType aValue; - + ENSURE_OR_THROW( - extractValue( aValue, - xAnimateNode->getTo(), - pShape, + extractValue( aValue, + xAnimateNode->getTo(), + pShape, getSlideSize() ), "AnimationSetNode::createSetActivity(): " "Could not import numeric to value" ); - + return makeSetActivity( aParms, - AnimationFactory::createNumberPropertyAnimation( + AnimationFactory::createNumberPropertyAnimation( attrName, pShape, getContext().mpSubsettableShapeManager, @@ -112,22 +112,22 @@ AnimationActivitySharedPtr AnimationSetNode::createActivity() const AnimationFactory::FLAG_NO_SPRITE ), aValue ); } - + case AnimationFactory::CLASS_ENUM_PROPERTY: { EnumAnimation::ValueType aValue; - + ENSURE_OR_THROW( - extractValue( aValue, - xAnimateNode->getTo(), - pShape, + extractValue( aValue, + xAnimateNode->getTo(), + pShape, getSlideSize() ), "AnimationSetNode::createSetActivity(): " "Could not import enum to value" ); - + return makeSetActivity( aParms, - AnimationFactory::createEnumPropertyAnimation( + AnimationFactory::createEnumPropertyAnimation( attrName, pShape, getContext().mpSubsettableShapeManager, @@ -135,22 +135,22 @@ AnimationActivitySharedPtr AnimationSetNode::createActivity() const AnimationFactory::FLAG_NO_SPRITE ), aValue ); } - + case AnimationFactory::CLASS_COLOR_PROPERTY: { ColorAnimation::ValueType aValue; - + ENSURE_OR_THROW( - extractValue( aValue, - xAnimateNode->getTo(), - pShape, + extractValue( aValue, + xAnimateNode->getTo(), + pShape, getSlideSize() ), "AnimationSetNode::createSetActivity(): " "Could not import color to value" ); - + return makeSetActivity( aParms, - AnimationFactory::createColorPropertyAnimation( + AnimationFactory::createColorPropertyAnimation( attrName, pShape, getContext().mpSubsettableShapeManager, @@ -158,22 +158,22 @@ AnimationActivitySharedPtr AnimationSetNode::createActivity() const AnimationFactory::FLAG_NO_SPRITE ), aValue ); } - + case AnimationFactory::CLASS_STRING_PROPERTY: { StringAnimation::ValueType aValue; - + ENSURE_OR_THROW( - extractValue( aValue, - xAnimateNode->getTo(), - pShape, + extractValue( aValue, + xAnimateNode->getTo(), + pShape, getSlideSize() ), "AnimationSetNode::createSetActivity(): " "Could not import string to value" ); - + return makeSetActivity( aParms, - AnimationFactory::createStringPropertyAnimation( + AnimationFactory::createStringPropertyAnimation( attrName, pShape, getContext().mpSubsettableShapeManager, @@ -181,22 +181,22 @@ AnimationActivitySharedPtr AnimationSetNode::createActivity() const AnimationFactory::FLAG_NO_SPRITE ), aValue ); } - + case AnimationFactory::CLASS_BOOL_PROPERTY: { BoolAnimation::ValueType aValue; - + ENSURE_OR_THROW( - extractValue( aValue, - xAnimateNode->getTo(), - pShape, + extractValue( aValue, + xAnimateNode->getTo(), + pShape, getSlideSize() ), "AnimationSetNode::createSetActivity(): " "Could not import bool to value" ); - + return makeSetActivity( aParms, - AnimationFactory::createBoolPropertyAnimation( + AnimationFactory::createBoolPropertyAnimation( attrName, pShape, getContext().mpSubsettableShapeManager, @@ -205,7 +205,7 @@ AnimationActivitySharedPtr AnimationSetNode::createActivity() const aValue ); } } - + return AnimationActivitySharedPtr(); } diff --git a/slideshow/source/engine/animationnodes/animationsetnode.hxx b/slideshow/source/engine/animationnodes/animationsetnode.hxx index a836b9ae0f38..f84f831d38cf 100644 --- a/slideshow/source/engine/animationnodes/animationsetnode.hxx +++ b/slideshow/source/engine/animationnodes/animationsetnode.hxx @@ -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 @@ -38,15 +38,15 @@ class AnimationSetNode : public AnimationBaseNode public: AnimationSetNode( ::com::sun::star::uno::Reference< - ::com::sun::star::animations::XAnimationNode> const& xNode, + ::com::sun::star::animations::XAnimationNode> const& xNode, ::boost::shared_ptr<BaseContainerNode> const& pParent, NodeContext const& rContext ) : AnimationBaseNode( xNode, pParent, rContext ) {} - + #if defined(VERBOSE) && defined(DBG_UTIL) virtual const char* getDescription() const { return "AnimationSetNode"; } #endif - + private: virtual AnimationActivitySharedPtr createActivity() const; void implScheduleDeactivationEvent(); diff --git a/slideshow/source/engine/animationnodes/animationtransformnode.cxx b/slideshow/source/engine/animationnodes/animationtransformnode.cxx index cfa22104c417..fa83ea7fc2da 100644 --- a/slideshow/source/engine/animationnodes/animationtransformnode.cxx +++ b/slideshow/source/engine/animationnodes/animationtransformnode.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 @@ -52,59 +52,59 @@ void AnimationTransformNode::dispose() AnimationActivitySharedPtr AnimationTransformNode::createActivity() const { ActivitiesFactory::CommonParameters aParms( fillCommonParameters() ); - + const sal_Int16 nTransformType( mxTransformNode->getTransformType() ); - + const AttributableShapeSharedPtr& rShape( getShape() ); - + switch( nTransformType ) { default: ENSURE_OR_THROW( false, "AnimationTransformNode::createTransformActivity(): " "Unknown transform type" ); - + case animations::AnimationTransformType::TRANSLATE: // FALLTHROUGH intended case animations::AnimationTransformType::SCALE: return ActivitiesFactory::createAnimateActivity( aParms, - AnimationFactory::createPairPropertyAnimation( - rShape, - getContext().mpSubsettableShapeManager, + AnimationFactory::createPairPropertyAnimation( + rShape, + getContext().mpSubsettableShapeManager, getSlideSize(), nTransformType ), getXAnimateNode() ); - + case animations::AnimationTransformType::ROTATE: return ActivitiesFactory::createAnimateActivity( aParms, - AnimationFactory::createNumberPropertyAnimation( - ::rtl::OUString( + AnimationFactory::createNumberPropertyAnimation( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Rotate") ), - rShape, + rShape, getContext().mpSubsettableShapeManager, getSlideSize() ), getXAnimateNode() ); - + case animations::AnimationTransformType::SKEWX: return ActivitiesFactory::createAnimateActivity( aParms, - AnimationFactory::createNumberPropertyAnimation( - ::rtl::OUString( + AnimationFactory::createNumberPropertyAnimation( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SkewX") ), - rShape, + rShape, getContext().mpSubsettableShapeManager, getSlideSize() ), getXAnimateNode() ); - + case animations::AnimationTransformType::SKEWY: return ActivitiesFactory::createAnimateActivity( aParms, - AnimationFactory::createNumberPropertyAnimation( - ::rtl::OUString( + AnimationFactory::createNumberPropertyAnimation( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SkewY") ), - rShape, + rShape, getContext().mpSubsettableShapeManager, getSlideSize() ), getXAnimateNode() ); diff --git a/slideshow/source/engine/animationnodes/animationtransformnode.hxx b/slideshow/source/engine/animationnodes/animationtransformnode.hxx index e2416b72a7f3..c24030f73d41 100644 --- a/slideshow/source/engine/animationnodes/animationtransformnode.hxx +++ b/slideshow/source/engine/animationnodes/animationtransformnode.hxx @@ -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 @@ -40,24 +40,24 @@ class AnimationTransformNode : public AnimationBaseNode public: AnimationTransformNode( ::com::sun::star::uno::Reference< - ::com::sun::star::animations::XAnimationNode> const& xNode, + ::com::sun::star::animations::XAnimationNode> const& xNode, ::boost::shared_ptr<BaseContainerNode> const& pParent, NodeContext const& rContext ) : AnimationBaseNode( xNode, pParent, rContext ), mxTransformNode( xNode, ::com::sun::star::uno::UNO_QUERY_THROW ) {} - + #if defined(VERBOSE) && defined(DBG_UTIL) virtual const char* getDescription() const { return "AnimationTransformNode"; } #endif - + protected: virtual void dispose(); - + private: virtual AnimationActivitySharedPtr createActivity() const; - - ::com::sun::star::uno::Reference< + + ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimateTransform > mxTransformNode; }; diff --git a/slideshow/source/engine/animationnodes/animationtransitionfilternode.cxx b/slideshow/source/engine/animationnodes/animationtransitionfilternode.cxx index feb88fe8f3d9..709685633d25 100644 --- a/slideshow/source/engine/animationnodes/animationtransitionfilternode.cxx +++ b/slideshow/source/engine/animationnodes/animationtransitionfilternode.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 diff --git a/slideshow/source/engine/animationnodes/animationtransitionfilternode.hxx b/slideshow/source/engine/animationnodes/animationtransitionfilternode.hxx index 506ab668050c..05a8802c4ac2 100644 --- a/slideshow/source/engine/animationnodes/animationtransitionfilternode.hxx +++ b/slideshow/source/engine/animationnodes/animationtransitionfilternode.hxx @@ -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 @@ -40,25 +40,25 @@ class AnimationTransitionFilterNode : public AnimationBaseNode public: AnimationTransitionFilterNode( ::com::sun::star::uno::Reference< - ::com::sun::star::animations::XAnimationNode> const& xNode, + ::com::sun::star::animations::XAnimationNode> const& xNode, ::boost::shared_ptr<BaseContainerNode> const& pParent, NodeContext const& rContext ) : AnimationBaseNode( xNode, pParent, rContext ), mxTransitionFilterNode( xNode, ::com::sun::star::uno::UNO_QUERY_THROW) {} - + #if defined(VERBOSE) virtual const char* getDescription() const { return "AnimationTransitionFilterNode"; } #endif - + protected: virtual void dispose(); - + private: virtual AnimationActivitySharedPtr createActivity() const; - - ::com::sun::star::uno::Reference< + + ::com::sun::star::uno::Reference< ::com::sun::star::animations::XTransitionFilter> mxTransitionFilterNode; }; diff --git a/slideshow/source/engine/animationnodes/basecontainernode.cxx b/slideshow/source/engine/animationnodes/basecontainernode.cxx index bd5c9a8868b3..8ee1c197fcb6 100644 --- a/slideshow/source/engine/animationnodes/basecontainernode.cxx +++ b/slideshow/source/engine/animationnodes/basecontainernode.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 @@ -47,7 +47,7 @@ namespace slideshow { namespace internal { BaseContainerNode::BaseContainerNode( - const uno::Reference< animations::XAnimationNode >& xNode, + const uno::Reference< animations::XAnimationNode >& xNode, const BaseContainerNodeSharedPtr& rParent, const NodeContext& rContext ) : BaseNode( xNode, rParent, rContext ), @@ -91,7 +91,7 @@ void BaseContainerNode::deactivate_st( NodeState eDestState ) bool BaseContainerNode::hasPendingAnimation() const { // does any of our children returns "true" on - // AnimationNode::hasPendingAnimation()? + // AnimationNode::hasPendingAnimation()? // If yes, we, too, return true VectorOfNodes::const_iterator const iEnd( maChildren.end() ); return (std::find_if( @@ -103,9 +103,9 @@ void BaseContainerNode::appendChildNode( AnimationNodeSharedPtr const& pNode ) { if (! checkValidNode()) return; - + // register derived classes as end listeners at all children. - // this is necessary to control the children animation + // this is necessary to control the children animation // sequence, and to determine our own end event if (pNode->registerDeactivatingListener( getSelf() )) { maChildren.push_back( pNode ); @@ -136,12 +136,12 @@ bool BaseContainerNode::notifyDeactivatedChild( OSL_ENSURE( false, "unknown notifier!" ); return false; } - + std::size_t const nSize = maChildren.size(); OSL_ASSERT( mnFinishedChildren < nSize ); ++mnFinishedChildren; bool const bFinished = (mnFinishedChildren >= nSize); - + // all children finished, and we've got indefinite duration? // think of ParallelTimeContainer::notifyDeactivating() // if duration given, we will be deactivated by some end event @@ -149,7 +149,7 @@ bool BaseContainerNode::notifyDeactivatedChild( if (bFinished && isDurationIndefinite()) { deactivate(); } - + return bFinished; } @@ -161,12 +161,12 @@ void BaseContainerNode::showState() const BaseNodeSharedPtr pNode = boost::shared_dynamic_cast<BaseNode>(maChildren[i]); VERBOSE_TRACE( - "Node connection: n0x%X -> n0x%X", - (const char*)this+debugGetCurrentOffset(), + "Node connection: n0x%X -> n0x%X", + (const char*)this+debugGetCurrentOffset(), (const char*)pNode.get()+debugGetCurrentOffset() ); pNode->showState(); } - + BaseNode::showState(); } #endif diff --git a/slideshow/source/engine/animationnodes/basecontainernode.hxx b/slideshow/source/engine/animationnodes/basecontainernode.hxx index 8523d122f722..3015694a2ec9 100644 --- a/slideshow/source/engine/animationnodes/basecontainernode.hxx +++ b/slideshow/source/engine/animationnodes/basecontainernode.hxx @@ -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 @@ -40,15 +40,15 @@ class BaseContainerNode : public BaseNode { public: BaseContainerNode( - ::com::sun::star::uno::Reference< - ::com::sun::star::animations::XAnimationNode> const& xNode, + ::com::sun::star::uno::Reference< + ::com::sun::star::animations::XAnimationNode> const& xNode, ::boost::shared_ptr<BaseContainerNode> const& pParent, NodeContext const& rContext ); - + /** Add given child node to this container */ void appendChildNode( AnimationNodeSharedPtr const& pNode ); - + #if defined(VERBOSE) && defined(DBG_UTIL) virtual void showState() const; virtual const char* getDescription() const { return "BaseContainerNode"; } @@ -57,7 +57,7 @@ public: protected: // overrides from BaseNode virtual void dispose(); - + private: virtual bool init_st(); virtual void deactivate_st( NodeState eDestState ); @@ -66,15 +66,15 @@ private: virtual void activate_st() = 0; virtual void notifyDeactivating( AnimationNodeSharedPtr const& rNotifier ) = 0; - + protected: bool isDurationIndefinite() const { return mbDurationIndefinite; } - + bool isChildNode( AnimationNodeSharedPtr const& pNode ) const; - + /// @return true: if all children have been deactivated bool notifyDeactivatedChild( AnimationNodeSharedPtr const& pChildNode ); - + template <typename FuncT> inline void forEachChildNode( FuncT const& func, int nodeStateMask = -1 ) const @@ -88,11 +88,11 @@ protected: func(pNode); } } - + typedef ::std::vector<AnimationNodeSharedPtr> VectorOfNodes; VectorOfNodes maChildren; ::std::size_t mnFinishedChildren; - + private: const bool mbDurationIndefinite; }; diff --git a/slideshow/source/engine/animationnodes/basenode.cxx b/slideshow/source/engine/animationnodes/basenode.cxx index e7343857f98b..71450cb568a9 100644 --- a/slideshow/source/engine/animationnodes/basenode.cxx +++ b/slideshow/source/engine/animationnodes/basenode.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 @@ -71,38 +71,38 @@ const int* getStateTransitionTable( sal_Int16 nRestartMode, sal_Int16 nFillMode ) { // TODO(F2): restart issues in below tables - + // transition table for restart=NEVER, fill=REMOVE static const StateTransitionTable stateTransitionTable_Never_Remove = { AnimationNode::INVALID, AnimationNode::RESOLVED|AnimationNode::ENDED, // active successors for UNRESOLVED AnimationNode::ACTIVE|AnimationNode::ENDED, // active successors for RESOLVED - AnimationNode::INVALID, + AnimationNode::INVALID, AnimationNode::ENDED, // active successors for ACTIVE: no freeze here - AnimationNode::INVALID, - AnimationNode::INVALID, - AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, AnimationNode::INVALID, // active successors for FROZEN: this state is unreachable here - AnimationNode::INVALID, - AnimationNode::INVALID, - AnimationNode::INVALID, - AnimationNode::INVALID, - AnimationNode::INVALID, - AnimationNode::INVALID, - AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, AnimationNode::ENDED // active successors for ENDED: this state is a sink here (cannot restart) }; - + // transition table for restart=WHEN_NOT_ACTIVE, fill=REMOVE static const StateTransitionTable stateTransitionTable_NotActive_Remove = { AnimationNode::INVALID, AnimationNode::RESOLVED|AnimationNode::ENDED, // active successors for UNRESOLVED AnimationNode::ACTIVE|AnimationNode::ENDED, // active successors for RESOLVED - AnimationNode::INVALID, + AnimationNode::INVALID, AnimationNode::ENDED, // active successors for ACTIVE: no freeze here - AnimationNode::INVALID, - AnimationNode::INVALID, - AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, AnimationNode::INVALID, // active successors for FROZEN: // this state is unreachable here AnimationNode::INVALID, @@ -115,13 +115,13 @@ const int* getStateTransitionTable( sal_Int16 nRestartMode, AnimationNode::ENDED|AnimationNode::RESOLVED|AnimationNode::ACTIVE // active successors for ENDED: // restart possible when ended }; - + // transition table for restart=ALWAYS, fill=REMOVE static const StateTransitionTable stateTransitionTable_Always_Remove = { AnimationNode::INVALID, AnimationNode::RESOLVED|AnimationNode::ENDED, // active successors for UNRESOLVED AnimationNode::ACTIVE|AnimationNode::ENDED, // active successors for RESOLVED - AnimationNode::INVALID, + AnimationNode::INVALID, AnimationNode::ENDED|AnimationNode::ACTIVE|AnimationNode::RESOLVED, // active successors for ACTIVE: restart AnimationNode::INVALID, AnimationNode::INVALID, @@ -137,38 +137,38 @@ const int* getStateTransitionTable( sal_Int16 nRestartMode, AnimationNode::INVALID, AnimationNode::ENDED|AnimationNode::ACTIVE|AnimationNode::RESOLVED // active successors for ENDED: restart }; - + // transition table for restart=NEVER, fill=FREEZE static const StateTransitionTable stateTransitionTable_Never_Freeze = { AnimationNode::INVALID, AnimationNode::RESOLVED|AnimationNode::ENDED, // active successors for UNRESOLVED AnimationNode::ACTIVE|AnimationNode::ENDED, // active successors for RESOLVED - AnimationNode::INVALID, + AnimationNode::INVALID, AnimationNode::FROZEN|AnimationNode::ENDED, // active successors for ACTIVE: freeze object - AnimationNode::INVALID, - AnimationNode::INVALID, - AnimationNode::INVALID, - AnimationNode::ENDED, // active successors for FROZEN: end - AnimationNode::INVALID, - AnimationNode::INVALID, - AnimationNode::INVALID, - AnimationNode::INVALID, - AnimationNode::INVALID, - AnimationNode::INVALID, - AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::ENDED, // active successors for FROZEN: end + AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, AnimationNode::ENDED, // active successors for ENDED: this state is a sink here (cannot restart) }; - + // transition table for restart=WHEN_NOT_ACTIVE, fill=FREEZE static const StateTransitionTable stateTransitionTable_NotActive_Freeze = { AnimationNode::INVALID, AnimationNode::RESOLVED|AnimationNode::ENDED, // active successors for UNRESOLVED AnimationNode::ACTIVE|AnimationNode::ENDED, // active successors for RESOLVED - AnimationNode::INVALID, + AnimationNode::INVALID, AnimationNode::FROZEN|AnimationNode::ENDED, // active successors for ACTIVE: freeze object - AnimationNode::INVALID, - AnimationNode::INVALID, - AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, AnimationNode::ENDED|AnimationNode::RESOLVED|AnimationNode::ACTIVE, // active successors for FROZEN: // restart possible when ended AnimationNode::INVALID, @@ -181,29 +181,29 @@ const int* getStateTransitionTable( sal_Int16 nRestartMode, AnimationNode::ENDED|AnimationNode::RESOLVED|AnimationNode::ACTIVE // active successors for ENDED: // restart possible when ended }; - + // transition table for restart=ALWAYS, fill=FREEZE static const StateTransitionTable stateTransitionTable_Always_Freeze = { AnimationNode::INVALID, AnimationNode::RESOLVED|AnimationNode::ENDED, // active successors for UNRESOLVED AnimationNode::ACTIVE|AnimationNode::ENDED, // active successors for RESOLVED - AnimationNode::INVALID, + AnimationNode::INVALID, AnimationNode::FROZEN|AnimationNode::ENDED|AnimationNode::ACTIVE|AnimationNode::RESOLVED, // active successors for ACTIVE: // end object, restart AnimationNode::INVALID, AnimationNode::INVALID, AnimationNode::INVALID, AnimationNode::ENDED|AnimationNode::RESOLVED|AnimationNode::ACTIVE, // active successors for FROZEN: restart possible - AnimationNode::INVALID, - AnimationNode::INVALID, - AnimationNode::INVALID, - AnimationNode::INVALID, - AnimationNode::INVALID, - AnimationNode::INVALID, - AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, + AnimationNode::INVALID, AnimationNode::ENDED|AnimationNode::ACTIVE|AnimationNode::RESOLVED // active successors for ENDED: restart }; - + static const StateTransitionTable* tableGuide[] = { &stateTransitionTable_Never_Remove, &stateTransitionTable_NotActive_Remove, @@ -212,12 +212,12 @@ const int* getStateTransitionTable( sal_Int16 nRestartMode, &stateTransitionTable_NotActive_Freeze, &stateTransitionTable_Always_Freeze }; - + int nRestartValue; switch( nRestartMode ) { default: case animations::AnimationRestart::DEFAULT: - // same value: animations::AnimationRestart::INHERIT: + // same value: animations::AnimationRestart::INHERIT: OSL_ENSURE( false, "getStateTransitionTable(): unexpected case for restart" ); // FALLTHROUGH intended @@ -231,7 +231,7 @@ const int* getStateTransitionTable( sal_Int16 nRestartMode, nRestartValue = 2; break; } - + int nFillValue; switch( nFillMode ) { default: @@ -250,7 +250,7 @@ const int* getStateTransitionTable( sal_Int16 nRestartMode, nFillValue = 1; break; } - + return *tableGuide[ 3*nFillValue + nRestartValue ]; } @@ -260,10 +260,10 @@ bool isMainSequenceRootNode_( { // detect main sequence root node (need that for // end-of-mainsequence signalling below) - beans::NamedValue const aSearchKey( + beans::NamedValue const aSearchKey( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "node-type" ) ), uno::makeAny( presentation::EffectNodeType::MAIN_SEQUENCE ) ); - + uno::Sequence<beans::NamedValue> const userData(xNode->getUserData()); return findNamedValue( userData, aSearchKey ); } @@ -279,14 +279,14 @@ class BaseNode::StateTransition : private boost::noncopyable { public: enum Options { NONE, FORCE }; - + explicit StateTransition( BaseNode * pNode ) : mpNode(pNode), meToState(INVALID) {} - + ~StateTransition() { clear(); } - + bool enter( NodeState eToState, int options = NONE ) { OSL_ENSURE( meToState == INVALID, @@ -304,7 +304,7 @@ public: meToState = eToState; return true; // in transition } - + void commit() { OSL_ENSURE( meToState != INVALID, "### nothing to commit!" ); if (meToState != INVALID) { @@ -316,7 +316,7 @@ public: // every state change of one of its nodes. // Debug_ShowNodeTree(mpNode->mpSelf); } - + void clear() { if (meToState != INVALID) { OSL_ASSERT( (mpNode->meCurrentStateTransition & meToState) != 0 ); @@ -324,13 +324,13 @@ public: meToState = INVALID; } } - + private: BaseNode *const mpNode; NodeState meToState; }; -BaseNode::BaseNode( const uno::Reference< animations::XAnimationNode >& xNode, +BaseNode::BaseNode( const uno::Reference< animations::XAnimationNode >& xNode, const BaseContainerNodeSharedPtr& rParent, const NodeContext& rContext ) : maContext( rContext.maContext ), @@ -347,7 +347,7 @@ BaseNode::BaseNode( const uno::Reference< animations::XAnimationNode >& xNode, { ENSURE_OR_THROW( mxAnimationNode.is(), "BaseNode::BaseNode(): Invalid XAnimationNode" ); - + // setup state transition table mpStateTransitionTable = getStateTransitionTable( getRestartMode(), getFillMode() ); @@ -356,7 +356,7 @@ BaseNode::BaseNode( const uno::Reference< animations::XAnimationNode >& xNode, void BaseNode::dispose() { meCurrState = INVALID; - + // discharge a loaded event, if any: if (mpCurrentEvent) { mpCurrentEvent->dispose(); @@ -384,13 +384,13 @@ sal_Int16 BaseNode::getFillMode() const sal_Int16 nFill((nTmp != animations::AnimationFill::DEFAULT && nTmp != animations::AnimationFill::INHERIT) ? nTmp : getFillDefaultMode()); - + // For AUTO fill mode, SMIL specifies that fill mode is FREEZE, // if no explicit active duration is given - // (no duration, end, repeatCount or repeatDuration given), + // (no duration, end, repeatCount or repeatDuration given), // and REMOVE otherwise if( nFill == animations::AnimationFill::AUTO ) { - return (isIndefiniteTiming( mxAnimationNode->getDuration() ) && + return (isIndefiniteTiming( mxAnimationNode->getDuration() ) && isIndefiniteTiming( mxAnimationNode->getEnd() ) && !mxAnimationNode->getRepeatCount().hasValue() && isIndefiniteTiming( mxAnimationNode->getRepeatDuration() )) @@ -451,31 +451,31 @@ bool BaseNode::resolve() { if (! checkValidNode()) return false; - + OSL_ASSERT( meCurrState != RESOLVED ); if (inStateOrTransition( RESOLVED )) return true; - + StateTransition st(this); if (st.enter( RESOLVED ) && isTransition( RESOLVED, ACTIVE ) && resolve_st() /* may call derived class */) { st.commit(); // changing state - + // discharge a loaded event, if any: if (mpCurrentEvent) mpCurrentEvent->dispose(); - + // schedule activation event: - + // This method takes the NodeContext::mnStartDelay value into account, // to cater for iterate container time shifts. We cannot put different - // iterations of the iterate container's children into different + // iterations of the iterate container's children into different // subcontainer (such as a 'DelayContainer', which delays resolving its - // children by a fixed amount), since all iterations' nodes must be + // children by a fixed amount), since all iterations' nodes must be // resolved at the same time (otherwise, the delayed subset creation - // will not work, i.e. deactivate the subsets too late in the master + // will not work, i.e. deactivate the subsets too late in the master // shape). uno::Any const aBegin( mxAnimationNode->getBegin() ); if (aBegin.hasValue()) { @@ -487,7 +487,7 @@ bool BaseNode::resolve() // For some leaf nodes, PPT import yields empty begin time, // although semantically, it should be 0.0 // TODO(F3): That should really be provided by the PPT import - + // schedule delayed activation event. Take iterate node // timeout into account mpCurrentEvent = makeDelay( @@ -496,7 +496,7 @@ bool BaseNode::resolve() "AnimationNode::activate with delay"); maContext.mrEventQueue.addEvent( mpCurrentEvent ); } - + return true; } return false; @@ -512,23 +512,23 @@ bool BaseNode::activate() { if (! checkValidNode()) return false; - + OSL_ASSERT( meCurrState != ACTIVE ); if (inStateOrTransition( ACTIVE )) return true; - + StateTransition st(this); if (st.enter( ACTIVE )) { - + activate_st(); // calling derived class - + st.commit(); // changing state - + maContext.mrEventMultiplexer.notifyAnimationStart( mpSelf ); - + return true; } - + return false; } @@ -553,12 +553,12 @@ void BaseNode::scheduleDeactivationEvent( EventSharedPtr const& pEvent ) // because the deactivation event is only scheduled // when the effect is started: the timeout is then // already respected. - + // xxx todo: // think about set node, anim base node! // if anim base node has no activity, this is called to schedule deactivatiion, // but what if it does not schedule anything? - + // TODO(F2): Handle end time attribute, too mpCurrentEvent = generateEvent( mxAnimationNode->getDuration(), @@ -571,17 +571,17 @@ void BaseNode::deactivate() { if (inStateOrTransition( ENDED | FROZEN ) || !checkValidNode()) return; - + if (isTransition( meCurrState, FROZEN, false /* no OSL_ASSERT */ )) { // do transition to FROZEN: StateTransition st(this); if (st.enter( FROZEN, StateTransition::FORCE )) { - + deactivate_st( FROZEN ); st.commit(); - + notifyEndListeners(); - + // discharge a loaded event, before going on: if (mpCurrentEvent) { mpCurrentEvent->dispose(); @@ -605,15 +605,15 @@ void BaseNode::end() bool const bIsFrozenOrInTransitionToFrozen = inStateOrTransition( FROZEN ); if (inStateOrTransition( ENDED ) || !checkValidNode()) return; - - // END must always be reachable. If not, that's an error in the + + // END must always be reachable. If not, that's an error in the // transition tables OSL_ENSURE( isTransition( meCurrState, ENDED ), "end state not reachable in transition table" ); - + StateTransition st(this); if (st.enter( ENDED, StateTransition::FORCE )) { - + deactivate_st( ENDED ); st.commit(); // changing state @@ -621,7 +621,7 @@ void BaseNode::end() // will/already notified deactivating listeners if (!bIsFrozenOrInTransitionToFrozen) notifyEndListeners(); - + // discharge a loaded event, before going on: if (mpCurrentEvent) { mpCurrentEvent->dispose(); @@ -645,10 +645,10 @@ void BaseNode::notifyEndListeners() const maDeactivatingListeners.end(), boost::bind( &AnimationNode::notifyDeactivating, _1, boost::cref(mpSelf) ) ); - + // notify state change maContext.mrEventMultiplexer.notifyAnimationEnd( mpSelf ); - + // notify main sequence end (iff we're the main // sequence root node). This is because the main // sequence determines the active duration of the @@ -671,12 +671,12 @@ bool BaseNode::registerDeactivatingListener( { if (! checkValidNode()) return false; - + ENSURE_OR_RETURN_FALSE( rNotifee, "BaseNode::registerDeactivatingListener(): invalid notifee" ); maDeactivatingListeners.push_back( rNotifee ); - + return true; } @@ -686,7 +686,7 @@ void BaseNode::setSelf( const BaseNodeSharedPtr& rSelf ) "BaseNode::setSelf(): got ptr to different object" ); ENSURE_OR_THROW( !mpSelf, "BaseNode::setSelf(): called multiple times" ); - + mpSelf = rSelf; } @@ -697,7 +697,7 @@ void BaseNode::setSelf( const BaseNodeSharedPtr& rSelf ) void BaseNode::showState() const { const AnimationNode::NodeState eNodeState( getState() ); - + if( eNodeState == AnimationNode::INVALID ) VERBOSE_TRACE( "Node state: n0x%X [label=\"%s\",style=filled," "fillcolor=\"0.5,0.2,0.5\"]", @@ -709,7 +709,7 @@ void BaseNode::showState() const (const char*)this+debugGetCurrentOffset(), getDescription(), log(double(getState()))/4.0 ); - + // determine additional node information uno::Reference<animations::XAnimate> const xAnimate( mxAnimationNode, uno::UNO_QUERY ); @@ -717,31 +717,31 @@ void BaseNode::showState() const { uno::Reference< drawing::XShape > xTargetShape( xAnimate->getTarget(), uno::UNO_QUERY ); - + if( !xTargetShape.is() ) { ::com::sun::star::presentation::ParagraphTarget aTarget; - + // no shape provided. Maybe a ParagraphTarget? if( (xAnimate->getTarget() >>= aTarget) ) xTargetShape = aTarget.Shape; } - + if( xTargetShape.is() ) { - uno::Reference< beans::XPropertySet > xPropSet( xTargetShape, + uno::Reference< beans::XPropertySet > xPropSet( xTargetShape, uno::UNO_QUERY ); - + // read shape name ::rtl::OUString aName; - if( (xPropSet->getPropertyValue( + if( (xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Name") ) ) >>= aName) ) { - const ::rtl::OString& rAsciiName( - ::rtl::OUStringToOString( aName, - RTL_TEXTENCODING_ASCII_US ) ); - + const ::rtl::OString& rAsciiName( + ::rtl::OUStringToOString( aName, + RTL_TEXTENCODING_ASCII_US ) ); + VERBOSE_TRACE( "Node info: n0x%X, name \"%s\"", (const char*)this+debugGetCurrentOffset(), rAsciiName.getStr() ); @@ -760,7 +760,7 @@ void BaseNode::showTreeFromWithin() const // find root node BaseNodeSharedPtr pCurrNode( mpSelf ); while( pCurrNode->mpParent ) pCurrNode = pCurrNode->mpParent; - + pCurrNode->showState(); } #endif diff --git a/slideshow/source/engine/animationnodes/basenode.hxx b/slideshow/source/engine/animationnodes/basenode.hxx index 6f4a6d9c47b3..f927c1be8f89 100644 --- a/slideshow/source/engine/animationnodes/basenode.hxx +++ b/slideshow/source/engine/animationnodes/basenode.hxx @@ -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 @@ -44,7 +44,7 @@ namespace slideshow { namespace internal { /** Context for every node. - + Besides the global AnimationNodeFactory::Context data, this struct also contains the current DocTree subset for this node. If start and end index of the @@ -61,13 +61,13 @@ struct NodeContext mnStartDelay(0.0), mbIsIndependentSubset( true ) {} - - void dispose() - { - maContext.dispose(); - mpMasterShapeSubset.reset(); + + void dispose() + { + maContext.dispose(); + mpMasterShapeSubset.reset(); } - + /// Context as passed to createAnimationNode() SlideShowContext maContext; @@ -76,10 +76,10 @@ struct NodeContext /// Shape to be used (provided by parent, e.g. for iterations) ShapeSubsetSharedPtr mpMasterShapeSubset; - + /// Additional delay to node begin (to offset iterate effects) double mnStartDelay; - + /// When true, subset must be created during slide initialization bool mbIsIndependentSubset; }; @@ -94,40 +94,40 @@ class BaseNode : public AnimationNode, private ::boost::noncopyable { public: - BaseNode( ::com::sun::star::uno::Reference< - ::com::sun::star::animations::XAnimationNode> const& xNode, + BaseNode( ::com::sun::star::uno::Reference< + ::com::sun::star::animations::XAnimationNode> const& xNode, ::boost::shared_ptr<BaseContainerNode> const& pParent, NodeContext const& rContext ); - + /** Provide the node with a shared_ptr to itself. - + Since implementation has to create objects which need a shared_ptr to this node, and a pointee cannot retrieve a shared_ptr to itself internally, have to set that from the outside. */ void setSelf( const ::boost::shared_ptr< BaseNode >& rSelf ); - - + + #if defined(VERBOSE) && defined(DBG_UTIL) virtual void showState() const; virtual const char* getDescription() const; void showTreeFromWithin() const; #endif - + const ::boost::shared_ptr< BaseContainerNode >& getParentNode() const { return mpParent; } - + // Disposable: virtual void dispose(); - + // AnimationNode: virtual bool init(); virtual bool resolve(); virtual bool activate(); virtual void deactivate(); virtual void end(); - virtual ::com::sun::star::uno::Reference< + virtual ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode> getXAnimationNode() const; virtual NodeState getState() const; virtual bool registerDeactivatingListener( @@ -135,12 +135,12 @@ public: // nop: virtual void notifyDeactivating( const AnimationNodeSharedPtr& rNotifier ); - bool isMainSequenceRootNode() const { return mbIsMainSequenceRootNode; } + bool isMainSequenceRootNode() const { return mbIsMainSequenceRootNode; } protected: void scheduleDeactivationEvent( EventSharedPtr const& pEvent = EventSharedPtr() ); - + SlideShowContext const& getContext() const { return maContext; } ::boost::shared_ptr<BaseNode> const& getSelf() const { return mpSelf; } @@ -150,7 +150,7 @@ protected: OSL_ENSURE( bRet, "### INVALID node!" ); return bRet; } - + private: // all state affecting methods have "_st" counterparts being called at // derived classes when in state transistion: no-ops here at BaseNode... @@ -158,35 +158,35 @@ private: virtual bool resolve_st(); virtual void activate_st(); virtual void deactivate_st( NodeState eDestState ); - + private: /// notifies /// - all registered deactivation listeners /// - single animation end (every node) /// - slide animations (if main sequence root node) void notifyEndListeners() const; - + /// Get the node's restart mode sal_Int16 getRestartMode(); - + /** Get the default restart mode - + If this node's default mode is AnimationRestart::DEFAULT, this method recursively calls the parent node. */ sal_Int16 getRestartDefaultMode() const; - + /// Get the node's fill mode sal_Int16 getFillMode(); - + /** Get the default fill mode. - + If this node's default mode is AnimationFill::DEFAULT, this method recursively calls the parent node. */ sal_Int16 getFillDefaultMode() const; - + bool isTransition( NodeState eFromState, NodeState eToState, bool debugAssert = true ) const { (void) debugAssert; // avoid warning @@ -199,17 +199,17 @@ private: return ((meCurrState & mask) != 0 || (meCurrentStateTransition & mask) != 0); } - + class StateTransition; friend class StateTransition; - + private: SlideShowContext maContext; - + typedef ::std::vector< AnimationNodeSharedPtr > ListenerVector; - + ListenerVector maDeactivatingListeners; - ::com::sun::star::uno::Reference< + ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > mxAnimationNode; ::boost::shared_ptr< BaseContainerNode > mpParent; ::boost::shared_ptr< BaseNode > mpSelf; diff --git a/slideshow/source/engine/animationnodes/generateevent.cxx b/slideshow/source/engine/animationnodes/generateevent.cxx index afb9f2bf4aa5..40380b080ac3 100644 --- a/slideshow/source/engine/animationnodes/generateevent.cxx +++ b/slideshow/source/engine/animationnodes/generateevent.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 @@ -58,15 +58,15 @@ EventSharedPtr generateEvent( double nAdditionalDelay ) { EventSharedPtr pEvent; - + if (! rEventDescription.hasValue()) return pEvent; - + animations::Timing eTiming; animations::Event aEvent; uno::Sequence<uno::Any> aSequence; double nDelay1 = 0; - + if (rEventDescription >>= eTiming) { switch (eTiming) { case animations::Timing_INDEFINITE: @@ -79,21 +79,21 @@ EventSharedPtr generateEvent( } } else if (rEventDescription >>= aEvent) { - + // try to extract additional event delay double nDelay2 = 0.0; if (aEvent.Offset.hasValue() && !(aEvent.Offset >>= nDelay2)) { OSL_ENSURE( false, "offset values apart from DOUBLE not " "recognized in animations::Event!" ); } - + // common vars used inside switch uno::Reference<animations::XAnimationNode> xNode; uno::Reference<drawing::XShape> xShape; ShapeSharedPtr pShape; - + // TODO(F1): Respect aEvent.Repeat value - + switch (aEvent.Trigger) { default: ENSURE_OR_THROW( false, "unexpected event trigger!" ); @@ -112,7 +112,7 @@ EventSharedPtr generateEvent( pEvent = makeDelay( rFunctor, nDelay2 + nAdditionalDelay, "generateEvent, BEGIN_EVENT"); - rContext.mrUserEventQueue.registerAnimationStartEvent( + rContext.mrUserEventQueue.registerAnimationStartEvent( pEvent, xNode ); } else { @@ -126,7 +126,7 @@ EventSharedPtr generateEvent( pEvent = makeDelay( rFunctor, nDelay2 + nAdditionalDelay, "generateEvent, END_EVENT"); - rContext.mrUserEventQueue.registerAnimationEndEvent( + rContext.mrUserEventQueue.registerAnimationEndEvent( pEvent, xNode ); } else { @@ -158,14 +158,14 @@ EventSharedPtr generateEvent( pEvent = makeDelay( rFunctor, nDelay2 + nAdditionalDelay, "generateEvent, ON_DBL_CLICK"); - rContext.mrUserEventQueue.registerShapeDoubleClickEvent( + rContext.mrUserEventQueue.registerShapeDoubleClickEvent( pEvent, pShape ); } else { OSL_ENSURE( false, "could not extract source XAnimationNode " "for ON_DBL_CLICK!" ); } - break; + break; case animations::EventTrigger::ON_MOUSE_ENTER: // try to extract XShape event source if ((aEvent.Source >>= xShape) && @@ -174,7 +174,7 @@ EventSharedPtr generateEvent( pEvent = makeDelay( rFunctor, nDelay2 + nAdditionalDelay, "generateEvent, ON_MOUSE_ENTER"); - rContext.mrUserEventQueue.registerMouseEnterEvent( + rContext.mrUserEventQueue.registerMouseEnterEvent( pEvent, pShape ); } else { @@ -190,7 +190,7 @@ EventSharedPtr generateEvent( pEvent = makeDelay( rFunctor, nDelay2 + nAdditionalDelay, "generateEvent, ON_MOUSE_LEAVE"); - rContext.mrUserEventQueue.registerMouseLeaveEvent( + rContext.mrUserEventQueue.registerMouseLeaveEvent( pEvent, pShape ); } else { @@ -238,7 +238,7 @@ EventSharedPtr generateEvent( // schedule delay event rContext.mrEventQueue.addEvent( pEvent ); } - + return pEvent; } diff --git a/slideshow/source/engine/animationnodes/generateevent.hxx b/slideshow/source/engine/animationnodes/generateevent.hxx index 9c0104e5a254..fcadee19dfd2 100644 --- a/slideshow/source/engine/animationnodes/generateevent.hxx +++ b/slideshow/source/engine/animationnodes/generateevent.hxx @@ -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 @@ -37,16 +37,16 @@ namespace slideshow { namespace internal { /** Create an event for the given description, calling the given functor. - + @param rEventDescription Directly from API - + @param rFunctor Functor to call when event fires. - + @param rContext Context struct, to provide event queue - + @param nAdditionalDelay Additional delay, gets added on top of timeout. */ diff --git a/slideshow/source/engine/animationnodes/nodetools.cxx b/slideshow/source/engine/animationnodes/nodetools.cxx index 756f6b1969b0..ce7fab6d3506 100644 --- a/slideshow/source/engine/animationnodes/nodetools.cxx +++ b/slideshow/source/engine/animationnodes/nodetools.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 @@ -49,14 +49,14 @@ namespace slideshow int& debugGetCurrentOffset() { static int lcl_nOffset = 0; // to make each tree output distinct - + return lcl_nOffset; } void debugNodesShowTree( const BaseNode* pNode ) { if( pNode ) - pNode->showState(); + pNode->showState(); ++debugGetCurrentOffset(); } @@ -64,24 +64,24 @@ namespace slideshow void debugNodesShowTreeWithin( const BaseNode* pNode ) { if( pNode ) - pNode->showTreeFromWithin(); + pNode->showTreeFromWithin(); ++debugGetCurrentOffset(); } #endif - AttributableShapeSharedPtr lookupAttributableShape( const ShapeManagerSharedPtr& rShapeManager, - const uno::Reference< drawing::XShape >& xShape ) + AttributableShapeSharedPtr lookupAttributableShape( const ShapeManagerSharedPtr& rShapeManager, + const uno::Reference< drawing::XShape >& xShape ) { ENSURE_OR_THROW( rShapeManager, "lookupAttributableShape(): invalid ShapeManager" ); - + ShapeSharedPtr pShape( rShapeManager->lookupShape( xShape ) ); ENSURE_OR_THROW( pShape, "lookupAttributableShape(): no shape found for given XShape" ); - AttributableShapeSharedPtr pRes( + AttributableShapeSharedPtr pRes( ::boost::dynamic_pointer_cast< AttributableShape >( pShape ) ); // TODO(E3): Cannot throw here, people might set animation info @@ -99,7 +99,7 @@ namespace slideshow return true; animations::Timing eTiming; - + if( !(rAny >>= eTiming) || eTiming != animations::Timing_INDEFINITE ) { @@ -110,13 +110,13 @@ namespace slideshow } /// Extract the node type from the user data - bool getNodeType( sal_Int16& o_rNodeType, - const uno::Sequence< beans::NamedValue >& rValues ) + bool getNodeType( sal_Int16& o_rNodeType, + const uno::Sequence< beans::NamedValue >& rValues ) { beans::NamedValue aNamedValue; if( findNamedValue( &aNamedValue, - rValues, + rValues, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("node-type") ) ) ) { if( (aNamedValue.Value >>= o_rNodeType) ) diff --git a/slideshow/source/engine/animationnodes/nodetools.hxx b/slideshow/source/engine/animationnodes/nodetools.hxx index df120c159ac8..ed02ddc24a06 100644 --- a/slideshow/source/engine/animationnodes/nodetools.hxx +++ b/slideshow/source/engine/animationnodes/nodetools.hxx @@ -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 @@ -56,22 +56,22 @@ namespace slideshow //========================================================================= #if defined(VERBOSE) && defined(DBG_UTIL) - int& debugGetCurrentOffset(); + int& debugGetCurrentOffset(); void debugNodesShowTree( const BaseNode* ); void debugNodesShowTreeWithin( const BaseNode* ); -#endif +#endif /** Look up an AttributableShape from ShapeManager. This method retrieves an AttributableShape pointer, given - an XShape and a LayerManager. + an XShape and a LayerManager. Throws a runtime exception if there's no such shape, or if it does not implement the AttributableShape interface. */ - AttributableShapeSharedPtr lookupAttributableShape( const ShapeManagerSharedPtr& rShapeManager, - const ::com::sun::star::uno::Reference< - ::com::sun::star::drawing::XShape >& xShape ); + AttributableShapeSharedPtr lookupAttributableShape( const ShapeManagerSharedPtr& rShapeManager, + const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShape >& xShape ); /** Predicate whether a Begin, Duration or End timing is indefinite, i.e. either contains no value, or the @@ -80,8 +80,8 @@ namespace slideshow bool isIndefiniteTiming( const ::com::sun::star::uno::Any& rAny ); /// Extract the node type from the user data - bool getNodeType( sal_Int16& o_rNodeType, - const ::com::sun::star::uno::Sequence< + bool getNodeType( sal_Int16& o_rNodeType, + const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rValues ); } } diff --git a/slideshow/source/engine/animationnodes/paralleltimecontainer.cxx b/slideshow/source/engine/animationnodes/paralleltimecontainer.cxx index 9e5ffa89bc29..766c0e9ad3cb 100644 --- a/slideshow/source/engine/animationnodes/paralleltimecontainer.cxx +++ b/slideshow/source/engine/animationnodes/paralleltimecontainer.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 diff --git a/slideshow/source/engine/animationnodes/paralleltimecontainer.hxx b/slideshow/source/engine/animationnodes/paralleltimecontainer.hxx index abeacb7cda6f..3387ca8b64b1 100644 --- a/slideshow/source/engine/animationnodes/paralleltimecontainer.hxx +++ b/slideshow/source/engine/animationnodes/paralleltimecontainer.hxx @@ -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 @@ -34,24 +34,24 @@ namespace slideshow { namespace internal { /** This class implements parallel node containers - + All children of this node are played in parallel */ class ParallelTimeContainer : public BaseContainerNode { public: ParallelTimeContainer( - const ::com::sun::star::uno::Reference< - ::com::sun::star::animations::XAnimationNode >& xNode, + const ::com::sun::star::uno::Reference< + ::com::sun::star::animations::XAnimationNode >& xNode, const BaseContainerNodeSharedPtr& rParent, const NodeContext& rContext ) : BaseContainerNode( xNode, rParent, rContext ) {} - + #if defined(VERBOSE) && defined(DBG_UTIL) virtual const char* getDescription() const { return "ParallelTimeContainer"; } #endif - + private: virtual void activate_st(); virtual void notifyDeactivating( AnimationNodeSharedPtr const& pChildNode ); diff --git a/slideshow/source/engine/animationnodes/propertyanimationnode.cxx b/slideshow/source/engine/animationnodes/propertyanimationnode.cxx index 669f000bd6c7..288a9b87c11e 100644 --- a/slideshow/source/engine/animationnodes/propertyanimationnode.cxx +++ b/slideshow/source/engine/animationnodes/propertyanimationnode.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 @@ -46,9 +46,9 @@ AnimationActivitySharedPtr PropertyAnimationNode::createActivity() const // Create AnimationActivity from common XAnimate parameters: ActivitiesFactory::CommonParameters aParms( fillCommonParameters() ); uno::Reference<animations::XAnimate> const& xAnimateNode =getXAnimateNode(); - rtl::OUString const attrName( xAnimateNode->getAttributeName() ); + rtl::OUString const attrName( xAnimateNode->getAttributeName() ); AttributableShapeSharedPtr const pShape( getShape() ); - + switch (AnimationFactory::classifyAttributeName( attrName )) { default: case AnimationFactory::CLASS_UNKNOWN_PROPERTY: @@ -56,58 +56,58 @@ AnimationActivitySharedPtr PropertyAnimationNode::createActivity() const false, "Unexpected attribute class (unknown or empty attribute name)" ); break; - + case AnimationFactory::CLASS_NUMBER_PROPERTY: return ActivitiesFactory::createAnimateActivity( aParms, - AnimationFactory::createNumberPropertyAnimation( + AnimationFactory::createNumberPropertyAnimation( attrName, pShape, getContext().mpSubsettableShapeManager, getSlideSize() ), xAnimateNode ); - + case AnimationFactory::CLASS_ENUM_PROPERTY: return ActivitiesFactory::createAnimateActivity( aParms, - AnimationFactory::createEnumPropertyAnimation( + AnimationFactory::createEnumPropertyAnimation( attrName, pShape, getContext().mpSubsettableShapeManager, getSlideSize() ), xAnimateNode ); - + case AnimationFactory::CLASS_COLOR_PROPERTY: return ActivitiesFactory::createAnimateActivity( aParms, - AnimationFactory::createColorPropertyAnimation( + AnimationFactory::createColorPropertyAnimation( attrName, pShape, getContext().mpSubsettableShapeManager, getSlideSize() ), xAnimateNode ); - + case AnimationFactory::CLASS_STRING_PROPERTY: return ActivitiesFactory::createAnimateActivity( aParms, - AnimationFactory::createStringPropertyAnimation( + AnimationFactory::createStringPropertyAnimation( attrName, pShape, getContext().mpSubsettableShapeManager, getSlideSize() ), xAnimateNode ); - + case AnimationFactory::CLASS_BOOL_PROPERTY: return ActivitiesFactory::createAnimateActivity( aParms, - AnimationFactory::createBoolPropertyAnimation( + AnimationFactory::createBoolPropertyAnimation( attrName, pShape, getContext().mpSubsettableShapeManager, getSlideSize() ), xAnimateNode ); } - + return AnimationActivitySharedPtr(); } diff --git a/slideshow/source/engine/animationnodes/propertyanimationnode.hxx b/slideshow/source/engine/animationnodes/propertyanimationnode.hxx index 66232ccf8063..8c542774dd9b 100644 --- a/slideshow/source/engine/animationnodes/propertyanimationnode.hxx +++ b/slideshow/source/engine/animationnodes/propertyanimationnode.hxx @@ -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 @@ -38,16 +38,16 @@ class PropertyAnimationNode : public AnimationBaseNode public: PropertyAnimationNode( ::com::sun::star::uno::Reference< - ::com::sun::star::animations::XAnimationNode> const& xNode, + ::com::sun::star::animations::XAnimationNode> const& xNode, ::boost::shared_ptr<BaseContainerNode> const& pParent, NodeContext const& rContext ) : AnimationBaseNode( xNode, pParent, rContext ) {} - + #if defined(VERBOSE) && defined(DBG_UTIL) virtual const char* getDescription() const { return "PropertyAnimationNode"; } #endif - + private: virtual AnimationActivitySharedPtr createActivity() const; }; diff --git a/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx b/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx index cf7340cd14fc..1fab09442990 100644 --- a/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx +++ b/slideshow/source/engine/animationnodes/sequentialtimecontainer.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 @@ -55,7 +55,7 @@ void SequentialTimeContainer::activate_st() OSL_ENSURE( false, "### resolving child failed!" ); } } - + if (isDurationIndefinite() && (maChildren.empty() || mnFinishedChildren >= maChildren.size())) { @@ -113,20 +113,20 @@ bool SequentialTimeContainer::resolveChild( mpCurrentSkipEvent->dispose(); if (mpCurrentRewindEvent) mpCurrentRewindEvent->dispose(); - + // event that will deactivate the resolved/running child: mpCurrentSkipEvent = makeEvent( - boost::bind( &SequentialTimeContainer::skipEffect, + boost::bind( &SequentialTimeContainer::skipEffect, boost::dynamic_pointer_cast<SequentialTimeContainer>( getSelf() ), pChildNode ), "SequentialTimeContainer::skipEffect, resolveChild"); // event that will reresolve the resolved/activated child: mpCurrentRewindEvent = makeEvent( - boost::bind( &SequentialTimeContainer::rewindEffect, + boost::bind( &SequentialTimeContainer::rewindEffect, boost::dynamic_pointer_cast<SequentialTimeContainer>( getSelf() ), pChildNode ), "SequentialTimeContainer::rewindEffect, resolveChild"); - + // deactivate child node when skip event occurs: getContext().mrUserEventQueue.registerSkipEffectEvent( mpCurrentSkipEvent, @@ -143,13 +143,13 @@ void SequentialTimeContainer::notifyDeactivating( { if (notifyDeactivatedChild( rNotifier )) return; - + OSL_ASSERT( mnFinishedChildren < maChildren.size() ); AnimationNodeSharedPtr const& pNextChild = maChildren[mnFinishedChildren]; OSL_ASSERT( pNextChild->getState() == UNRESOLVED ); - + if (! resolveChild( pNextChild )) { - // could not resolve child - since we risk to + // could not resolve child - since we risk to // stall the chain of events here, play it safe // and deactivate this node (only if we have // indefinite duration - otherwise, we'll get a diff --git a/slideshow/source/engine/animationnodes/sequentialtimecontainer.hxx b/slideshow/source/engine/animationnodes/sequentialtimecontainer.hxx index 003d80333074..878b0f34f4f0 100644 --- a/slideshow/source/engine/animationnodes/sequentialtimecontainer.hxx +++ b/slideshow/source/engine/animationnodes/sequentialtimecontainer.hxx @@ -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 @@ -34,37 +34,37 @@ namespace slideshow { namespace internal { /** This class implements sequential node containers - + All children of this node are played sequentially */ class SequentialTimeContainer : public BaseContainerNode { public: SequentialTimeContainer( - ::com::sun::star::uno::Reference< - ::com::sun::star::animations::XAnimationNode> const& xNode, + ::com::sun::star::uno::Reference< + ::com::sun::star::animations::XAnimationNode> const& xNode, BaseContainerNodeSharedPtr const& pParent, NodeContext const& rContext ) : BaseContainerNode( xNode, pParent, rContext ) {} - + #if defined(VERBOSE) && defined(DBG_UTIL) virtual const char* getDescription() const { return "SequentialTimeContainer"; } #endif - + protected: virtual void dispose(); - + private: virtual void activate_st(); virtual void notifyDeactivating( AnimationNodeSharedPtr const& rNotifier ); - + void skipEffect( AnimationNodeSharedPtr const& pChildNode ); void rewindEffect( AnimationNodeSharedPtr const& pChildNode ); - + private: bool resolveChild( AnimationNodeSharedPtr const& pChildNode ); - + EventSharedPtr mpCurrentSkipEvent; EventSharedPtr mpCurrentRewindEvent; }; diff --git a/slideshow/source/engine/animationnodes/setactivity.hxx b/slideshow/source/engine/animationnodes/setactivity.hxx index 821971115ea6..76d750f2b337 100644 --- a/slideshow/source/engine/animationnodes/setactivity.hxx +++ b/slideshow/source/engine/animationnodes/setactivity.hxx @@ -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 @@ -43,11 +43,11 @@ namespace slideshow { namespace internal { /** Templated setter for animation values - + This template class implements the AnimationActivity interface, but only the perform() and setAttributeLayer() methods are functional. To be used for set animations. - + @see AnimationSetNode. */ template <class AnimationT> @@ -56,7 +56,7 @@ class SetActivity : public AnimationActivity public: typedef ::boost::shared_ptr< AnimationT > AnimationSharedPtrT; typedef typename AnimationT::ValueType ValueT; - + SetActivity( const ActivitiesFactory::CommonParameters& rParms, const AnimationSharedPtrT& rAnimation, const ValueT& rToValue ) @@ -70,7 +70,7 @@ public: { ENSURE_OR_THROW( mpAnimation, "Invalid animation" ); } - + virtual void dispose() { mbIsActive = false; @@ -82,19 +82,19 @@ public: mpEndEvent->dispose(); mpEndEvent.reset(); } - + virtual double calcTimeLag() const { return 0.0; } - + virtual bool perform() { if (! isActive()) return false; // we're going inactive immediately: mbIsActive = false; - + if (mpAnimation && mpAttributeLayer && mpShape) { mpAnimation->start( mpShape, mpAttributeLayer ); (*mpAnimation)(maToValue); @@ -103,15 +103,15 @@ public: // fire end event, if any if (mpEndEvent) mrEventQueue.addEvent( mpEndEvent ); - + return false; // don't reinsert } - + virtual bool isActive() const { return mbIsActive; } - + virtual void dequeued() { } @@ -120,17 +120,17 @@ public: { perform(); } - + virtual void setTargets( const AnimatableShapeSharedPtr& rShape, const ShapeAttributeLayerSharedPtr& rAttrLayer ) { ENSURE_OR_THROW( rShape, "Invalid shape" ); ENSURE_OR_THROW( rAttrLayer, "Invalid attribute layer" ); - + mpShape = rShape; mpAttributeLayer = rAttrLayer; } - + private: AnimationSharedPtrT mpAnimation; AnimatableShapeSharedPtr mpShape; |