diff options
author | Kurt Zenker <kz@openoffice.org> | 2005-03-18 16:10:16 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2005-03-18 16:10:16 +0000 |
commit | fb64bb3c9b5d2c083acbb44113bccbf6df18da72 (patch) | |
tree | 2353eddb2a1d8ef42394e0de288b8e9a7082cc1c /slideshow/source/engine/eventmultiplexer.cxx | |
parent | b2dd960e52b71b811a07e8f035f32355e2b2de7b (diff) |
INTEGRATION: CWS impress36 (1.2.18); FILE MERGED
2005/03/15 17:52:14 cl 1.2.18.5: RESYNC: (1.2-1.3); FILE MERGED
2005/03/08 11:13:49 cl 1.2.18.4: do not use references for mouse events
2005/03/04 16:06:45 thb 1.2.18.3: #i43997# Reworked notification handling: now, _all_ external events are handled through the EventQueue, i.e. every external notification call (mouse events, whatever) will enqueue zero-timeout events, thus invoking the actual functionality through XSlideShow::update(). Together with the requirement to only call XSlideShow::update() from the main thread, this should result in correct behaviour under nearly all multi-threading circumstances.
2005/03/02 11:52:08 cl 1.2.18.2: #i43679# added AnimationCommandNode for STOPAUDIO support
2005/02/28 15:09:55 cl 1.2.18.1: #i42524# foreward setShapeCursor to buffered slides
Diffstat (limited to 'slideshow/source/engine/eventmultiplexer.cxx')
-rw-r--r-- | slideshow/source/engine/eventmultiplexer.cxx | 117 |
1 files changed, 99 insertions, 18 deletions
diff --git a/slideshow/source/engine/eventmultiplexer.cxx b/slideshow/source/engine/eventmultiplexer.cxx index 6710bead9ae1..32696690f6fc 100644 --- a/slideshow/source/engine/eventmultiplexer.cxx +++ b/slideshow/source/engine/eventmultiplexer.cxx @@ -2,9 +2,9 @@ * * $RCSfile: eventmultiplexer.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: vg $ $Date: 2005-03-10 13:41:42 $ + * last change: $Author: kz $ $Date: 2005-03-18 17:10:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -389,6 +389,16 @@ namespace presentation mpListener->removeAudioStoppedHandler( rHandler ); } + void EventMultiplexer::addCommandStopAudioHandler( const AnimationEventHandlerSharedPtr& rHandler ) + { + mpListener->addCommandStopAudioHandler( rHandler ); + } + + void EventMultiplexer::removeCommandStopAudioHandler( const AnimationEventHandlerSharedPtr& rHandler ) + { + mpListener->removeCommandStopAudioHandler( rHandler ); + } + void EventMultiplexer::addPauseHandler( const PauseEventHandlerSharedPtr& rHandler ) { return mpListener->addPauseHandler( rHandler ); @@ -475,7 +485,10 @@ namespace presentation { return mpListener->notifyPauseMode( bPauseShow ); } - + void EventMultiplexer::notifyCommandStopAudio( const AnimationNodeSharedPtr& rNode ) + { + mpListener->notifyCommandStopAudio( rNode ); + } EventMultiplexer::Listener::Listener( EventQueue& rEventQueue ) : Listener_UnoBase( m_aMutex ), @@ -488,6 +501,7 @@ namespace presentation maAnimationEndHandlers(), maSlideAnimationsEndHandlers(), maAudioStoppedHandlers(), + maCommandStopAudioHandlers(), maPauseHandlers(), maMouseClickHandlers(), maMouseDoubleClickHandlers(), @@ -596,6 +610,7 @@ namespace presentation maAnimationEndHandlers.clear(); maSlideAnimationsEndHandlers.clear(); maAudioStoppedHandlers.clear(); + maCommandStopAudioHandlers.clear(); maPauseHandlers.clear(); maMouseClickHandlers.clear(); maMouseDoubleClickHandlers.clear(); @@ -775,6 +790,18 @@ namespace presentation rHandler ); } + void EventMultiplexer::Listener::addCommandStopAudioHandler( const AnimationEventHandlerSharedPtr& rHandler ) + { + addHandler( maCommandStopAudioHandlers, + rHandler ); + } + + void EventMultiplexer::Listener::removeCommandStopAudioHandler( const AnimationEventHandlerSharedPtr& rHandler ) + { + removeHandler( maCommandStopAudioHandlers, + rHandler ); + } + void EventMultiplexer::Listener::addPauseHandler( const PauseEventHandlerSharedPtr& rHandler ) { addHandler( maPauseHandlers, @@ -886,6 +913,12 @@ namespace presentation rNode ); } + void EventMultiplexer::Listener::notifyCommandStopAudio( const AnimationNodeSharedPtr& rNode ) + { + notifyHandlers( maCommandStopAudioHandlers, + rNode ); + } + bool EventMultiplexer::Listener::notifyPauseMode( bool bPauseShow ) { ::osl::ClearableMutexGuard aGuard( m_aMutex ); @@ -1034,7 +1067,7 @@ namespace presentation } } - void SAL_CALL EventMultiplexer::Listener::mousePressed( const awt::MouseEvent& e ) throw (uno::RuntimeException) + void EventMultiplexer::Listener::implMousePressed( const ::com::sun::star::awt::MouseEvent& e ) { ::osl::ClearableMutexGuard aGuard( m_aMutex ); @@ -1069,7 +1102,7 @@ namespace presentation } } - void SAL_CALL EventMultiplexer::Listener::mouseReleased( const awt::MouseEvent& e ) throw (uno::RuntimeException) + void EventMultiplexer::Listener::implMouseReleased( const ::com::sun::star::awt::MouseEvent& e ) { ::osl::ClearableMutexGuard aGuard( m_aMutex ); @@ -1104,18 +1137,7 @@ namespace presentation } } - void SAL_CALL EventMultiplexer::Listener::mouseEntered( const awt::MouseEvent& e ) throw (uno::RuntimeException) - { - // not used here - } - - void SAL_CALL EventMultiplexer::Listener::mouseExited( const awt::MouseEvent& e ) throw (uno::RuntimeException) - { - // not used here - } - - // XMouseMotionListener implementation - void SAL_CALL EventMultiplexer::Listener::mouseDragged( const awt::MouseEvent& e ) throw (uno::RuntimeException) + void EventMultiplexer::Listener::implMouseDragged( const ::com::sun::star::awt::MouseEvent& e ) { ::osl::ResettableMutexGuard aGuard( m_aMutex ); @@ -1151,7 +1173,7 @@ namespace presentation } } - void SAL_CALL EventMultiplexer::Listener::mouseMoved( const awt::MouseEvent& e ) throw (uno::RuntimeException) + void EventMultiplexer::Listener::implMouseMoved( const ::com::sun::star::awt::MouseEvent& e ) { ::osl::ResettableMutexGuard aGuard( m_aMutex ); @@ -1186,5 +1208,64 @@ namespace presentation mnLastVolatileMouseCursor = mnMouseCursor; } } + + void SAL_CALL EventMultiplexer::Listener::mousePressed( const awt::MouseEvent& e ) throw (uno::RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + + // notify mouse press. Don't call handlers directly, this + // might not be the main thread! + mrEventQueue.addEvent( + makeEvent( ::boost::bind( &EventMultiplexer::Listener::implMousePressed, + this, + e ) ) ); + } + + void SAL_CALL EventMultiplexer::Listener::mouseReleased( const awt::MouseEvent& e ) throw (uno::RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + + // notify mouse release. Don't call handlers directly, + // this might not be the main thread! + mrEventQueue.addEvent( + makeEvent( ::boost::bind( &EventMultiplexer::Listener::implMouseReleased, + this, + e ) ) ); + } + + void SAL_CALL EventMultiplexer::Listener::mouseEntered( const awt::MouseEvent& e ) throw (uno::RuntimeException) + { + // not used here + } + + void SAL_CALL EventMultiplexer::Listener::mouseExited( const awt::MouseEvent& e ) throw (uno::RuntimeException) + { + // not used here + } + + // XMouseMotionListener implementation + void SAL_CALL EventMultiplexer::Listener::mouseDragged( const awt::MouseEvent& e ) throw (uno::RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + + // notify mouse drag. Don't call handlers directly, this + // might not be the main thread! + mrEventQueue.addEvent( + makeEvent( ::boost::bind( &EventMultiplexer::Listener::implMouseDragged, + this, + e ) ) ); + } + + void SAL_CALL EventMultiplexer::Listener::mouseMoved( const awt::MouseEvent& e ) throw (uno::RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + + // notify mouse move. Don't call handlers directly, this + // might not be the main thread! + mrEventQueue.addEvent( + makeEvent( ::boost::bind( &EventMultiplexer::Listener::implMouseMoved, + this, + e ) ) ); + } } } |