/*
- * 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>
#include <dali/integration-api/debug.h>
#include <test-application.h>
+#include <test-render-surface.h>
namespace Dali
{
bool Adaptor::mAvailable = false;
Vector<CallbackBase*> Adaptor::mCallbacks = Vector<CallbackBase*>();
+Dali::WindowContainer Adaptor::mWindows;
+Dali::Adaptor::WindowCreatedSignalType* Adaptor::mWindowCreatedSignal = nullptr;
Dali::Adaptor& Adaptor::Get()
{
return *adaptor;
}
-Dali::RenderSurface& Adaptor::GetSurface()
+Dali::RenderSurfaceInterface& Adaptor::GetSurface()
{
- Dali::RenderSurface *renderSurface = new Dali::TestRenderSurface;
+ Dali::RenderSurfaceInterface* renderSurface = reinterpret_cast <Dali::RenderSurfaceInterface*>( new Dali::TestRenderSurface( Dali::PositionSize( 0, 0, 480, 800 ) ) );
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
return Internal::Adaptor::Adaptor::Get();
}
-Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface )
+Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surface )
+{
+ return Internal::Adaptor::Adaptor::Get();
+}
+
+Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration )
+{
+ 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( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration )
+Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration )
{
return Internal::Adaptor::Adaptor::Get();
}
}
}
-void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface )
+void Adaptor::ReplaceSurface( Window window, Dali::RenderSurfaceInterface& surface )
+{
+}
+
+void Adaptor::ReplaceSurface( Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface& surface )
{
}
return Internal::Adaptor::Adaptor::AdaptorSignal();
}
-RenderSurface& Adaptor::GetSurface()
+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;
{
}
-void Adaptor::SetMinimumPinchDistance(float distance)
-{
-}
-
void Adaptor::FeedTouchPoint( TouchPoint& point, int timeStamp )
{
}
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