[dali_2.2.0] Merge branch 'devel/master' 70/283870/1
authorAdam Bialogonski <adam.b@samsung.com>
Fri, 4 Nov 2022 10:36:13 +0000 (10:36 +0000)
committerAdam Bialogonski <adam.b@samsung.com>
Fri, 4 Nov 2022 10:36:13 +0000 (10:36 +0000)
Change-Id: I21de27fa0cb3d5444f8558b50cdce2cc1e77b859

36 files changed:
automated-tests/src/dali-internal/utc-Dali-Internal-TapGesture.cpp
automated-tests/src/dali/utc-Dali-RenderTask.cpp
automated-tests/src/dali/utc-Dali-Scene.cpp
automated-tests/src/dali/utc-Dali-TapGestureDetector.cpp
dali/integration-api/scene.cpp
dali/integration-api/scene.h
dali/internal/event/common/scene-impl.cpp
dali/internal/event/common/scene-impl.h
dali/internal/event/events/gesture-event.cpp
dali/internal/event/events/gesture-event.h
dali/internal/event/events/gesture-impl.h
dali/internal/event/events/gesture-recognizer.h
dali/internal/event/events/long-press-gesture/long-press-gesture-processor.cpp
dali/internal/event/events/long-press-gesture/long-press-gesture-recognizer.cpp
dali/internal/event/events/pan-gesture/pan-gesture-processor.cpp
dali/internal/event/events/pan-gesture/pan-gesture-recognizer.cpp
dali/internal/event/events/pinch-gesture/pinch-gesture-processor.cpp
dali/internal/event/events/pinch-gesture/pinch-gesture-recognizer.cpp
dali/internal/event/events/rotation-gesture/rotation-gesture-processor.cpp
dali/internal/event/events/rotation-gesture/rotation-gesture-recognizer.cpp
dali/internal/event/events/tap-gesture/tap-gesture-detector-impl.cpp
dali/internal/event/events/tap-gesture/tap-gesture-event.cpp
dali/internal/event/events/tap-gesture/tap-gesture-event.h
dali/internal/event/events/tap-gesture/tap-gesture-impl.h
dali/internal/event/events/tap-gesture/tap-gesture-processor.cpp
dali/internal/event/events/tap-gesture/tap-gesture-recognizer.cpp
dali/internal/event/events/tap-gesture/tap-gesture-recognizer.h
dali/internal/update/common/scene-graph-scene.cpp
dali/internal/update/common/scene-graph-scene.h
dali/public-api/dali-core-version.cpp
dali/public-api/events/gesture-enumerations.h
dali/public-api/events/gesture.cpp
dali/public-api/events/gesture.h
dali/public-api/events/tap-gesture.cpp
dali/public-api/events/tap-gesture.h
packaging/dali.spec

index 483fe64..87becc2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -136,20 +136,3 @@ int UtcDaliTapGestureSetGetLocalPointP(void)
 
   END_TEST;
 }
-
-int UtcDaliTapGestureSetGetSourceTypeP(void)
-{
-  TapGesture gesture = DevelTapGesture::New(GestureState::STARTED);
-  DALI_TEST_EQUALS(gesture.GetSourceType(), GestureSourceType::INVALID, TEST_LOCATION);
-
-  GetImplementation(gesture).SetGestureSourceType(GestureSourceType::PRIMARY);
-  DALI_TEST_EQUALS(gesture.GetSourceType(), GestureSourceType::PRIMARY, TEST_LOCATION);
-
-  GetImplementation(gesture).SetGestureSourceType(GestureSourceType::SECONDARY);
-  DALI_TEST_EQUALS(gesture.GetSourceType(), GestureSourceType::SECONDARY, TEST_LOCATION);
-
-  GetImplementation(gesture).SetGestureSourceType(GestureSourceType::TERTIARY);
-  DALI_TEST_EQUALS(gesture.GetSourceType(), GestureSourceType::TERTIARY, TEST_LOCATION);
-
-  END_TEST;
-}
\ No newline at end of file
index e625d29..e3857dc 100644 (file)
@@ -3666,9 +3666,9 @@ int UtcDaliRenderTaskViewportGuideActor02(void)
   renderTask.SetSourceActor(blue);
   renderTask.SetViewportGuideActor(blue);
 
-  application.GetScene().SurfaceRotated(TestApplication::DEFAULT_SURFACE_HEIGHT,
-                                        TestApplication::DEFAULT_SURFACE_WIDTH,
-                                        90);
+  application.GetScene().SurfaceRotated(static_cast<float>(TestApplication::DEFAULT_SURFACE_HEIGHT),
+                                        static_cast<float>(TestApplication::DEFAULT_SURFACE_WIDTH),
+                                        90, 0);
 
   // Render and notify
   application.SendNotification();
@@ -3682,4 +3682,4 @@ int UtcDaliRenderTaskViewportGuideActor02(void)
   DALI_TEST_CHECK(callStack.FindIndexFromMethodAndParams("Viewport", viewportParams2) >= 0);
 
   END_TEST;
-}
\ No newline at end of file
+}
index 37e3854..e4e0369 100644 (file)
@@ -1172,18 +1172,21 @@ int UtcDaliSceneSurfaceRotatedWithAngle0(void)
   actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
   application.GetScene().Add(actor);
 
+  // consume the orientating changing flag by first rendering
   application.SendNotification();
 
   damagedRects.clear();
   application.GetScene().SurfaceRotated(TestApplication::DEFAULT_SURFACE_WIDTH,
                                         TestApplication::DEFAULT_SURFACE_HEIGHT,
-                                        0);
+                                        0, 0);
 
-  // Check current surface orientation
+  // Check current orientations
   int32_t orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  int32_t screenOrientation = application.GetScene().GetCurrentScreenOrientation();
 
   // It should not be changed yet.
   DALI_TEST_EQUALS(orientation, 0, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 0, TEST_LOCATION);
 
   application.SendNotification();
   application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
@@ -1198,11 +1201,13 @@ int UtcDaliSceneSurfaceRotatedWithAngle0(void)
   DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
   DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
 
-  // Check current surface orientation
+  // Check current orientations
   orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  screenOrientation = application.GetScene().GetCurrentScreenOrientation();
 
   // It should be changed.
   DALI_TEST_EQUALS(orientation, 0, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 0, TEST_LOCATION);
 
   END_TEST;
 }
