/*
- * 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 Dali
{
-class DALI_INTERNAL DragAndDropDetector : public BaseHandle {}; // Empty class only required to compile Deprecated API GetDragAndDropDetector
-
Window Window::New(PositionSize posSize, const std::string& name, bool isTransparent)
{
- Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, "", isTransparent);
-
- Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get();
- Integration::SceneHolder sceneHolder = Integration::SceneHolder( window );
- Internal::Adaptor::Adaptor::GetImplementation( adaptor ).AddWindow( sceneHolder, name, "", isTransparent );
-
- return Window(window);
+ return Dali::Window::New(posSize, name, "", isTransparent);
}
Window Window::New(PositionSize posSize, const std::string& name, const std::string& className, bool isTransparent)
{
- Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, 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();
+ }
- Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get();
- Integration::SceneHolder sceneHolder = Integration::SceneHolder( window );
- Internal::Adaptor::Adaptor::GetImplementation( adaptor ).AddWindow( sceneHolder, name, className, isTransparent );
+ if (isNewWindowAllowed)
+ {
+ Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, isTransparent);
- return Window(window);
+ 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;
}
Window::Window()
{
}
-Window::Window(const Window& handle)
-: BaseHandle(handle)
-{
-}
+Window::Window( const Window& copy ) = default;
-Window& Window::operator=(const Window& rhs)
-{
- BaseHandle::operator=(rhs);
- return *this;
-}
+Window& Window::operator=( const Window& rhs ) = default;
+
+Window::Window( Window&& rhs ) = default;
+
+Window& Window::operator=( Window&& rhs ) = default;
void Window::Add( Dali::Actor actor )
{
return GetImplementation( *this ).GetLayer( depth );
}
-void Window::ShowIndicator( IndicatorVisibleMode visibleMode )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: ShowIndicator is deprecated and will be removed from next release.\n" );
-
- GetImplementation(*this).ShowIndicator( visibleMode );
-}
-
-Window::IndicatorSignalType& Window::IndicatorVisibilityChangedSignal()
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: IndicatorVisibilityChangedSignal is deprecated and will be removed from next release.\n" );
-
- return GetImplementation(*this).IndicatorVisibilityChangedSignal();
-}
-
-void Window::SetIndicatorBgOpacity( IndicatorBgOpacity opacity )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetIndicatorBgOpacity is deprecated and will be removed from next release.\n" );
-
- GetImplementation(*this).SetIndicatorBgOpacity( opacity );
-}
-
-void Window::RotateIndicator( WindowOrientation orientation )
+Uint16Pair Window::GetDpi() const
{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: RotateIndicator is deprecated and will be removed from next release.\n" );
-
- GetImplementation(*this).RotateIndicator( orientation );
+ return GetImplementation(*this).GetDpi();
}
void Window::SetClass( std::string name, std::string klass )
GetImplementation(*this).RemoveAvailableOrientation( orientation );
}
-void Window::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
+void Window::SetPreferredOrientation( WindowOrientation orientation )
{
GetImplementation(*this).SetPreferredOrientation( orientation );
}
return GetImplementation(*this).GetPreferredOrientation();
}
-DragAndDropDetector Window::GetDragAndDropDetector() const
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetDragAndDropDetector is deprecated and will be removed from the next release.\n" );
- DALI_ASSERT_ALWAYS( &GetImplementation( *this ) == GetObjectPtr() && "Empty Handle" );
- return Dali::DragAndDropDetector();
-}
-
Any Window::GetNativeHandle() const
{
return GetImplementation(*this).GetNativeHandle();
}
-Window::FocusSignalType& Window::FocusChangedSignal()
+Window::FocusChangeSignalType& Window::FocusChangeSignal()
{
- return GetImplementation(*this).FocusChangedSignal();
+ return GetImplementation(*this).FocusChangeSignal();
}
void Window::SetAcceptFocus( bool accept )
return GetImplementation(*this).GetBrightness();
}
-Window::ResizedSignalType& Window::ResizedSignal()
+Window::ResizeSignalType& Window::ResizeSignal()
{
- return GetImplementation(*this).ResizedSignal();
+ return GetImplementation(*this).ResizeSignal();
}
void Window::SetSize( Window::WindowSize size )
GetImplementation(*this).SetTransparency( transparent );
}
+Dali::RenderTaskList Window::GetRenderTaskList()
+{
+ return GetImplementation(*this).GetRenderTaskList();
+}
+
+Window::KeyEventSignalType& Window::KeyEventSignal()
+{
+ return GetImplementation(*this).KeyEventSignal();
+}
+
+Window::TouchEventSignalType& Window::TouchedSignal()
+{
+ return GetImplementation(*this).TouchedSignal();
+}
+
Window::Window( Internal::Adaptor::Window* window )
: BaseHandle( window )
{