[Libreoffice-commits] core.git: Branch 'private/quwex/gsoc-box2d-experimental' - animations/source include/xmloff offapi/com offapi/UnoApi_offapi.mk sd/inc sd/source slideshow/source xmloff/source

Sarper Akdemir (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 25 17:33:58 UTC 2020


Rebased ref, commits from common ancestor:
commit 763bd89feedf8f692c0229319c84b7d21ecbf9c3
Author:     Sarper Akdemir <q.sarperakdemir at gmail.com>
AuthorDate: Thu Jun 25 20:33:05 2020 +0300
Commit:     Sarper Akdemir <q.sarperakdemir at gmail.com>
CommitDate: Thu Jun 25 20:33:05 2020 +0300

    work-in-progress import export simulatedanimations
    
    Change-Id: I38b0511f973668655cff78becebe3f1e628d9083

diff --git a/animations/source/animcore/animcore.component b/animations/source/animcore/animcore.component
index 2f490aa0ae06..bcc7f58aaac3 100644
--- a/animations/source/animcore/animcore.component
+++ b/animations/source/animcore/animcore.component
@@ -30,6 +30,10 @@
   <implementation name="animcore::AnimateMotion"
       constructor="com_sun_star_animations_AnimateMotion_get_implementation">
     <service name="com.sun.star.animations.AnimateMotion"/>
+  </implementation>
+    <implementation name="animcore::AnimateSimulation"
+      constructor="com_sun_star_animations_AnimateSimulation_get_implementation">
+    <service name="com.sun.star.animations.AnimateSimulation"/>
   </implementation>
   <implementation name="animcore::AnimateSet"
       constructor="com_sun_star_animations_AnimateSet_get_implementation">
diff --git a/animations/source/animcore/animcore.cxx b/animations/source/animcore/animcore.cxx
index f3ffe8c4190a..e529ccfe6ba9 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_ANIMATESIMULATION()
+{
+    return { "com.sun.star.animations.AnimateSimulation" };
+}
+
+static OUString getImplementationName_ANIMATESIMULATION()
+{
+    return "animcore::AnimateSimulation";
+}
+
 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::ANIMATESIMULATED:
+            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, // ANIMATESIMULATED
     };
 
     // 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::ANIMATESIMULATED:
+        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::ANIMATESIMULATED:
+        return getImplementationName_ANIMATESIMULATION();
     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::ANIMATESIMULATED:
+        return getSupportedServiceNames_ANIMATESIMULATION();
     case AnimationNodeType::TRANSITIONFILTER:
         return getSupportedServiceNames_TRANSITIONFILTER();
     case AnimationNodeType::ANIMATETRANSFORM:
