Basic support of keyboard focus for multiple windows
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-adaptor.cpp
index 10a2659..522537c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 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.
  *
  */
 
-// CLASS HEADER
+#include <toolkit-window.h>
+
+// Don't want to include the actual window.h which otherwise will be indirectly included by adaptor.h.
+#define DALI_WINDOW_H
 #include <dali/integration-api/adaptors/adaptor.h>
 
+#include <dali/integration-api/adaptors/scene-holder.h>
+
 #include <dali/public-api/object/base-object.h>
 
 #include <toolkit-adaptor-impl.h>
@@ -35,6 +40,8 @@ namespace Adaptor
 
 bool Adaptor::mAvailable = false;
 Vector<CallbackBase*> Adaptor::mCallbacks = Vector<CallbackBase*>();
+Dali::WindowContainer Adaptor::mWindows;
+Dali::Adaptor::WindowCreatedSignalType* Adaptor::mWindowCreatedSignal = nullptr;
 
 Dali::Adaptor& Adaptor::Get()
 {
@@ -49,12 +56,27 @@ Dali::RenderSurfaceInterface& Adaptor::GetSurface()
   return *renderSurface;
 }
 
+Dali::WindowContainer Adaptor::GetWindows()
+{
+  return Adaptor::mWindows;
+}
+
 Dali::Adaptor::AdaptorSignalType& Adaptor::AdaptorSignal()
 {
   Dali::Adaptor::AdaptorSignalType* signal = new Dali::Adaptor::AdaptorSignalType;
   return *signal;
 }
 
+Dali::Adaptor::WindowCreatedSignalType& Adaptor::WindowCreatedSignal()
+{
+  if ( !Adaptor::mWindowCreatedSignal )
+  {
+    Adaptor::mWindowCreatedSignal = new Dali::Adaptor::WindowCreatedSignalType;
+  }
+
+  return *Adaptor::mWindowCreatedSignal;
+}
+
 } // namespace Adaptor
 } // namespace Internal
 
@@ -78,6 +100,26 @@ Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surfac
   return Internal::Adaptor::Adaptor::Get();
 }
 
+Adaptor& Adaptor::New( Dali::Integration::SceneHolder window )
+{
+  return Internal::Adaptor::Adaptor::Get();
+}
+
+Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, Configuration::ContextLoss configuration )
+{
+  return Internal::Adaptor::Adaptor::Get();
+}
+
+Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface )
+{
+  return Internal::Adaptor::Adaptor::Get();
+}
+
+Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration )
+{
+  return Internal::Adaptor::Adaptor::Get();
+}
+
 Adaptor::~Adaptor()
 {
 }
@@ -134,6 +176,10 @@ void Adaptor::ReplaceSurface( Window window, Dali::RenderSurfaceInterface& surfa
 {
 }
 
+void Adaptor::ReplaceSurface( Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface& surface )
+{
+}
+
 Adaptor::AdaptorSignalType& Adaptor::ResizedSignal()
 {
   return Internal::Adaptor::Adaptor::AdaptorSignal();
@@ -144,11 +190,21 @@ Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal()
   return Internal::Adaptor::Adaptor::AdaptorSignal();
 }
 
+Adaptor::WindowCreatedSignalType& Adaptor::WindowCreatedSignal()
+{
+  return Internal::Adaptor::Adaptor::WindowCreatedSignal();
+}
+
 Dali::RenderSurfaceInterface& Adaptor::GetSurface()
 {
   return Internal::Adaptor::Adaptor::GetSurface();
 }
 
+Dali::WindowContainer Adaptor::GetWindows() const
+{
+  return Internal::Adaptor::Adaptor::GetWindows();
+}
+
 Any Adaptor::GetNativeWindowHandle()
 {
   Any window;
@@ -185,10 +241,6 @@ void Adaptor::NotifyLanguageChanged()
 {
 }
 
-void Adaptor::SetMinimumPinchDistance(float distance)
-{
-}
-
 void Adaptor::FeedTouchPoint( TouchPoint& point, int timeStamp )
 {
 }
@@ -235,6 +287,12 @@ const LogFactoryInterface& Adaptor::GetLogFactory()
 Adaptor::Adaptor()
 : mImpl( NULL )
 {
+  Dali::PositionSize win_size;
+  win_size.width = 640;
+  win_size.height = 800;
+
+  Dali::Window window = Dali::Window::New( win_size, "" );
+  Internal::Adaptor::Adaptor::mWindows.push_back( window );
 }
 
 } // namespace Dali