Renamed TouchSignal to TouchedSignal
[platform/core/uifw/dali-adaptor.git] / dali / public-api / adaptor-framework / window.cpp
index 08562d0..9452630 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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();
-  if( Internal::Adaptor::Adaptor::GetImplementation( adaptor ).IsMultipleWindowSupported() )
-  {
-    Integration::SceneHolder sceneHolder = Integration::SceneHolder( window );
-    Internal::Adaptor::Adaptor::GetImplementation( adaptor ).AddWindow( sceneHolder, name, "", isTransparent );
-
-    return Window(window);
-  }
-  else
-  {
-    DALI_LOG_ERROR("This device can't support multiple windows.\n");
-    return 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();
-  if( Internal::Adaptor::Adaptor::GetImplementation( adaptor ).IsMultipleWindowSupported() )
+  if (isNewWindowAllowed)
   {
-    Integration::SceneHolder sceneHolder = Integration::SceneHolder( window );
-    Internal::Adaptor::Adaptor::GetImplementation( adaptor ).AddWindow( sceneHolder, name, className, isTransparent );
+    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 Window();
   }
+
+  return newWindow;
 }
 
 Window::Window()
@@ -77,16 +76,13 @@ 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 )
 {
@@ -123,32 +119,9 @@ Layer Window::GetLayer( uint32_t depth ) const
   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 )
+Uint16Pair Window::GetDpi() const
 {
-  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 )
-{
-  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 )
@@ -191,24 +164,11 @@ Dali::Window::WindowOrientation Window::GetPreferredOrientation()
   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()
-{
-  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: FocusChangedSignal is deprecated and will be removed from next release.\n" );
-  return GetImplementation(*this).FocusChangedSignal();
-}
-
 Window::FocusChangeSignalType& Window::FocusChangeSignal()
 {
   return GetImplementation(*this).FocusChangeSignal();
@@ -329,12 +289,6 @@ int Window::GetBrightness() const
   return GetImplementation(*this).GetBrightness();
 }
 
-Window::ResizedSignalType& Window::ResizedSignal()
-{
-  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: ResizedSignal is deprecated and will be removed from next release.\n" );
-  return GetImplementation(*this).ResizedSignal();
-}
-
 Window::ResizeSignalType& Window::ResizeSignal()
 {
   return GetImplementation(*this).ResizeSignal();
@@ -365,6 +319,21 @@ void Window::SetTransparency( bool transparent )
   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 )
 {