X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fevents%2Ftouch-event-processor.h;h=75849aecf850e26e08ca30de2fdc8bfd87967a65;hb=d7775bfee328210d5b7300caf0fccfc2ec3dc2e8;hp=40220454c82a87c5dcb748f5f165fd437470e540;hpb=7dcb0a38005dd8c6d71e466c1ea0ec4d7d57239f;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/events/touch-event-processor.h b/dali/internal/event/events/touch-event-processor.h index 4022045..75849ae 100644 --- a/dali/internal/event/events/touch-event-processor.h +++ b/dali/internal/event/events/touch-event-processor.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_TOUCH_EVENT_PROCESSOR_H__ -#define __DALI_INTERNAL_TOUCH_EVENT_PROCESSOR_H__ +#ifndef DALI_INTERNAL_TOUCH_EVENT_PROCESSOR_H +#define DALI_INTERNAL_TOUCH_EVENT_PROCESSOR_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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,12 +19,12 @@ */ // INTERNAL INCLUDES -#include -#include +#include +#include +#include namespace Dali { - class Actor; struct Vector2; struct Vector4; @@ -36,9 +36,9 @@ struct TouchEvent; namespace Internal { - class Actor; -class Stage; +class Scene; +struct ActorObserver; /** *

Multi-Touch Event Processing:

@@ -51,12 +51,11 @@ class Stage; class TouchEventProcessor { public: - /** * Create an event processor. - * @param[in] stage The stage. + * @param[in] scene The scene the event processor belongs to. */ - TouchEventProcessor( Stage& stage ); + TouchEventProcessor(Scene& scene); /** * Non-virtual destructor; TouchEventProcessor is not a base class @@ -66,11 +65,11 @@ public: /** * This function is called by the event processor whenever a touch event occurs. * @param[in] event The touch event that has occurred. + * @return true if consumed */ - void ProcessTouchEvent( const Integration::TouchEvent& event ); + bool ProcessTouchEvent(const Integration::TouchEvent& event); private: - // Undefined TouchEventProcessor(const TouchEventProcessor&); @@ -78,89 +77,31 @@ private: TouchEventProcessor& operator=(const TouchEventProcessor& rhs); private: + Scene& mScene; ///< Used to deliver touch events + + /** + * Called by some actor-observers when the observed actor is disconnected. + * + * @param[in] actor The actor that has been disconnected. + */ + void OnObservedActorDisconnected(Actor* actor); /** - * Stores an actor pointer and connects/disconnects to any required signals appropriately when set/unset. + * Clears the value. */ - struct ActorObserver : public ProxyObject::Observer - { - public: - - // Construction & Destruction - - /** - * Constructor. - */ - ActorObserver(); - - /** - * Non virtual destructor - */ - ~ActorObserver(); - - // Methods - - /** - * Return the stored Actor pointer. - * @return The Actor pointer. - */ - Actor* GetActor(); - - /** - * Assignment operator. - * This disconnects the required signals from the currently set actor and connects to the required - * signals for the the actor specified (if set). - */ - void SetActor( Actor* actor ); - - /** - * Resets the set actor and disconnects any connected signals. - */ - void ResetActor(); - - private: - - // Undefined - ActorObserver( const ActorObserver& ); - ActorObserver& operator=( const ActorObserver& ); - - private: - - /** - * This will never get called as we do not observe objects that have not been added to the scene. - * @param[in] proxy The proxy object. - * @see ProxyObject::Observer::SceneObjectAdded() - */ - virtual void SceneObjectAdded(ProxyObject& proxy) { } - - /** - * This will be called when the actor is removed from the stage, we should clear and stop - * observing it. - * @param[in] proxy The proxy object. - * @see ProxyObject::Observer::SceneObjectRemoved() - */ - virtual void SceneObjectRemoved(ProxyObject& proxy); - - /** - * This will be called when the actor is destroyed. We should clear the actor. - * No need to stop observing as the object is being destroyed anyway. - * @see ProxyObject::Observer::ProxyDestroyed() - */ - virtual void ProxyDestroyed(ProxyObject& proxy); - - private: - Actor* mActor; ///< Raw pointer to an Actor. - bool mActorDisconnected; ///< Indicates whether the actor has been disconnected from the scene - }; - - Stage& mStage; ///< Used to deliver touch events - ActorObserver mLastPrimaryHitActor; ///< Stores the last primary point hit actor - ActorObserver mLastConsumedActor; ///< Stores the last consumed actor - Dali::RenderTask mLastRenderTask; ///< The RenderTask used for the last hit actor + void Clear(); + + ActorObserver mLastPrimaryHitActor; ///< Stores the last primary point hit actor + ActorObserver mLastConsumedActor; ///< Stores the last consumed actor + ActorObserver mCapturingTouchActor; ///< Stored the actor that captures touch + ActorObserver mOwnTouchActor; ///< Stored the actor that own touch + ActorObserver mTouchDownConsumedActor; ///< Stores the touch-down consumed actor + RenderTaskPtr mLastRenderTask; ///< The RenderTask used for the last hit actor + PointState::Type mLastPrimaryPointState; ///< Stores the last primary point state }; } // namespace Internal } // namespace Dali -#endif // __DALI_INTERNAL_TOUCH_EVENT_PROCESSOR_H__ +#endif // DALI_INTERNAL_TOUCH_EVENT_PROCESSOR_H