[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-scene-holder.cpp
index bfc1315..22a027b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
  *
  */
 
+#include <dali/integration-api/adaptor-framework/scene-holder.h>
 #include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/adaptors/scene-holder.h>
 
 #include <toolkit-scene-holder-impl.h>
 
 #include <dali/public-api/actors/actor.h>
 #include <dali/public-api/actors/layer.h>
-#include <dali/public-api/common/stage.h>
 #include <dali/public-api/object/base-object.h>
 
-#include <dali/integration-api/adaptors/adaptor.h>
+#include <dali/integration-api/adaptor-framework/adaptor.h>
+#include <dali/public-api/render-tasks/render-task-list.h>
 #include <toolkit-adaptor-impl.h>
 
 using AdaptorImpl = Dali::Internal::Adaptor::Adaptor;
 
 namespace Dali
 {
-
 ///////////////////////////////////////////////////////////////////////////////
 //
 // Dali::Internal::Adaptor::SceneHolder Stub
@@ -41,32 +40,30 @@ namespace Dali
 
 namespace Internal
 {
-
 namespace Adaptor
 {
-
-SceneHolder::SceneHolder( const Dali::Rect<int>& positionSize )
-: mRenderSurface( positionSize ),
-  mScene( Dali::Integration::Scene::New( mRenderSurface ) )
+SceneHolder::SceneHolder(const Dali::Rect<int>& positionSize)
+: mRenderSurface(positionSize),
+  mScene(Dali::Integration::Scene::New(Dali::Size(static_cast<float>(positionSize.width), static_cast<float>(positionSize.height))))
 {
 }
 
 SceneHolder::~SceneHolder()
 {
-  if ( Dali::Adaptor::IsAvailable() )
+  if(Dali::Adaptor::IsAvailable())
   {
-    AdaptorImpl::GetImpl( AdaptorImpl::Get() ).RemoveWindow( this );
+    AdaptorImpl::GetImpl(AdaptorImpl::Get()).RemoveWindow(this);
   }
 }
 
-void SceneHolder::Add( Dali::Actor actor )
+void SceneHolder::Add(Dali::Actor actor)
 {
-  mScene.Add( actor );
+  mScene.Add(actor);
 }
 
-void SceneHolder::Remove( Dali::Actor actor )
+void SceneHolder::Remove(Dali::Actor actor)
 {
-  mScene.Remove( actor );
+  mScene.Remove(actor);
 }
 
 Dali::Layer SceneHolder::GetRootLayer() const
@@ -74,9 +71,9 @@ Dali::Layer SceneHolder::GetRootLayer() const
   return mScene.GetRootLayer();
 }
 
-void SceneHolder::SetBackgroundColor( Vector4 color )
+void SceneHolder::SetBackgroundColor(Vector4 color)
 {
-  return mScene.SetBackgroundColor( color );
+  return mScene.SetBackgroundColor(color);
 }
 
 Vector4 SceneHolder::GetBackgroundColor() const
@@ -84,15 +81,15 @@ Vector4 SceneHolder::GetBackgroundColor() const
   return mScene.GetBackgroundColor();
 }
 
-void SceneHolder::FeedTouchPoint( Dali::TouchPoint& point, int timeStamp )
+void SceneHolder::FeedTouchPoint(Dali::TouchPoint& point, int timeStamp)
 {
 }
 
-void SceneHolder::FeedWheelEvent( Dali::WheelEvent& wheelEvent )
+void SceneHolder::FeedWheelEvent(Dali::WheelEvent& wheelEvent)
 {
 }
 
-void SceneHolder::FeedKeyEvent( Dali::KeyEvent& keyEvent )
+void SceneHolder::FeedKeyEvent(Dali::KeyEvent& keyEvent)
 {
 }
 
@@ -106,9 +103,9 @@ Dali::Integration::SceneHolder::KeyEventGeneratedSignalType& SceneHolder::KeyEve
   return mScene.KeyEventGeneratedSignal();
 }
 
-Dali::Integration::SceneHolder::TouchSignalType& SceneHolder::TouchSignal()
+Dali::Integration::SceneHolder::TouchEventSignalType& SceneHolder::TouchedSignal()
 {
-  return mScene.TouchSignal();
+  return mScene.TouchedSignal();
 }
 
 Dali::Integration::SceneHolder::WheelEventSignalType& SceneHolder::WheelEventSignal()
@@ -116,16 +113,26 @@ Dali::Integration::SceneHolder::WheelEventSignalType& SceneHolder::WheelEventSig
   return mScene.WheelEventSignal();
 }
 
+Dali::Integration::SceneHolder::WheelEventGeneratedSignalType& SceneHolder::WheelEventGeneratedSignal()
+{
+  return mScene.WheelEventGeneratedSignal();
+}
+
 Integration::Scene SceneHolder::GetScene()
 {
   return mScene;
 }
 
-Integration::RenderSurface& SceneHolder::GetRenderSurface()
+Dali::RenderSurfaceInterface& SceneHolder::GetRenderSurface()
 {
   return mRenderSurface;
 }
 
