From: minho.sun Date: Fri, 14 Apr 2017 05:58:01 +0000 (-0700) Subject: Merge "Make ecore-indicator-impl use TouchSignal instead of TouchedSignal" into devel... X-Git-Tag: dali_1.2.36~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d7bc0b00bce2f5560dc8ad4401cbe0461b90e10c;hp=23fbad0f6653d708f1fb2686fa930045324dda0c;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Merge "Make ecore-indicator-impl use TouchSignal instead of TouchedSignal" into devel/master --- diff --git a/adaptors/ecore/common/ecore-indicator-impl.cpp b/adaptors/ecore/common/ecore-indicator-impl.cpp index 568890b..7f6b3ae 100644 --- a/adaptors/ecore/common/ecore-indicator-impl.cpp +++ b/adaptors/ecore/common/ecore-indicator-impl.cpp @@ -256,9 +256,9 @@ struct IpcDataEvMouseMove unsigned int timestamp; Evas_Event_Flags event_flags; - IpcDataEvMouseMove(const Dali::TouchPoint& touchPoint, unsigned long timestamp) - : x(static_cast(touchPoint.local.x)), - y(static_cast(touchPoint.local.y)), + IpcDataEvMouseMove(const Dali::Vector2& touchPoint, unsigned long timestamp) + : x(static_cast(touchPoint.x)), + y(static_cast(touchPoint.y)), flags(EVAS_BUTTON_NONE), mask(0), timestamp(static_cast(timestamp)), @@ -575,7 +575,7 @@ Indicator::Indicator( Adaptor* adaptor, Dali::Window::WindowOrientation orientat // Indicator image handles the touch event including "leave" mIndicatorContentActor.SetLeaveRequired( true ); - mIndicatorContentActor.TouchedSignal().Connect( this, &Indicator::OnTouched ); + mIndicatorContentActor.TouchSignal().Connect( this, &Indicator::OnTouch ); mIndicatorContentActor.SetColor( Color::BLACK ); mIndicatorActor = Dali::Actor::New(); @@ -619,7 +619,7 @@ Indicator::~Indicator() if(mEventActor) { - mEventActor.TouchedSignal().Disconnect( this, &Indicator::OnTouched ); + mEventActor.TouchSignal().Disconnect( this, &Indicator::OnTouch ); } Disconnect(); } @@ -789,21 +789,19 @@ bool Indicator::SendMessage( int messageDomain, int messageId, const void *data, } } -bool Indicator::OnTouched(Dali::Actor indicator, const Dali::TouchEvent& touchEvent) +bool Indicator::OnTouch(Dali::Actor indicator, const Dali::TouchData& touchData) { if( mServerConnection ) { - const TouchPoint& touchPoint = touchEvent.GetPoint( 0 ); - // Send touch event to indicator server when indicator is showing if( CheckVisibleState() || mIsShowing ) { - switch( touchPoint.state ) + switch( touchData.GetState(0) ) { case Dali::PointState::DOWN: { - IpcDataEvMouseMove ipcMove( touchPoint, touchEvent.time ); - IpcDataEvMouseDown ipcDown( touchEvent.time ); + IpcDataEvMouseMove ipcMove( touchData.GetLocalPosition(0), touchData.GetTime() ); + IpcDataEvMouseDown ipcDown( touchData.GetTime() ); mServerConnection->SendEvent( OP_EV_MOUSE_MOVE, &ipcMove, sizeof(ipcMove) ); mServerConnection->SendEvent( OP_EV_MOUSE_DOWN, &ipcDown, sizeof(ipcDown) ); @@ -817,7 +815,7 @@ bool Indicator::OnTouched(Dali::Actor indicator, const Dali::TouchEvent& touchEv case Dali::PointState::MOTION: { - IpcDataEvMouseMove ipcMove( touchPoint, touchEvent.time ); + IpcDataEvMouseMove ipcMove( touchData.GetLocalPosition(0), touchData.GetTime() ); mServerConnection->SendEvent( OP_EV_MOUSE_MOVE, &ipcMove, sizeof(ipcMove) ); } break; @@ -825,7 +823,7 @@ bool Indicator::OnTouched(Dali::Actor indicator, const Dali::TouchEvent& touchEv case Dali::PointState::UP: case Dali::PointState::INTERRUPTED: { - IpcDataEvMouseUp ipcUp( touchEvent.time ); + IpcDataEvMouseUp ipcUp( touchData.GetTime() ); mServerConnection->SendEvent( OP_EV_MOUSE_UP, &ipcUp, sizeof(ipcUp) ); if( mVisible == Dali::Window::AUTO ) @@ -838,9 +836,9 @@ bool Indicator::OnTouched(Dali::Actor indicator, const Dali::TouchEvent& touchEv case Dali::TouchPoint::Leave: { - IpcDataEvMouseMove ipcMove( touchPoint, touchEvent.time ); + IpcDataEvMouseMove ipcMove( touchData.GetLocalPosition(0), touchData.GetTime() ); mServerConnection->SendEvent( OP_EV_MOUSE_MOVE, &ipcMove, sizeof(ipcMove) ); - IpcDataEvMouseUp ipcOut( touchEvent.time ); + IpcDataEvMouseUp ipcOut( touchData.GetTime() ); mServerConnection->SendEvent( OP_EV_MOUSE_OUT, &ipcOut, sizeof(ipcOut) ); } break; @@ -1592,7 +1590,7 @@ void Indicator::ShowIndicator(float duration) if( mVisible == Dali::Window::AUTO ) { // check the stage touch - Dali::Stage::GetCurrent().TouchedSignal().Connect( this, &Indicator::OnStageTouched ); + Dali::Stage::GetCurrent().TouchSignal().Connect( this, &Indicator::OnStageTouch ); } } else @@ -1605,7 +1603,7 @@ void Indicator::ShowIndicator(float duration) if( mVisible == Dali::Window::AUTO ) { // check the stage touch - Dali::Stage::GetCurrent().TouchedSignal().Disconnect( this, &Indicator::OnStageTouched ); + Dali::Stage::GetCurrent().TouchSignal().Disconnect( this, &Indicator::OnStageTouch ); } } } @@ -1633,19 +1631,17 @@ void Indicator::OnPan( Dali::Actor actor, const Dali::PanGesture& gesture ) // Nothing to do, but we still want to consume pan } -void Indicator::OnStageTouched(const Dali::TouchEvent& touchEvent) +void Indicator::OnStageTouch(const Dali::TouchData& touchData) { - const TouchPoint& touchPoint = touchEvent.GetPoint( 0 ); - // when stage is touched while indicator is showing temporary, hide it if( mIsShowing && ( CheckVisibleState() == false || mVisible == Dali::Window::AUTO ) ) { - switch( touchPoint.state ) + switch( touchData.GetState(0) ) { case Dali::PointState::DOWN: { // if touch point is inside the indicator, indicator is not hidden - if( mImageHeight < int(touchPoint.screen.y) ) + if( mImageHeight < int( touchData.GetScreenPosition(0).y ) ) { ShowIndicator( HIDE_NOW ); } diff --git a/adaptors/ecore/common/ecore-indicator-impl.h b/adaptors/ecore/common/ecore-indicator-impl.h index 1f0e693..bcef998 100644 --- a/adaptors/ecore/common/ecore-indicator-impl.h +++ b/adaptors/ecore/common/ecore-indicator-impl.h @@ -22,6 +22,7 @@ #include #include #include +#include #include // INTERNAL INCLUDES @@ -215,9 +216,9 @@ private: * It should pass the valid touch event to indicator server * * @param[in] indicator The indicator actor that was touched - * @param[in] touchEvent The touch event + * @param[in] touchEvent The touch data */ - bool OnTouched(Dali::Actor indicator, const TouchEvent& touchEvent); + bool OnTouch(Dali::Actor indicator, const Dali::TouchData& touchData); /** * Pan gesture callback. @@ -232,9 +233,9 @@ private: * Touch event callback on stage. * If stage is touched, hide showing indicator image * - * @param[in] touchEvent The touch event + * @param[in] touchEvent The touch data */ - void OnStageTouched(const Dali::TouchEvent& touchEvent); + void OnStageTouch(const Dali::TouchData& touchData); /** * Connect to the indicator service