22#include <com/sun/star/presentation/ParagraphTarget.hpp>
23#include <com/sun/star/animations/Timing.hpp>
24#include <com/sun/star/animations/AnimationAdditiveMode.hpp>
25#include <com/sun/star/presentation/ShapeAnimationSubType.hpp>
44 :
BaseNode( xNode, rParent, rContext ),
45 mxAnimateNode( xNode,
uno::UNO_QUERY_THROW ),
46 maAttributeLayerHolder(),
51 mbPreservedVisibility(true),
52 mbIsIndependentSubset( rContext.mbIsIndependentSubset ),
104 presentation::ParagraphTarget aTarget;
108 false,
"could not extract any target information" );
110 xShape = aTarget.Shape;
122 presentation::ShapeAnimationSubType::ONLY_TEXT ||
124 presentation::ShapeAnimationSubType::AS_WHOLE,
125 "ParagraphTarget given, but subitem not AS_TEXT or AS_WHOLE? "
126 "Make up your mind, I'll ignore the subitem." );
130 if( aTarget.Paragraph >= 0 &&
131 mpShape->getTreeNodeSupplier().getNumberOfTreeNodes(
135 mpShape->getTreeNodeSupplier().getTreeNode(
145 std::make_shared<ShapeSubset>(
mpShape,
208 catch (uno::Exception
const&) {
242 "Could not generate shape attribute layer" );
276 animations::AnimationAdditiveMode::REPLACE );
331 if (eDestState !=
ENDED)
385 SAL_INFO(
"slideshow.verbose",
"AnimationBaseNode info: independent subset=" <<
393 double nDuration = 0.0;
401 nDuration = ::std::max( 0.001, nDuration );
405 std::optional<double> aRepeats;
420 aRepeats = nRepeats / (2.0 * nDuration);
422 aRepeats = nRepeats / nDuration;
427 animations::Timing eTiming;
430 eTiming != animations::Timing_INDEFINITE )
433 eTiming != animations::Timing_INDEFINITE )
444 double nAcceleration = 0.0;
445 double nDeceleration = 0.0;
447 for ( std::shared_ptr<BaseNode> pNode( pSelf );
448 pNode; pNode = pNode->getParentNode() )
451 pNode->getXAnimationNode() );
452 nAcceleration = std::max( nAcceleration,
453 xAnimationNode->getAcceleration() );
454 nDeceleration = std::max( nDeceleration,
455 xAnimationNode->getDecelerate() );
460 pEndEvent =
makeEvent( [pSelf] () {pSelf->deactivate(); },
461 "AnimationBaseNode::deactivate");
466 const sal_Int32 nMinFrameCount (std::clamp<sal_Int32>(
AnimatableShapeSharedPtr mpShape
bool addActivity(const ActivitySharedPtr &pActivity)
Add the given activity to the queue.
virtual void showState() const override
virtual bool init_st() override
virtual void deactivate_st(NodeState eDestState) override
bool isDependentSubsettedShape() const
Returns true, if this is a subset animation, and the subset is autogenerated (e.g.
AttributableShapeSharedPtr const & getShape() const
SubsettableShapeManagerSharedPtr mpSubsetManager
bool mbIsIndependentSubset
virtual AnimationActivitySharedPtr createActivity() const =0
bool mbPreservedVisibility
ShapeSubsetSharedPtr mpShapeSubset
When valid, this is a subsetted target shape.
virtual bool enqueueActivity() const
ShapeAttributeLayerHolder maAttributeLayerHolder
virtual void activate_st() override
virtual bool hasPendingAnimation() const override
Query node whether it has an animation pending.
::basegfx::B2DVector const & getSlideSize() const
AttributableShapeSharedPtr mpShape
When valid, this node has a plain target shape.
virtual void removeEffect() override
Called by the container to remove the animation effect to make the painted shape correct if it restar...
css::uno::Reference< css::animations::XAnimate > mxAnimateNode
virtual void dispose() override
Dispose all object references.
AnimationActivitySharedPtr mpActivity
ActivitiesFactory::CommonParameters fillCommonParameters() const
Create parameter struct for ActivitiesFactory.
virtual bool resolve_st() override
AnimationBaseNode(css::uno::Reference< css::animations::XAnimationNode > const &xNode, BaseContainerNodeSharedPtr const &pParent, NodeContext const &rContext)
NodeState
The current state of this AnimationNode.
@ FROZEN
Node is frozen (no longer active, but changes remain in place)
@ ENDED
Node has completed an active lifecycle, and any effect is removed from the document.
This interface extends AnimationNode with some file-private accessor methods.
virtual void showState() const
SlideShowContext const & getContext() const
::std::shared_ptr< BaseNode > const & getSelf() const
virtual void dispose() override
Dispose all object references.
void scheduleDeactivationEvent(EventSharedPtr const &pEvent=EventSharedPtr())
This class represents kind of a DOM tree node for shape text.
@ LogicalParagraph
This node represents a paragraph.
static const sal_Int32 MinimumFramesPerSecond
The minimum number of frames per second is used to calculate the minimum number of frames that is to ...
bool createAttributeLayer(const AttributableShapeSharedPtr &rShape)
This constructor receives a pointer to the Shape, from which attribute layers should be generated.
const ShapeAttributeLayerSharedPtr & get() const
#define TOOLS_WARN_EXCEPTION(area, stream)
#define ENSURE_OR_THROW(c, m)
SlideShowContext maContext
#define SAL_INFO(area, stream)
B2IRange fround(const B2DRange &rRange)
AttributableShapeSharedPtr lookupAttributableShape(const ShapeManagerSharedPtr &rShapeManager, const uno::Reference< drawing::XShape > &xShape)
::std::shared_ptr< BaseContainerNode > BaseContainerNodeSharedPtr
::std::shared_ptr< Event > EventSharedPtr
::std::shared_ptr< AttributableShape > AttributableShapeSharedPtr
::std::shared_ptr< BaseNode > BaseNodeSharedPtr
std::shared_ptr< SubsettableShapeManager > mpSubsettableShapeManager
const basegfx::B2ISize maSlideSize
EventQueue & mrEventQueue
Collection of common factory parameters.
ShapeSubsetSharedPtr mpMasterShapeSubset
Shape to be used (provided by parent, e.g. for iterations)
std::shared_ptr< SubsettableShapeManager > & mpSubsettableShapeManager
ActivitiesQueue & mrActivitiesQueue