@@ -1243,13 +1248,15 @@ int UtcDaliSceneSurfaceRotatedWithAngle90(void)
   damagedRects.clear();
   application.GetScene().SurfaceRotated(TestApplication::DEFAULT_SURFACE_WIDTH,
                                         TestApplication::DEFAULT_SURFACE_HEIGHT,
-                                        90);
+                                        90, 90);
 
   // Check current surface orientation
   int32_t orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  int32_t screenOrientation = application.GetScene().GetCurrentScreenOrientation();
 
   // It should not be changed yet.
   DALI_TEST_EQUALS(orientation, 0, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 0, TEST_LOCATION);
 
   application.SendNotification();
   application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
@@ -1271,11 +1278,13 @@ int UtcDaliSceneSurfaceRotatedWithAngle90(void)
   DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
   DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
 
-  // Check current surface orientation
+  // Check current orientations
   orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  screenOrientation = application.GetScene().GetCurrentScreenOrientation();
 
   // It should be changed.
   DALI_TEST_EQUALS(orientation, 90, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 90, TEST_LOCATION);
 
   END_TEST;
 }
@@ -1316,13 +1325,15 @@ int UtcDaliSceneSurfaceRotatedWithAngle180(void)
   damagedRects.clear();
   application.GetScene().SurfaceRotated(TestApplication::DEFAULT_SURFACE_WIDTH,
                                         TestApplication::DEFAULT_SURFACE_HEIGHT,
-                                        180);
+                                        180, 180);
 
   // Check current surface orientation
   int32_t orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  int32_t screenOrientation = application.GetScene().GetCurrentScreenOrientation();
 
   // It should not be changed yet.
   DALI_TEST_EQUALS(orientation, 0, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 0, TEST_LOCATION);
 
   application.SendNotification();
   application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
@@ -1344,11 +1355,13 @@ int UtcDaliSceneSurfaceRotatedWithAngle180(void)
   DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
   DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
 
-  // Check current surface orientation
+  // Check current orientations
   orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  screenOrientation = application.GetScene().GetCurrentScreenOrientation();
 
   // It should be changed.
   DALI_TEST_EQUALS(orientation, 180, TEST_LOCATION);
+DALI_TEST_EQUALS(screenOrientation, 180, TEST_LOCATION);
 
   END_TEST;
 }
@@ -1389,13 +1402,15 @@ int UtcDaliSceneSurfaceRotatedWithAngle270(void)
   damagedRects.clear();
   application.GetScene().SurfaceRotated(TestApplication::DEFAULT_SURFACE_WIDTH,
                                         TestApplication::DEFAULT_SURFACE_HEIGHT,
-                                        270);
+                                        270, 270);
 
   // Check current surface orientation
   int32_t orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  int32_t screenOrientation = application.GetScene().GetCurrentScreenOrientation();
 
   // It should not be changed yet.
   DALI_TEST_EQUALS(orientation, 0, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 0, TEST_LOCATION);
 
   application.SendNotification();
   application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
@@ -1417,11 +1432,13 @@ int UtcDaliSceneSurfaceRotatedWithAngle270(void)
   DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
   DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
 
-  // Check current surface orientation
+  // Check current orientations
   orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  screenOrientation = application.GetScene().GetCurrentScreenOrientation();
 
   // It should be changed.
   DALI_TEST_EQUALS(orientation, 270, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 270, TEST_LOCATION);
 
   END_TEST;
 }
@@ -1460,13 +1477,15 @@ int UtcDaliSceneSetRotationCompletedAcknowledgementWithAngle90(void)
   damagedRects.clear();
   application.GetScene().SurfaceRotated(TestApplication::DEFAULT_SURFACE_WIDTH,
                                         TestApplication::DEFAULT_SURFACE_HEIGHT,
-                                        90);
+                                        90, 90);
 
   // Check current surface orientation
   int32_t orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  int32_t screenOrientation = application.GetScene().GetCurrentScreenOrientation();
 
   // It should not be changed yet.
   DALI_TEST_EQUALS(orientation, 0, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 0, TEST_LOCATION);
 
   application.GetScene().SetRotationCompletedAcknowledgement();
 
@@ -1490,11 +1509,13 @@ int UtcDaliSceneSetRotationCompletedAcknowledgementWithAngle90(void)
   DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
   DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
 
-  // Check current surface orientation
+  // Check current orientations
   orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  screenOrientation = application.GetScene().GetCurrentScreenOrientation();
 
   // It should be changed.
   DALI_TEST_EQUALS(orientation, 90, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 90, TEST_LOCATION);
 
   bool isSetRotationCompletedAcknowledgementSet = application.GetScene().IsRotationCompletedAcknowledgementSet();
   DALI_TEST_EQUALS(isSetRotationCompletedAcknowledgementSet, true, TEST_LOCATION);
@@ -1561,7 +1582,7 @@ int UtcDaliSceneSurfaceRotatedPartialUpdate(void)
   // Rotate surface
   application.GetScene().SurfaceRotated(TestApplication::DEFAULT_SURFACE_HEIGHT,
                                         TestApplication::DEFAULT_SURFACE_WIDTH,
-                                        90);
+                                        90, 0);
 
   damagedRects.clear();
 
index 851040b..50c1d8f 100644 (file)
@@ -1050,22 +1050,13 @@ int UtcDaliTapGestureGetSourceType(void)
   detector.DetectedSignal().Connect(&application, functor);
 
   // Emit a down signal with MouseButton
-  application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, Vector2(20.0f, 20.0f), 0, 100));
-  application.ProcessEvent(GenerateSingleTouch(PointState::UP, Vector2(20.0f, 20.0f), 0, 120));
-  application.SendNotification();
-
-  DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(data.receivedGesture.GetSourceType(), GestureSourceType::INVALID, TEST_LOCATION);
-
-  data.Reset();
-
-  // Emit a down signal with MouseButton
-  application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, Vector2(20.0f, 20.0f), 1, 700));
-  application.ProcessEvent(GenerateSingleTouch(PointState::UP, Vector2(20.0f, 20.0f), 1, 720));
+  application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, Vector2(20.0f, 20.0f), 1, 100));
+  application.ProcessEvent(GenerateSingleTouch(PointState::UP, Vector2(20.0f, 20.0f), 1, 120));
   application.SendNotification();
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(data.receivedGesture.GetSourceType(), GestureSourceType::PRIMARY, TEST_LOCATION);
+  DALI_TEST_EQUALS(data.receivedGesture.GetSourceType(), GestureSourceType::MOUSE, TEST_LOCATION);
+  DALI_TEST_EQUALS(data.receivedGesture.GetSourceData(), GestureSourceData::MOUSE_PRIMARY, TEST_LOCATION);
 
   data.Reset();
 
