LibreOffice Module slideshow (master) 1
slideanimations.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20
22
23#include "slideanimations.hxx"
25#include <utility>
26
27using namespace ::com::sun::star;
28
29namespace slideshow::internal
30{
32 const ::basegfx::B2DVector& rSlideSize ) :
33 maContext(std::move( aContext )),
34 maSlideSize( rSlideSize ),
35 mpRootNode()
36 {
38 "SlideAnimations::SlideAnimations(): Invalid SlideShowContext" );
39 }
40
41 SlideAnimations::~SlideAnimations() COVERITY_NOEXCEPT_FALSE
42 {
43 if( !mpRootNode )
44 return;
45
47
48 try
49 {
50 mpRootNode->dispose();
51 }
52 catch (uno::Exception &)
53 {
54 TOOLS_WARN_EXCEPTION( "slideshow", "" );
55 }
56 }
57
59 {
61 xRootAnimationNode,
63 maContext );
64
66
67 return static_cast< bool >(mpRootNode);
68 }
69
71 {
72 if( !mpRootNode )
73 return false; // no animations there
74
75 // query root node about pending animations
76 return mpRootNode->hasPendingAnimation();
77 }
78
80 {
81 if( !mpRootNode )
82 return false; // no animations there
83
84 // init all nodes
85 if( !mpRootNode->init() )
86 return false;
87
88 // resolve root node
89 if( !mpRootNode->resolve() )
90 return false;
91
92 return true;
93 }
94
96 {
97 if( !mpRootNode )
98 return; // no animations there
99
100 // end root node
101 mpRootNode->deactivate();
102 mpRootNode->end();
103 }
104
105}
106
107/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define SHOW_NODE_TREE(a)
bool start()
Start the animations.
bool importAnimations(const css::uno::Reference< css::animations::XAnimationNode > &xRootAnimationNode)
Import animations from a SMIL root animation node.
SlideAnimations(SlideShowContext aContext, const ::basegfx::B2DVector &rSlideSize)
Create an animation generator.
const basegfx::B2DVector maSlideSize
~SlideAnimations() COVERITY_NOEXCEPT_FALSE
bool isAnimated() const
Check, whether imported animations actually contain any effects.
#define TOOLS_WARN_EXCEPTION(area, stream)
#define ENSURE_OR_THROW(c, m)
SlideShowContext maContext
AnimationNodeSharedPtr createAnimationNode(const css::uno::Reference< css::animations::XAnimationNode > &xNode, const ::basegfx::B2DVector &rSlideSize, const SlideShowContext &rContext)
Create an AnimationNode for the given XAnimationNode.
const basegfx::B2ISize maSlideSize
Definition: slideimpl.cxx:221
Common arguments for slideshow objects.
std::shared_ptr< SubsettableShapeManager > & mpSubsettableShapeManager