Remove RenderSurface from Core
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-window.cpp
index 1424f1a..d7878e3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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/public-api/object/base-object.h>
 
 #define DALI_WINDOW_H
-#include <dali/integration-api/adaptors/adaptor.h>
+#include <dali/integration-api/adaptor-framework/adaptor.h>
 #include <toolkit-adaptor-impl.h>
 
-// INTERNAL INCLUDES
-#include "test-render-surface.h"
-
 using AdaptorImpl = Dali::Internal::Adaptor::Adaptor;
 
 namespace Dali
@@ -48,7 +45,9 @@ namespace Adaptor
 {
 
 Window::Window( const PositionSize& positionSize )
-: SceneHolder( positionSize )
+: SceneHolder( positionSize ),
+  mFocusChangeSignal(),
+  mVisibilityChangedSignal()
 {
 }
 
@@ -120,11 +119,51 @@ Integration::Scene Window::GetScene()
   return GetImplementation( *this ).GetScene();
 }
 
-Integration::RenderSurface& Window::GetRenderSurface()
+Dali::RenderSurfaceInterface& Window::GetRenderSurface()
 {
   return GetImplementation( *this ).GetRenderSurface();
 }
 
+void Window::Add( Actor actor )
+{
+  GetImplementation( *this ).Add( actor );
+}
+
+void Window::Remove( Actor actor )
+{
+  GetImplementation( *this ).Remove( actor );
+}
+
+Dali::Layer Window::GetRootLayer() const
+{
+  return GetImplementation( *this ).GetRootLayer();
+}
+
+void Window::SetBackgroundColor( const Vector4& color )
+{
+  GetImplementation( *this ).SetBackgroundColor( color );
+}
+
+Vector4 Window::GetBackgroundColor() const
+{
+  return GetImplementation( *this ).GetBackgroundColor();
+}
+
+void Window::Raise()
+{
+  GetImplementation( *this ).mFocusChangeSignal.Emit(*this, true);
+}
+
+void Window::Hide()
+{
+  GetImplementation( *this ).mVisibilityChangedSignal.Emit( *this, false );
+}
+
+FocusChangeSignalType& Window::FocusChangeSignal()
+{
+  return GetImplementation( *this ).mFocusChangeSignal;
+}
+
 namespace DevelWindow
 {
 
@@ -140,6 +179,16 @@ Window Get( Actor actor )
   return Dali::Window( windowImpl );
 }
 
+Window DownCast( BaseHandle handle )
+{
+  Internal::Adaptor::Window* windowImpl = nullptr;
+  if ( Dali::Adaptor::IsAvailable() )
+  {
+    windowImpl = dynamic_cast<Dali::Internal::Adaptor::Window*>( handle.GetObjectPtr());
+  }
+  return Dali::Window( windowImpl );
+}
+
 EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window )
 {
   return GetImplementation( window ).GetScene().EventProcessingFinishedSignal();
@@ -164,6 +213,12 @@ WheelEventSignalType& WheelEventSignal( Window window )
 {
   return GetImplementation( window ).WheelEventSignal();
 }
+
+VisibilityChangedSignalType& VisibilityChangedSignal( Window window )
+{
+  return GetImplementation( window ).mVisibilityChangedSignal;
+}
+
 } // namespace DevelWindow
 
 } // Dali