Kaydet (Commit) 731f3d98 authored tarafından Siqi LIU's avatar Siqi LIU

request immdiateupdate for pointerSymbol, but bad performance

Change-Id: I943019f6f6c6aaddeb40bf7f56bd0ffefff8a6b3
üst dffc87dd
......@@ -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,
......
......@@ -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;
}
}
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment