2004-03-18 09:44:39 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 23:25:08 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2004-03-18 09:44:39 +00:00
|
|
|
*
|
2008-04-10 23:25:08 +00:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2004-03-18 09:44:39 +00:00
|
|
|
*
|
2008-04-10 23:25:08 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2004-03-18 09:44:39 +00:00
|
|
|
*
|
2008-04-10 23:25:08 +00:00
|
|
|
* $RCSfile: eventqueue.cxx,v $
|
2008-06-24 11:02:19 +00:00
|
|
|
* $Revision: 1.15 $
|
2004-03-18 09:44:39 +00:00
|
|
|
*
|
2008-04-10 23:25:08 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2004-03-18 09:44:39 +00:00
|
|
|
*
|
2008-04-10 23:25:08 +00:00
|
|
|
* 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.
|
2004-03-18 09:44:39 +00:00
|
|
|
*
|
2008-04-10 23:25:08 +00:00
|
|
|
* 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).
|
2004-03-18 09:44:39 +00:00
|
|
|
*
|
2008-04-10 23:25:08 +00:00
|
|
|
* 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.
|
2004-03-18 09:44:39 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-17 07:25:30 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_slideshow.hxx"
|
|
|
|
|
2004-11-26 17:53:02 +00:00
|
|
|
// must be first
|
|
|
|
#include <canvas/debug.hxx>
|
2008-06-24 11:02:19 +00:00
|
|
|
#include <tools/diagnose_ex.h>
|
2004-03-18 09:44:39 +00:00
|
|
|
#include <canvas/verbosetrace.hxx>
|
2006-12-13 14:15:23 +00:00
|
|
|
|
2005-03-30 06:54:16 +00:00
|
|
|
#include <comphelper/anytostring.hxx>
|
|
|
|
#include <cppuhelper/exc_hlp.hxx>
|
|
|
|
|
|
|
|
#include <event.hxx>
|
|
|
|
#include <eventqueue.hxx>
|
|
|
|
#include <slideshowexceptions.hxx>
|
2004-03-18 09:44:39 +00:00
|
|
|
|
2004-09-08 15:36:05 +00:00
|
|
|
#include <boost/shared_ptr.hpp>
|
2004-11-26 17:53:02 +00:00
|
|
|
#include <limits>
|
|
|
|
|
2004-03-18 09:44:39 +00:00
|
|
|
|
2004-11-26 17:53:02 +00:00
|
|
|
using namespace ::com::sun::star;
|
2004-03-18 09:44:39 +00:00
|
|
|
|
2006-12-13 14:15:23 +00:00
|
|
|
namespace slideshow
|
2004-03-18 09:44:39 +00:00
|
|
|
{
|
|
|
|
namespace internal
|
|
|
|
{
|
|
|
|
bool EventQueue::EventEntry::operator<( const EventEntry& rEvent ) const
|
|
|
|
{
|
|
|
|
// negate comparison, we want priority queue to be sorted
|
|
|
|
// in increasing order of activation times
|
|
|
|
return this->nTime > rEvent.nTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-10 12:41:56 +00:00
|
|
|
EventQueue::EventQueue(
|
|
|
|
boost::shared_ptr<canvas::tools::ElapsedTime> const & pPresTimer )
|
INTEGRATION: CWS presfixes12 (1.12.12); FILE MERGED
2007/02/25 01:10:23 thb 1.12.12.3: #i37778# Cleared up error handling a lot: no longer quenching RuntimeExceptions; reporting assertions in the debug case; ViewLayer now reports resized sprite (which needs re-render from all shapes); fixed missing subset area reduction for glyph-level animations; added return of resize state from Layer::commitLayerBounds(); adapted unit tests to corrected behaviour
2007/02/06 17:18:03 thb 1.12.12.2: #i37778# Moved clear() method from View to ViewLayer (also sprites need to be cleared); fixed a few more cases of local code style violations; removed redundant inline keywords; finished Layer/LayerManager rework (Layer now represents ViewLayers, shapes and rendering are fully under LayerManager control); made shape comparator reusable
2007/01/29 14:01:53 thb 1.12.12.1: Issue number: #i37778#
Larger slideshow refactoring. Wrote design and coding style manifest,
and adapted the code to actually conform to this. In detail:
- cleaned up ownership/disposable/weak_ptr story. removed hacks and
explicit Disposable implementations, where workaround were available
- removed object mutices, where superfluous
- reworked EventMultiplexer (using templatized listener class now), added
more events. EventMultiplexer now serves as a true blackboard
- reworked directory structure: disjunct parts are now physically separated
into directories, instantiation happens via factories & abstract interfaces
- added CursorManager, to make setting mouse cursor less hackish
- reworked DrawShape, to implement SeparateListener pattern
- reworked IntrinsicAnimationActivity, to avoid cyclic references
- modified hyperlink & shape cursor handling to communicate via
EventMultiplexer
- renamed & cleaned up files (presentation.cxx now named slideshowimpl.cxx,
etc.)
- added first version of the z-order fix to layer/layermanager
- cleaned up include guards and include syntax
2007-07-17 13:36:13 +00:00
|
|
|
: maMutex(),
|
|
|
|
maEvents(),
|
2006-07-26 06:25:33 +00:00
|
|
|
maNextEvents(),
|
2005-03-10 12:41:56 +00:00
|
|
|
mpTimer( pPresTimer )
|
2004-03-18 09:44:39 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2004-11-26 17:53:02 +00:00
|
|
|
EventQueue::~EventQueue()
|
|
|
|
{
|
2006-07-26 06:25:33 +00:00
|
|
|
// add in all that have been added explicitly for this round:
|
|
|
|
EventEntryVector::const_iterator const iEnd( maNextEvents.end() );
|
|
|
|
for ( EventEntryVector::const_iterator iPos( maNextEvents.begin() );
|
INTEGRATION: CWS presfixes12 (1.12.12); FILE MERGED
2007/02/25 01:10:23 thb 1.12.12.3: #i37778# Cleared up error handling a lot: no longer quenching RuntimeExceptions; reporting assertions in the debug case; ViewLayer now reports resized sprite (which needs re-render from all shapes); fixed missing subset area reduction for glyph-level animations; added return of resize state from Layer::commitLayerBounds(); adapted unit tests to corrected behaviour
2007/02/06 17:18:03 thb 1.12.12.2: #i37778# Moved clear() method from View to ViewLayer (also sprites need to be cleared); fixed a few more cases of local code style violations; removed redundant inline keywords; finished Layer/LayerManager rework (Layer now represents ViewLayers, shapes and rendering are fully under LayerManager control); made shape comparator reusable
2007/01/29 14:01:53 thb 1.12.12.1: Issue number: #i37778#
Larger slideshow refactoring. Wrote design and coding style manifest,
and adapted the code to actually conform to this. In detail:
- cleaned up ownership/disposable/weak_ptr story. removed hacks and
explicit Disposable implementations, where workaround were available
- removed object mutices, where superfluous
- reworked EventMultiplexer (using templatized listener class now), added
more events. EventMultiplexer now serves as a true blackboard
- reworked directory structure: disjunct parts are now physically separated
into directories, instantiation happens via factories & abstract interfaces
- added CursorManager, to make setting mouse cursor less hackish
- reworked DrawShape, to implement SeparateListener pattern
- reworked IntrinsicAnimationActivity, to avoid cyclic references
- modified hyperlink & shape cursor handling to communicate via
EventMultiplexer
- renamed & cleaned up files (presentation.cxx now named slideshowimpl.cxx,
etc.)
- added first version of the z-order fix to layer/layermanager
- cleaned up include guards and include syntax
2007-07-17 13:36:13 +00:00
|
|
|
iPos != iEnd; ++iPos )
|
|
|
|
{
|
2006-07-26 06:25:33 +00:00
|
|
|
maEvents.push(*iPos);
|
|
|
|
}
|
|
|
|
EventEntryVector().swap( maNextEvents );
|
|
|
|
|
2004-11-26 17:53:02 +00:00
|
|
|
// dispose event queue
|
|
|
|
while( !maEvents.empty() )
|
|
|
|
{
|
INTEGRATION: CWS presfixes12 (1.12.12); FILE MERGED
2007/02/25 01:10:23 thb 1.12.12.3: #i37778# Cleared up error handling a lot: no longer quenching RuntimeExceptions; reporting assertions in the debug case; ViewLayer now reports resized sprite (which needs re-render from all shapes); fixed missing subset area reduction for glyph-level animations; added return of resize state from Layer::commitLayerBounds(); adapted unit tests to corrected behaviour
2007/02/06 17:18:03 thb 1.12.12.2: #i37778# Moved clear() method from View to ViewLayer (also sprites need to be cleared); fixed a few more cases of local code style violations; removed redundant inline keywords; finished Layer/LayerManager rework (Layer now represents ViewLayers, shapes and rendering are fully under LayerManager control); made shape comparator reusable
2007/01/29 14:01:53 thb 1.12.12.1: Issue number: #i37778#
Larger slideshow refactoring. Wrote design and coding style manifest,
and adapted the code to actually conform to this. In detail:
- cleaned up ownership/disposable/weak_ptr story. removed hacks and
explicit Disposable implementations, where workaround were available
- removed object mutices, where superfluous
- reworked EventMultiplexer (using templatized listener class now), added
more events. EventMultiplexer now serves as a true blackboard
- reworked directory structure: disjunct parts are now physically separated
into directories, instantiation happens via factories & abstract interfaces
- added CursorManager, to make setting mouse cursor less hackish
- reworked DrawShape, to implement SeparateListener pattern
- reworked IntrinsicAnimationActivity, to avoid cyclic references
- modified hyperlink & shape cursor handling to communicate via
EventMultiplexer
- renamed & cleaned up files (presentation.cxx now named slideshowimpl.cxx,
etc.)
- added first version of the z-order fix to layer/layermanager
- cleaned up include guards and include syntax
2007-07-17 13:36:13 +00:00
|
|
|
try
|
|
|
|
{
|
2005-03-30 06:54:16 +00:00
|
|
|
maEvents.top().pEvent->dispose();
|
|
|
|
}
|
INTEGRATION: CWS presfixes12 (1.12.12); FILE MERGED
2007/02/25 01:10:23 thb 1.12.12.3: #i37778# Cleared up error handling a lot: no longer quenching RuntimeExceptions; reporting assertions in the debug case; ViewLayer now reports resized sprite (which needs re-render from all shapes); fixed missing subset area reduction for glyph-level animations; added return of resize state from Layer::commitLayerBounds(); adapted unit tests to corrected behaviour
2007/02/06 17:18:03 thb 1.12.12.2: #i37778# Moved clear() method from View to ViewLayer (also sprites need to be cleared); fixed a few more cases of local code style violations; removed redundant inline keywords; finished Layer/LayerManager rework (Layer now represents ViewLayers, shapes and rendering are fully under LayerManager control); made shape comparator reusable
2007/01/29 14:01:53 thb 1.12.12.1: Issue number: #i37778#
Larger slideshow refactoring. Wrote design and coding style manifest,
and adapted the code to actually conform to this. In detail:
- cleaned up ownership/disposable/weak_ptr story. removed hacks and
explicit Disposable implementations, where workaround were available
- removed object mutices, where superfluous
- reworked EventMultiplexer (using templatized listener class now), added
more events. EventMultiplexer now serves as a true blackboard
- reworked directory structure: disjunct parts are now physically separated
into directories, instantiation happens via factories & abstract interfaces
- added CursorManager, to make setting mouse cursor less hackish
- reworked DrawShape, to implement SeparateListener pattern
- reworked IntrinsicAnimationActivity, to avoid cyclic references
- modified hyperlink & shape cursor handling to communicate via
EventMultiplexer
- renamed & cleaned up files (presentation.cxx now named slideshowimpl.cxx,
etc.)
- added first version of the z-order fix to layer/layermanager
- cleaned up include guards and include syntax
2007-07-17 13:36:13 +00:00
|
|
|
catch (uno::Exception &)
|
|
|
|
{
|
2005-03-30 06:54:16 +00:00
|
|
|
OSL_ENSURE( false, rtl::OUStringToOString(
|
|
|
|
comphelper::anyToString(
|
|
|
|
cppu::getCaughtException() ),
|
|
|
|
RTL_TEXTENCODING_UTF8 ).getStr() );
|
|
|
|
}
|
2004-11-26 17:53:02 +00:00
|
|
|
maEvents.pop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-03-18 09:44:39 +00:00
|
|
|
bool EventQueue::addEvent( const EventSharedPtr& rEvent )
|
|
|
|
{
|
INTEGRATION: CWS presfixes12 (1.12.12); FILE MERGED
2007/02/25 01:10:23 thb 1.12.12.3: #i37778# Cleared up error handling a lot: no longer quenching RuntimeExceptions; reporting assertions in the debug case; ViewLayer now reports resized sprite (which needs re-render from all shapes); fixed missing subset area reduction for glyph-level animations; added return of resize state from Layer::commitLayerBounds(); adapted unit tests to corrected behaviour
2007/02/06 17:18:03 thb 1.12.12.2: #i37778# Moved clear() method from View to ViewLayer (also sprites need to be cleared); fixed a few more cases of local code style violations; removed redundant inline keywords; finished Layer/LayerManager rework (Layer now represents ViewLayers, shapes and rendering are fully under LayerManager control); made shape comparator reusable
2007/01/29 14:01:53 thb 1.12.12.1: Issue number: #i37778#
Larger slideshow refactoring. Wrote design and coding style manifest,
and adapted the code to actually conform to this. In detail:
- cleaned up ownership/disposable/weak_ptr story. removed hacks and
explicit Disposable implementations, where workaround were available
- removed object mutices, where superfluous
- reworked EventMultiplexer (using templatized listener class now), added
more events. EventMultiplexer now serves as a true blackboard
- reworked directory structure: disjunct parts are now physically separated
into directories, instantiation happens via factories & abstract interfaces
- added CursorManager, to make setting mouse cursor less hackish
- reworked DrawShape, to implement SeparateListener pattern
- reworked IntrinsicAnimationActivity, to avoid cyclic references
- modified hyperlink & shape cursor handling to communicate via
EventMultiplexer
- renamed & cleaned up files (presentation.cxx now named slideshowimpl.cxx,
etc.)
- added first version of the z-order fix to layer/layermanager
- cleaned up include guards and include syntax
2007-07-17 13:36:13 +00:00
|
|
|
::osl::MutexGuard aGuard( maMutex );
|
|
|
|
|
2008-06-24 11:02:19 +00:00
|
|
|
ENSURE_OR_RETURN( rEvent,
|
2005-04-22 12:28:48 +00:00
|
|
|
"EventQueue::addEvent: event ptr NULL" );
|
2004-03-18 09:44:39 +00:00
|
|
|
|
|
|
|
// prepare entry
|
2004-11-26 17:53:02 +00:00
|
|
|
|
|
|
|
// A seemingly obvious optimization cannot be used here,
|
|
|
|
// because it breaks assumed order of notification: zero
|
|
|
|
// timeout events could be fired() immediately, but that
|
|
|
|
// would not unwind the stack and furthermore changes
|
|
|
|
// order of notification
|
2004-03-18 09:44:39 +00:00
|
|
|
|
|
|
|
// add entry
|
2006-07-26 06:25:33 +00:00
|
|
|
maEvents.push( EventEntry( rEvent, rEvent->getActivationTime(
|
|
|
|
mpTimer->getElapsedTime()) ) );
|
|
|
|
return true;
|
|
|
|
}
|
2004-03-18 09:44:39 +00:00
|
|
|
|
2006-07-26 06:25:33 +00:00
|
|
|
bool EventQueue::addEventForNextRound( EventSharedPtr const& rEvent )
|
|
|
|
{
|
INTEGRATION: CWS presfixes12 (1.12.12); FILE MERGED
2007/02/25 01:10:23 thb 1.12.12.3: #i37778# Cleared up error handling a lot: no longer quenching RuntimeExceptions; reporting assertions in the debug case; ViewLayer now reports resized sprite (which needs re-render from all shapes); fixed missing subset area reduction for glyph-level animations; added return of resize state from Layer::commitLayerBounds(); adapted unit tests to corrected behaviour
2007/02/06 17:18:03 thb 1.12.12.2: #i37778# Moved clear() method from View to ViewLayer (also sprites need to be cleared); fixed a few more cases of local code style violations; removed redundant inline keywords; finished Layer/LayerManager rework (Layer now represents ViewLayers, shapes and rendering are fully under LayerManager control); made shape comparator reusable
2007/01/29 14:01:53 thb 1.12.12.1: Issue number: #i37778#
Larger slideshow refactoring. Wrote design and coding style manifest,
and adapted the code to actually conform to this. In detail:
- cleaned up ownership/disposable/weak_ptr story. removed hacks and
explicit Disposable implementations, where workaround were available
- removed object mutices, where superfluous
- reworked EventMultiplexer (using templatized listener class now), added
more events. EventMultiplexer now serves as a true blackboard
- reworked directory structure: disjunct parts are now physically separated
into directories, instantiation happens via factories & abstract interfaces
- added CursorManager, to make setting mouse cursor less hackish
- reworked DrawShape, to implement SeparateListener pattern
- reworked IntrinsicAnimationActivity, to avoid cyclic references
- modified hyperlink & shape cursor handling to communicate via
EventMultiplexer
- renamed & cleaned up files (presentation.cxx now named slideshowimpl.cxx,
etc.)
- added first version of the z-order fix to layer/layermanager
- cleaned up include guards and include syntax
2007-07-17 13:36:13 +00:00
|
|
|
::osl::MutexGuard aGuard( maMutex );
|
|
|
|
|
2008-06-24 11:02:19 +00:00
|
|
|
ENSURE_OR_RETURN( rEvent.get() != NULL,
|
2006-07-26 06:25:33 +00:00
|
|
|
"EventQueue::addEvent: event ptr NULL" );
|
|
|
|
maNextEvents.push_back(
|
|
|
|
EventEntry( rEvent, rEvent->getActivationTime(
|
|
|
|
mpTimer->getElapsedTime()) ) );
|
2004-03-18 09:44:39 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2006-07-26 06:25:33 +00:00
|
|
|
void EventQueue::forceEmpty()
|
|
|
|
{
|
INTEGRATION: CWS presfixes12 (1.12.12); FILE MERGED
2007/02/25 01:10:23 thb 1.12.12.3: #i37778# Cleared up error handling a lot: no longer quenching RuntimeExceptions; reporting assertions in the debug case; ViewLayer now reports resized sprite (which needs re-render from all shapes); fixed missing subset area reduction for glyph-level animations; added return of resize state from Layer::commitLayerBounds(); adapted unit tests to corrected behaviour
2007/02/06 17:18:03 thb 1.12.12.2: #i37778# Moved clear() method from View to ViewLayer (also sprites need to be cleared); fixed a few more cases of local code style violations; removed redundant inline keywords; finished Layer/LayerManager rework (Layer now represents ViewLayers, shapes and rendering are fully under LayerManager control); made shape comparator reusable
2007/01/29 14:01:53 thb 1.12.12.1: Issue number: #i37778#
Larger slideshow refactoring. Wrote design and coding style manifest,
and adapted the code to actually conform to this. In detail:
- cleaned up ownership/disposable/weak_ptr story. removed hacks and
explicit Disposable implementations, where workaround were available
- removed object mutices, where superfluous
- reworked EventMultiplexer (using templatized listener class now), added
more events. EventMultiplexer now serves as a true blackboard
- reworked directory structure: disjunct parts are now physically separated
into directories, instantiation happens via factories & abstract interfaces
- added CursorManager, to make setting mouse cursor less hackish
- reworked DrawShape, to implement SeparateListener pattern
- reworked IntrinsicAnimationActivity, to avoid cyclic references
- modified hyperlink & shape cursor handling to communicate via
EventMultiplexer
- renamed & cleaned up files (presentation.cxx now named slideshowimpl.cxx,
etc.)
- added first version of the z-order fix to layer/layermanager
- cleaned up include guards and include syntax
2007-07-17 13:36:13 +00:00
|
|
|
::osl::MutexGuard aGuard( maMutex );
|
|
|
|
|
2006-07-26 06:25:33 +00:00
|
|
|
process_(true);
|
|
|
|
}
|
|
|
|
|
2006-02-09 13:48:22 +00:00
|
|
|
void EventQueue::process()
|
2006-07-26 06:25:33 +00:00
|
|
|
{
|
INTEGRATION: CWS presfixes12 (1.12.12); FILE MERGED
2007/02/25 01:10:23 thb 1.12.12.3: #i37778# Cleared up error handling a lot: no longer quenching RuntimeExceptions; reporting assertions in the debug case; ViewLayer now reports resized sprite (which needs re-render from all shapes); fixed missing subset area reduction for glyph-level animations; added return of resize state from Layer::commitLayerBounds(); adapted unit tests to corrected behaviour
2007/02/06 17:18:03 thb 1.12.12.2: #i37778# Moved clear() method from View to ViewLayer (also sprites need to be cleared); fixed a few more cases of local code style violations; removed redundant inline keywords; finished Layer/LayerManager rework (Layer now represents ViewLayers, shapes and rendering are fully under LayerManager control); made shape comparator reusable
2007/01/29 14:01:53 thb 1.12.12.1: Issue number: #i37778#
Larger slideshow refactoring. Wrote design and coding style manifest,
and adapted the code to actually conform to this. In detail:
- cleaned up ownership/disposable/weak_ptr story. removed hacks and
explicit Disposable implementations, where workaround were available
- removed object mutices, where superfluous
- reworked EventMultiplexer (using templatized listener class now), added
more events. EventMultiplexer now serves as a true blackboard
- reworked directory structure: disjunct parts are now physically separated
into directories, instantiation happens via factories & abstract interfaces
- added CursorManager, to make setting mouse cursor less hackish
- reworked DrawShape, to implement SeparateListener pattern
- reworked IntrinsicAnimationActivity, to avoid cyclic references
- modified hyperlink & shape cursor handling to communicate via
EventMultiplexer
- renamed & cleaned up files (presentation.cxx now named slideshowimpl.cxx,
etc.)
- added first version of the z-order fix to layer/layermanager
- cleaned up include guards and include syntax
2007-07-17 13:36:13 +00:00
|
|
|
::osl::MutexGuard aGuard( maMutex );
|
|
|
|
|
2006-07-26 06:25:33 +00:00
|
|
|
process_(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
void EventQueue::process_( bool bFireAllEvents )
|
2004-03-18 09:44:39 +00:00
|
|
|
{
|
|
|
|
VERBOSE_TRACE( "EventQueue: heartbeat" );
|
|
|
|
|
2006-07-26 06:25:33 +00:00
|
|
|
// add in all that have been added explicitly for this round:
|
|
|
|
EventEntryVector::const_iterator const iEnd( maNextEvents.end() );
|
|
|
|
for ( EventEntryVector::const_iterator iPos( maNextEvents.begin() );
|
|
|
|
iPos != iEnd; ++iPos ) {
|
|
|
|
maEvents.push(*iPos);
|
|
|
|
}
|
|
|
|
EventEntryVector().swap( maNextEvents );
|
|
|
|
|
2004-03-18 09:44:39 +00:00
|
|
|
// perform topmost, ready-to-execute event
|
|
|
|
// =======================================
|
|
|
|
|
2005-03-10 12:41:56 +00:00
|
|
|
const double nCurrTime( mpTimer->getElapsedTime() );
|
2004-11-26 17:53:02 +00:00
|
|
|
|
|
|
|
// process ready/elapsed events. Note that the 'perceived'
|
|
|
|
// current time remains constant for this loop, thus we're
|
|
|
|
// processing only those events which where ready when we
|
|
|
|
// entered this method.
|
|
|
|
while( !maEvents.empty() &&
|
2006-07-26 06:25:33 +00:00
|
|
|
(bFireAllEvents || maEvents.top().nTime <= nCurrTime) )
|
2004-03-18 09:44:39 +00:00
|
|
|
{
|
|
|
|
EventEntry event( maEvents.top() );
|
|
|
|
maEvents.pop();
|
|
|
|
|
2005-04-22 12:28:48 +00:00
|
|
|
// only process event, if it is still 'charged',
|
|
|
|
// i.e. the fire() call effects something. This is
|
|
|
|
// used when e.g. having events registered at multiple
|
|
|
|
// places, which should fire only once: after the
|
|
|
|
// initial fire() call, those events become inactive
|
|
|
|
// and return false on isCharged. This frees us from
|
|
|
|
// the need to prune queues of those inactive shells.
|
|
|
|
if( event.pEvent->isCharged() )
|
2004-03-18 09:44:39 +00:00
|
|
|
{
|
2005-04-22 12:28:48 +00:00
|
|
|
try
|
|
|
|
{
|
2004-11-26 17:53:02 +00:00
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2005-04-22 12:28:48 +00:00
|
|
|
VERBOSE_TRACE( "Firing event: unknown (0x%X), timeout was: %f",
|
|
|
|
event.pEvent.get(),
|
|
|
|
event.pEvent->getActivationTime(0.0) );
|
2004-11-26 17:53:02 +00:00
|
|
|
#endif
|
|
|
|
|
2005-04-22 12:28:48 +00:00
|
|
|
event.pEvent->fire();
|
|
|
|
}
|
INTEGRATION: CWS presfixes12 (1.12.12); FILE MERGED
2007/02/25 01:10:23 thb 1.12.12.3: #i37778# Cleared up error handling a lot: no longer quenching RuntimeExceptions; reporting assertions in the debug case; ViewLayer now reports resized sprite (which needs re-render from all shapes); fixed missing subset area reduction for glyph-level animations; added return of resize state from Layer::commitLayerBounds(); adapted unit tests to corrected behaviour
2007/02/06 17:18:03 thb 1.12.12.2: #i37778# Moved clear() method from View to ViewLayer (also sprites need to be cleared); fixed a few more cases of local code style violations; removed redundant inline keywords; finished Layer/LayerManager rework (Layer now represents ViewLayers, shapes and rendering are fully under LayerManager control); made shape comparator reusable
2007/01/29 14:01:53 thb 1.12.12.1: Issue number: #i37778#
Larger slideshow refactoring. Wrote design and coding style manifest,
and adapted the code to actually conform to this. In detail:
- cleaned up ownership/disposable/weak_ptr story. removed hacks and
explicit Disposable implementations, where workaround were available
- removed object mutices, where superfluous
- reworked EventMultiplexer (using templatized listener class now), added
more events. EventMultiplexer now serves as a true blackboard
- reworked directory structure: disjunct parts are now physically separated
into directories, instantiation happens via factories & abstract interfaces
- added CursorManager, to make setting mouse cursor less hackish
- reworked DrawShape, to implement SeparateListener pattern
- reworked IntrinsicAnimationActivity, to avoid cyclic references
- modified hyperlink & shape cursor handling to communicate via
EventMultiplexer
- renamed & cleaned up files (presentation.cxx now named slideshowimpl.cxx,
etc.)
- added first version of the z-order fix to layer/layermanager
- cleaned up include guards and include syntax
2007-07-17 13:36:13 +00:00
|
|
|
catch( uno::RuntimeException& )
|
|
|
|
{
|
|
|
|
throw;
|
|
|
|
}
|
2005-04-22 12:28:48 +00:00
|
|
|
catch( uno::Exception& )
|
|
|
|
{
|
|
|
|
// catch anything here, we don't want
|
|
|
|
// to leave this scope under _any_
|
|
|
|
// circumstance. Although, do _not_
|
|
|
|
// reinsert an activity that threw
|
|
|
|
// once.
|
|
|
|
|
|
|
|
// NOTE: we explicitely don't catch(...) here,
|
|
|
|
// since this will also capture segmentation
|
|
|
|
// violations and the like. In such a case, we
|
|
|
|
// still better let our clients now...
|
INTEGRATION: CWS presfixes12 (1.12.12); FILE MERGED
2007/02/25 01:10:23 thb 1.12.12.3: #i37778# Cleared up error handling a lot: no longer quenching RuntimeExceptions; reporting assertions in the debug case; ViewLayer now reports resized sprite (which needs re-render from all shapes); fixed missing subset area reduction for glyph-level animations; added return of resize state from Layer::commitLayerBounds(); adapted unit tests to corrected behaviour
2007/02/06 17:18:03 thb 1.12.12.2: #i37778# Moved clear() method from View to ViewLayer (also sprites need to be cleared); fixed a few more cases of local code style violations; removed redundant inline keywords; finished Layer/LayerManager rework (Layer now represents ViewLayers, shapes and rendering are fully under LayerManager control); made shape comparator reusable
2007/01/29 14:01:53 thb 1.12.12.1: Issue number: #i37778#
Larger slideshow refactoring. Wrote design and coding style manifest,
and adapted the code to actually conform to this. In detail:
- cleaned up ownership/disposable/weak_ptr story. removed hacks and
explicit Disposable implementations, where workaround were available
- removed object mutices, where superfluous
- reworked EventMultiplexer (using templatized listener class now), added
more events. EventMultiplexer now serves as a true blackboard
- reworked directory structure: disjunct parts are now physically separated
into directories, instantiation happens via factories & abstract interfaces
- added CursorManager, to make setting mouse cursor less hackish
- reworked DrawShape, to implement SeparateListener pattern
- reworked IntrinsicAnimationActivity, to avoid cyclic references
- modified hyperlink & shape cursor handling to communicate via
EventMultiplexer
- renamed & cleaned up files (presentation.cxx now named slideshowimpl.cxx,
etc.)
- added first version of the z-order fix to layer/layermanager
- cleaned up include guards and include syntax
2007-07-17 13:36:13 +00:00
|
|
|
OSL_ENSURE( false,
|
|
|
|
rtl::OUStringToOString(
|
|
|
|
comphelper::anyToString( cppu::getCaughtException() ),
|
|
|
|
RTL_TEXTENCODING_UTF8 ).getStr() );
|
2005-04-22 12:28:48 +00:00
|
|
|
}
|
|
|
|
catch( SlideShowException& )
|
|
|
|
{
|
|
|
|
// catch anything here, we don't want
|
|
|
|
// to leave this scope under _any_
|
|
|
|
// circumstance. Although, do _not_
|
|
|
|
// reinsert an activity that threw
|
|
|
|
// once.
|
|
|
|
|
|
|
|
// NOTE: we explicitely don't catch(...) here,
|
|
|
|
// since this will also capture segmentation
|
|
|
|
// violations and the like. In such a case, we
|
|
|
|
// still better let our clients now...
|
|
|
|
OSL_TRACE( "::presentation::internal::EventQueue: Event threw a SlideShowException, action might not have been fully performed" );
|
|
|
|
}
|
2004-11-26 17:53:02 +00:00
|
|
|
}
|
2005-04-22 12:28:48 +00:00
|
|
|
else
|
2004-03-18 09:44:39 +00:00
|
|
|
{
|
2005-04-22 12:28:48 +00:00
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
|
|
|
VERBOSE_TRACE( "Ignoring discharged event: unknown (0x%X), timeout was: %f",
|
|
|
|
event.pEvent.get(),
|
|
|
|
event.pEvent->getActivationTime(0.0) );
|
|
|
|
#endif
|
2004-11-26 17:53:02 +00:00
|
|
|
}
|
|
|
|
}
|
2004-03-18 09:44:39 +00:00
|
|
|
}
|
|
|
|
|
2006-02-09 13:48:22 +00:00
|
|
|
bool EventQueue::isEmpty() const
|
2004-03-18 09:44:39 +00:00
|
|
|
{
|
INTEGRATION: CWS presfixes12 (1.12.12); FILE MERGED
2007/02/25 01:10:23 thb 1.12.12.3: #i37778# Cleared up error handling a lot: no longer quenching RuntimeExceptions; reporting assertions in the debug case; ViewLayer now reports resized sprite (which needs re-render from all shapes); fixed missing subset area reduction for glyph-level animations; added return of resize state from Layer::commitLayerBounds(); adapted unit tests to corrected behaviour
2007/02/06 17:18:03 thb 1.12.12.2: #i37778# Moved clear() method from View to ViewLayer (also sprites need to be cleared); fixed a few more cases of local code style violations; removed redundant inline keywords; finished Layer/LayerManager rework (Layer now represents ViewLayers, shapes and rendering are fully under LayerManager control); made shape comparator reusable
2007/01/29 14:01:53 thb 1.12.12.1: Issue number: #i37778#
Larger slideshow refactoring. Wrote design and coding style manifest,
and adapted the code to actually conform to this. In detail:
- cleaned up ownership/disposable/weak_ptr story. removed hacks and
explicit Disposable implementations, where workaround were available
- removed object mutices, where superfluous
- reworked EventMultiplexer (using templatized listener class now), added
more events. EventMultiplexer now serves as a true blackboard
- reworked directory structure: disjunct parts are now physically separated
into directories, instantiation happens via factories & abstract interfaces
- added CursorManager, to make setting mouse cursor less hackish
- reworked DrawShape, to implement SeparateListener pattern
- reworked IntrinsicAnimationActivity, to avoid cyclic references
- modified hyperlink & shape cursor handling to communicate via
EventMultiplexer
- renamed & cleaned up files (presentation.cxx now named slideshowimpl.cxx,
etc.)
- added first version of the z-order fix to layer/layermanager
- cleaned up include guards and include syntax
2007-07-17 13:36:13 +00:00
|
|
|
::osl::MutexGuard aGuard( maMutex );
|
|
|
|
|
2004-03-18 09:44:39 +00:00
|
|
|
return maEvents.empty();
|
|
|
|
}
|
|
|
|
|
2006-02-09 13:48:22 +00:00
|
|
|
double EventQueue::nextTimeout() const
|
|
|
|
{
|
INTEGRATION: CWS presfixes12 (1.12.12); FILE MERGED
2007/02/25 01:10:23 thb 1.12.12.3: #i37778# Cleared up error handling a lot: no longer quenching RuntimeExceptions; reporting assertions in the debug case; ViewLayer now reports resized sprite (which needs re-render from all shapes); fixed missing subset area reduction for glyph-level animations; added return of resize state from Layer::commitLayerBounds(); adapted unit tests to corrected behaviour
2007/02/06 17:18:03 thb 1.12.12.2: #i37778# Moved clear() method from View to ViewLayer (also sprites need to be cleared); fixed a few more cases of local code style violations; removed redundant inline keywords; finished Layer/LayerManager rework (Layer now represents ViewLayers, shapes and rendering are fully under LayerManager control); made shape comparator reusable
2007/01/29 14:01:53 thb 1.12.12.1: Issue number: #i37778#
Larger slideshow refactoring. Wrote design and coding style manifest,
and adapted the code to actually conform to this. In detail:
- cleaned up ownership/disposable/weak_ptr story. removed hacks and
explicit Disposable implementations, where workaround were available
- removed object mutices, where superfluous
- reworked EventMultiplexer (using templatized listener class now), added
more events. EventMultiplexer now serves as a true blackboard
- reworked directory structure: disjunct parts are now physically separated
into directories, instantiation happens via factories & abstract interfaces
- added CursorManager, to make setting mouse cursor less hackish
- reworked DrawShape, to implement SeparateListener pattern
- reworked IntrinsicAnimationActivity, to avoid cyclic references
- modified hyperlink & shape cursor handling to communicate via
EventMultiplexer
- renamed & cleaned up files (presentation.cxx now named slideshowimpl.cxx,
etc.)
- added first version of the z-order fix to layer/layermanager
- cleaned up include guards and include syntax
2007-07-17 13:36:13 +00:00
|
|
|
::osl::MutexGuard aGuard( maMutex );
|
|
|
|
|
2006-02-09 13:48:22 +00:00
|
|
|
// return time for next entry (if any)
|
|
|
|
return isEmpty() ?
|
|
|
|
::std::numeric_limits<double>::max() :
|
|
|
|
maEvents.top().nTime - mpTimer->getElapsedTime();
|
|
|
|
}
|
|
|
|
|
2004-11-26 17:53:02 +00:00
|
|
|
void EventQueue::clear()
|
|
|
|
{
|
INTEGRATION: CWS presfixes12 (1.12.12); FILE MERGED
2007/02/25 01:10:23 thb 1.12.12.3: #i37778# Cleared up error handling a lot: no longer quenching RuntimeExceptions; reporting assertions in the debug case; ViewLayer now reports resized sprite (which needs re-render from all shapes); fixed missing subset area reduction for glyph-level animations; added return of resize state from Layer::commitLayerBounds(); adapted unit tests to corrected behaviour
2007/02/06 17:18:03 thb 1.12.12.2: #i37778# Moved clear() method from View to ViewLayer (also sprites need to be cleared); fixed a few more cases of local code style violations; removed redundant inline keywords; finished Layer/LayerManager rework (Layer now represents ViewLayers, shapes and rendering are fully under LayerManager control); made shape comparator reusable
2007/01/29 14:01:53 thb 1.12.12.1: Issue number: #i37778#
Larger slideshow refactoring. Wrote design and coding style manifest,
and adapted the code to actually conform to this. In detail:
- cleaned up ownership/disposable/weak_ptr story. removed hacks and
explicit Disposable implementations, where workaround were available
- removed object mutices, where superfluous
- reworked EventMultiplexer (using templatized listener class now), added
more events. EventMultiplexer now serves as a true blackboard
- reworked directory structure: disjunct parts are now physically separated
into directories, instantiation happens via factories & abstract interfaces
- added CursorManager, to make setting mouse cursor less hackish
- reworked DrawShape, to implement SeparateListener pattern
- reworked IntrinsicAnimationActivity, to avoid cyclic references
- modified hyperlink & shape cursor handling to communicate via
EventMultiplexer
- renamed & cleaned up files (presentation.cxx now named slideshowimpl.cxx,
etc.)
- added first version of the z-order fix to layer/layermanager
- cleaned up include guards and include syntax
2007-07-17 13:36:13 +00:00
|
|
|
::osl::MutexGuard aGuard( maMutex );
|
|
|
|
|
2004-11-26 17:53:02 +00:00
|
|
|
// TODO(P1): Maybe a plain vector and vector.swap will
|
|
|
|
// be faster here. Profile.
|
|
|
|
maEvents = ImplQueueType();
|
|
|
|
}
|
2004-03-18 09:44:39 +00:00
|
|
|
}
|
|
|
|
}
|