summaryrefslogtreecommitdiff
path: root/animations
diff options
context:
space:
mode:
authorSarper Akdemir <q.sarperakdemir@gmail.com>2020-06-25 20:33:05 +0300
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-08-20 15:21:07 +0200
commite33486189d5af3e651a5bc2e974b548fc07cc5bc (patch)
tree08af11ef308771f9c51efa660ce83dc25b5dc475 /animations
parenta58fe88b5b406749f6e47c14f56d7490a7958bda (diff)
make physics based animation effects importable-exportable
Makes physics based animation effects importable and exportable on content.xml. Uses one new xml token animatePhysics. Also adds a new animation preset called Physics Basic that is available under Emphasis animation effect category. Change-Id: I38b0511f973668655cff78becebe3f1e628d9083 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100247 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'animations')
-rw-r--r--animations/source/animcore/animcore.component4
-rw-r--r--animations/source/animcore/animcore.cxx35
2 files changed, 37 insertions, 2 deletions
diff --git a/animations/source/animcore/animcore.component b/animations/source/animcore/animcore.component
index 2f490aa0ae06..cd691f05e0ba 100644
--- a/animations/source/animcore/animcore.component
+++ b/animations/source/animcore/animcore.component
@@ -31,6 +31,10 @@
constructor="com_sun_star_animations_AnimateMotion_get_implementation">
<service name="com.sun.star.animations.AnimateMotion"/>
</implementation>
+ <implementation name="animcore::AnimatePhysics"
+ constructor="com_sun_star_animations_AnimatePhysics_get_implementation">
+ <service name="com.sun.star.animations.AnimatePhysics"/>
+ </implementation>
<implementation name="animcore::AnimateSet"
constructor="com_sun_star_animations_AnimateSet_get_implementation">
<service name="com.sun.star.animations.AnimateSet"/>
diff --git a/animations/source/animcore/animcore.cxx b/animations/source/animcore/animcore.cxx
index f3ffe8c4190a..88e42772936a 100644
--- a/animations/source/animcore/animcore.cxx
+++ b/animations/source/animcore/animcore.cxx
@@ -291,7 +291,7 @@ private:
const sal_Int16 mnNodeType;
// for XTypeProvider
- static std::array<Sequence< Type >*, 12> mpTypes;
+ static std::array<Sequence< Type >*, 13> mpTypes;
// attributes for the XAnimationNode interface implementation
Any maBegin, maDuration, maEnd, maEndSync, maRepeatCount, maRepeatDuration;
@@ -394,7 +394,7 @@ Any SAL_CALL TimeContainerEnumeration::nextElement()
}
-std::array<Sequence< Type >*, 12> AnimationNode::mpTypes = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr };
+std::array<Sequence< Type >*, 13> AnimationNode::mpTypes = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr };
AnimationNode::AnimationNode( sal_Int16 nNodeType )
: maChangeListener(maMutex),
@@ -565,6 +565,16 @@ static OUString getImplementationName_ANIMATEMOTION()
return "animcore::AnimateMotion";
}
+static Sequence<OUString> getSupportedServiceNames_ANIMATEPHYSICS()
+{
+ return { "com.sun.star.animations.AnimatePhysics" };
+}
+
+static OUString getImplementationName_ANIMATEPHYSICS()
+{
+ return "animcore::AnimatePhysics";
+}
+
static Sequence<OUString> getSupportedServiceNames_ANIMATETRANSFORM()
{
return { "com.sun.star.animations.AnimateTransform" };
@@ -658,6 +668,12 @@ Any SAL_CALL AnimationNode::queryInterface( const Type& aType )
static_cast< XAnimate * >( static_cast< XAnimateMotion * >(this) ),
static_cast< XAnimateMotion * >( this ) );
break;
+ case AnimationNodeType::ANIMATEPHYSICS:
+ aRet = ::cppu::queryInterface(
+ aType,
+ static_cast< XAnimate * >( static_cast< XAnimateMotion * >(this) ),
+ static_cast< XAnimateMotion * >( this ) );
+ break;
case AnimationNodeType::ANIMATECOLOR:
aRet = ::cppu::queryInterface(
aType,
@@ -717,6 +733,7 @@ void AnimationNode::initTypeProvider( sal_Int16 nNodeType ) throw()
8, // TRANSITIONFILTER
8, // AUDIO
8, // COMMAND
+ 8, // ANIMATEPHYSICS
};
// collect types
@@ -749,6 +766,9 @@ void AnimationNode::initTypeProvider( sal_Int16 nNodeType ) throw()
case AnimationNodeType::ANIMATEMOTION:
pTypeAr[nPos++] = cppu::UnoType<XAnimateMotion>::get();
break;
+ case AnimationNodeType::ANIMATEPHYSICS:
+ pTypeAr[nPos++] = cppu::UnoType<XAnimateMotion>::get();
+ break;
case AnimationNodeType::ANIMATECOLOR:
pTypeAr[nPos++] = cppu::UnoType<XAnimateColor>::get();
break;
@@ -817,6 +837,8 @@ OUString AnimationNode::getImplementationName()
return getImplementationName_ANIMATECOLOR();
case AnimationNodeType::ANIMATEMOTION:
return getImplementationName_ANIMATEMOTION();
+ case AnimationNodeType::ANIMATEPHYSICS:
+ return getImplementationName_ANIMATEPHYSICS();
case AnimationNodeType::TRANSITIONFILTER:
return getImplementationName_TRANSITIONFILTER();
case AnimationNodeType::ANIMATETRANSFORM:
@@ -854,6 +876,8 @@ Sequence< OUString > AnimationNode::getSupportedServiceNames()
return getSupportedServiceNames_ANIMATECOLOR();
case AnimationNodeType::ANIMATEMOTION:
return getSupportedServiceNames_ANIMATEMOTION();
+ case AnimationNodeType::ANIMATEPHYSICS:
+ return getSupportedServiceNames_ANIMATEPHYSICS();
case AnimationNodeType::TRANSITIONFILTER:
return getSupportedServiceNames_TRANSITIONFILTER();
case AnimationNodeType::ANIMATETRANSFORM:
@@ -2042,6 +2066,13 @@ com_sun_star_animations_AnimateMotion_get_implementation(css::uno::XComponentCon
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+com_sun_star_animations_AnimatePhysics_get_implementation(css::uno::XComponentContext*,
+ css::uno::Sequence<css::uno::Any> const &)
+{
+ return cppu::acquire(new animcore::AnimationNode(ANIMATEPHYSICS));
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
com_sun_star_animations_AnimateTransform_get_implementation(css::uno::XComponentContext*,
css::uno::Sequence<css::uno::Any> const &)
{