// INTERNAL INCLUDES
#include <dali/integration-api/debug.h>
+#include <dali/internal/event/events/actor-gesture-data.h>
#include <dali/internal/event/events/gesture-event-processor.h>
#include <dali/internal/event/common/thread-local-storage.h>
#include <dali/internal/event/common/stage-impl.h>
namespace Internal
{
-namespace
-{
-const std::string INVALID_PROPERTY; // Empty string for invalid calls
-}
-
GestureDetector::GestureDetector(Gesture::Type type)
: mType(type),
- mGestureEventProcessor(ThreadLocalStorage::Get().GetGestureEventProcessor()),
- mSlotDelegate(this)
+ mGestureEventProcessor(ThreadLocalStorage::Get().GetGestureEventProcessor())
{
}
{
for ( GestureDetectorActorContainer::iterator iter = mAttachedActors.begin(), endIter = mAttachedActors.end(); iter != endIter; ++iter )
{
- (*iter)->RemoveObserver( *this );
- (*iter)->TouchedSignal().Disconnect( mSlotDelegate, &GestureDetector::OnTouchEvent );
+ Actor* actor( *iter );
+ actor->RemoveObserver( *this );
+ actor->GetGestureData().RemoveGestureDetector( *this );
}
mAttachedActors.clear();
// We need to observe the actor's destruction
actor.AddObserver(*this);
- // Dummy connection to touch event
- actor.TouchedSignal().Connect( mSlotDelegate, &GestureDetector::OnTouchEvent );
+ // Add the detector to the actor (so the actor knows it requires this gesture when going through hit-test algorithm)
+ actor.GetGestureData().AddGestureDetector( *this );
// Notification for derived classes
OnActorAttach(actor);
// We no longer need to observe the actor's destruction
actor.RemoveObserver(*this);
- mAttachedActors.erase(match);
+ // Remove detector from actor-gesture-data
+ actor.GetGestureData().RemoveGestureDetector( *this );
- // Disconnect connection to touch event
- actor.TouchedSignal().Disconnect( mSlotDelegate, &PanGestureDetector::OnTouchEvent );
+ mAttachedActors.erase(match);
// Notification for derived classes
OnActorDetach(actor);
// We no longer need to observe the actor's destruction
actor->RemoveObserver(*this);
+ // Remove detector from actor-gesture-data
+ actor->GetGestureData().RemoveGestureDetector( *this );
+
// Notification for derived classes
OnActorDetach(*actor);
}
}
}
-bool GestureDetector::OnTouchEvent(Dali::Actor actor, const TouchEvent& event)
-{
- return false;
-}
-
bool GestureDetector::IsSceneObjectRemovable() const
{
return false;
const std::string& GestureDetector::GetDefaultPropertyName( Property::Index index ) const
{
- return INVALID_PROPERTY;
+ return String::EMPTY;
}
Property::Index GestureDetector::GetDefaultPropertyIndex(const std::string& name) const