[Tizen] Temporarily modified so that window is no null
[platform/core/uifw/dali-adaptor.git] / dali / public-api / adaptor-framework / window.cpp
index 34a8fa9..9da92dd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -34,22 +34,26 @@ class DALI_INTERNAL DragAndDropDetector : public BaseHandle {}; // Empty class o
 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 );
-
+  Internal::Adaptor::Adaptor::GetImplementation( adaptor ).AddWindow( sceneHolder, name, "", isTransparent );
+  if( !Internal::Adaptor::Adaptor::GetImplementation( adaptor ).IsMultipleWindowSupported() )
+  {
+    DALI_LOG_ERROR("This device can't support multiple windows.\n");
+  }
   return Window(window);
 }
 
 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);
-
   Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get();
   Integration::SceneHolder sceneHolder = Integration::SceneHolder( window );
-  Internal::Adaptor::Adaptor::GetImplementation( adaptor ).AddWindow( &sceneHolder, name, className, isTransparent );
-
+  Internal::Adaptor::Adaptor::GetImplementation( adaptor ).AddWindow( sceneHolder, name, className, isTransparent );
+  if( !Internal::Adaptor::Adaptor::GetImplementation( adaptor ).IsMultipleWindowSupported() )
+  {
+    DALI_LOG_ERROR("This device can't support multiple windows.\n");
+  }
   return Window(window);
 }
 
@@ -72,6 +76,41 @@ Window& Window::operator=(const Window& rhs)
   return *this;
 }
 
+void Window::Add( Dali::Actor actor )
+{
+  GetImplementation( *this ).Add( actor );
+}
+
+void Window::Remove( Dali::Actor actor )
+{
+  GetImplementation( *this ).Remove( actor );
+}
+
+void Window::SetBackgroundColor( const Vector4& color )
+{
+  GetImplementation( *this ).SetBackgroundColor( color );
+}
+
+Vector4 Window::GetBackgroundColor() const
+{
+  return GetImplementation( *this ).GetBackgroundColor();
+}
+
+Layer Window::GetRootLayer() const
+{
+  return GetImplementation( *this ).GetRootLayer();
+}
+
+uint32_t Window::GetLayerCount() const
+{
+  return GetImplementation( *this ).GetLayerCount();
+}
+
+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" );
@@ -130,7 +169,7 @@ void Window::RemoveAvailableOrientation( WindowOrientation orientation )
   GetImplementation(*this).RemoveAvailableOrientation( orientation );
 }
 
-void Window::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
+void Window::SetPreferredOrientation( WindowOrientation orientation )
 {
   GetImplementation(*this).SetPreferredOrientation( orientation );
 }
@@ -154,9 +193,15 @@ Any Window::GetNativeHandle() const
 
 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();
+}
+
 void Window::SetAcceptFocus( bool accept )
 {
   GetImplementation(*this).SetAcceptFocus( accept );
@@ -274,9 +319,15 @@ int Window::GetBrightness() const
 
 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();
+}
+
 void Window::SetSize( Window::WindowSize size )
 {
   GetImplementation(*this).SetSize( size );