/*
- * 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/wheel-event.h>
+
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/window-devel.h>
#include <dali/internal/window-system/common/window-impl.h>
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 )
+{
+ return Internal::Adaptor::Window::Get( actor );
+}
+
+EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window )
+{
+ return GetImplementation( window ).EventProcessingFinishedSignal();
+}
+
+WheelEventSignalType& WheelEventSignal( Window window )
+{
+ return GetImplementation( window ).WheelEventSignal();
+}
+
+VisibilityChangedSignalType& VisibilityChangedSignal( Window window )
+{
+ return GetImplementation( window ).VisibilityChangedSignal();
+}
+
+TransitionEffectEventSignalType& TransitionEffectEventSignal( Window window )
+{
+ return GetImplementation( window ).TransitionEffectEventSignal();
+}
+
+KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal( Window window )
+{
+ 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 )
{
- GetImplementation( window ).Add( actor );
+ return GetImplementation( window ).GetParent();
}
-void Remove( Window window, Dali::Actor actor )
+Window DownCast( BaseHandle handle )
{
- GetImplementation( window ).Remove( actor );
+ return Window( dynamic_cast<Dali::Internal::Adaptor::Window*>( handle.GetObjectPtr()) );
}
-void SetBackgroundColor( Window window, Vector4 color )
+Dali::Window::WindowOrientation GetCurrentOrientation( Window window )
{
- GetImplementation( window ).SetBackgroundColor( color );
+ return GetImplementation( window ).GetCurrentOrientation();
}
-Vector4 GetBackgroundColor( Window window )
+void SetAvailableOrientations( Window window, const Dali::Vector<Dali::Window::WindowOrientation>& orientations )
{
- return GetImplementation( window ).GetBackgroundColor();
+ GetImplementation( window ).SetAvailableOrientations( orientations );
}
-Dali::Layer GetRootLayer( Window window )
+int32_t GetNativeId( Window window )
{
- return GetImplementation( window ).GetRootLayer();
+ return GetImplementation( window ).GetNativeId();
}
-uint32_t GetLayerCount( Window window )
+void AddFrameRenderedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId )
{
- return GetImplementation( window ).GetLayerCount();
+ GetImplementation( window ).AddFrameRenderedCallback( std::move( callback ), frameId );
}
-Dali::Layer GetLayer( Window window, uint32_t depth )
+void AddFramePresentedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId )
{
- return GetImplementation( window ).GetLayer( depth );
+ GetImplementation( window ).AddFramePresentedCallback( std::move( callback ), frameId );
}
} // namespace DevelWindow