@@ -2041,6 +2065,13 @@ com_sun_star_animations_AnimateMotion_get_implementation(css::uno::XComponentCon
     return cppu::acquire(new animcore::AnimationNode(ANIMATEMOTION));
 }
 
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+com_sun_star_animations_AnimateSimulation_get_implementation(css::uno::XComponentContext*,
+                                                             css::uno::Sequence<css::uno::Any> const &)
+{
+    return cppu::acquire(new animcore::AnimationNode(ANIMATESIMULATED));
+}
+
 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 &)
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 49178ebdc996..4e3a23dacffd 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -2791,6 +2791,7 @@ namespace xmloff::token {
         XML_MULTIPLY,
         XML_ANIMATE,
         XML_ANIMATEMOTION,
+        XML_ANIMATESIMULATION,
         XML_ANIMATETRANSFORM,
         XML_ANIMATECOLOR,
         XML_TRANSITIONFILTER,
@@ -2986,6 +2987,7 @@ namespace xmloff::token {
         XML_EXIT,
         XML_EMPHASIS,
         XML_MOTION_PATH,
+        XML_MOTION_SIMULATED,
         XML_OLE_ACTION,
         XML_MEDIA_CALL,
         XML_ON_CLICK,
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 68a493cfa6ac..cef77ecc02f8 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -29,6 +29,7 @@ $(eval $(call gb_UnoApi_use_api,offapi,\
 $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/animations,\
 	AnimateColor \
 	AnimateMotion \
+	AnimateSimulation \
 	AnimateSet \
 	Audio \
 	Command \
diff --git a/offapi/com/sun/star/animations/AnimateSimulation.idl b/offapi/com/sun/star/animations/AnimateSimulation.idl
new file mode 100644
index 000000000000..e8ce028db7a4
--- /dev/null
+++ b/offapi/com/sun/star/animations/AnimateSimulation.idl
@@ -0,0 +1,35 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef __com_sun_star_animations_AnimateSimulation_idl__
+#define __com_sun_star_animations_AnimateSimulation_idl__
+
+#include <com/sun/star/animations/XAnimationNode.idl>
+
+
+module com {  module sun {  module star {  module animations {
+
+
+service AnimateSimulation : com::sun::star::animations::XAnimationNode;
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/presentation/EffectPresetClass.idl b/offapi/com/sun/star/presentation/EffectPresetClass.idl
index 9ff0e1201a63..50b08d0913fd 100644
--- a/offapi/com/sun/star/presentation/EffectPresetClass.idl
+++ b/offapi/com/sun/star/presentation/EffectPresetClass.idl
@@ -40,6 +40,7 @@ constants EffectPresetClass
     const short EXIT = 2;
     const short EMPHASIS = 3;
     const short MOTIONPATH = 4;
+    const short MOTIONSIMULATION = 7;
     const short OLEACTION = 5;
     const short MEDIACALL = 6;
 };
diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc
index 0e093d1da84b..436654321bb7 100644
--- a/sd/inc/strings.hrc
+++ b/sd/inc/strings.hrc
@@ -434,6 +434,7 @@
 #define STR_CUSTOMANIMATION_EMPHASIS                    NC_("STR_CUSTOMANIMATION_EMPHASIS", "Emphasis: %1")
 #define STR_CUSTOMANIMATION_EXIT                        NC_("STR_CUSTOMANIMATION_EXIT", "Exit: %1")
 #define STR_CUSTOMANIMATION_MOTION_PATHS                NC_("STR_CUSTOMANIMATION_MOTION_PATHS", "Motion Paths: %1")
+#define STR_CUSTOMANIMATION_MOTION_SIMULATION           NC_("STR_CUSTOMANIMATION_MOTION_SIMULATION", "Motion Simulation: %1")
 #define STR_CUSTOMANIMATION_MISC                        NC_("STR_CUSTOMANIMATION_MISC", "Misc: %1")
 #define STR_SLIDETRANSITION_NONE                        NC_("STR_SLIDETRANSITION_NONE", "None")
 
diff --git a/sd/source/core/CustomAnimationPreset.cxx b/sd/source/core/CustomAnimationPreset.cxx
index 3be4e76941f8..773ed79bcf55 100644
--- a/sd/source/core/CustomAnimationPreset.cxx
+++ b/sd/source/core/CustomAnimationPreset.cxx
@@ -502,6 +502,7 @@ Reference< XAnimationNode > CustomAnimationPresets::getRandomPreset( sal_Int16 n
     case EffectPresetClass::EXIT:       pCategoryList = &maExitPresets; break;
     case EffectPresetClass::EMPHASIS:   pCategoryList = &maEmphasisPresets; break;
     case EffectPresetClass::MOTIONPATH: pCategoryList = &maMotionPathsPresets; break;
+    case EffectPresetClass::MOTIONSIMULATION: pCategoryList = &maMotionPathsPresets; break;
     default:
         pCategoryList = nullptr;
     }
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx
index 0e2762ce762e..63fe7b391a97 100644
--- a/sd/source/ui/animations/CustomAnimationList.cxx
+++ b/sd/source/ui/animations/CustomAnimationList.cxx
@@ -252,6 +252,8 @@ CustomAnimationListEntryItem::CustomAnimationListEntryItem(const OUString& aDesc
         msEffectName = SdResId(STR_CUSTOMANIMATION_EMPHASIS); break;
     case EffectPresetClass::MOTIONPATH:
         msEffectName = SdResId(STR_CUSTOMANIMATION_MOTION_PATHS); break;
+    case EffectPresetClass::MOTIONSIMULATION:
+        msEffectName = SdResId(STR_CUSTOMANIMATION_MOTION_SIMULATION); break;
     default:
         msEffectName = SdResId(STR_CUSTOMANIMATION_MISC); break;
     }
@@ -371,6 +373,7 @@ void CustomAnimationListEntryItem::PaintEffect(vcl::RenderContext& rRenderContex
     case EffectPresetClass::EMPHASIS:
         sImage = BMP_CUSTOMANIMATION_EMPHASIS_EFFECT; break;
     case EffectPresetClass::MOTIONPATH:
+    case EffectPresetClass::MOTIONSIMULATION:
         sImage = BMP_CUSTOMANIMATION_MOTION_PATH; break;
     case EffectPresetClass::OLEACTION:
         sImage = BMP_CUSTOMANIMATION_OLE; break;
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index 45e44c0d8628..4740c42d9ebc 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -585,6 +585,7 @@ void CustomAnimationPane::updateControls()
             case EffectPresetClass::EMPHASIS: nCategoryPos = 1; break;
             case EffectPresetClass::EXIT: nCategoryPos = 2; break;
             case EffectPresetClass::MOTIONPATH: nCategoryPos = 3; break;
+            case EffectPresetClass::MOTIONSIMULATION: nCategoryPos = 3; break;
             default:
                 break;
         }
diff --git a/slideshow/source/engine/animationnodes/animationnodefactory.cxx b/slideshow/source/engine/animationnodes/animationnodefactory.cxx
index f07dfd2f3572..93eadc6495c3 100644
--- a/slideshow/source/engine/animationnodes/animationnodefactory.cxx
+++ b/slideshow/source/engine/animationnodes/animationnodefactory.cxx
@@ -480,8 +480,8 @@ BaseNodeSharedPtr implCreateAnimationNode(
         break;
 
     case animations::AnimationNodeType::ANIMATEMOTION:
-//        pCreatedNode = std::make_shared<AnimationPathMotionNode>(
-        pCreatedNode = std::make_shared<AnimationSimulatedNode>(
+        pCreatedNode = std::make_shared<AnimationPathMotionNode>(
+//        pCreatedNode = std::make_shared<AnimationSimulatedNode>(
                                 xNode, rParent, rContext );
         break;
 
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 8d9a70f5e082..d0528ca80e33 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -2792,6 +2792,7 @@ namespace xmloff::token {
         TOKEN( "multiply",                  XML_MULTIPLY ),
         TOKEN( "animate",                       XML_ANIMATE ),
         TOKEN( "animateMotion",             XML_ANIMATEMOTION ),
+        TOKEN( "animateSimulation",         XML_ANIMATESIMULATION ),
         TOKEN( "animateTransform",          XML_ANIMATETRANSFORM ),
         TOKEN( "animateColor",              XML_ANIMATECOLOR ),
         TOKEN( "transitionFilter",          XML_TRANSITIONFILTER ),
@@ -2987,6 +2988,7 @@ namespace xmloff::token {
         TOKEN( "exit",              XML_EXIT ),
         TOKEN( "emphasis",          XML_EMPHASIS ),
         TOKEN( "motion-path",           XML_MOTION_PATH ),
+        TOKEN( "motion-simulated",      XML_MOTION_SIMULATED ),
         TOKEN( "ole-action",            XML_OLE_ACTION ),
         TOKEN( "media-call",            XML_MEDIA_CALL ),
         TOKEN( "on-click",          XML_ON_CLICK ),
diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx
index 7aa293e75716..e56f0d952177 100644
--- a/xmloff/source/draw/animationexport.cxx
+++ b/xmloff/source/draw/animationexport.cxx
@@ -947,6 +947,7 @@ void AnimationsExporterImpl::exportNode( const Reference< XAnimationNode >& xNod
         case AnimationNodeType::ANIMATE:
         case AnimationNodeType::SET:
         case AnimationNodeType::ANIMATEMOTION:
+        case AnimationNodeType::ANIMATESIMULATED:
         case AnimationNodeType::ANIMATECOLOR:
         case AnimationNodeType::ANIMATETRANSFORM:
         case AnimationNodeType::TRANSITIONFILTER:
@@ -1089,6 +1090,10 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat
         {
             eAttributeName = XML_ANIMATEMOTION;
         }
+        else if( nNodeType == AnimationNodeType::ANIMATESIMULATED )
+        {
+            eAttributeName = XML_ANIMATESIMULATION;
+        }
         else
         {
             OUString sTemp( xAnimate->getAttributeName() );
@@ -1234,6 +1239,24 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat
         }
         break;
 
+        case AnimationNodeType::ANIMATESIMULATED:
+        {
+            eElementToken = XML_ANIMATESIMULATION;
+
+            Reference< XAnimateMotion > xAnimateMotion( xAnimate, UNO_QUERY_THROW );
+
+//            aTemp = xAnimateMotion->getPath();
+//            if( aTemp.hasValue() )
+//            {
+//                convertPath( sTmp, aTemp );
+//                mxExport->AddAttribute( XML_NAMESPACE_SVG, XML_PATH, sTmp.makeStringAndClear() );
+//            }
+
+//            // TODO: origin = ( parent | layout )
+//            aTemp = xAnimateMotion->getOrigin();
+        }
+        break;
+
         case AnimationNodeType::ANIMATECOLOR:
         {
             eElementToken = XML_ANIMATECOLOR;
@@ -1437,6 +1460,7 @@ void AnimationsExporterImpl::convertValue( XMLTokenEnum eAttributeName, OUString
         case XML_HEIGHT:
         case XML_ANIMATETRANSFORM:
         case XML_ANIMATEMOTION:
+        case XML_ANIMATESIMULATION:
         {
             if( auto aString = o3tl::tryAccess<OUString>(rValue) )
             {
diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx
index ebccff3d1a22..0cddb5169f80 100644
--- a/xmloff/source/draw/animationimport.cxx
+++ b/xmloff/source/draw/animationimport.cxx
@@ -460,6 +460,8 @@ AnimationNodeContext::AnimationNodeContext(
                 pServiceName = "com.sun.star.animations.AnimateSet"; break;
             case XML_ANIMATEMOTION:
                 pServiceName = "com.sun.star.animations.AnimateMotion"; break;
+            case XML_ANIMATESIMULATION:
+                pServiceName = "com.sun.star.animations.AnimateSimulation"; break;
             case XML_ANIMATECOLOR:
                 pServiceName = "com.sun.star.animations.AnimateColor"; break;
             case XML_ANIMATETRANSFORM:
diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt
index 34b9af91e03c..18f75351e199 100644
--- a/xmloff/source/token/tokens.txt
+++ b/xmloff/source/token/tokens.txt
@@ -2620,6 +2620,7 @@ additive
 multiply
 animate
 animateMotion
+animateSimulation
 animateTransform
 animateColor
 transitionFilter
@@ -2802,6 +2803,7 @@ entrance
 exit
 emphasis
 motion-path
+motion-simulated
 ole-action
 media-call
 on-click


More information about the Libreoffice-commits mailing list