@@ -1075,7 +1066,8 @@ int UtcDaliTapGestureGetSourceType(void)
   application.SendNotification();
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(data.receivedGesture.GetSourceType(), GestureSourceType::SECONDARY, TEST_LOCATION);
+  DALI_TEST_EQUALS(data.receivedGesture.GetSourceType(), GestureSourceType::MOUSE, TEST_LOCATION);
+  DALI_TEST_EQUALS(data.receivedGesture.GetSourceData(), GestureSourceData::MOUSE_SECONDARY, TEST_LOCATION);
 
   data.Reset();
 
@@ -1085,7 +1077,8 @@ int UtcDaliTapGestureGetSourceType(void)
   application.SendNotification();
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(data.receivedGesture.GetSourceType(), GestureSourceType::TERTIARY, TEST_LOCATION);
+  DALI_TEST_EQUALS(data.receivedGesture.GetSourceType(), GestureSourceType::MOUSE, TEST_LOCATION);
+  DALI_TEST_EQUALS(data.receivedGesture.GetSourceData(), GestureSourceData::MOUSE_TERTIARY, TEST_LOCATION);
 
   END_TEST;
 }
index 28dbe68..cce626d 100644 (file)
@@ -30,9 +30,9 @@ namespace Dali
 {
 namespace Integration
 {
-Scene Scene::New(Size size, int32_t orientation)
+Scene Scene::New(Size size, int32_t windowOrientation, int32_t screenOrientation)
 {
-  Internal::ScenePtr internal = Internal::Scene::New(size, orientation);
+  Internal::ScenePtr internal = Internal::Scene::New(size, windowOrientation, screenOrientation);
   return Scene(internal.Get());
 }
 
@@ -164,9 +164,9 @@ void Scene::GetFramePresentedCallback(FrameCallbackContainer& callbacks)
   GetImplementation(*this).GetFramePresentedCallback(callbacks);
 }
 
-void Scene::SurfaceRotated(float width, float height, int32_t orientation)
+void Scene::SurfaceRotated(float width, float height, int32_t windowOrientation, int32_t screenOrientation)
 {
-  GetImplementation(*this).SurfaceRotated(width, height, orientation);
+  GetImplementation(*this).SurfaceRotated(width, height, windowOrientation, screenOrientation);
 }
 
 int32_t Scene::GetCurrentSurfaceOrientation() const
@@ -174,6 +174,11 @@ int32_t Scene::GetCurrentSurfaceOrientation() const
   return GetImplementation(*this).GetCurrentSurfaceOrientation();
 }
 
