[Libreoffice-commits] .: sdext/Library_presenter.mk sdext/source unusedcode.easy

Matus Kukan mkukan at kemper.freedesktop.org
Sat Apr 14 10:42:22 PDT 2012


 sdext/Library_presenter.mk                        |    2 
 sdext/source/presenter/PresenterAnimation.cxx     |   75 -----------
 sdext/source/presenter/PresenterAnimation.hxx     |  110 -----------------
 sdext/source/presenter/PresenterAnimator.cxx      |  139 ----------------------
 sdext/source/presenter/PresenterAnimator.hxx      |   69 ----------
 sdext/source/presenter/PresenterController.cxx    |    3 
 sdext/source/presenter/PresenterController.hxx    |    2 
 sdext/source/presenter/PresenterWindowManager.cxx |    2 
 unusedcode.easy                                   |    1 
 9 files changed, 403 deletions(-)

New commits:
commit 2d0e58e1fca4d098ecea1a3b0c0fe1447da99855
Author: Matúš Kukan <matus.kukan at gmail.com>
Date:   Sat Apr 14 16:21:40 2012 +0200

    unusedcode: PresenterAnimation and PresenterAnimator

diff --git a/sdext/Library_presenter.mk b/sdext/Library_presenter.mk
index 7cefb48..c6232de 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 b5c30ec..0000000
--- 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 8c2ce42..0000000
--- 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 a401c2a..0000000
--- 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 2ee3522..0000000
--- 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 46960c9..95fa288 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 8b53342..c19d23a 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 ee6490d..730d018 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"
diff --git a/unusedcode.easy b/unusedcode.easy
index 724d26e..1bafd51 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -774,7 +774,6 @@ sd::ViewShellBase::RegisterFactory(unsigned short)
 sd::slidesorter::controller::SelectionFunction::EventDescriptor::EventDescriptor(KeyEvent const&, sd::slidesorter::SlideSorter&)
 sd::slidesorter::view::Button::IsDown() const
 sd::slidesorter::view::FontProvider::GetFont(OutputDevice const&)
-sdext::presenter::PresenterAnimation::PresenterAnimation(unsigned long, unsigned long, unsigned long)
 sdr::animation::Scheduler::Reset(unsigned int)
 sdr::contact::ViewContactOfPageObj::GetReferencedPage() const
 sdr::contact::ViewContactOfSdrMediaObj::hasPreferredSize() const


More information about the Libreoffice-commits mailing list