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
This commit is contained in:
Oliver Bolte 2007-07-17 13:36:13 +00:00
parent 75129de43a
commit c490787e55

View file

@ -4,9 +4,9 @@
*
* $RCSfile: eventqueue.cxx,v $
*
* $Revision: 1.12 $
* $Revision: 1.13 $
*
* last change: $Author: kz $ $Date: 2006-12-13 15:15:23 $
* last change: $Author: obo $ $Date: 2007-07-17 14:36:13 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@ -48,9 +48,6 @@
#include <slideshowexceptions.hxx>
#include <boost/shared_ptr.hpp>
#include <boost/mem_fn.hpp>
#include <queue>
#include <algorithm>
#include <limits>
@ -70,7 +67,8 @@ namespace slideshow
EventQueue::EventQueue(
boost::shared_ptr<canvas::tools::ElapsedTime> const & pPresTimer )
: maEvents(),
: maMutex(),
maEvents(),
maNextEvents(),
mpTimer( pPresTimer )
{
@ -81,7 +79,8 @@ namespace slideshow
// 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 ) {
iPos != iEnd; ++iPos )
{
maEvents.push(*iPos);
}
EventEntryVector().swap( maNextEvents );
@ -89,10 +88,12 @@ namespace slideshow
// dispose event queue
while( !maEvents.empty() )
{
try {
try
{
maEvents.top().pEvent->dispose();
}
catch (uno::Exception &) {
catch (uno::Exception &)
{
OSL_ENSURE( false, rtl::OUStringToOString(
comphelper::anyToString(
cppu::getCaughtException() ),
@ -104,6 +105,8 @@ namespace slideshow
bool EventQueue::addEvent( const EventSharedPtr& rEvent )
{
::osl::MutexGuard aGuard( maMutex );
ENSURE_AND_RETURN( rEvent,
"EventQueue::addEvent: event ptr NULL" );
@ -123,6 +126,8 @@ namespace slideshow
bool EventQueue::addEventForNextRound( EventSharedPtr const& rEvent )
{
::osl::MutexGuard aGuard( maMutex );
ENSURE_AND_RETURN( rEvent.get() != NULL,
"EventQueue::addEvent: event ptr NULL" );
maNextEvents.push_back(
@ -133,11 +138,15 @@ namespace slideshow
void EventQueue::forceEmpty()
{
::osl::MutexGuard aGuard( maMutex );
process_(true);
}
void EventQueue::process()
{
::osl::MutexGuard aGuard( maMutex );
process_(false);
}
@ -187,6 +196,10 @@ namespace slideshow
event.pEvent->fire();
}
catch( uno::RuntimeException& )
{
throw;
}
catch( uno::Exception& )
{
// catch anything here, we don't want
@ -199,7 +212,10 @@ namespace slideshow
// 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 uno::Exception, action might not have been fully performed" );
OSL_ENSURE( false,
rtl::OUStringToOString(
comphelper::anyToString( cppu::getCaughtException() ),
RTL_TEXTENCODING_UTF8 ).getStr() );
}
catch( SlideShowException& )
{
@ -229,11 +245,15 @@ namespace slideshow
bool EventQueue::isEmpty() const
{
::osl::MutexGuard aGuard( maMutex );
return maEvents.empty();
}
double EventQueue::nextTimeout() const
{
::osl::MutexGuard aGuard( maMutex );
// return time for next entry (if any)
return isEmpty() ?
::std::numeric_limits<double>::max() :
@ -242,6 +262,8 @@ namespace slideshow
void EventQueue::clear()
{
::osl::MutexGuard aGuard( maMutex );
// TODO(P1): Maybe a plain vector and vector.swap will
// be faster here. Profile.
maEvents = ImplQueueType();