diff options
-rw-r--r-- | sd/source/ui/remotecontrol/Receiver.cxx | 34 | ||||
-rw-r--r-- | slideshow/source/engine/pointersymbol.cxx | 16 | ||||
-rw-r--r-- | slideshow/source/engine/slideshowimpl.cxx | 2 |
3 files changed, 40 insertions, 12 deletions
diff --git a/sd/source/ui/remotecontrol/Receiver.cxx b/sd/source/ui/remotecontrol/Receiver.cxx index f7a3f8c344e4..593ff99ba2bd 100644 --- a/sd/source/ui/remotecontrol/Receiver.cxx +++ b/sd/source/ui/remotecontrol/Receiver.cxx @@ -132,11 +132,32 @@ void Receiver::executeCommand( const std::vector<OString> &aCommand ) } else if (aCommand[0].equals( "pointer_started" )) { - std::cerr << "pointer_started" << std::endl; + // std::cerr << "pointer_started" << std::endl; + float x = aCommand[1].toFloat(); + float y = aCommand[2].toFloat(); SolarMutexGuard aSolarGuard; + + const ::com::sun::star::geometry::RealPoint2D pos(x,y); + // std::cerr << "Pointer at ("<<pos.X<<","<<pos.Y<<")" << std::endl; + + if (xSlideShow.is()) try + { + // std::cerr << "pointer_coordination in the is" << std::endl; + xSlideShow->setProperty( + beans::PropertyValue( "PointerPosition" , + -1, + makeAny( pos ), + beans::PropertyState_DIRECT_VALUE ) ); + } + catch ( Exception& ) + { + SAL_WARN( "sd.slideshow", "sd::SlideShowImpl::setPointerPosition(), " + "exception caught: " << comphelper::anyToString( cppu::getCaughtException() )); + } + if (xSlideShow.is()) try { - std::cerr << "pointer_started in the is" << std::endl; + // std::cerr << "pointer_started in the is" << std::endl; xSlideShow->setProperty( beans::PropertyValue( "PointerVisible" , -1, @@ -148,15 +169,16 @@ void Receiver::executeCommand( const std::vector<OString> &aCommand ) SAL_WARN( "sd.slideshow", "sd::SlideShowImpl::setPointerMode(), " "exception caught: " << comphelper::anyToString( cppu::getCaughtException() )); } + SAL_INFO( "sdremote", "Pointer started, we display the pointer on screen" ); } else if (aCommand[0].equals( "pointer_dismissed" )) { - std::cerr << "pointer_dismissed" << std::endl; + // std::cerr << "pointer_dismissed" << std::endl; SolarMutexGuard aSolarGuard; if (xSlideShow.is()) try { - std::cerr << "pointer_dismissed in the is" << std::endl; + // std::cerr << "pointer_dismissed in the is" << std::endl; xSlideShow->setProperty( beans::PropertyValue( "PointerVisible" , -1, @@ -178,12 +200,12 @@ void Receiver::executeCommand( const std::vector<OString> &aCommand ) SAL_INFO( "sdremote", "Pointer at ("<<x<<","<<y<<")" ); const ::com::sun::star::geometry::RealPoint2D pos(x,y); - std::cerr << "Pointer at ("<<pos.X<<","<<pos.Y<<")" << std::endl; + // std::cerr << "Pointer at ("<<pos.X<<","<<pos.Y<<")" << std::endl; SolarMutexGuard aSolarGuard; if (xSlideShow.is()) try { - std::cerr << "pointer_coordination in the is" << std::endl; + // std::cerr << "pointer_coordination in the is" << std::endl; xSlideShow->setProperty( beans::PropertyValue( "PointerPosition" , -1, diff --git a/slideshow/source/engine/pointersymbol.cxx b/slideshow/source/engine/pointersymbol.cxx index 8629ea74f413..d0e7fce6e2eb 100644 --- a/slideshow/source/engine/pointersymbol.cxx +++ b/slideshow/source/engine/pointersymbol.cxx @@ -119,11 +119,15 @@ basegfx::B2DPoint PointerSymbol::calcSpritePos( const uno::Reference<rendering::XBitmap> xBitmap( rView->getCanvas()->getUNOCanvas(), uno::UNO_QUERY_THROW ); const geometry::IntegerSize2D realSize( xBitmap->getSize() ); - return basegfx::B2DPoint( + + basegfx::B2DPoint newPos( // pos.X pos.Y are given in 0..1, beginning from the upper left corner of the currentSlide. - std::min<sal_Int32>( realSize.Width * pos.X, LEFT_BORDER_SPACE ), - std::max<sal_Int32>( 0, realSize.Height * (1-pos.Y) - mxBitmap->getSize().Height - - LOWER_BORDER_SPACE ) ); + realSize.Width * pos.X, + realSize.Height * pos.Y); + + // std::cerr << "calcSpritePos : (" << newPos.getX() << ","<<newPos.getY() << ")" << std::endl; + + return newPos; } void PointerSymbol::viewAdded( const UnoViewSharedPtr& rView ) @@ -215,9 +219,11 @@ void PointerSymbol::viewsChanged(const ::com::sun::star::geometry::RealPoint2D p ViewsVecT::const_iterator const aEnd ( maViews.end() ); while( aIter != aEnd ) { - if( aIter->second ) + if( aIter->second ) { aIter->second->movePixel( calcSpritePos( aIter->first, pos )); + mrScreenUpdater.requestImmediateUpdate(); + } ++aIter; } } diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index db207a892adb..ded62b4ca970 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -1809,7 +1809,7 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) if (! (rProperty.Value >>= pos)) return false; - std::cerr<<"Received pos at :(" << pos.X << ","<<pos.Y << ")" << std::endl; + // std::cerr<<"Received pos at :(" << pos.X << ","<<pos.Y << ")" << std::endl; mpPointerSymbol->viewsChanged(pos); } |