summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@gmail.com>2012-04-14 16:21:40 +0200
committerMatúš Kukan <matus.kukan@gmail.com>2012-04-14 19:41:07 +0200
commit2d0e58e1fca4d098ecea1a3b0c0fe1447da99855 (patch)
tree2a04a980952a4de286c3d2ceac2178866f13362a /sdext
parent3a603d376a2bc2b839be3b89a8ecf8df1c42260b (diff)
unusedcode: PresenterAnimation and PresenterAnimator
Diffstat (limited to 'sdext')
-rw-r--r--sdext/Library_presenter.mk2
-rw-r--r--sdext/source/presenter/PresenterAnimation.cxx75
-rw-r--r--sdext/source/presenter/PresenterAnimation.hxx110
-rw-r--r--sdext/source/presenter/PresenterAnimator.cxx139
-rw-r--r--sdext/source/presenter/PresenterAnimator.hxx69
-rw-r--r--sdext/source/presenter/PresenterController.cxx3
-rw-r--r--sdext/source/presenter/PresenterController.hxx2
-rw-r--r--sdext/source/presenter/PresenterWindowManager.cxx2
8 files changed, 0 insertions, 402 deletions
diff --git a/sdext/Library_presenter.mk b/sdext/Library_presenter.mk
index 7cefb48fb395..c6232deaf722 100644
--- a/sdext/Library_presenter.mk
+++ b/sdext/Library_presenter.mk
@@ -44,8 +44,6 @@ $(eval $(call gb_Library_use_libraries,PresenterScreen,\
$(eval $(call gb_Library_add_exception_objects,PresenterScreen,\
sdext/source/presenter/PresenterAccessibility \
- sdext/source/presenter/PresenterAnimation \
- sdext/source/presenter/PresenterAnimator \
sdext/source/presenter/PresenterBitmapContainer \
sdext/source/presenter/PresenterButton \
sdext/source/presenter/PresenterCanvasHelper \
diff --git a/sdext/source/presenter/PresenterAnimation.cxx b/sdext/source/presenter/PresenterAnimation.cxx
deleted file mode 100644
index b5c30ec64d9f..000000000000
--- a/sdext/source/presenter/PresenterAnimation.cxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "PresenterAnimation.hxx"
-
-#include <osl/time.h>
-
-namespace sdext { namespace presenter {
-
-sal_uInt64 GetCurrentTime (void)
-{
- TimeValue aTimeValue;
- if (osl_getSystemTime(&aTimeValue))
- return sal_uInt64(aTimeValue.Seconds * 1000.0 + aTimeValue.Nanosec / 1000000.0);
- else
- return 0;
-}
-
-PresenterAnimation::PresenterAnimation (
- const sal_uInt64 nStartDelay,
- const sal_uInt64 nTotalDuration,
- const sal_uInt64 nStepDuration)
- : mnStartTime(GetCurrentTime()+nStartDelay),
- mnTotalDuration(nTotalDuration),
- mnStepDuration(nStepDuration)
-{
-}
-
-PresenterAnimation::~PresenterAnimation (void)
-{
-}
-
-sal_uInt64 PresenterAnimation::GetStartTime (void)
-{
- return mnStartTime;
-}
-
-sal_uInt64 PresenterAnimation::GetEndTime (void)
-{
- return mnStartTime + mnTotalDuration;
-}
-
-sal_uInt64 PresenterAnimation::GetStepDuration (void)
-{
- return mnStepDuration;
-}
-
-} } // end of namespace ::sdext::presenter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sdext/source/presenter/PresenterAnimation.hxx b/sdext/source/presenter/PresenterAnimation.hxx
deleted file mode 100644
index 8c2ce42bef34..000000000000
--- a/sdext/source/presenter/PresenterAnimation.hxx
+++ /dev/null
@@ -1,110 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef SDEXT_PRESENTER_ANIMATION_HXX
-#define SDEXT_PRESENTER_ANIMATION_HXX
-
-#include <sal/types.h>
-#include <boost/function.hpp>
-#include <boost/noncopyable.hpp>
-#include <boost/scoped_ptr.hpp>
-#include <boost/shared_ptr.hpp>
-#include <vector>
-
-namespace sdext { namespace presenter {
-
-/** Base class for animations handled by a PresenterAnimator object.
- A PresenterAnimation objects basically states when it wants to be
- started, how long it runs, and in what steps it wants to be called back
- while running.
- When a PresenterAnimation object is active/running its Run() method is
- called back with increasing values between 0 and 1.
-*/
-class PresenterAnimation
- : private ::boost::noncopyable
-{
-public:
- /** Create a new PresenterAnimation object.
- @param nStartDelay
- The delay in ms (milliseconds) from this call until the new
- object is to be activated.
- @param nTotalDuration
- The duration in ms the Run() method is to be called with
- increasing values between 0 and 1.
- @param nStepDuration
- The duration between calls to Run(). This leads to approximately
- nTotalDuration/nStepDuration calls to Run(). The exact duration
- of each step may vary depending on system load an other influences.
- */
- PresenterAnimation (
- const sal_uInt64 nStartDelay,
- const sal_uInt64 nTotalDuration,
- const sal_uInt64 nStepDuration);
- virtual ~PresenterAnimation (void);
-
- /** Return the absolute start time in a system dependent format.
- At about this time the Run() method will be called with a value of 0.
- */
- sal_uInt64 GetStartTime (void);
-
- /** Return the absolute end time in a system dependent format.
- At about this time the Run() method will be called with a value of 1.
- */
- sal_uInt64 GetEndTime (void);
-
- /** Return the duration of each step in ms.
- */
- sal_uInt64 GetStepDuration (void);
-
- typedef ::boost::function<void(void)> Callback;
-
- /** Called with nProgress taking on values between 0 and 1.
- @param nProgress
- A value between 0 and 1.
- @param nCurrentTime
- Current time in a system dependent format.
- */
- virtual void Run (const double nProgress, const sal_uInt64 nCurrentTime) = 0;
-
-private:
- const sal_uInt64 mnStartTime;
- const sal_uInt64 mnTotalDuration;
- const sal_uInt64 mnStepDuration;
-};
-
-sal_uInt64 GetCurrentTime (void);
-inline sal_uInt32 GetSeconds (const sal_uInt64 nTime) { return sal_uInt32(nTime / 1000); }
-inline sal_uInt32 GetNanoSeconds (const sal_uInt64 nTime) { return sal_uInt32((nTime % 1000) * 1000000); }
-
-typedef ::boost::shared_ptr<PresenterAnimation> SharedPresenterAnimation;
-
-} } // end of namespace ::sdext::presenter
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sdext/source/presenter/PresenterAnimator.cxx b/sdext/source/presenter/PresenterAnimator.cxx
deleted file mode 100644
index a401c2a866c7..000000000000
--- a/sdext/source/presenter/PresenterAnimator.cxx
+++ /dev/null
@@ -1,139 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "PresenterAnimator.hxx"
-
-#include "PresenterTimer.hxx"
-#include <osl/diagnose.h>
-#include <osl/time.h>
-#include <salhelper/timer.hxx>
-#include <boost/bind.hpp>
-#include <boost/function.hpp>
-
-namespace sdext { namespace presenter {
-
-//===== PresenterAnimator =====================================================
-
-PresenterAnimator::PresenterAnimator (void)
- : maFutureAnimations(),
- maActiveAnimations(),
- mnCurrentTaskId(0),
- mnNextTime(0)
-{
-}
-
-PresenterAnimator::~PresenterAnimator (void)
-{
- PresenterTimer::CancelTask(mnCurrentTaskId);
-}
-
-void PresenterAnimator::Process (void)
-{
- ::osl::MutexGuard aGuard (m_aMutex);
-
- mnNextTime = 0;
-
- const sal_uInt64 nCurrentTime (GetCurrentTime());
-
- ActivateAnimations(nCurrentTime);
-
- while ( ! maActiveAnimations.empty())
- {
- sal_uInt64 nRequestedTime (maActiveAnimations.begin()->first);
- SharedPresenterAnimation pAnimation (maActiveAnimations.begin()->second);
-
- if (nRequestedTime > nCurrentTime)
- break;
-
- maActiveAnimations.erase(maActiveAnimations.begin());
-
- const double nTotalDuration (double(pAnimation->GetEndTime() - pAnimation->GetStartTime()));
- double nProgress (nTotalDuration > 0 ? (nCurrentTime - pAnimation->GetStartTime()) / nTotalDuration : 1);
- if (nProgress <= 0)
- nProgress = 0;
- else if (nProgress >= 1)
- nProgress = 1;
-
- OSL_TRACE("running animation step at %f (requested was %f) %f\n",
- nCurrentTime/1e6, nRequestedTime/1e6, nProgress);
- pAnimation->Run(nProgress, nCurrentTime);
-
- if (nCurrentTime < pAnimation->GetEndTime())
- maActiveAnimations.insert(
- AnimationList::value_type(
- nCurrentTime + pAnimation->GetStepDuration(),
- pAnimation));
- }
-
- ScheduleNextRun();
-}
-
-void PresenterAnimator::ActivateAnimations (const sal_uInt64 nCurrentTime)
-{
- while ( ! maFutureAnimations.empty()
- && maFutureAnimations.begin()->first <= nCurrentTime)
- {
- SharedPresenterAnimation pAnimation (maFutureAnimations.begin()->second);
- maActiveAnimations.insert(*maFutureAnimations.begin());
- maFutureAnimations.erase(maFutureAnimations.begin());
- }
-}
-
-void PresenterAnimator::ScheduleNextRun (void)
-{
- sal_uInt64 nStartTime (0);
-
- if ( ! maActiveAnimations.empty())
- {
- nStartTime = maActiveAnimations.begin()->first;
- if ( ! maFutureAnimations.empty())
- if (maFutureAnimations.begin()->first < nStartTime)
- nStartTime = maFutureAnimations.begin()->first;
- }
- else if ( ! maFutureAnimations.empty())
- nStartTime = maFutureAnimations.begin()->first;
-
- if (nStartTime > 0)
- ScheduleNextRun(nStartTime);
-}
-
-void PresenterAnimator::ScheduleNextRun (const sal_uInt64 nStartTime)
-{
- if (mnNextTime==0 || nStartTime<mnNextTime)
- {
- mnNextTime = nStartTime;
- ::salhelper::TTimeValue aTimeValue (GetSeconds(mnNextTime), GetNanoSeconds(mnNextTime));
- PresenterTimer::ScheduleSingleTaskAbsolute (
- ::boost::bind(&PresenterAnimator::Process, this),
- aTimeValue);
- }
-}
-
-} } // end of namespace ::sdext::presenter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sdext/source/presenter/PresenterAnimator.hxx b/sdext/source/presenter/PresenterAnimator.hxx
deleted file mode 100644
index 2ee352271aef..000000000000
--- a/sdext/source/presenter/PresenterAnimator.hxx
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef SDEXT_PRESENTER_ANIMATOR_HXX
-#define SDEXT_PRESENTER_ANIMATOR_HXX
-
-#include "PresenterAnimation.hxx"
-#include <cppuhelper/basemutex.hxx>
-#include <map>
-#include <boost/noncopyable.hpp>
-#include <boost/scoped_ptr.hpp>
-
-namespace sdext { namespace presenter {
-
-/** Simple animation management. See PresenterAnimation for details of
- how to specify animations.
-*/
-class PresenterAnimator
- : private ::boost::noncopyable,
- private ::cppu::BaseMutex
-{
-public:
- PresenterAnimator (void);
- virtual ~PresenterAnimator (void);
-
-private:
- typedef ::std::multimap<sal_uInt64,SharedPresenterAnimation> AnimationList;
- AnimationList maFutureAnimations;
- AnimationList maActiveAnimations;
- sal_Int32 mnCurrentTaskId;
- sal_uInt64 mnNextTime;
-
- void Process (void);
- void ActivateAnimations (const sal_uInt64 nCurrentTime);
- void ScheduleNextRun (void);
- void ScheduleNextRun (const sal_uInt64 nStartTime);
-
-};
-
-} } // end of namespace ::sdext::presenter
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx
index 46960c958376..95fa2887712d 100644
--- a/sdext/source/presenter/PresenterController.cxx
+++ b/sdext/source/presenter/PresenterController.cxx
@@ -29,7 +29,6 @@
#include "PresenterController.hxx"
#include "PresenterAccessibility.hxx"
-#include "PresenterAnimator.hxx"
#include "PresenterCanvasHelper.hxx"
#include "PresenterCurrentSlideObserver.hxx"
#include "PresenterFrameworkObserver.hxx"
@@ -118,7 +117,6 @@ PresenterController::PresenterController (
mpTheme(),
mxMainWindow(),
mpPaneBorderPainter(),
- mpAnimator(new PresenterAnimator()),
mpCanvasHelper(new PresenterCanvasHelper()),
mxPresenterHelper(),
mpPaintManager(),
@@ -254,7 +252,6 @@ void PresenterController::disposing (void)
if (xComponent.is())
xComponent->dispose();
}
- mpAnimator.reset();
mpCanvasHelper.reset();
{
Reference<lang::XComponent> xComponent (mxPresenterHelper, UNO_QUERY);
diff --git a/sdext/source/presenter/PresenterController.hxx b/sdext/source/presenter/PresenterController.hxx
index 8b533420ddae..c19d23a2af15 100644
--- a/sdext/source/presenter/PresenterController.hxx
+++ b/sdext/source/presenter/PresenterController.hxx
@@ -63,7 +63,6 @@ namespace css = ::com::sun::star;
namespace sdext { namespace presenter {
-class PresenterAnimator;
class PresenterCanvasHelper;
class PresenterPaintManager;
class PresenterPaneAnimator;
@@ -224,7 +223,6 @@ private:
::boost::shared_ptr<PresenterTheme> mpTheme;
css::uno::Reference<css::awt::XWindow> mxMainWindow;
::rtl::Reference<PresenterPaneBorderPainter> mpPaneBorderPainter;
- ::boost::shared_ptr<PresenterAnimator> mpAnimator;
::boost::shared_ptr<PresenterCanvasHelper> mpCanvasHelper;
css::uno::Reference<css::drawing::XPresenterHelper> mxPresenterHelper;
::boost::shared_ptr<PresenterPaintManager> mpPaintManager;
diff --git a/sdext/source/presenter/PresenterWindowManager.cxx b/sdext/source/presenter/PresenterWindowManager.cxx
index ee6490df89ed..730d018e4485 100644
--- a/sdext/source/presenter/PresenterWindowManager.cxx
+++ b/sdext/source/presenter/PresenterWindowManager.cxx
@@ -30,8 +30,6 @@
//#define ENABLE_PANE_RESIZING
#include "PresenterWindowManager.hxx"
-#include "PresenterAnimation.hxx"
-#include "PresenterAnimator.hxx"
#include "PresenterController.hxx"
#include "PresenterGeometryHelper.hxx"
#include "PresenterHelper.hxx"