From: joogab.yun Date: Mon, 11 Sep 2023 05:20:30 +0000 (+0900) Subject: Add log about Touch and Gesture X-Git-Tag: accepted/tizen/unified/20230915.085402~2^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6670ecd6ad1bb631543e3c7bb22fd1c27aad7162;p=platform%2Fcore%2Fuifw%2Fdali-core.git Add log about Touch and Gesture Change-Id: I8b5c34c30132a11d8f090442ac789f79af46b9b7 --- diff --git a/dali/internal/event/events/hover-event-processor.cpp b/dali/internal/event/events/hover-event-processor.cpp index 17d8193ae..9188fd7a5 100644 --- a/dali/internal/event/events/hover-event-processor.cpp +++ b/dali/internal/event/events/hover-event-processor.cpp @@ -272,6 +272,10 @@ void HoverEventProcessor::ProcessHoverEvent(const Integration::HoverEvent& event // 3) Recursively deliver events to the actor and its parents, until the event is consumed or the stage is reached. + Integration::Point primaryPoint = hoverEvent->GetPoint(0); + Dali::Actor primaryHitActor = primaryPoint.GetHitActor(); + PointState::Type primaryPointState = primaryPoint.GetState(); + // Emit the touch signal Dali::Actor consumedActor; if(currentRenderTask) @@ -289,14 +293,13 @@ void HoverEventProcessor::ProcessHoverEvent(const Integration::HoverEvent& event } } consumedActor = EmitHoverSignals(hitActor, hoverEventHandle); - } - - Integration::Point primaryPoint = hoverEvent->GetPoint(0); - Dali::Actor primaryHitActor = primaryPoint.GetHitActor(); - PointState::Type primaryPointState = primaryPoint.GetState(); - DALI_LOG_INFO(gLogFilter, Debug::Concise, "PrimaryHitActor: (%p) %s\n", primaryHitActor ? reinterpret_cast(&primaryHitActor.GetBaseObject()) : NULL, primaryHitActor ? primaryHitActor.GetProperty(Dali::Actor::Property::NAME).c_str() : ""); - DALI_LOG_INFO(gLogFilter, Debug::Concise, "ConsumedActor: (%p) %s\n", consumedActor ? reinterpret_cast(&consumedActor.GetBaseObject()) : NULL, consumedActor ? consumedActor.GetProperty(Dali::Actor::Property::NAME).c_str() : ""); + if(hoverEvent->GetPoint(0).GetState() != PointState::MOTION) + { + DALI_LOG_DEBUG_INFO("PrimaryHitActor:(%p), id(%d), name(%s), state(%d)\n", primaryHitActor ? reinterpret_cast(&primaryHitActor.GetBaseObject()) : NULL, primaryHitActor ? primaryHitActor.GetProperty(Dali::Actor::Property::ID) : -1, primaryHitActor ? primaryHitActor.GetProperty(Dali::Actor::Property::NAME).c_str() : "", hoverEvent->GetPoint(0).GetState()); + DALI_LOG_DEBUG_INFO("ConsumedActor: (%p), id(%d), name(%s), state(%d)\n", consumedActor ? reinterpret_cast(&consumedActor.GetBaseObject()) : NULL, consumedActor ? consumedActor.GetProperty(Dali::Actor::Property::ID) : -1, consumedActor ? consumedActor.GetProperty(Dali::Actor::Property::NAME).c_str() : "", hoverEvent->GetPoint(0).GetState()); + } + } if((primaryPointState == PointState::STARTED) && (hoverEvent->GetPointCount() == 1) && @@ -325,7 +328,7 @@ void HoverEventProcessor::ProcessHoverEvent(const Integration::HoverEvent& event { if(lastPrimaryHitActor->GetLeaveRequired()) { - DALI_LOG_INFO(gLogFilter, Debug::Concise, "LeaveActor(Hit): (%p) %s\n", reinterpret_cast(lastPrimaryHitActor), lastPrimaryHitActor->GetName().data()); + DALI_LOG_DEBUG_INFO("LeaveActor(Hit): (%p) %s\n", reinterpret_cast(lastPrimaryHitActor), lastPrimaryHitActor->GetName().data()); leaveEventConsumer = EmitHoverSignals(mLastPrimaryHitActor.GetActor(), lastRenderTaskImpl, hoverEvent, PointState::LEAVE); } } @@ -333,7 +336,7 @@ void HoverEventProcessor::ProcessHoverEvent(const Integration::HoverEvent& event { // At this point mLastPrimaryHitActor was touchable and sensitive in the previous touch event process but is not in the current one. // An interrupted event is send to allow some actors to go back to their original state (i.e. Button controls) - DALI_LOG_INFO(gLogFilter, Debug::Concise, "InterruptedActor(Hit): (%p) %s\n", reinterpret_cast(lastPrimaryHitActor), lastPrimaryHitActor->GetName().data()); + DALI_LOG_DEBUG_INFO("InterruptedActor(Hit): (%p) %s\n", reinterpret_cast(lastPrimaryHitActor), lastPrimaryHitActor->GetName().data()); leaveEventConsumer = EmitHoverSignals(mLastPrimaryHitActor.GetActor(), lastRenderTaskImpl, hoverEvent, PointState::INTERRUPTED); } } @@ -351,7 +354,7 @@ void HoverEventProcessor::ProcessHoverEvent(const Integration::HoverEvent& event { if(lastConsumedActor->GetLeaveRequired()) { - DALI_LOG_INFO(gLogFilter, Debug::Concise, "LeaveActor(Consume): (%p) %s\n", reinterpret_cast(lastConsumedActor), lastConsumedActor->GetName().data()); + DALI_LOG_DEBUG_INFO("LeaveActor(Consume): (%p) %s\n", reinterpret_cast(lastConsumedActor), lastConsumedActor->GetName().data()); EmitHoverSignals(lastConsumedActor, lastRenderTaskImpl, hoverEvent, PointState::LEAVE); } } @@ -359,7 +362,7 @@ void HoverEventProcessor::ProcessHoverEvent(const Integration::HoverEvent& event { // At this point mLastConsumedActor was touchable and sensitive in the previous touch event process but is not in the current one. // An interrupted event is send to allow some actors to go back to their original state (i.e. Button controls) - DALI_LOG_INFO(gLogFilter, Debug::Concise, "InterruptedActor(Consume): (%p) %s\n", reinterpret_cast(lastConsumedActor), lastConsumedActor->GetName().data()); + DALI_LOG_DEBUG_INFO("InterruptedActor(Consume): (%p) %s\n", reinterpret_cast(lastConsumedActor), lastConsumedActor->GetName().data()); EmitHoverSignals(mLastConsumedActor.GetActor(), lastRenderTaskImpl, hoverEvent, PointState::INTERRUPTED); } } diff --git a/dali/internal/event/events/long-press-gesture/long-press-gesture-detector-impl.cpp b/dali/internal/event/events/long-press-gesture/long-press-gesture-detector-impl.cpp index 0ed09be8b..52c315eb2 100644 --- a/dali/internal/event/events/long-press-gesture/long-press-gesture-detector-impl.cpp +++ b/dali/internal/event/events/long-press-gesture/long-press-gesture-detector-impl.cpp @@ -32,6 +32,10 @@ namespace Internal { namespace { +#if defined(DEBUG_ENABLED) +Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_LONG_PRESS_GESTURE_DETECTOR"); +#endif // defined(DEBUG_ENABLED) + // Signals const char* const SIGNAL_LONG_PRESS_DETECTED = "longPressDetected"; @@ -130,7 +134,7 @@ void LongPressGestureDetector::EmitLongPressGestureSignal(Dali::Actor pressedAct { // Guard against destruction during signal emission Dali::LongPressGestureDetector handle(this); - + DALI_LOG_DEBUG_INFO("emitting longPress gesture actor id(%d)\n", pressedActor.GetProperty(Dali::Actor::Property::ID)); mDetectedSignal.Emit(pressedActor, longPress); } @@ -154,12 +158,12 @@ bool LongPressGestureDetector::DoConnectSignal(BaseObject* object, ConnectionTra void LongPressGestureDetector::OnActorAttach(Actor& actor) { - // Do nothing + DALI_LOG_INFO(gLogFilter, Debug::General, "LongPressGestureDetector attach actor(%d)\n", actor.GetId()); } void LongPressGestureDetector::OnActorDetach(Actor& actor) { - // Do nothing + DALI_LOG_INFO(gLogFilter, Debug::General, "LongPressGestureDetector detach actor(%d)\n", actor.GetId()); } void LongPressGestureDetector::OnActorDestroyed(Object& object) diff --git a/dali/internal/event/events/pan-gesture/pan-gesture-detector-impl.cpp b/dali/internal/event/events/pan-gesture/pan-gesture-detector-impl.cpp index 0c6576ab0..93afaa5a2 100644 --- a/dali/internal/event/events/pan-gesture/pan-gesture-detector-impl.cpp +++ b/dali/internal/event/events/pan-gesture/pan-gesture-detector-impl.cpp @@ -283,7 +283,10 @@ void PanGestureDetector::EmitPanGestureSignal(Dali::Actor actor, const Dali::Pan Dali::PanGestureDetector handle(this); DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Emitting Signal (%p)\n", this); - + if(pan.GetState() != GestureState::CONTINUING) + { + DALI_LOG_DEBUG_INFO("emitting pan gesture actor id(%d) state(%d)\n", actor.GetProperty(Dali::Actor::Property::ID), pan.GetState()); + } mDetectedSignal.Emit(actor, pan); } } @@ -328,12 +331,12 @@ const SceneGraph::PanGesture& PanGestureDetector::GetPanGestureSceneObject() con void PanGestureDetector::OnActorAttach(Actor& actor) { - // Do nothing + DALI_LOG_INFO(gLogFilter, Debug::General, "PanGestureDetector attach actor(%d)\n", actor.GetId()); } void PanGestureDetector::OnActorDetach(Actor& actor) { - // Do nothing + DALI_LOG_INFO(gLogFilter, Debug::General, "PanGestureDetector detach actor(%d)\n", actor.GetId()); } void PanGestureDetector::OnActorDestroyed(Object& object) diff --git a/dali/internal/event/events/pinch-gesture/pinch-gesture-detector-impl.cpp b/dali/internal/event/events/pinch-gesture/pinch-gesture-detector-impl.cpp index 60761b1ff..9aa96523d 100644 --- a/dali/internal/event/events/pinch-gesture/pinch-gesture-detector-impl.cpp +++ b/dali/internal/event/events/pinch-gesture/pinch-gesture-detector-impl.cpp @@ -33,6 +33,10 @@ namespace Internal { namespace { +#if defined(DEBUG_ENABLED) +Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_PINCH_GESTURE_DETECTOR"); +#endif // defined(DEBUG_ENABLED) + // Signals const char* const SIGNAL_PINCH_DETECTED = "pinchDetected"; @@ -64,7 +68,10 @@ void PinchGestureDetector::EmitPinchGestureSignal(Dali::Actor actor, const Dali: { // Guard against destruction during signal emission Dali::PinchGestureDetector handle(this); - + if(pinch.GetState() != GestureState::CONTINUING) + { + DALI_LOG_DEBUG_INFO("emitting pinch gesture actor id(%d) state(%d)\n", actor.GetProperty(Dali::Actor::Property::ID), pinch.GetState()); + } mDetectedSignal.Emit(actor, pinch); } @@ -88,12 +95,12 @@ bool PinchGestureDetector::DoConnectSignal(BaseObject* object, ConnectionTracker void PinchGestureDetector::OnActorAttach(Actor& actor) { - // Do nothing + DALI_LOG_INFO(gLogFilter, Debug::General, "PinchGestureDetector attach actor(%d)\n", actor.GetId()); } void PinchGestureDetector::OnActorDetach(Actor& actor) { - // Do nothing + DALI_LOG_INFO(gLogFilter, Debug::General, "PinchGestureDetector detach actor(%d)\n", actor.GetId()); } void PinchGestureDetector::OnActorDestroyed(Object& object) diff --git a/dali/internal/event/events/rotation-gesture/rotation-gesture-detector-impl.cpp b/dali/internal/event/events/rotation-gesture/rotation-gesture-detector-impl.cpp index 1edb0083d..07d6776b7 100644 --- a/dali/internal/event/events/rotation-gesture/rotation-gesture-detector-impl.cpp +++ b/dali/internal/event/events/rotation-gesture/rotation-gesture-detector-impl.cpp @@ -33,6 +33,10 @@ namespace Internal { namespace { +#if defined(DEBUG_ENABLED) +Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_ROTATION_GESTURE_DETECTOR"); +#endif // defined(DEBUG_ENABLED) + // Signals const char* const SIGNAL_ROTATION_DETECTED = "rotationDetected"; @@ -62,7 +66,10 @@ void RotationGestureDetector::EmitRotationGestureSignal(Dali::Actor actor, const { // Guard against destruction during signal emission Dali::RotationGestureDetector handle(this); - + if(rotation.GetState() != GestureState::CONTINUING) + { + DALI_LOG_DEBUG_INFO("emitting rotation gesture actor id(%d) state(%d)\n", actor.GetProperty(Dali::Actor::Property::ID), rotation.GetState()); + } mDetectedSignal.Emit(actor, rotation); } @@ -84,6 +91,16 @@ bool RotationGestureDetector::DoConnectSignal(BaseObject* object, ConnectionTrac return connected; } +void RotationGestureDetector::OnActorAttach(Actor& actor) +{ + DALI_LOG_INFO(gLogFilter, Debug::General, "RotationGestureDetector attach actor(%d)\n", actor.GetId()); +} + +void RotationGestureDetector::OnActorDetach(Actor& actor) +{ + DALI_LOG_INFO(gLogFilter, Debug::General, "RotationGestureDetector detach actor(%d)\n", actor.GetId()); +} + } // namespace Internal } // namespace Dali diff --git a/dali/internal/event/events/rotation-gesture/rotation-gesture-detector-impl.h b/dali/internal/event/events/rotation-gesture/rotation-gesture-detector-impl.h index 7db75e591..2e0eb9e05 100644 --- a/dali/internal/event/events/rotation-gesture/rotation-gesture-detector-impl.h +++ b/dali/internal/event/events/rotation-gesture/rotation-gesture-detector-impl.h @@ -93,16 +93,12 @@ private: // GestureDetector overrides /** * @copydoc Dali::Internal::GestureDetector::OnActorAttach(Actor&) */ - void OnActorAttach(Actor& actor) override - { /* Nothing to do */ - } + void OnActorAttach(Actor& actor) override; /** * @copydoc Dali::Internal::GestureDetector::OnActorDetach(Actor&) */ - void OnActorDetach(Actor& actor) override - { /* Nothing to do */ - } + void OnActorDetach(Actor& actor) override; /** * @copydoc Dali::Internal::GestureDetector::OnActorDestroyed(Object&) diff --git a/dali/internal/event/events/tap-gesture/tap-gesture-detector-impl.cpp b/dali/internal/event/events/tap-gesture/tap-gesture-detector-impl.cpp index 7a04bc855..e78a0e332 100644 --- a/dali/internal/event/events/tap-gesture/tap-gesture-detector-impl.cpp +++ b/dali/internal/event/events/tap-gesture/tap-gesture-detector-impl.cpp @@ -36,6 +36,10 @@ namespace Internal { namespace { +#if defined(DEBUG_ENABLED) +Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_TAP_GESTURE_DETECTOR"); +#endif // defined(DEBUG_ENABLED) + constexpr uint32_t DEFAULT_TAPS_REQUIRED = 1u; constexpr uint32_t DEFAULT_TOUCHES_REQUIRED = 1u; constexpr uint32_t DEFAULT_TAP_WAIT_TIME = 330u; @@ -193,7 +197,7 @@ void TapGestureDetector::EmitTapGestureSignal(Dali::Actor tappedActor, const Dal { // Guard against destruction during signal emission Dali::TapGestureDetector handle(this); - + DALI_LOG_DEBUG_INFO("emitting tap gesture actor id(%d)\n", tappedActor.GetProperty(Dali::Actor::Property::ID)); mDetectedSignal.Emit(tappedActor, mTap); } else @@ -209,7 +213,7 @@ bool TapGestureDetector::TimerCallback() { // Guard against destruction during signal emission Dali::TapGestureDetector handle(this); - + DALI_LOG_DEBUG_INFO("emitting tap gesture actor id(%d)\n", mTappedActor.GetProperty(Dali::Actor::Property::ID)); mDetectedSignal.Emit(mTappedActor, mTap); mTimerId = 0; @@ -238,11 +242,12 @@ void TapGestureDetector::OnActorAttach(Actor& actor) { CheckMinMaxTapsRequired(); mWaitTime = mGestureEventProcessor.GetTapGestureProcessor().GetMaximumAllowedTime(); + DALI_LOG_INFO(gLogFilter, Debug::General, "TapGestureDetector attach actor(%d)\n", actor.GetId()); } void TapGestureDetector::OnActorDetach(Actor& actor) { - // Do nothing + DALI_LOG_INFO(gLogFilter, Debug::General, "TapGestureDetector detector actor(%d)\n", actor.GetId()); } void TapGestureDetector::OnActorDestroyed(Object& object) diff --git a/dali/internal/event/events/tap-gesture/tap-gesture-recognizer.cpp b/dali/internal/event/events/tap-gesture/tap-gesture-recognizer.cpp index 932de4a8f..fd8f3fffc 100644 --- a/dali/internal/event/events/tap-gesture/tap-gesture-recognizer.cpp +++ b/dali/internal/event/events/tap-gesture/tap-gesture-recognizer.cpp @@ -87,6 +87,7 @@ void TapGestureRecognizer::SendEvent(const Integration::TouchEvent& event) else // Clear if the time between touch down and touch up is long. { mState = CLEAR; + DALI_LOG_DEBUG_INFO("time between touch down and touch up is long. (%dms > %dms)\n", mDeltaBetweenTouchDownTouchUp, mRecognizerTime); } } else if(pointState == PointState::INTERRUPTED) @@ -108,6 +109,7 @@ void TapGestureRecognizer::SendEvent(const Integration::TouchEvent& event) else // Clear if the time between touch down and touch up is long. { mState = CLEAR; + DALI_LOG_DEBUG_INFO("time between touch down and touch up is long. (%dms > %dms)\n", mDeltaBetweenTouchDownTouchUp, mRecognizerTime); } } else if(pointState == PointState::DOWN) diff --git a/dali/internal/event/events/touch-event-processor.cpp b/dali/internal/event/events/touch-event-processor.cpp index 1461900ad..e91e7c096 100644 --- a/dali/internal/event/events/touch-event-processor.cpp +++ b/dali/internal/event/events/touch-event-processor.cpp @@ -396,10 +396,13 @@ bool TouchEventProcessor::ProcessTouchEvent(const Integration::TouchEvent& event } } consumed = consumedActor ? true : false; - } - DALI_LOG_INFO(gLogFilter, Debug::Concise, "PrimaryHitActor: (%p) %s\n", primaryHitActor ? reinterpret_cast(&primaryHitActor.GetBaseObject()) : NULL, primaryHitActor ? primaryHitActor.GetProperty(Dali::Actor::Property::NAME).c_str() : ""); - DALI_LOG_INFO(gLogFilter, Debug::Concise, "ConsumedActor: (%p) %s\n", consumedActor ? reinterpret_cast(&consumedActor.GetBaseObject()) : NULL, consumedActor ? consumedActor.GetProperty(Dali::Actor::Property::NAME).c_str() : ""); + if(primaryPointState != PointState::MOTION) + { + DALI_LOG_DEBUG_INFO("PrimaryHitActor:(%p), id(%d), name(%s), state(%d)\n", primaryHitActor ? reinterpret_cast(&primaryHitActor.GetBaseObject()) : NULL, primaryHitActor ? primaryHitActor.GetProperty(Dali::Actor::Property::ID) : -1, primaryHitActor ? primaryHitActor.GetProperty(Dali::Actor::Property::NAME).c_str() : "", primaryPointState); + DALI_LOG_DEBUG_INFO("ConsumedActor: (%p), id(%d), name(%s), state(%d)\n", consumedActor ? reinterpret_cast(&consumedActor.GetBaseObject()) : NULL, consumedActor ? consumedActor.GetProperty(Dali::Actor::Property::ID) : -1, consumedActor ? consumedActor.GetProperty(Dali::Actor::Property::NAME).c_str() : "", primaryPointState); + } + } if((primaryPointState == PointState::DOWN) && (touchEventImpl->GetPointCount() == 1) && @@ -435,7 +438,7 @@ bool TouchEventProcessor::ProcessTouchEvent(const Integration::TouchEvent& event { if(lastPrimaryHitActor->GetLeaveRequired()) { - DALI_LOG_INFO(gLogFilter, Debug::Concise, "LeaveActor(Hit): (%p) %s\n", reinterpret_cast(lastPrimaryHitActor), lastPrimaryHitActor->GetName().data()); + DALI_LOG_DEBUG_INFO("LeaveActor(Hit): (%p) %s\n", reinterpret_cast(lastPrimaryHitActor), lastPrimaryHitActor->GetName().data()); leaveEventConsumer = EmitTouchSignals(lastPrimaryHitActor, lastRenderTaskImpl, touchEventImpl, PointState::LEAVE); } } @@ -443,7 +446,7 @@ bool TouchEventProcessor::ProcessTouchEvent(const Integration::TouchEvent& event { // At this point mLastPrimaryHitActor was touchable and sensitive in the previous touch event process but is not in the current one. // An interrupted event is send to allow some actors to go back to their original state (i.e. Button controls) - DALI_LOG_INFO(gLogFilter, Debug::Concise, "InterruptedActor(Hit): (%p) %s\n", reinterpret_cast(lastPrimaryHitActor), lastPrimaryHitActor->GetName().data()); + DALI_LOG_DEBUG_INFO("InterruptedActor(Hit): (%p) %s\n", reinterpret_cast(lastPrimaryHitActor), lastPrimaryHitActor->GetName().data()); leaveEventConsumer = EmitTouchSignals(lastPrimaryHitActor, lastRenderTaskImpl, touchEventImpl, PointState::INTERRUPTED); } } @@ -463,7 +466,7 @@ bool TouchEventProcessor::ProcessTouchEvent(const Integration::TouchEvent& event { if(lastConsumedActor->GetLeaveRequired()) { - DALI_LOG_INFO(gLogFilter, Debug::Concise, "LeaveActor(Consume): (%p) %s\n", reinterpret_cast(lastConsumedActor), lastConsumedActor->GetName().data()); + DALI_LOG_DEBUG_INFO("LeaveActor(Consume): (%p) %s\n", reinterpret_cast(lastConsumedActor), lastConsumedActor->GetName().data()); EmitTouchSignals(lastConsumedActor, lastRenderTaskImpl, touchEventImpl, PointState::LEAVE); } } @@ -471,7 +474,7 @@ bool TouchEventProcessor::ProcessTouchEvent(const Integration::TouchEvent& event { // At this point mLastConsumedActor was touchable and sensitive in the previous touch event process but is not in the current one. // An interrupted event is send to allow some actors to go back to their original state (i.e. Button controls) - DALI_LOG_INFO(gLogFilter, Debug::Concise, "InterruptedActor(Consume): (%p) %s\n", reinterpret_cast(lastConsumedActor), lastConsumedActor->GetName().data()); + DALI_LOG_DEBUG_INFO("InterruptedActor(Consume): (%p) %s\n", reinterpret_cast(lastConsumedActor), lastConsumedActor->GetName().data()); EmitTouchSignals(mLastConsumedActor.GetActor(), lastRenderTaskImpl, touchEventImpl, PointState::INTERRUPTED); } }