/*
- * 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.
// EXTERNAL INCLUDES
#include <dali/public-api/events/key-event.h>
-#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/events/wheel-event.h>
// INTERNAL INCLUDES
namespace DevelWindow
{
+Window New(Any surface, PositionSize windowPosition, const std::string& name, bool isTransparent)
+{
+ 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);
+ }
+ newWindow = Window(window);
+ }
+ else
+ {
+ DALI_LOG_ERROR("This device can't support multiple windows.\n");
+ }
+
+ return newWindow;
+}
+
void SetPositionSize( Window window, PositionSize positionSize )
{
GetImplementation( window ).SetPositionSize( positionSize );
}
-void Add( Window window, Dali::Actor actor )
+Window Get( Actor actor )
{
- GetImplementation( window ).Add( actor );
+ return Internal::Adaptor::Window::Get( actor );
}
-void Remove( Window window, Dali::Actor actor )
+EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window )
{
- GetImplementation( window ).Remove( actor );
+ return GetImplementation( window ).EventProcessingFinishedSignal();
}
-void SetBackgroundColor( Window window, Vector4 color )
+WheelEventSignalType& WheelEventSignal( Window window )
{
- GetImplementation( window ).SetBackgroundColor( color );
+ return GetImplementation( window ).WheelEventSignal();
}
-Vector4 GetBackgroundColor( Window window )
+VisibilityChangedSignalType& VisibilityChangedSignal( Window window )
{
- return GetImplementation( window ).GetBackgroundColor();
+ return GetImplementation( window ).VisibilityChangedSignal();
}
-Dali::Layer GetRootLayer( Window window )
+TransitionEffectEventSignalType& TransitionEffectEventSignal( Window window )
{
- return GetImplementation( window ).GetRootLayer();
+ return GetImplementation( window ).TransitionEffectEventSignal();
}
-uint32_t GetLayerCount( Window window )
+KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal( Window window )
{
- return GetImplementation( window ).GetLayerCount();
+ return GetImplementation( window ).KeyboardRepeatSettingsChangedSignal();
}
-Dali::Layer GetLayer( Window window, uint32_t depth )
+void SetParent( Window window, Window parent )
{
- return GetImplementation( window ).GetLayer( depth );
+ GetImplementation( window ).SetParent( parent );
}
-EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window )
+void Unparent( Window window )
{
- return GetImplementation( window ).EventProcessingFinishedSignal();
+ GetImplementation( window ).Unparent();
}
-KeyEventSignalType& KeyEventSignal( Window window )
+Window GetParent( Window window )
{
- return GetImplementation( window ).KeyEventSignal();
+ return GetImplementation( window ).GetParent();
}
-TouchSignalType& TouchSignal( Window window )
+Window DownCast( BaseHandle handle )
{
- return GetImplementation( window ).TouchSignal();
+ return Window( dynamic_cast<Dali::Internal::Adaptor::Window*>( handle.GetObjectPtr()) );
}
-WheelEventSignalType& WheelEventSignal( Window window )
+Dali::Window::WindowOrientation GetCurrentOrientation( Window window )
{
- return GetImplementation( window ).WheelEventSignal();
+ 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 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