Add EmitWheelEventGeneratedSignal for custom wheel event
[platform/core/uifw/dali-core.git] / dali / internal / event / common / scene-impl.h
index 01e4b47..7c856ab 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_H
 
 /*
- * Copyright (c) 2021 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.
@@ -38,63 +38,9 @@ struct Event;
 
 namespace Internal
 {
-//@todo Break this dependence somehow.
-namespace Render
-{
-class Renderer;
-}
-
 namespace SceneGraph
 {
 class Scene;
-
-struct DirtyRect
-{
-  DirtyRect(Node* node, Render::Renderer* renderer, int frame, Rect<int>& rect)
-  : node(node),
-    renderer(renderer),
-    frame(frame),
-    rect(rect),
-    visited(true)
-  {
-  }
-
-  DirtyRect()
-  : node(nullptr),
-    renderer(nullptr),
-    frame(0),
-    rect(),
-    visited(true)
-  {
-  }
-
-  bool operator<(const DirtyRect& rhs) const
-  {
-    if(node == rhs.node)
-    {
-      if(renderer == rhs.renderer)
-      {
-        return frame > rhs.frame; // Most recent rects come first
-      }
-      else
-      {
-        return renderer < rhs.renderer;
-      }
-    }
-    else
-    {
-      return node < rhs.node;
-    }
-  }
-
-  Node*             node;
-  Render::Renderer* renderer;
-  int               frame;
-
-  Rect<int> rect;
-  bool      visited;
-};
-
 } // namespace SceneGraph
 
 class EventProcessor;
@@ -116,7 +62,7 @@ public:
   /**
    * @copydoc Dali::Integration::Scene::New
    */
-  static ScenePtr New(Size size, int orientation = 0);
+  static ScenePtr New(Size size, int32_t orientation = 0);
 
   /**
    * virtual destructor
@@ -242,14 +188,37 @@ public:
    * @param[in] height The height of rotated surface
    * @param[in] orientation The orientation of rotated surface
    */
-  void SurfaceRotated(float width, float height, int orientation);
+  void SurfaceRotated(float width, float height, int32_t orientation);
 
   /**
-   * @brief Get surface's current orientation
-   *
-   * @return surface orientation
+   * @copydoc Dali::Integration::Scene::SetRotationCompletedAcknowledgement
    */
-  int GetSurfaceOrientation();
+  void SetRotationCompletedAcknowledgement();
+
+  /**
+   * @copydoc Dali::Integration::Scene::IsRotationCompletedAcknowledgementSet
+   */
+  bool IsRotationCompletedAcknowledgementSet() const;
+
+  /**
+   * @copydoc Dali::Integration::Scene::GetCurrentSurfaceOrientation
+   */
+  int32_t GetCurrentSurfaceOrientation() const;
+
+  /**
+   * @copydoc Dali::Integration::Scene::GetCurrentSurfaceRect
+   */
+  const Rect<int32_t>& GetCurrentSurfaceRect() const;
+
+  /**
+   * @copydoc Dali::Integration::Scene::IsSurfaceRectChanged
+   */
+  bool IsSurfaceRectChanged() const;
+
+  /**
+   * @copydoc Dali::Integration::Scene::SetSurfaceRenderTarget
+   */
+  void SetSurfaceRenderTarget(const Graphics::RenderTargetCreateInfo& renderTargetCreateInfo);
 
   /**
    * Used by the EventProcessor to emit key event signals.
@@ -284,6 +253,13 @@ public:
   void EmitWheelEventSignal(const Dali::WheelEvent& event);
 
   /**
+   * Used by the WheelEventProcessor to emit WheelEventGenerated signals.
+   * @param[in] event The wheel event.
+   * @return The return is true if WheelEvent is consumed, otherwise false.
+   */
+  bool EmitWheelEventGeneratedSignal(const Dali::WheelEvent& event);
+
+  /**
    * @copydoc Dali::Integration::Scene::AddFrameRenderedCallback
    */
   void AddFrameRenderedCallback(std::unique_ptr<CallbackBase> callback, int32_t frameId);
@@ -329,11 +305,9 @@ public:
   Integration::Scene::WheelEventSignalType& WheelEventSignal();
 
   /**
-   * @brief Get ItemsDirtyRects
-   *
-   * @return the ItemsDirtyRects
+   * @copydoc Integration::Scene::WheelEventGeneratedSignal()
    */
-  std::vector<Dali::Internal::SceneGraph::DirtyRect>& GetItemsDirtyRects();
+  Integration::Scene::WheelEventGeneratedSignalType& WheelEventGeneratedSignal();
 
 public:
   /**
@@ -346,7 +320,7 @@ public:
    * From RenderTaskDefaults; retrieve the default camera actor.
    * @return The default camera actor.
    */
-  CameraActor& GetDefaultCameraActor() override;
+  CameraActor& GetDefaultCameraActor() const override;
 
 private:
   // Constructor
@@ -358,7 +332,7 @@ private:
    * @param[in] size The size of the set surface
    * @param[in] orientation The orientation of the set surface for this scene
    */
-  void Initialize(Size size, int orientation);
+  void Initialize(Size size, int32_t orientation);
 
   // Undefined
   Scene(const Scene&) = delete;
@@ -373,7 +347,7 @@ private:
    * @param[in] height The height of rotated surface
    * @param[in] orientation The orientation of rotated surface
    */
-  void ChangedSurface(float width, float height, int orientation);
+  void ChangedSurface(float width, float height, int32_t orientation);
 
 private:
   Internal::SceneGraph::Scene* mSceneObject;
@@ -399,7 +373,7 @@ private:
   EventProcessor mEventProcessor;
 
   // The Surface's orientation
-  int mSurfaceOrientation;
+  int32_t mSurfaceOrientation;
 
   // The key event signal
   Integration::Scene::KeyEventSignalType          mKeyEventSignal;
@@ -412,9 +386,8 @@ private:
   Integration::Scene::TouchEventSignalType mTouchedSignal;
 
   // The wheel event signal
-  Integration::Scene::WheelEventSignalType mWheelEventSignal;
-
-  std::vector<Dali::Internal::SceneGraph::DirtyRect> mItemsDirtyRects;
+  Integration::Scene::WheelEventSignalType          mWheelEventSignal;
+  Integration::Scene::WheelEventGeneratedSignalType mWheelEventGeneratedSignal;
 };
 
 } // namespace Internal