Support off-screen buffer rendering in additional windows
[platform/core/uifw/dali-core.git] / dali / internal / event / events / gesture-processor.h
index 2469f33..af39967 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_INTERNAL_GESTURE_PROCESSOR_H__
-#define __DALI_INTERNAL_GESTURE_PROCESSOR_H__
+#ifndef DALI_INTERNAL_GESTURE_PROCESSOR_H
+#define DALI_INTERNAL_GESTURE_PROCESSOR_H
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -21,7 +21,8 @@
 // INTERNAL INCLUDES
 #include <dali/internal/event/events/gesture-detector-impl.h>
 #include <dali/internal/event/events/hit-test-algorithm-impl.h>
-#include <dali/internal/event/common/proxy-object.h>
+#include <dali/internal/event/events/gesture-recognizer.h>
+#include <dali/internal/event/common/object-impl.h>
 
 namespace Dali
 {
@@ -34,8 +35,28 @@ namespace Internal
 /**
  * Base class for the different Gesture Processors.
  */
-class GestureProcessor : public ProxyObject::Observer
+class GestureProcessor : public Object::Observer
 {
+public:
+
+  /**
+   * Process the touch event in the attached recognizer
+   * @param[in] scene Scene.
+   * @param[in] event Touch event to process
+   */
+  void ProcessTouch( Scene& scene, const Integration::TouchEvent& event );
+
+  /**
+   * Returns whether any GestureDetector requires a Core::Update
+   * @return true if update required
+   */
+  inline bool NeedsUpdate()
+  {
+    bool updateRequired = mNeedsUpdate;
+    mNeedsUpdate = false;
+    return updateRequired;
+  }
+
 protected:
 
   // Construction & Destruction
@@ -76,12 +97,12 @@ protected:
 
   /**
    * Hit test the screen coordinates, and place the results in hitTestResults.
-   * @param[in] stage Stage.
+   * @param[in] scene Scene.
    * @param[in] screenCoordinates The screen coordinates to test.
    * @param[out] hitTestResults Structure to write results into.
    * @return false if the system overlay was hit or no actor was hit.
    */
-  virtual bool HitTest(Stage& stage, Vector2 screenCoordinates, HitTestAlgorithm::Results& hitTestResults);
+  virtual bool HitTest( Scene& scene, Vector2 screenCoordinates, HitTestAlgorithm::Results& hitTestResults);
 
   /**
    * Sets the mCurrentGesturedActor and connects to the required signals.
@@ -141,25 +162,31 @@ 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()
+   * @param[in] object The object object.
+   * @see Object::Observer::SceneObjectAdded()
    */
-  virtual void SceneObjectAdded(ProxyObject& proxy) { }
+  virtual void SceneObjectAdded(Object& object) { }
 
   /**
    * 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()
+   * @param[in] object The object object.
+   * @see Object::Observer::SceneObjectRemoved()
    */
-  virtual void SceneObjectRemoved(ProxyObject& proxy);
+  virtual void SceneObjectRemoved(Object& object);
 
   /**
    * 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()
+   * @see Object::Observer::ObjectDestroyed()
    */
-  virtual void ProxyDestroyed(ProxyObject& proxy);
+  virtual void ObjectDestroyed(Object& object);
+
+
+protected:  //Data
+
+  GestureRecognizerPtr mGestureRecognizer;  ///< The gesture recognizer
+  bool   mNeedsUpdate;                 ///< Indicates if any GestureDetector requires a Core::Update
 
 private: // Data
 
@@ -172,4 +199,4 @@ private: // Data
 
 } // namespace Dali
 
-#endif // __DALI_INTERNAL_GESTURE_PROCESSOR_H__
+#endif // DALI_INTERNAL_GESTURE_PROCESSOR_H