[Libreoffice-commits] core.git: 3 commits - sd/source slideshow/source
Zolnai Tamás
tamas.zolnai at collabora.com
Tue Apr 15 12:38:34 PDT 2014
sd/source/ui/animations/CustomAnimationCreateDialog.cxx | 2
slideshow/source/engine/animationnodes/animationcommandnode.cxx | 2
slideshow/source/engine/animationnodes/animationcommandnode.hxx | 5
slideshow/source/engine/shapes/appletshape.cxx | 25 -
slideshow/source/engine/shapes/externalshapebase.cxx | 43 ---
slideshow/source/engine/shapes/externalshapebase.hxx | 139 ----------
slideshow/source/engine/shapes/mediashape.cxx | 26 -
slideshow/source/inc/externalmediashape.hxx | 85 ------
slideshow/source/inc/externalshapebase.hxx | 131 +++++++++
9 files changed, 160 insertions(+), 298 deletions(-)
New commits:
commit 0ae0301d1cd6e690473f932411ca880c20f45e13
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date: Tue Apr 15 13:46:46 2014 +0200
Slideshow: remove unneded function duplicates
Change-Id: I682ae771f13e42dd1a4e1cf6a1ee062a5eca640f
diff --git a/slideshow/source/engine/shapes/appletshape.cxx b/slideshow/source/engine/shapes/appletshape.cxx
index f5de6d8..85ec41f 100644
--- a/slideshow/source/engine/shapes/appletshape.cxx
+++ b/slideshow/source/engine/shapes/appletshape.cxx
@@ -96,11 +96,11 @@ namespace slideshow
virtual bool implRender( const ::basegfx::B2DRange& rCurrBounds ) const SAL_OVERRIDE;
virtual void implViewChanged( const UnoViewSharedPtr& rView ) SAL_OVERRIDE;
virtual void implViewsChanged() SAL_OVERRIDE;
- virtual bool implStartIntrinsicAnimation() SAL_OVERRIDE;
- virtual bool implEndIntrinsicAnimation() SAL_OVERRIDE;
- virtual bool implPauseIntrinsicAnimation() SAL_OVERRIDE;
- virtual bool implIsIntrinsicAnimationPlaying() const SAL_OVERRIDE;
- virtual void implSetIntrinsicAnimationTime(double) SAL_OVERRIDE;
+ virtual void play() SAL_OVERRIDE;
+ virtual void stop() SAL_OVERRIDE;
+ virtual void pause() SAL_OVERRIDE;
+ virtual bool isPlaying() const SAL_OVERRIDE;
+ virtual void setMediaTime(double) SAL_OVERRIDE;
const OUString maServiceName;
const char** mpPropCopyTable;
@@ -250,7 +250,7 @@ namespace slideshow
- bool AppletShape::implStartIntrinsicAnimation()
+ void AppletShape::play()
{
::std::for_each( maViewAppletShapes.begin(),
maViewAppletShapes.end(),
@@ -258,42 +258,37 @@ namespace slideshow
_1,
::boost::cref( getBounds() )));
mbIsPlaying = true;
-
- return true;
}
- bool AppletShape::implEndIntrinsicAnimation()
+ void AppletShape::stop()
{
::std::for_each( maViewAppletShapes.begin(),
maViewAppletShapes.end(),
::boost::mem_fn( &ViewAppletShape::endApplet ) );
mbIsPlaying = false;
-
- return true;
}
- bool AppletShape::implPauseIntrinsicAnimation()
+ void AppletShape::pause()
{
// TODO(F1): any way of temporarily disabling/deactivating
// applets?
- return true;
}
- bool AppletShape::implIsIntrinsicAnimationPlaying() const
+ bool AppletShape::isPlaying() const
{
return mbIsPlaying;
}
- void AppletShape::implSetIntrinsicAnimationTime(double)
+ void AppletShape::setMediaTime(double)
{
// No way of doing this, or?
}
diff --git a/slideshow/source/engine/shapes/externalshapebase.cxx b/slideshow/source/engine/shapes/externalshapebase.cxx
index 00c0766..05ad628 100644
--- a/slideshow/source/engine/shapes/externalshapebase.cxx
+++ b/slideshow/source/engine/shapes/externalshapebase.cxx
@@ -73,11 +73,13 @@ namespace slideshow
virtual bool enableAnimations() SAL_OVERRIDE
{
- return mrBase.implStartIntrinsicAnimation();
+ mrBase.play();
+ return true;
}
virtual bool disableAnimations() SAL_OVERRIDE
{
- return mrBase.implEndIntrinsicAnimation();
+ mrBase.stop();
+ return true;
}
ExternalShapeBase& mrBase;
@@ -126,43 +128,6 @@ namespace slideshow
return mxShape;
}
-
-
- void ExternalShapeBase::play()
- {
- implStartIntrinsicAnimation();
- }
-
-
-
- void ExternalShapeBase::stop()
- {
- implEndIntrinsicAnimation();
- }
-
-
-
- void ExternalShapeBase::pause()
- {
- implPauseIntrinsicAnimation();
- }
-
-
-
- bool ExternalShapeBase::isPlaying() const
- {
- return implIsIntrinsicAnimationPlaying();
- }
-
-
-
- void ExternalShapeBase::setMediaTime(double fTime)
- {
- implSetIntrinsicAnimationTime(fTime);
- }
-
-
-
bool ExternalShapeBase::update() const
{
return render();
diff --git a/slideshow/source/engine/shapes/mediashape.cxx b/slideshow/source/engine/shapes/mediashape.cxx
index f50e84b..ae13af3 100644
--- a/slideshow/source/engine/shapes/mediashape.cxx
+++ b/slideshow/source/engine/shapes/mediashape.cxx
@@ -82,11 +82,11 @@ namespace slideshow
virtual bool implRender( const ::basegfx::B2DRange& rCurrBounds ) const SAL_OVERRIDE;
virtual void implViewChanged( const UnoViewSharedPtr& rView ) SAL_OVERRIDE;
virtual void implViewsChanged() SAL_OVERRIDE;
- virtual bool implStartIntrinsicAnimation() SAL_OVERRIDE;
- virtual bool implEndIntrinsicAnimation() SAL_OVERRIDE;
- virtual bool implPauseIntrinsicAnimation() SAL_OVERRIDE;
- virtual bool implIsIntrinsicAnimationPlaying() const SAL_OVERRIDE;
- virtual void implSetIntrinsicAnimationTime(double) SAL_OVERRIDE;
+ virtual void play() SAL_OVERRIDE;
+ virtual void stop() SAL_OVERRIDE;
+ virtual void pause() SAL_OVERRIDE;
+ virtual bool isPlaying() const SAL_OVERRIDE;
+ virtual void setMediaTime(double) SAL_OVERRIDE;
/// the list of active view shapes (one for each registered view layer)
typedef ::std::vector< ViewMediaShapeSharedPtr > ViewMediaShapeVector;
@@ -216,53 +216,47 @@ namespace slideshow
- bool MediaShape::implStartIntrinsicAnimation()
+ void MediaShape::play()
{
::std::for_each( maViewMediaShapes.begin(),
maViewMediaShapes.end(),
::boost::mem_fn( &ViewMediaShape::startMedia ) );
mbIsPlaying = true;
-
- return true;
}
- bool MediaShape::implEndIntrinsicAnimation()
+ void MediaShape::stop()
{
::std::for_each( maViewMediaShapes.begin(),
maViewMediaShapes.end(),
::boost::mem_fn( &ViewMediaShape::endMedia ) );
mbIsPlaying = false;
-
- return true;
}
- bool MediaShape::implPauseIntrinsicAnimation()
+ void MediaShape::pause()
{
::std::for_each( maViewMediaShapes.begin(),
maViewMediaShapes.end(),
::boost::mem_fn( &ViewMediaShape::pauseMedia ) );
mbIsPlaying = false;
-
- return true;
}
- bool MediaShape::implIsIntrinsicAnimationPlaying() const
+ bool MediaShape::isPlaying() const
{
return mbIsPlaying;
}
- void MediaShape::implSetIntrinsicAnimationTime(double fTime)
+ void MediaShape::setMediaTime(double fTime)
{
::std::for_each( maViewMediaShapes.begin(),
maViewMediaShapes.end(),
diff --git a/slideshow/source/inc/externalshapebase.hxx b/slideshow/source/inc/externalshapebase.hxx
index 8110228..67a1c2e 100644
--- a/slideshow/source/inc/externalshapebase.hxx
+++ b/slideshow/source/inc/externalshapebase.hxx
@@ -67,12 +67,16 @@ namespace slideshow
// animation methods
-
- virtual void play();
- virtual void stop();
- virtual void pause();
- virtual bool isPlaying() const;
- virtual void setMediaTime(double);
+ /// override in derived class to play external viewer
+ virtual void play() = 0;
+ /// override in derived class to stop external viewer
+ virtual void stop() = 0;
+ /// override in derived class to pause external viewer
+ virtual void pause() = 0;
+ /// override in derived class to return status of animation
+ virtual bool isPlaying() const = 0;
+ /// override in derived class to set media time
+ virtual void setMediaTime(double) = 0;
// render methods
@@ -107,18 +111,6 @@ namespace slideshow
/// override in derived class to resize
virtual void implViewsChanged() = 0;
- /// override in derived class to start external viewer
- virtual bool implStartIntrinsicAnimation() = 0;
- /// override in derived class to stop external viewer
- virtual bool implEndIntrinsicAnimation() = 0;
- /// override in derived class to pause external viewer
- virtual bool implPauseIntrinsicAnimation() = 0;
- /// override in derived class to return status of animation
- virtual bool implIsIntrinsicAnimationPlaying() const = 0;
- /// override in derived class to set media time
- virtual void implSetIntrinsicAnimationTime(double) = 0;
-
-
/// The associated XShape
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxShape;
commit 2a594eb22bfed62fdbcef51a56c2c180bea0283f
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date: Mon Apr 14 16:23:06 2014 +0200
Slideshow: Remove unneded ExternalMediaShape
ExternalShapeBase is the base class of MediaShape and
AppletShape so it's nonsense that ExternalMediaShape
to be the base of ExternalShapeBase.
Actually this class does nothing, anyway.
Change-Id: I8a278c9273a1788f0859205b8f1d0905427179b6
diff --git a/slideshow/source/engine/animationnodes/animationcommandnode.cxx b/slideshow/source/engine/animationnodes/animationcommandnode.cxx
index c7cbf09..53f9c8c 100644
--- a/slideshow/source/engine/animationnodes/animationcommandnode.cxx
+++ b/slideshow/source/engine/animationnodes/animationcommandnode.cxx
@@ -49,7 +49,7 @@ AnimationCommandNode::AnimationCommandNode( uno::Reference<animations::XAnimatio
uno::Reference< drawing::XShape > xShape( mxCommandNode->getTarget(),
uno::UNO_QUERY );
ShapeSharedPtr pShape( getContext().mpSubsettableShapeManager->lookupShape( xShape ) );
- mpShape = ::boost::dynamic_pointer_cast< ExternalMediaShape >( pShape );
+ mpShape = ::boost::dynamic_pointer_cast< ExternalShapeBase >( pShape );
}
void AnimationCommandNode::dispose()
diff --git a/slideshow/source/engine/animationnodes/animationcommandnode.hxx b/slideshow/source/engine/animationnodes/animationcommandnode.hxx
index 3ce5f23..9d8f278 100644
--- a/slideshow/source/engine/animationnodes/animationcommandnode.hxx
+++ b/slideshow/source/engine/animationnodes/animationcommandnode.hxx
@@ -20,9 +20,10 @@
#define INCLUDED_SLIDESHOW_ANIMATIONCOMMANDNODE_HXX
#include "basecontainernode.hxx"
-#include "externalmediashape.hxx"
+#include "externalshapebase.hxx"
#include "soundplayer.hxx"
#include "com/sun/star/animations/XCommand.hpp"
+#include <boost/shared_ptr.hpp>
namespace slideshow {
namespace internal {
@@ -49,7 +50,7 @@ private:
virtual bool hasPendingAnimation() const SAL_OVERRIDE;
private:
- ExternalMediaShapeSharedPtr mpShape;
+ boost::shared_ptr< ExternalShapeBase > mpShape;
::com::sun::star::uno::Reference<
::com::sun::star::animations::XCommand > mxCommandNode;
};
diff --git a/slideshow/source/inc/externalmediashape.hxx b/slideshow/source/inc/externalmediashape.hxx
deleted file mode 100644
index c55d0ba..0000000
--- a/slideshow/source/inc/externalmediashape.hxx
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- 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 INCLUDED_SLIDESHOW_EXTERNALMEDIASHAPE_HXX
-#define INCLUDED_SLIDESHOW_EXTERNALMEDIASHAPE_HXX
-
-#include <boost/shared_ptr.hpp>
-
-#include "shape.hxx"
-
-
-namespace slideshow
-{
- namespace internal
- {
- /** Represents a shape containing media (video, sound).
-
- This interface adds media handling methods to a shape. It
- allows starting/stopping and pausing playback.
- */
- class ExternalMediaShape : public Shape
- {
- public:
- // Animation methods
-
-
- /** Notify the Shape that it should start with playback
-
- This method enters playback mode on all registered
- views. It makes the media initially visible (for videos).
- */
- virtual void play() = 0;
-
- /** Notify the Shape that it should stop playback
-
- This method leaves playback mode on all registered
- views. The media is then rewound to the start, and
- removed from screen (for videos)
- */
- virtual void stop() = 0;
-
- /** Notify the Shape that it should pause playback
-
- This method stops playback on all registered
- views. The media stays visible (for videos)
- */
- virtual void pause() = 0;
-
- /** Query whether the media is currently playing.
- */
- virtual bool isPlaying() const = 0;
-
- /** Set media time in seconds.
-
- @param fTime
- Time in seconds of the media time line, that should now be
- presented
- */
- virtual void setMediaTime(double fTime) = 0;
- };
-
- typedef ::boost::shared_ptr< ExternalMediaShape > ExternalMediaShapeSharedPtr;
-
- }
-}
-
-#endif /* INCLUDED_SLIDESHOW_EXTERNALMEDIASHAPE_HXX */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/slideshow/source/engine/shapes/externalshapebase.hxx b/slideshow/source/inc/externalshapebase.hxx
similarity index 93%
rename from slideshow/source/engine/shapes/externalshapebase.hxx
rename to slideshow/source/inc/externalshapebase.hxx
index 4de1360..8110228 100644
--- a/slideshow/source/engine/shapes/externalshapebase.hxx
+++ b/slideshow/source/inc/externalshapebase.hxx
@@ -22,11 +22,11 @@
#include <vector>
-#include "externalmediashape.hxx"
#include "unoview.hxx"
#include "subsettableshapemanager.hxx"
#include "slideshowexceptions.hxx"
#include "slideshowcontext.hxx"
+#include "shape.hxx"
namespace slideshow
@@ -44,7 +44,7 @@ namespace slideshow
(including mutual overdraw). It therefore reports yes for
the isBackgroundDetached() question.
*/
- class ExternalShapeBase : public ExternalMediaShape
+ class ExternalShapeBase : public Shape
{
public:
/** Create a shape for the given XShape for an external shape
@@ -68,11 +68,11 @@ namespace slideshow
// animation methods
- virtual void play() SAL_OVERRIDE;
- virtual void stop() SAL_OVERRIDE;
- virtual void pause() SAL_OVERRIDE;
- virtual bool isPlaying() const SAL_OVERRIDE;
- virtual void setMediaTime(double) SAL_OVERRIDE;
+ virtual void play();
+ virtual void stop();
+ virtual void pause();
+ virtual bool isPlaying() const;
+ virtual void setMediaTime(double);
// render methods
commit 81e98150cc04ad764abc668dc12b91d3de90369e
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date: Mon Apr 14 12:14:48 2014 +0200
Slideshow: Fix regression related to media animations
Misc effects tab page animations were lost.
Regression from
9695f38ca4ab26b40524f2eade98c45f0360131d.
Change-Id: I81f7321d7dd87f5b0f6b4acbecbd60241ab1e430
diff --git a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
index c56f938..97d7aaa 100644
--- a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
@@ -570,7 +570,7 @@ CustomAnimationCreateTabPage* CustomAnimationCreateDialog::getCurrentPage() cons
{
sal_Int16 curPageId = mpTabControl->GetCurPageId();
- for( sal_uInt16 i = ENTRANCE; i <= MOTIONPATH; i++ )
+ for( sal_uInt16 i = ENTRANCE; i <= MISCEFFECTS; i++ )
{
if( mpTabPages[i]->getId() == curPageId )
return mpTabPages[i];
More information about the Libreoffice-commits
mailing list