(Partial update) Fix surface damage area
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / window-devel.cpp
index 9453a93..f883ae8 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.
@@ -17,7 +17,6 @@
 
 // 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
@@ -30,29 +29,122 @@ namespace Dali
 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 );
 }
 
+Window Get( Actor actor )
+{
+  return Internal::Adaptor::Window::Get( actor );
+}
+
 EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window )
 {
   return GetImplementation( window ).EventProcessingFinishedSignal();
 }
 
-KeyEventSignalType& KeyEventSignal( Window window )
+WheelEventSignalType& WheelEventSignal( Window window )
 {
-  return GetImplementation( window ).KeyEventSignal();
+  return GetImplementation( window ).WheelEventSignal();
 }
 
-TouchSignalType& TouchSignal( Window window )
+VisibilityChangedSignalType& VisibilityChangedSignal( Window window )
 {
-  return GetImplementation( window ).TouchSignal();
+  return GetImplementation( window ).VisibilityChangedSignal();
 }
 
-WheelEventSignalType& WheelEventSignal( Window window )
+TransitionEffectEventSignalType& TransitionEffectEventSignal( Window window )
 {
-  return GetImplementation( window ).WheelEventSignal();
+  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 )
+{
+  return GetImplementation( window ).GetParent();
+}
+
+Window DownCast( BaseHandle handle )
+{
+  return Window( dynamic_cast<Dali::Internal::Adaptor::Window*>( handle.GetObjectPtr()) );
+}
+
+Dali::Window::WindowOrientation GetCurrentOrientation( Window window )
+{
+  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