+Dali::RenderTaskList SceneHolder::GetRenderTaskList()
+{
+  return mScene.GetRenderTaskList();
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
@@ -138,7 +145,6 @@ Integration::RenderSurface& SceneHolder::GetRenderSurface()
 
 namespace Integration
 {
-
 SceneHolder::SceneHolder()
 {
   // Dali::Internal::Adaptor::Adaptor::Get().WindowCreatedSignal().Emit( *this );
@@ -148,94 +154,104 @@ SceneHolder::~SceneHolder()
 {
 }
 
-SceneHolder::SceneHolder( const SceneHolder& handle )
+SceneHolder::SceneHolder(const SceneHolder& handle)
 : BaseHandle(handle)
 {
 }
 
-SceneHolder::SceneHolder( Internal::Adaptor::SceneHolder* internal )
+SceneHolder::SceneHolder(Internal::Adaptor::SceneHolder* internal)
 : BaseHandle(internal)
 {
 }
 
-SceneHolder& SceneHolder::operator=( const SceneHolder& rhs )
+SceneHolder& SceneHolder::operator=(const SceneHolder& rhs)
 {
   BaseHandle::operator=(rhs);
   return *this;
 }
 
-Dali::Integration::SceneHolder SceneHolder::Get( Dali::Actor actor )
+Dali::Integration::SceneHolder SceneHolder::Get(Dali::Actor actor)
 {
   Internal::Adaptor::SceneHolder* sceneHolderImpl = nullptr;
 
-  if ( Dali::Adaptor::IsAvailable() )
+  if(Dali::Adaptor::IsAvailable())
   {
-    sceneHolderImpl = AdaptorImpl::GetImpl( AdaptorImpl::Get() ).GetWindow( actor );
+    sceneHolderImpl = AdaptorImpl::GetImpl(AdaptorImpl::Get()).GetWindow(actor);
   }
 
-  return Dali::Integration::SceneHolder( sceneHolderImpl );
+  return Dali::Integration::SceneHolder(sceneHolderImpl);
 }
 
-void SceneHolder::Add( Actor actor )
+void SceneHolder::Add(Actor actor)
 {
-  GetImplementation( *this ).Add( actor );
+  GetImplementation(*this).Add(actor);
 }
 
-void SceneHolder::Remove( Actor actor )
+void SceneHolder::Remove(Actor actor)
 {
-  GetImplementation( *this ).Remove( actor );
+  GetImplementation(*this).Remove(actor);
 }
 
 Dali::Layer SceneHolder::GetRootLayer() const
 {
-  return GetImplementation( *this ).GetRootLayer();
+  return GetImplementation(*this).GetRootLayer();
 }
 
-void SceneHolder::SetBackgroundColor( Vector4 color )
+void SceneHolder::SetBackgroundColor(Vector4 color)
 {
-  GetImplementation( *this ).SetBackgroundColor( color );
+  GetImplementation(*this).SetBackgroundColor(color);
 }
 
 Vector4 SceneHolder::GetBackgroundColor() const
 {
-  return GetImplementation( *this ).GetBackgroundColor();
+  return GetImplementation(*this).GetBackgroundColor();
+}
+
+void SceneHolder::FeedTouchPoint(Dali::TouchPoint& point, int timeStamp)
+{
+  GetImplementation(*this).FeedTouchPoint(point, timeStamp);
 }
 
-void SceneHolder::FeedTouchPoint( Dali::TouchPoint& point, int timeStamp )
+void SceneHolder::FeedWheelEvent(Dali::WheelEvent& wheelEvent)
 {
-  GetImplementation( *this ).FeedTouchPoint( point, timeStamp );
+  GetImplementation(*this).FeedWheelEvent(wheelEvent);
 }
 
-void SceneHolder::FeedWheelEvent( Dali::WheelEvent& wheelEvent )
+void SceneHolder::FeedKeyEvent(Dali::KeyEvent& keyEvent)
 {
-  GetImplementation( *this ).FeedWheelEvent( wheelEvent );
+  GetImplementation(*this).FeedKeyEvent(keyEvent);
 }
 
-void SceneHolder::FeedKeyEvent( Dali::KeyEvent& keyEvent )
+RenderTaskList SceneHolder::GetRenderTaskList()
 {
-  GetImplementation( *this ).FeedKeyEvent( keyEvent );
+  return GetImplementation(*this).GetRenderTaskList();
 }
 
 SceneHolder::KeyEventSignalType& SceneHolder::KeyEventSignal()
 {
-  return GetImplementation( *this ).KeyEventSignal();
+  return GetImplementation(*this).KeyEventSignal();
 }
 
 SceneHolder::KeyEventGeneratedSignalType& SceneHolder::KeyEventGeneratedSignal()
 {
-  return GetImplementation( *this ).KeyEventGeneratedSignal();
+  return GetImplementation(*this).KeyEventGeneratedSignal();
 }
 
-SceneHolder::TouchSignalType& SceneHolder::TouchSignal()
+SceneHolder::TouchEventSignalType& SceneHolder::TouchedSignal()
 {
-  return GetImplementation( *this ).TouchSignal();
+  return GetImplementation(*this).TouchedSignal();
 }
 
 SceneHolder::WheelEventSignalType& SceneHolder::WheelEventSignal()
 {
-  return GetImplementation( *this ).WheelEventSignal();
+  return GetImplementation(*this).WheelEventSignal();
+}
+
+SceneHolder::WheelEventGeneratedSignalType& SceneHolder::WheelEventGeneratedSignal()
+{
+  return GetImplementation(*this).WheelEventGeneratedSignal();
 }
 
-} // Integration
+} // namespace Integration
 
-} // Dali
+} // namespace Dali