X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fevents%2Fhit-test-algorithm-impl.h;h=bfe9cb007ff750faf808cd15eac8791b9004ddbf;hb=418d4f93f7158ef267ab389106f831033671c880;hp=1225900ed3d2d64b5c132a7313b7257182647136;hpb=71ea008bc985fb640e2a193d6c5af270e9b897e5;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/events/hit-test-algorithm-impl.h b/dali/internal/event/events/hit-test-algorithm-impl.h index 1225900..bfe9cb0 100644 --- a/dali/internal/event/events/hit-test-algorithm-impl.h +++ b/dali/internal/event/events/hit-test-algorithm-impl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_HIT_TEST_ALGORITHM_H__ -#define __DALI_INTERNAL_HIT_TEST_ALGORITHM_H__ +#ifndef DALI_INTERNAL_HIT_TEST_ALGORITHM_H +#define DALI_INTERNAL_HIT_TEST_ALGORITHM_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ */ // INTERNAL INCLUDES -#include +#include #include namespace Dali @@ -81,12 +81,20 @@ struct HitTestInterface * @return true if the layer should consume the hit, false otherwise. */ virtual bool DoesLayerConsumeHit( Layer* layer ) = 0; + +protected: + + /** + * Virtual destructor, no deletion through this interface + */ + virtual ~HitTestInterface(); + }; /** * @copydoc Dali::HitTestAlgorithm::HitTest(Stage stage, const Vector2& screenCoordinates, Results& results, HitTestFunction func ) */ -void HitTest( Stage& stage, const Vector2& screenCoordinates, Dali::HitTestAlgorithm::Results& results, Dali::HitTestAlgorithm::HitTestFunction func ); +bool HitTest( Stage& stage, const Vector2& screenCoordinates, Dali::HitTestAlgorithm::Results& results, Dali::HitTestAlgorithm::HitTestFunction func ); /** * Given screen coordinates, this method returns the hit actor & the local coordinates relative to the actor etc. @@ -94,6 +102,7 @@ void HitTest( Stage& stage, const Vector2& screenCoordinates, Dali::HitTestAlgor * @param[in] screenCoordinates The screen coordinates. * @param[out] results The results of the hit-test. * @param[in] hitTestInterface Used to determine whether the actor is hit or whether we walk down its hierarchy + * @return true if something was hit * *

Hit Test Algorithm:

* @@ -110,7 +119,7 @@ void HitTest( Stage& stage, const Vector2& screenCoordinates, Dali::HitTestAlgor * @note Currently, we prefer a child hit over a parent (regardless of the distance from the * camera) unless the parent is a RenderableActor but this is subject to change. */ -void HitTest( Stage& stage, const Vector2& screenCoordinates, Results& results, HitTestInterface& hitTestInterface ); +bool HitTest( Stage& stage, const Vector2& screenCoordinates, Results& results, HitTestInterface& hitTestInterface ); /** * Default HitTest where we check if a touch is required. @@ -118,10 +127,11 @@ void HitTest( Stage& stage, const Vector2& screenCoordinates, Results& results, * @param[in] stage The stage. * @param[in] screenCoordinates The screen coordinates. * @param[out] results The results of the hit-test. + * @return true if something was hit * * @see HitTest(Stage&, const Vector2&, Results&, HitTestInterface&) */ -void HitTest( Stage& stage, const Vector2& screenCoordinates, Results& results ); +bool HitTest( Stage& stage, const Vector2& screenCoordinates, Results& results ); /** * Hit test specific to a given RenderTask @@ -131,14 +141,16 @@ void HitTest( Stage& stage, const Vector2& screenCoordinates, Results& results ) * @param[in] screenCoordinates The screen coordinates. * @param[out] results The results of the hit-test. * @param[in] func The function to use in the hit-test algorithm. + * @return true if something was hit */ -void HitTest( Stage& stage, RenderTask& renderTask, const Vector2& screenCoordinates, +bool HitTest( Stage& stage, RenderTask& renderTask, const Vector2& screenCoordinates, Dali::HitTestAlgorithm::Results& results, Dali::HitTestAlgorithm::HitTestFunction func ); + } // namespace HitTestAlgorithm } // namespace Internal } // namespace Dali -#endif // __DALI_INTERNAL_HIT_TEST_ALGORITHM_H__ +#endif // DALI_INTERNAL_HIT_TEST_ALGORITHM_H