/*
- * 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.
namespace DevelWindow
{
-void SetPositionSize( Window window, PositionSize positionSize )
+Window New(Any surface, PositionSize windowPosition, const std::string& name, bool isTransparent)
{
- GetImplementation( window ).SetPositionSize( positionSize );
+ return DevelWindow::New(surface, windowPosition, name, "", isTransparent);
+}
+
+Window New(Any surface, PositionSize windowPosition, const std::string& name, const std::string& className, bool isTransparent)
+{
+ Window newWindow;
+
+ const bool isAdaptorAvailable = Dali::Adaptor::IsAvailable();
+ bool isNewWindowAllowed = true;
+
+ if (isAdaptorAvailable)
+ {
+ Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get();
+ isNewWindowAllowed = Internal::Adaptor::Adaptor::GetImplementation(adaptor).IsMultipleWindowSupported();
+ }
+
+ if (isNewWindowAllowed)
+ {
+ Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(surface, windowPosition, name, className, isTransparent);
+
+ Integration::SceneHolder sceneHolder = Integration::SceneHolder(window);
+ if (isAdaptorAvailable)
+ {
+ Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get();
+ Internal::Adaptor::Adaptor::GetImplementation(adaptor).AddWindow(sceneHolder, name, className, isTransparent);
+ }
+ newWindow = Window(window);
+ }
+ else
+ {
+ DALI_LOG_ERROR("This device can't support multiple windows.\n");
+ }
+
+ return newWindow;
}
-Dali::RenderTaskList GetRenderTaskList( Window window )
+void SetPositionSize( Window window, PositionSize positionSize )
{
- return GetImplementation( window ).GetRenderTaskList();
+ GetImplementation( window ).SetPositionSize( positionSize );
}
Window Get( Actor actor )
return GetImplementation( window ).EventProcessingFinishedSignal();
}
-KeyEventSignalType& KeyEventSignal( Window window )
+WheelEventSignalType& WheelEventSignal( Window window )
{
- return GetImplementation( window ).KeyEventSignal();
+ return GetImplementation( window ).WheelEventSignal();
}
-KeyEventGeneratedSignalType& KeyEventGeneratedSignal( Window window )
+VisibilityChangedSignalType& VisibilityChangedSignal( Window window )
{
- return GetImplementation( window ).KeyEventGeneratedSignal();
+ return GetImplementation( window ).VisibilityChangedSignal();
}
-TouchSignalType& TouchSignal( Window window )
+TransitionEffectEventSignalType& TransitionEffectEventSignal( Window window )
{
- return GetImplementation( window ).TouchSignal();
+ return GetImplementation( window ).TransitionEffectEventSignal();
}
-WheelEventSignalType& WheelEventSignal( Window window )
+KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal( Window window )
{
- return GetImplementation( window ).WheelEventSignal();
+ return GetImplementation( window ).KeyboardRepeatSettingsChangedSignal();
+}
+
+void SetParent( Window window, Window parent )
+{
+ GetImplementation( window ).SetParent( parent );
+}
+
+void Unparent( Window window )
+{
+ GetImplementation( window ).Unparent();
+}
+
+Window GetParent( Window window )
+{
+ return GetImplementation( window ).GetParent();
+}
+
+Window DownCast( BaseHandle handle )
+{
+ return Window( dynamic_cast<Dali::Internal::Adaptor::Window*>( handle.GetObjectPtr()) );
+}
+
+Dali::Window::WindowOrientation GetCurrentOrientation( Window window )
+{
+ return GetImplementation( window ).GetCurrentOrientation();
+}
+
+void SetAvailableOrientations( Window window, const Dali::Vector<Dali::Window::WindowOrientation>& orientations )
+{
+ GetImplementation( window ).SetAvailableOrientations( orientations );
+}
+
+int32_t GetNativeId( Window window )
+{
+ return GetImplementation( window ).GetNativeId();
+}
+
+void SetDamagedAreas(Window window, std::vector<Dali::Rect<int>>& areas)
+{
+ GetImplementation(window).SetDamagedAreas(areas);
+}
+
+void AddFrameRenderedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId )
+{
+ GetImplementation( window ).AddFrameRenderedCallback( std::move( callback ), frameId );
+}
+
+void AddFramePresentedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId )
+{
+ GetImplementation( window ).AddFramePresentedCallback( std::move( callback ), frameId );
}
} // namespace DevelWindow