+int32_t Scene::GetCurrentScreenOrientation() const
+{
+  return GetImplementation(*this).GetCurrentScreenOrientation();
+}
+
 const Rect<int32_t>& Scene::GetCurrentSurfaceRect() const
 {
   return GetImplementation(*this).GetCurrentSurfaceRect();
index 8b463ec..bdaf814 100644 (file)
@@ -74,11 +74,12 @@ public:
    * @brief Create an initialized Scene handle.
    *
    * @param[in] size The size of the set surface for this scene
-   * @param[in] orientation The rotated angle of the set surface for this scene
+   * @param[in] windowOrientation The rotated angle of the set surface for this scene
+   * @param[in] screenOrientation The rotated angle of the screen
    *
    * @return a handle to a newly allocated Dali resource.
    */
-  static Scene New(Size size, int32_t orientation = 0);
+  static Scene New(Size size, int32_t windowOrientation = 0, int32_t screenOrientation = 0);
 
   /**
    * @brief Downcast an Object handle to Scene handle.
@@ -304,9 +305,10 @@ public:
    *
    * @param[in] width The width of rotated surface
    * @param[in] height The height of rotated surface
-   * @param[in] orientation The orientation of rotated surface
+   * @param[in] windowOrientation the current window orientation
+   * @param[in] screenOrientation the current screen orientation
    */
-  void SurfaceRotated(float width, float height, int32_t orientation);
+  void SurfaceRotated(float width, float height, int32_t windowOrientation, int32_t screenOrientation);
 
   /**
    * @brief Gets the current surface orientation. It gets the value from the scene object.
@@ -316,6 +318,13 @@ public:
   int32_t GetCurrentSurfaceOrientation() const;
 
   /**
+   * @brief Gets the current screen orientation. It gets the value from the scene object.
+   *
+   * @return The current screen orientation.
+   */
+  int32_t GetCurrentScreenOrientation() const;
+
+  /**
    * @brief Gets the current surface rectangle. It gets the value from the scene object.
    *
    * @return The current surface rectangle
index cdec748..ea5c689 100644 (file)
@@ -41,12 +41,12 @@ namespace Dali
 {
 namespace Internal
 {
-ScenePtr Scene::New(Size size, int32_t orientation)
+ScenePtr Scene::New(Size size, int32_t windowOrientation, int32_t screenOrientation)
 {
   ScenePtr scene = new Scene;
 
   // Second-phase construction
-  scene->Initialize(size, orientation);
+  scene->Initialize(size, windowOrientation, screenOrientation);
 
   return scene;
 }
@@ -58,7 +58,8 @@ Scene::Scene()
   mBackgroundColor(DEFAULT_BACKGROUND_COLOR),
   mDepthTreeDirty(false),
   mEventProcessor(*this, ThreadLocalStorage::GetInternal()->GetGestureEventProcessor()),
-  mSurfaceOrientation(0)
+  mSurfaceOrientation(0),
+  mScreenOrientation(0)
 {
 }
 
@@ -93,7 +94,7 @@ Scene::~Scene()
   // When this destructor is called, the scene has either already been removed from Core or Core has already been destroyed
 }
 
-void Scene::Initialize(Size size, int32_t orientation)
+void Scene::Initialize(Size size, int32_t windowOrientation, int32_t screenOrientation)
 {
   ThreadLocalStorage* tls = ThreadLocalStorage::GetInternal();
 
@@ -135,7 +136,7 @@ void Scene::Initialize(Size size, int32_t orientation)
   OwnerPointer<SceneGraph::Scene> transferOwnership(const_cast<SceneGraph::Scene*>(mSceneObject));
   AddSceneMessage(updateManager, transferOwnership);
 
-  SurfaceRotated(size.width, size.height, orientation);
+  SurfaceRotated(size.width, size.height, windowOrientation, screenOrientation);
 }
 
 void Scene::Add(Actor& actor)
@@ -202,7 +203,7 @@ void Scene::SurfaceResized(float width, float height)
 {
   if((fabsf(mSize.width - width) > Math::MACHINE_EPSILON_1) || (fabsf(mSize.height - height) > Math::MACHINE_EPSILON_1))
   {
-    ChangedSurface(width, height, mSurfaceOrientation);
+    ChangedSurface(width, height, mSurfaceOrientation, mScreenOrientation);
   }
 }
 
@@ -277,10 +278,9 @@ void Scene::EmitKeyEventSignal(const Dali::KeyEvent& event)
   }
 }
 
-void Scene::SurfaceRotated(float width, float height, int32_t orientation)
+void Scene::SurfaceRotated(float width, float height, int32_t windowOrientation, int32_t screenOrientation)
 {
-  mSurfaceOrientation = orientation;
-  ChangedSurface(width, height, orientation);
+  ChangedSurface(width, height, windowOrientation, screenOrientation);
 }
 
 int32_t Scene::GetCurrentSurfaceOrientation() const
@@ -288,28 +288,51 @@ int32_t Scene::GetCurrentSurfaceOrientation() const
   return mSceneObject->GetSurfaceOrientation();
 }
 
+int32_t Scene::GetCurrentScreenOrientation() const
+{
+  return mSceneObject->GetScreenOrientation();
+}
+
 const Rect<int32_t>& Scene::GetCurrentSurfaceRect() const
 {
   return mSceneObject->GetSurfaceRect();
 }
 
-void Scene::ChangedSurface(float width, float height, int32_t orientation)
+void Scene::ChangedSurface(float width, float height, int32_t windowOrientation, int32_t screenOrientation)
 {
+  bool changedOrientation = false;
   Rect<int32_t> newSize(0, 0, static_cast<int32_t>(width), static_cast<int32_t>(height)); // truncated
   mSize.width  = width;
   mSize.height = height;
 
+  if(mSurfaceOrientation != windowOrientation || mScreenOrientation != screenOrientation)
+  {
+    changedOrientation = true;
+  }
+
+  mSurfaceOrientation = windowOrientation;
+  mScreenOrientation = screenOrientation;
+
   // Calculates the aspect ratio, near and far clipping planes, field of view and camera Z position.
   mDefaultCamera->SetPerspectiveProjection(mSize);
   // Set the surface orientation to Default camera for window/screen rotation
-  mDefaultCamera->RotateProjection(orientation);
+  if(changedOrientation)
+  {
+    int32_t orientation = (windowOrientation + screenOrientation) % 360;
+    mDefaultCamera->RotateProjection(orientation);
+  }
 
   mRootLayer->SetSize(width, height);
 
   // Send the surface rectangle/orientation to SceneGraph::Scene for calculating glViewport/Scissor
   ThreadLocalStorage* tls = ThreadLocalStorage::GetInternal();
+  DALI_LOG_RELEASE_INFO("Send Surface Rect Message, width[%d], height[%d]\n", newSize.width, newSize.height);
   SetSurfaceRectMessage(tls->GetEventThreadServices(), *mSceneObject, newSize);
-  SetSurfaceOrientationMessage(tls->GetEventThreadServices(), *mSceneObject, static_cast<int32_t>(orientation));
+  if(changedOrientation)
+  {
+    DALI_LOG_RELEASE_INFO("Send Surface Orientation Message, surface orientation[%d], screen orientation[%d]\n", mSurfaceOrientation, mScreenOrientation);
+    SetSurfaceOrientationsMessage(tls->GetEventThreadServices(), *mSceneObject, mSurfaceOrientation, mScreenOrientation);
+  }
 
   // set default render-task viewport parameters
   RenderTaskPtr defaultRenderTask = mRenderTaskList->GetTask(0u);
index 182ed0f..52ea356 100644 (file)
@@ -62,7 +62,7 @@ public:
   /**
    * @copydoc Dali::Integration::Scene::New
    */
-  static ScenePtr New(Size size, int32_t orientation = 0);
+  static ScenePtr New(Size size, int32_t windowOrientation = 0, int32_t screenOrientation = 0);
 
   /**
    * virtual destructor
@@ -186,9 +186,10 @@ public:
    *
    * @param[in] width The width of rotated surface
    * @param[in] height The height of rotated surface
-   * @param[in] orientation The orientation of rotated surface
+   * @param[in] windowOrientation the current window orientation
+   * @param[in] screenOrientation the current screen orientation
    */
-  void SurfaceRotated(float width, float height, int32_t orientation);
+  void SurfaceRotated(float width, float height, int32_t windowOrientation, int32_t screenOrientation);
 
   /**
    * @copydoc Dali::Integration::Scene::SetRotationCompletedAcknowledgement
@@ -206,6 +207,11 @@ public:
   int32_t GetCurrentSurfaceOrientation() const;
 
   /**
+   * @copydoc Dali::Integration::Scene::GetCurrentScreenOrientation
+   */
+  int32_t GetCurrentScreenOrientation() const;
+
+  /**
    * @copydoc Dali::Integration::Scene::GetCurrentSurfaceRect
    */
   const Rect<int32_t>& GetCurrentSurfaceRect() const;
@@ -342,9 +348,10 @@ private:
    * Second-phase constructor.
    *
    * @param[in] size The size of the set surface
-   * @param[in] orientation The orientation of the set surface for this scene
+   * @param[in] windowOrientation The rotated angle of the set surface for this scene
+   * @param[in] screenOrientation The rotated angle of the screen
    */
-  void Initialize(Size size, int32_t orientation);
+  void Initialize(Size size, int32_t windowOrientation, int32_t screenOrientation);
 
   // Undefined
   Scene(const Scene&) = delete;
@@ -357,9 +364,10 @@ private:
    *
    * @param[in] width The width of rotated surface
    * @param[in] height The height of rotated surface
-   * @param[in] orientation The orientation of rotated surface
+   * @param[in] windowOrientation the current window orientation
+   * @param[in] screenOrientation the current screen orientation
    */
-  void ChangedSurface(float width, float height, int32_t orientation);
+  void ChangedSurface(float width, float height, int32_t windowOrientation, int32_t screenOrientation);
 
 private:
   Internal::SceneGraph::Scene* mSceneObject;
@@ -387,6 +395,9 @@ private:
   // The Surface's orientation
   int32_t mSurfaceOrientation;
 
+  // The Screen's orientation
+  int32_t mScreenOrientation;
+
   // The key event signal
   Integration::Scene::KeyEventSignalType          mKeyEventSignal;
   Integration::Scene::KeyEventGeneratedSignalType mKeyEventGeneratedSignal;
index 07a11bb..ee05c5a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -27,7 +27,9 @@ GestureEvent::~GestureEvent() = default;
 GestureEvent::GestureEvent(GestureType::Value gesture, GestureState gestureState)
 : gestureType(gesture),
   state(gestureState),
-  time(0)
+  time(0),
+  sourceType(GestureSourceType::INVALID),
+  sourceData(GestureSourceData::INVALID)
 {
 }
 } // namespace Internal
