- case Dali::HitTestAlgorithm::CHECK_ACTOR:
- {
- if( GetImplementation(actor).GetTouchRequired() && // Does the Application or derived actor type require a touch event?
- GetImplementation(actor).IsHittable() ) // Is actor sensitive, visible and on the scene?
- {
- hittable = true;
- }
- break;
- }
- case Dali::HitTestAlgorithm::DESCEND_ACTOR_TREE:
+ return mFunc( Dali::Actor( actor ), Dali::HitTestAlgorithm::CHECK_ACTOR );
+ }
+
+ virtual bool DescendActorHierarchy( Actor* actor )
+ {
+ return mFunc( Dali::Actor( actor ), Dali::HitTestAlgorithm::DESCEND_ACTOR_TREE );
+ }
+
+ virtual bool DoesLayerConsumeHit( Layer* layer )
+ {
+ // Layer::IsTouchConsumed() focuses on touch only. Here we are a wrapper for the public-api
+ // where the caller may want to check for something completely different.
+ // TODO: Should provide a means to let caller decide. For now do not allow layers to consume
+ return false;
+ }
+
+ Dali::HitTestAlgorithm::HitTestFunction mFunc;
+};
+
+/**
+ * Used in the hit-test algorithm to check whether the actor is touchable.
+ * It is used by the touch event processor.
+ */
+struct ActorTouchableCheck : public HitTestInterface
+{
+ virtual bool IsActorHittable( Actor* actor )
+ {
+ return actor->GetTouchRequired() && // Does the Application or derived actor type require a touch event?
+ actor->IsHittable(); // Is actor sensitive, visible and on the scene?
+ }
+
+ virtual bool DescendActorHierarchy( Actor* actor )
+ {
+ return actor->IsVisible() && // Actor is visible, if not visible then none of its children are visible.
+ actor->IsSensitive(); // Actor is sensitive, if insensitive none of its children should be hittable either.
+ }
+
+ virtual bool DoesLayerConsumeHit( Layer* layer )
+ {
+ return layer->IsTouchConsumed();
+ }
+};
+
+/**
+ * Check to see if the actor we're about to hit test is exclusively owned by another rendertask?
+ */
+bool IsActorExclusiveToAnotherRenderTask( const Actor& actor,
+ const RenderTask& renderTask,
+ const Vector< RenderTaskList::Exclusive >& exclusives )
+
+{
+ if ( exclusives.Size() )
+ {
+ for ( Vector< RenderTaskList::Exclusive >::Iterator exclusiveIt = exclusives.Begin(); exclusives.End() != exclusiveIt; ++exclusiveIt )