index 85afd83..d803dcf 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_EVENT_GESTURE_EVENT_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.
@@ -56,6 +56,16 @@ struct GestureEvent
    */
   uint32_t time;
 
+  /**
+   * This is the value of which source the gesture was started with. (ex : mouse)
+   */
+  GestureSourceType sourceType;
+
+  /**
+   * The data of the source type.
+   */
+  GestureSourceData sourceData;
+
 protected: // Constructors only to be used by derived structures.
   /**
    * This constructor is only used by derived classes.
index c4688fb..5ba1058 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_GESTURE_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.
@@ -85,6 +85,42 @@ public:
     return mTime;
   }
 
+  /**
+   * @brief Sets the value of which source the gesture was started with. (ex : mouse)
+   * @param[in] source The gesture source type.
+   */
+  inline void SetSourceType(GestureSourceType source)
+  {
+    mSourceType = source;
+  }
+
+  /**
+   * @brief Gets the value of which source the gesture was started with.
+   * @return The gesture source type.
+   */
+  inline GestureSourceType GetSourceType() const
+  {
+    return mSourceType;
+  }
+
+  /**
+   * @brief Sets the value of source data.
+   * @param[in] data The gesture source data.
+   */
+  inline void SetSourceData(GestureSourceData data)
+  {
+    mSourceData = data;
+  }
+
+  /**
+   * @brief Gets the data of source type.
+   * @return The gesture source data.
+   */
+  inline GestureSourceData GetSourceData() const
+  {
+    return mSourceData;
+  }
+
   Gesture(const Gesture&) = delete;            ///< Deleted copy constructor
   Gesture(Gesture&&)      = delete;            ///< Deleted move constructor
   Gesture& operator=(const Gesture&) = delete; ///< Deleted copy assignment operator
@@ -98,7 +134,9 @@ protected:
    */
   Gesture(GestureType::Value gestureType, GestureState gestureState)
   : mGestureType(gestureType),
-    mState(gestureState)
+    mState(gestureState),
+    mSourceType(GestureSourceType::INVALID),
+    mSourceData(GestureSourceData::INVALID)
   {
   }
 
@@ -113,6 +151,8 @@ private:
   GestureType::Value mGestureType;
   GestureState       mState;
   uint32_t           mTime{0u};
+  GestureSourceType  mSourceType;
+  GestureSourceData  mSourceData;
 };
 
 } // namespace Internal
index bd802b2..7aafb36 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_GESTURE_RECOGNIZER_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.
@@ -19,6 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
+#include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/internal/event/events/gesture-event.h>
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/events/gesture.h>
@@ -86,6 +87,38 @@ public:
   void SendEvent(Scene& scene, const Integration::TouchEvent& event)
   {
     mScene = &scene;
+    if(event.GetPointCount() > 0)
+    {
+      const Integration::Point& point       = event.points[0];
+      MouseButton::Type         mouseButton = point.GetMouseButton();
+      if(mouseButton != MouseButton::INVALID)
+      {
+        mSourceType = GestureSourceType::MOUSE;
+        switch(mouseButton)
+        {
+          case MouseButton::PRIMARY:
+          {
+            mSourceData = GestureSourceData::MOUSE_PRIMARY;
+            break;
+          }
+          case MouseButton::SECONDARY:
+          {
+            mSourceData = GestureSourceData::MOUSE_SECONDARY;
+            break;
+          }
+          case MouseButton::TERTIARY:
+          {
+            mSourceData = GestureSourceData::MOUSE_TERTIARY;
+            break;
+          }
+          default:
+          {
+            mSourceData = GestureSourceData::INVALID;
+            break;
+          }
+        }
+      }
+    }
     SendEvent(event);
   }
 
@@ -98,7 +131,9 @@ protected:
   GestureRecognizer(Vector2 screenSize, GestureType::Value detectorType)
   : mScreenSize(screenSize),
     mType(detectorType),
-    mScene(nullptr)
+    mScene(nullptr),
+    mSourceType(GestureSourceType::INVALID),
+    mSourceData(GestureSourceData::INVALID)
   {
   }
 
@@ -122,6 +157,8 @@ protected:
   Vector2            mScreenSize;
   GestureType::Value mType;
   Scene*             mScene;
+  GestureSourceType  mSourceType; /// < Gesture input source type.
+  GestureSourceData  mSourceData; /// < Gesture input source data.
 };
 
 using GestureRecognizerPtr = IntrusivePtr<GestureRecognizer>;
index 4e73eb1..7c57cd0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -59,6 +59,8 @@ void EmitLongPressSignal(
   longPress->SetNumberOfTouches(longPressEvent.numberOfTouches);
   longPress->SetScreenPoint(longPressEvent.point);
   longPress->SetLocalPoint(localPoint);
+  longPress->SetSourceType(longPressEvent.sourceType);
+  longPress->SetSourceData(longPressEvent.sourceData);
 
   Dali::Actor                                    actorHandle(actor);
   const GestureDetectorContainer::const_iterator endIter = gestureDetectors.end();
index adc77de..eac654b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -239,6 +239,8 @@ void LongPressGestureRecognizer::EmitGesture(GestureState state)
     {
       longPress.time += mMinimumHoldingTime;
     }
+    longPress.sourceType = mSourceType;
+    longPress.sourceData = mSourceData;
 
     if(mScene)
     {
index 5e6c9bb..c548833 100644 (file)
@@ -514,6 +514,8 @@ void PanGestureProcessor::EmitPanSignal(Actor*                          actor,
     pan->SetNumberOfTouches(panEvent.numberOfTouches);
     pan->SetScreenPosition(panEvent.currentPosition);
     pan->SetPosition(localCurrent);
+    pan->SetSourceType(panEvent.sourceType);
+    pan->SetSourceData(panEvent.sourceData);
 
     RenderTask& renderTaskImpl(*renderTask.Get());
 
index 39e43ce..4e6ad9e 100644 (file)
@@ -332,7 +332,9 @@ void PanGestureRecognizer::SendPan(GestureState state, const Integration::TouchE
     gesture.timeDelta        = 0;
   }
 
-  gesture.time = currentEvent.time;
+  gesture.time       = currentEvent.time;
+  gesture.sourceType = mSourceType;
+  gesture.sourceData = mSourceData;
 
   if(mScene)
   {
index 5c80484..2483fc6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -63,6 +63,8 @@ void EmitPinchSignal(
   pinch->SetScreenCenterPoint(pinchEvent.centerPoint);
 
   pinch->SetLocalCenterPoint(localCenter);
+  pinch->SetSourceType(pinchEvent.sourceType);
+  pinch->SetSourceData(pinchEvent.sourceData);
 
   Dali::Actor                                    actorHandle(actor);
   const GestureDetectorContainer::const_iterator endIter = gestureDetectors.end();
index 5f036a8..9ab75a2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -259,7 +259,9 @@ void PinchGestureRecognizer::SendPinch(GestureState state, const Integration::To
     gesture.state = GestureState::CANCELLED;
   }
 
-  gesture.time = currentEvent.time;
+  gesture.time       = currentEvent.time;
+  gesture.sourceType = mSourceType;
+  gesture.sourceData = mSourceData;
 
   if(mScene)
   {
index cde8108..6596f0d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -60,6 +60,8 @@ void EmitRotationSignal(
   rotation->SetRotation(rotationEvent.rotation);
   rotation->SetScreenCenterPoint(rotationEvent.centerPoint);
   rotation->SetLocalCenterPoint(localCenter);
+  rotation->SetSourceType(rotationEvent.sourceType);
+  rotation->SetSourceData(rotationEvent.sourceData);
 
   Dali::Actor                                    actorHandle(actor);
   const GestureDetectorContainer::const_iterator endIter = gestureDetectors.end();
index e8e8428..dc10844 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -221,7 +221,9 @@ void RotationGestureRecognizer::SendRotation(GestureState state, const Integrati
     gesture.state = GestureState::CANCELLED;
   }
 
-  gesture.time = currentEvent.time;
+  gesture.time       = currentEvent.time;
+  gesture.sourceType = mSourceType;
+  gesture.sourceData = mSourceData;
 
   if(mScene)
   {
index 210ba57..2f87991 100644 (file)
@@ -176,7 +176,8 @@ void TapGestureDetector::EmitTapGestureSignal(Dali::Actor tappedActor, const Dal
   internalTap->SetNumberOfTouches(tap.GetNumberOfTouches());
   internalTap->SetScreenPoint(tap.GetScreenPoint());
   internalTap->SetLocalPoint(tap.GetLocalPoint());
-  internalTap->SetGestureSourceType(tap.GetSourceType());
+  internalTap->SetSourceType(tap.GetSourceType());
+  internalTap->SetSourceData(tap.GetSourceData());
   internalTap->SetNumberOfTaps(numberOfTaps == 0u ? mMaximumTapsRequired : numberOfTaps);
   mTap = Dali::TapGesture(internalTap.Get());
   if(numberOfTaps == 0u || mReceiveAllTapEvents)
index 89b0620..837fb3e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -25,8 +25,7 @@ namespace Internal
 TapGestureEvent::TapGestureEvent(GestureState state)
 : GestureEvent(GestureType::TAP, state),
   numberOfTaps(1),
-  numberOfTouches(1),
-  gestureSourceType(GestureSourceType::INVALID)
+  numberOfTouches(1)
 {
 }
 
index 85f0b0f..744593a 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_EVENT_TAP_GESTURE_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.
@@ -72,11 +72,6 @@ struct TapGestureEvent : public GestureEvent
    * If a multi-touch tap, then this should be the centroid of all the touch points.
    */
   Vector2 point;
-
-  /**
-   * This is the value of which input was tapped.
-   */
-  GestureSourceType gestureSourceType;
 };
 
 } // namespace Internal
index 58c62f4..d40e491 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_TAP_GESTURE_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.
@@ -118,23 +118,6 @@ public:
     return mLocalPoint;
   }
 
-  /**
-   * @brief This is the value of which input was tapped.
-   * @param[in] source This is the value of which input was tapped to set.
-   */
-  inline void SetGestureSourceType(const GestureSourceType sourceType)
-  {
-    mGestureSourceType = sourceType;
-  }
-
-  /**
-   * @copydoc Dali::TapGesture::GetSourceType()
-   */
-  inline const GestureSourceType& GetSourceType() const
-  {
-    return mGestureSourceType;
-  }
-
 private:
   /**
    * @brief Virtual destructor
@@ -144,11 +127,10 @@ private:
   ~TapGesture() override = default;
 
 private:
-  Vector2           mScreenPoint;
-  Vector2           mLocalPoint;
-  uint32_t          mNumberOfTaps{1u};
-  uint32_t          mNumberOfTouches{1u};
-  GestureSourceType mGestureSourceType{GestureSourceType::INVALID};
+  Vector2  mScreenPoint;
+  Vector2  mLocalPoint;
+  uint32_t mNumberOfTaps{1u};
+  uint32_t mNumberOfTouches{1u};
 };
 
 } // namespace Internal
index 6bde317..0ac00f0 100644 (file)
@@ -62,7 +62,8 @@ void EmitTapSignal(
   tap->SetNumberOfTouches(tapEvent.numberOfTouches);
   tap->SetScreenPoint(tapEvent.point);
   tap->SetLocalPoint(localPoint);
-  tap->SetGestureSourceType(tapEvent.gestureSourceType);
+  tap->SetSourceType(tapEvent.sourceType);
+  tap->SetSourceData(tapEvent.sourceData);
 
   Dali::Actor                                    actorHandle(actor);
   const GestureDetectorContainer::const_iterator endIter = gestureDetectors.end();
index 05bbf94..33ce529 100644 (file)
@@ -50,7 +50,6 @@ TapGestureRecognizer::TapGestureRecognizer(Observer& observer, Vector2 screenSiz
   mTouchTime(0u),
   mLastTapTime(0u),
   mLastTouchTime(0u),
-  mGestureSourceType(GestureSourceType::INVALID),
   mMaximumAllowedTime(maximumAllowedTime)
 {
 }
@@ -66,36 +65,6 @@ void TapGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
     const Integration::Point& point      = event.points[0];
     PointState::Type          pointState = point.GetState();
 
-    MouseButton::Type mouseButton = point.GetMouseButton();
-    switch(mouseButton)
-    {
-      case MouseButton::INVALID:
-      {
-        mGestureSourceType = GestureSourceType::INVALID;
-        break;
-      }
-      case MouseButton::PRIMARY:
-      {
-        mGestureSourceType = GestureSourceType::PRIMARY;
-        break;
-      }
-      case MouseButton::SECONDARY:
-      {
-        mGestureSourceType = GestureSourceType::SECONDARY;
-        break;
-      }
-      case MouseButton::TERTIARY:
-      {
-        mGestureSourceType = GestureSourceType::TERTIARY;
-        break;
-      }
-      default:
-      {
-        mGestureSourceType = GestureSourceType::INVALID;
-        break;
-      }
-    }
-
     switch(mState)
     {
       case CLEAR:
@@ -206,9 +175,8 @@ void TapGestureRecognizer::SetupForTouchDown(const Integration::TouchEvent& even
 void TapGestureRecognizer::EmitPossibleState(const Integration::TouchEvent& event)
 {
   TapGestureEvent tapEvent(GestureState::POSSIBLE);
-  tapEvent.point             = mTouchPosition;
-  tapEvent.time              = event.time;
-  tapEvent.gestureSourceType = mGestureSourceType;
+  tapEvent.point = mTouchPosition;
+  tapEvent.time  = event.time;
 
   ProcessEvent(tapEvent);
 }
@@ -255,16 +223,17 @@ void TapGestureRecognizer::EmitSingleTap(uint32_t time, const Integration::Point
 
 void TapGestureRecognizer::EmitTap(uint32_t time, TapGestureEvent& event)
 {
-  event.numberOfTaps      = mTapsRegistered;
-  event.point             = mTouchPosition;
-  event.time              = time;
-  event.gestureSourceType = mGestureSourceType;
+  event.numberOfTaps = mTapsRegistered;
+  event.point        = mTouchPosition;
+  event.time         = time;
 
   ProcessEvent(event);
 }
 
 void TapGestureRecognizer::ProcessEvent(TapGestureEvent& event)
 {
+  event.sourceType = mSourceType;
+  event.sourceData = mSourceData;
   if(mScene)
   {
     // Create another handle so the recognizer cannot be destroyed during process function
index d6e39c1..293c1c9 100644 (file)
@@ -151,8 +151,7 @@ private:
   uint32_t mLastTapTime;   ///< Time last tap gesture was registered
   uint32_t mLastTouchTime; ///< The last touch down time.
 
-  GestureSourceType mGestureSourceType;  /// < Gesture input source type value.
-  uint32_t          mMaximumAllowedTime; ///< The maximum allowed time required to be recognized as a multi tap gesture (millisecond)
+  uint32_t mMaximumAllowedTime; ///< The maximum allowed time required to be recognized as a multi tap gesture (millisecond)
 };
 
 } // namespace Internal
index 30676f7..198299a 100644 (file)
@@ -33,6 +33,7 @@ Scene::Scene()
   mSkipRendering(false),
   mSurfaceRect(),
   mSurfaceOrientation(0),
+  mScreenOrientation(0),
   mSurfaceRectChanged(false),
   mRotationCompletedAcknowledgement(false)
 {
@@ -151,6 +152,8 @@ void Scene::SetSurfaceRect(const Rect<int32_t>& rect)
   mSurfaceRect        = rect;
   mSurfaceRectChanged = true;
 
+  DALI_LOG_RELEASE_INFO("update surfce rect in scene-graph, width[%d], height[%d]\n", mSurfaceRect.width, mSurfaceRect.height);
+
   if(mRoot)
   {
     mRoot->SetUpdated(true);
@@ -162,14 +165,25 @@ const Rect<int32_t>& Scene::GetSurfaceRect() const
   return mSurfaceRect;
 }
 
-void Scene::SetSurfaceOrientation(int32_t orientation)
+bool Scene::IsSurfaceRectChanged()
 {
-  mSurfaceOrientation = orientation;
+  bool surfaceRectChanged = mSurfaceRectChanged;
+  mSurfaceRectChanged     = false;
+
+  return surfaceRectChanged;
+}
+
+void Scene::SetSurfaceOrientations(int32_t windowOrientation, int32_t screenOrienation)
+{
+  mSurfaceOrientation = windowOrientation;
+  mScreenOrientation = screenOrienation;
 
   if(mRoot)
   {
     mRoot->SetUpdated(true);
   }
+
+  DALI_LOG_RELEASE_INFO("update orientation in scene-graph, surface [%d], screen[%d]\n", mSurfaceOrientation, mScreenOrientation);
 }
 
 int32_t Scene::GetSurfaceOrientation() const
@@ -177,12 +191,9 @@ int32_t Scene::GetSurfaceOrientation() const
   return mSurfaceOrientation;
 }
 
-bool Scene::IsSurfaceRectChanged()
+int32_t Scene::GetScreenOrientation() const
 {
-  bool surfaceRectChanged = mSurfaceRectChanged;
-  mSurfaceRectChanged     = false;
-
-  return surfaceRectChanged;
+  return mScreenOrientation;
 }
 
 void Scene::SetRotationCompletedAcknowledgement()
index cca0106..8d5339e 100644 (file)
@@ -173,11 +173,12 @@ public:
   const Rect<int32_t>& GetSurfaceRect() const;
 
   /**
-   * Set the surface orientation when surface is rotated.
+   * Set the surface orientations when surface or screen is rotated.
    *
-   * @param[in] orientation The orientation value representing the surface.
+   * @param[in] windowOrientation The orientations value representing surface.
+   * @param[in] screenOrienation The orientations value representing screen.
    */
-  void SetSurfaceOrientation(int32_t orientation);
+  void SetSurfaceOrientations(int32_t windowOrientation, int32_t screenOrienation);
 
   /**
    * Get the surface orientation.
@@ -187,6 +188,13 @@ public:
   int32_t GetSurfaceOrientation() const;
 
   /**
+   * Get the screen orientation.
+   *
+   * @return the current screen orientation
+   */
+  int32_t GetScreenOrientation() const;
+
+  /**
    * Query wheter the surface rect is changed or not.
    * @return true if the surface rect is changed.
    */
@@ -289,7 +297,8 @@ private:
 
   Rect<int32_t> mSurfaceRect;                      ///< The rectangle of surface which is related ot this scene.
   int32_t       mSurfaceOrientation;               ///< The orientation of surface which is related of this scene
-  bool          mSurfaceRectChanged;               ///< The flag of surface's rectangle is changed when is resized, moved or rotated.
+  int32_t       mScreenOrientation;                ///< The orientation of screen
+  bool          mSurfaceRectChanged;               ///< The flag of surface's rectangle is changed when is resized or moved.
   bool          mRotationCompletedAcknowledgement; ///< The flag of sending the acknowledgement to complete window rotation.
 
   // Render pass and render target
@@ -345,15 +354,15 @@ inline void SetSurfaceRectMessage(EventThreadServices& eventThreadServices, cons
   new(slot) LocalType(&scene, &Scene::SetSurfaceRect, rect);
 }
 
-inline void SetSurfaceOrientationMessage(EventThreadServices& eventThreadServices, const Scene& scene, int32_t orientation)
+inline void SetSurfaceOrientationsMessage(EventThreadServices& eventThreadServices, const Scene& scene, const int32_t windowOrientation, const int32_t screenOrientation)
 {
-  using LocalType = MessageValue1<Scene, int32_t>;
+  using LocalType = MessageValue2<Scene, int32_t, int32_t>;
 
   // Reserve some memory inside the message queue
   uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new(slot) LocalType(&scene, &Scene::SetSurfaceOrientation, orientation);
+  new(slot) LocalType(&scene, &Scene::SetSurfaceOrientations, windowOrientation, screenOrientation);
 }
 
 inline void SetRotationCompletedAcknowledgementMessage(EventThreadServices& eventThreadServices, const Scene& scene)
index dfd1e89..6f3d9a4 100644 (file)
@@ -26,8 +26,8 @@
 namespace Dali
 {
 const uint32_t    CORE_MAJOR_VERSION = 2;
-const uint32_t    CORE_MINOR_VERSION = 1;
-const uint32_t    CORE_MICRO_VERSION = 46;
+const uint32_t    CORE_MINOR_VERSION = 2;
+const uint32_t    CORE_MICRO_VERSION = 0;
 const char* const CORE_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index ba14daa..4600467 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GESTURE_ENUMERATIONS_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.
@@ -55,13 +55,24 @@ enum class GestureState : uint8_t
 
 /**
  * @brief Enumeration for gesture input source type.
+ * @SINCE_2_2.0
  */
 enum class GestureSourceType : int8_t
 {
-  INVALID   = -1, ///< invalid data
-  PRIMARY   = 1,  ///< Primary
-  SECONDARY = 3,  ///< Secondary
-  TERTIARY  = 2,  ///< Third (tertiary)
+  INVALID, ///< invalid data
+  MOUSE,   ///< mouse
+};
+
+/**
+ * @brief Enumeration for data of gesture input source type.
+ * @SINCE_2_2.0
+ */
+enum class GestureSourceData : int8_t
+{
+  INVALID         = -1, ///< invalid data
+  MOUSE_PRIMARY   = 1,  /**< Primary(Left) mouse button */
+  MOUSE_SECONDARY = 3,  /**< Secondary(Right) mouse button */
+  MOUSE_TERTIARY  = 2,  /**< Center(Wheel) mouse button */
 };
 
 } // namespace Dali
index 20c1ca4..da26137 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 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.
@@ -55,4 +55,14 @@ uint32_t Gesture::GetTime() const
   return GetImplementation(*this).GetTime();
 }
 
+GestureSourceType Gesture::GetSourceType() const
+{
+  return GetImplementation(*this).GetSourceType();
+}
+
+GestureSourceData Gesture::GetSourceData() const
+{
+  return GetImplementation(*this).GetSourceData();
+}
+
 } // namespace Dali
index aed5e0c..2529cb9 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GESTURE_H
 
 /*
- * Copyright (c) 2020 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.
@@ -124,6 +124,20 @@ public:
    */
   uint32_t GetTime() const;
 
+  /**
+   * @brief Gets the value of which source the gesture was started with. (ex : mouse)
+   * @SINCE_2_2.0
+   * @return The gesture input source.
+   */
+  GestureSourceType GetSourceType() const;
+
+  /**
+   * @brief Gets the data of the source type.
+   * @SINCE_2_2.0
+   * @return The gesture source data.
+   */
+  GestureSourceData GetSourceData() const;
+
 public: // Not intended for application developers
   /// @cond internal
   /**
index aba1966..8bec36e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -61,9 +61,4 @@ const Vector2& TapGesture::GetLocalPoint() const
   return GetImplementation(*this).GetLocalPoint();
 }
 
-const GestureSourceType& TapGesture::GetSourceType() const
-{
-  return GetImplementation(*this).GetSourceType();
-}
-
 } // namespace Dali
index 04a2d9b..d0efc90 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TAP_GESTURE_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.
@@ -120,12 +120,6 @@ public:
    */
   const Vector2& GetLocalPoint() const;
 
-  /**
-   * @brief This is the input type of which was tapped.
-   * @return The input type which was tapped.
-   */
-  const GestureSourceType& GetSourceType() const;
-
 public: // Not intended for application developers
   /// @cond internal
   /**
index 291ff2e..f2a1bc2 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali2
 Summary:    DALi 3D Engine
-Version:    2.1.46
+Version:    2.2.0
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT