[Tizen] Reset to "Modify API name and the description of window APIs" 83/318983/1
authorSeungho Baek <sbsh.baek@samsung.com>
Fri, 11 Oct 2024 11:08:49 +0000 (20:08 +0900)
committerSeungho Baek <sbsh.baek@samsung.com>
Fri, 11 Oct 2024 11:08:49 +0000 (20:08 +0900)
Change-Id: Iab15d458ad9dcbe5bc7d14cceb79138f4fa89018
Signed-off-by: Seungho Baek <sbsh.baek@samsung.com>
23 files changed:
dali/devel-api/adaptor-framework/accessibility.cpp
dali/devel-api/adaptor-framework/atspi-accessibility.cpp
dali/devel-api/adaptor-framework/atspi-accessibility.h
dali/devel-api/adaptor-framework/key-devel.h
dali/devel-api/adaptor-framework/window-devel.cpp
dali/devel-api/adaptor-framework/window-devel.h
dali/internal/accessibility/bridge/bridge-base.cpp
dali/internal/imaging/common/image-operations.cpp
dali/internal/window-system/android/window-base-android.cpp
dali/internal/window-system/android/window-base-android.h
dali/internal/window-system/common/window-base.h
dali/internal/window-system/common/window-impl.cpp
dali/internal/window-system/common/window-impl.h
dali/internal/window-system/macos/window-base-mac.h
dali/internal/window-system/macos/window-base-mac.mm
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h
dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp
dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h
dali/internal/window-system/windows/window-base-win.cpp
dali/internal/window-system/windows/window-base-win.h
dali/internal/window-system/x11/window-base-x.cpp
dali/internal/window-system/x11/window-base-x.h

index fe0b3a51778bb29b91292034bed0f87dd061470e..f6e1702eaf7f29fb6686d240b5f0942bd12bee18 100644 (file)
@@ -359,6 +359,17 @@ public:
   {
   }
 
+  ~AdaptorAccessible() override
+  {
+    if(mRoot)
+    {
+      if(auto bridge = Accessibility::Bridge::GetCurrentBridge())
+      {
+        bridge->RemoveTopLevelWindow(this);
+      }
+    }
+  }
+
   bool GrabFocus() override
   {
     return false;
index 1adebe75636d291bbad92e32b9b9ce54649152ef..c5d33a1547b04d47effcb25d8c040f6fc1f96384 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -61,59 +61,6 @@ void Dali::AtspiAccessibility::Say(const std::string& text, bool discardable, st
   }
 }
 
-int Dali::AtspiAccessibility::SetForcefully(bool turnOn)
-{
-  if(turnOn)
-  {
-    if(auto bridge = Dali::Accessibility::Bridge::GetCurrentBridge())
-    {
-      bridge->Initialize();
-      auto ret = bridge->ForceUp();
-      return (int)ret;
-    }
-  }
-  else
-  {
-    if(auto bridge = Dali::Accessibility::Bridge::GetCurrentBridge())
-    {
-      bridge->ForceDown();
-      return 0;
-    }
-  }
-  return -1;
-}
-
-int Dali::AtspiAccessibility::GetStatus()
-{
-  //0(ATSPI OFF, ScreenReader OFF), 1(ATSPI ON, ScreenReader OFF), 2 (ATSPI OFF, ScreenReader ON), 3(ATSPI ON, ScreenReader ON)
-  if(auto bridge = Dali::Accessibility::Bridge::GetCurrentBridge())
-  {
-    if(bridge->GetScreenReaderEnabled())
-    {
-      if(bridge->IsEnabled())
-      {
-        return 3;
-      }
-      else
-      {
-        return 2;
-      }
-    }
-    else
-    {
-      if(bridge->IsEnabled())
-      {
-        return 1;
-      }
-      else
-      {
-        return 0;
-      }
-    }
-  }
-  return -1;
-}
-
 bool Dali::AtspiAccessibility::IsEnabled()
 {
   return Dali::Accessibility::IsUp();
index 3ee0674ea5d6deae1aa3b5001b09f22c5c4cc1ea..26ca5f2dc32c0889d14eec7f5adb61258bdc37e4 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_DEVEL_ATSPI_ACCESSIBILITY_H
 #define DALI_DEVEL_ATSPI_ACCESSIBILITY_H
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -64,22 +64,6 @@ DALI_ADAPTOR_API void StopReading(bool alsoNonDiscardable = false);
  */
 DALI_ADAPTOR_API bool SuppressScreenReader(bool suppress);
 
-/**
- * @brief Sets ATSPI to be turned On or Off forcibly.
- *
- * @param[in] turnOn true to turn on, false to turn off.
- * @return The status of ATSPI : 0(ATSPI OFF, ScreenReader OFF), 1(ATSPI ON, ScreenReader OFF),
- * 2 (ATSPI OFF, ScreenReader ON), 3(ATSPI ON, ScreenReader ON)
- */
-DALI_ADAPTOR_API int SetForcefully(bool turnOn);
-
-/**
- * @brief Gets ATSPI status.
- * @return Status of ATSPI : 0(ATSPI OFF, ScreenReader OFF), 1(ATSPI ON, ScreenReader OFF),
- * 2 (ATSPI OFF, ScreenReader ON), 3(ATSPI ON, ScreenReader ON)
- */
-DALI_ADAPTOR_API int GetStatus();
-
 /**
  * @brief Returns whether the state of Accessibility is enabled or not.
  *
index 60de30b99adcd7903233fc20fef7acb8d9ffc1d0..8a939e9ade8b1678a761cc7e7ab61d2ade1370ea 100644 (file)
@@ -86,10 +86,14 @@ enum Key
   DALI_KEY_CONTROL_RIGHT = 105,
 
   /**
-   * @brief Control Return key.
+   * @brief Return key.
    */
-  DALI_KEY_RETURN = 36
+  DALI_KEY_RETURN = 36,
 
+  /**
+   * @brief Keypad Enter key.
+   */
+  DALI_KEY_KP_ENTER = 104
 };
 
 /**
index 243c8c5bb16499688fe6ec370f1e00de179758c4..8f3456d68b5d4cc8fce921936766f942dec43f70 100644 (file)
@@ -389,6 +389,16 @@ bool IsAlwaysOnTop(Window window)
   return GetImplementation(window).IsAlwaysOnTop();
 }
 
+void SetBottom(Window window, bool enable)
+{
+  GetImplementation(window).SetBottom(enable);
+}
+
+bool IsBottom(Window window)
+{
+  return GetImplementation(window).IsBottom();
+}
+
 Any GetNativeBuffer(Window window)
 {
   return GetImplementation(window).GetNativeBuffer();
index 481aa8d7ec6d010381712611e38a68b89bc5db53..e2ab62566653fef8503b483d44beb66acc0161d1 100644 (file)
@@ -686,6 +686,9 @@ DALI_ADAPTOR_API bool IsModal(Window window);
 /**
  * @brief Enables or disables the window always is on top.
  *
+ * This is valid between windows that have no notification level or a notification level of 'none'.
+ * If it has a notification level, this will not do anything.
+ *
  * @param[in] window The window instance.
  * @param[in] alwaysOnTop true to enable the window always is on top, false to disable.
  */
@@ -699,6 +702,25 @@ DALI_ADAPTOR_API void SetAlwaysOnTop(Window window, bool alwaysOnTop);
  */
 DALI_ADAPTOR_API bool IsAlwaysOnTop(Window window);
 
+/**
+ * @brief Enables or disables the window's layer is changed to bottom.
+ *
+ * If the enable flag is true, this window will be placed below other windows.
+ * Otherwise, if it's called with a false value, it will be located above other windows.
+ *
+ * @param[in] window The window instance.
+ * @param[in] enable true to change the window layer to the bottom.
+ */
+DALI_ADAPTOR_API void SetBottom(Window window, bool enable);
+
+/**
+ * @brief Returns whether the window layer is the bottom or not.
+ *
+ * @param[in] window The window instance.
+ * @return True if the window layer is the bottom, false otherwise.
+ */
+DALI_ADAPTOR_API bool IsBottom(Window window);
+
 /**
  * @brief Gets the native buffer of the window.
  *
index 0e3269c37e6ff067cc23afcbb188ef6291d0dc2c..3179368beb985009496a8c9eb9b5588d28275d84 100644 (file)
@@ -38,7 +38,6 @@ BridgeBase::BridgeBase()
 
 BridgeBase::~BridgeBase()
 {
-  mApplication.mChildren.clear();
 }
 
 void BridgeBase::AddCoalescableMessage(CoalescableMessages kind, Dali::Accessibility::Accessible* obj, float delay, std::function<void()> functor)
@@ -225,6 +224,7 @@ void BridgeBase::RemoveTopLevelWindow(Accessible* windowAccessible)
     if(mApplication.mChildren[i] == windowAccessible)
     {
       mApplication.mChildren.erase(mApplication.mChildren.begin() + i);
+      Emit(windowAccessible, WindowEvent::DESTROY);
       break;
     }
   }
index d33b48b6217746835488a87beda3f8d4e9d6c70b..8a20af1f51fd5202e45017d746043164a7cb313f 100644 (file)
@@ -476,11 +476,11 @@ ImageDimensions CalculateDesiredDimensions(uint32_t bitmapWidth, uint32_t bitmap
       if (aspectOfImageSize > aspectOfDesiredSize)
       {
         adjustedDesiredWidth = requestedWidth;
-        adjustedDesiredHeight = static_cast<uint64_t>(bitmapHeight) * requestedWidth / bitmapWidth;
+        adjustedDesiredHeight = (static_cast<uint64_t>(bitmapHeight) * requestedWidth + bitmapWidth / 2) / bitmapWidth; ///< round up
       }
       else
       {
-        adjustedDesiredWidth = static_cast<uint64_t>(bitmapWidth) * requestedHeight / bitmapHeight;
+        adjustedDesiredWidth = (static_cast<uint64_t>(bitmapWidth) * requestedHeight + bitmapHeight / 2) / bitmapHeight; ///< round up
         adjustedDesiredHeight = requestedHeight;
       }
 
index 4c13e7053d2c795f0d31fb9c8998f3bc1135813d..cb9aea66de4ac545a3ad3245995ae8fd0ee7522c 100644 (file)
@@ -516,6 +516,15 @@ bool WindowBaseAndroid::IsAlwaysOnTop()
   return false;
 }
 
+void WindowBaseAndroid::SetBottom(bool enable)
+{
+}
+
+bool WindowBaseAndroid::IsBottom()
+{
+  return false;
+}
+
 Any WindowBaseAndroid::GetNativeBuffer() const
 {
   return 0;
index f9c4e4d5504d7271b2e343ac2f82ddf133b95b44..a7ffb96ba52d9e6bc3fd79f118fc720ea5bfbfa6 100644 (file)
@@ -539,6 +539,16 @@ public:
    */
   bool IsAlwaysOnTop() override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
+   */
+  void SetBottom(bool enable) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()
+   */
+  bool IsBottom() override;
+
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer()
    */
index 7a7ff25dfb1aee7d11812215e52b8fcffc7e1cfc..5afb0848aaeca3ba158dae43d94d80f60d85369e 100644 (file)
@@ -582,6 +582,9 @@ public:
   /**
    * @brief Enables or disables the window always is on top.
    *
+   * This is valid between windows that have no notification level or a notification level of 'none'.
+   * If it has a notification level, this will not do anything.
+   *
    * @param[in] alwaysOnTop true to enable the window always is on top, false to disable.
    */
   virtual void SetAlwaysOnTop(bool alwaysOnTop) = 0;
@@ -593,6 +596,24 @@ public:
    */
   virtual bool IsAlwaysOnTop() = 0;
 
+  /**
+   * @brief Enables or disables the window's layer is changed to bottom.
+   *
+   * If the enable flag is true, this window will be placed below other windows.
+   * Otherwise, if it's called with a false value, it will be located above other windows.
+   *
+   * @param[in] window The window instance.
+   * @param[in] enable true to change the window layer to the bottom.
+   */
+  virtual void SetBottom(bool enable) = 0;
+
+  /**
+   * @brief Returns whether the window layer is the bottom or not.
+   *
+   * @return True if the window layer is the bottom, false otherwise.
+   */
+  virtual bool IsBottom() = 0;
+
   /**
    * @brief Get native buffer of window.
    * @return The native window buffer handle
index 2ff068ec7de17fdd4a56e63a4129b4b69d9eb5b1..279630f94df3e176971578fef4c2c5c0901d758f 100644 (file)
@@ -113,16 +113,6 @@ Window::Window()
 
 Window::~Window()
 {
-  if(mScene)
-  {
-    auto bridge     = Accessibility::Bridge::GetCurrentBridge();
-    auto rootLayer  = mScene.GetRootLayer();
-    auto accessible = Accessibility::Accessible::Get(rootLayer);
-    bridge->RemoveTopLevelWindow(accessible);
-    // Related to multi-window case. This is called for default window and non-default window, but it is effective for non-default window.
-    bridge->Emit(accessible, Accessibility::WindowEvent::DESTROY);
-  }
-
   if(mAdaptor)
   {
     mAdaptor->RemoveWindow(this);
@@ -1308,14 +1298,9 @@ void Window::OnAccessibilityEnabled()
 
 void Window::OnAccessibilityDisabled()
 {
-  auto bridge     = Accessibility::Bridge::GetCurrentBridge();
-  auto rootLayer  = mScene.GetRootLayer();
-  auto accessible = Accessibility::Accessible::Get(rootLayer);
-
   DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Accessibility is disabled\n", this, mNativeWindowId);
 
   InterceptKeyEventSignal().Disconnect(this, &Window::OnAccessibilityInterceptKeyEvent);
-  bridge->RemoveTopLevelWindow(accessible);
 }
 
 bool Window::OnAccessibilityInterceptKeyEvent(const Dali::KeyEvent& keyEvent)
@@ -1649,6 +1634,16 @@ bool Window::IsAlwaysOnTop()
   return mWindowBase->IsAlwaysOnTop();
 }
 
+void Window::SetBottom(bool enable)
+{
+  mWindowBase->SetBottom(enable);
+}
+
+bool Window::IsBottom()
+{
+  return mWindowBase->IsBottom();
+}
+
 Dali::Any Window::GetNativeBuffer() const
 {
   return mWindowBase->GetNativeBuffer();
index 031046915e0f5bf5ab6bcc4b7b4be53777854ff7..3c31b00ab00f07a9472db3adb6a352c15c4ff185 100644 (file)
@@ -602,6 +602,16 @@ public: // Dali::Internal::Adaptor::SceneHolder
    */
   bool IsAlwaysOnTop();
 
+  /**
+   * @copydoc Dali::DevelWindow::SetBottom()
+   */
+  void SetBottom(bool enable);
+
+  /**
+   * @copydoc Dali::DevelWindow::IsBottom()
+   */
+  bool IsBottom();
+
   /**
    * @copydoc Dali::DevelWindow::GetNativeBuffer()
    */
index 190286fd4284e96db69ddd4161710fc48b91e1cf..fd50d91de44cd4b2e404a71b468e26a5d08e8f91 100644 (file)
@@ -467,6 +467,16 @@ public:
    */
   bool IsAlwaysOnTop() override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
+   */
+  void SetBottom(bool enable) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()
+   */
+  bool IsBottom() override;
+
   /**
    * @brief Sets front buffer rendering to the window.
    * @param[in] enable True to enable front buffer rendering mode, False to otherwise.
index 303ddf2ad8f40f66adacff5d9d079dd0d1353023..a414e0529ae4f2bbfeb67922e2490f11ca5c6730 100644 (file)
@@ -824,6 +824,15 @@ bool WindowBaseCocoa::IsAlwaysOnTop()
   return false;
 }
 
+void WindowBaseCocoa::SetBottom(bool enable)
+{
+}
+
+bool WindowBaseCocoa::IsBottom()
+{
+  return false;
+}
+
 Any WindowBaseCocoa::GetNativeBuffer() const
 {
   return 0;
index 343347c92d09b4665d02e6ad69b222f645b826b3..6027bb16d1d2498668c4fa1dd40d62af11d6a65b 100644 (file)
@@ -936,7 +936,8 @@ WindowBaseEcoreWl2::WindowBaseEcoreWl2(Dali::PositionSize positionSize, Any surf
   mOwnSurface(false),
   mBrightnessChangeDone(true),
   mIsFrontBufferRendering(false),
-  mIsIMEWindowInitialized(false)
+  mIsIMEWindowInitialized(false),
+  mBottom(false)
 {
   Initialize(positionSize, surface, isTransparent);
 }
@@ -3690,6 +3691,7 @@ void WindowBaseEcoreWl2::SetAlwaysOnTop(bool alwaysOnTop)
   DALI_LOG_RELEASE_INFO("ecore_wl2_window_pin_mode_set, window: [%p], flag [%d]\n", mEcoreWindow, alwaysOnTop);
   START_DURATION_CHECK();
   ecore_wl2_window_pin_mode_set(mEcoreWindow, alwaysOnTop);
+  ecore_wl2_window_commit(mEcoreWindow, EINA_TRUE);
   FINISH_DURATION_CHECK("ecore_wl2_window_pin_mode_set");
 }
 
@@ -3700,6 +3702,29 @@ bool WindowBaseEcoreWl2::IsAlwaysOnTop()
   return ret;
 }
 
+void WindowBaseEcoreWl2::SetBottom(bool enable)
+{
+  START_DURATION_CHECK();
+  mBottom = enable;
+  if(mBottom)
+  {
+    DALI_LOG_RELEASE_INFO("ecore_wl2_window_stack_mode_set, window: [%p], flag[%d] ECORE_WL2_WINDOW_STACK_BELOW\n", mEcoreWindow, mBottom);
+    ecore_wl2_window_stack_mode_set(mEcoreWindow, ECORE_WL2_WINDOW_STACK_BELOW);
+  }
+  else
+  {
+    DALI_LOG_RELEASE_INFO("ecore_wl2_window_stack_mode_set, window: [%p], flag[%d] ECORE_WL2_WINDOW_STACK_NONE\n", mEcoreWindow, mBottom);
+    ecore_wl2_window_stack_mode_set(mEcoreWindow, ECORE_WL2_WINDOW_STACK_NONE);
+  }
+  ecore_wl2_window_commit(mEcoreWindow, EINA_TRUE);
+  FINISH_DURATION_CHECK("ecore_wl2_window_stack_mode_set");
+}
+
+bool WindowBaseEcoreWl2::IsBottom()
+{
+  return mBottom;
+}
+
 Any WindowBaseEcoreWl2::GetNativeBuffer() const
 {
   DALI_LOG_RELEASE_INFO("Get wl_egl_window, ecore_window: [%p], wl_egl_window [%p]\n", mEcoreWindow, mEglWindow);
index dd0d137aef639ec9c9814b8419b35d59fa5b1ee8..1d12c2de538158e90f661ba2ac0452a830d8234a 100644 (file)
@@ -682,6 +682,16 @@ public:
    */
   bool IsAlwaysOnTop() override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
+   */
+  void SetBottom(bool enable) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()
+   */
+  bool IsBottom() override;
+
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer()
    */
@@ -806,6 +816,7 @@ private:
   bool mBrightnessChangeDone;
   bool mIsFrontBufferRendering;
   bool mIsIMEWindowInitialized;
+  bool mBottom;
 };
 
 } // namespace Adaptor
index a1a434587fbfd52afa0674c22c2614217468c84d..cdb15dad14e2dc56331822f9bb3444b91aefec8d 100644 (file)
@@ -1115,6 +1115,15 @@ bool WindowBaseEcoreX::IsAlwaysOnTop()
   return false;
 }
 
+void WindowBaseEcoreX::SetBottom(bool enable)
+{
+}
+
+bool WindowBaseEcoreX::IsBottom()
+{
+  return false;
+}
+
 Any WindowBaseEcoreX::GetNativeBuffer() const
 {
   return 0;
index fb68356a3359cb0aad2e4332a08306e117bfc673..eaacefc0891d3e70eda8549ac37841dd2672318a 100644 (file)
@@ -544,6 +544,16 @@ public:
    */
   bool IsAlwaysOnTop() override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
+   */
+  void SetBottom(bool enable) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()
+   */
+  bool IsBottom() override;
+
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer()
    */
index f42bd1e6dd581e611816eb95e98e5119d5431159..12a152177b27d827c3f7c2830bc9f79e7732512b 100644 (file)
@@ -744,6 +744,15 @@ bool WindowBaseWin::IsAlwaysOnTop()
   return false;
 }
 
+void WindowBaseWin::SetBottom(bool enable)
+{
+}
+
+bool WindowBaseWin::IsBottom()
+{
+  return false;
+}
+
 Any WindowBaseWin::GetNativeBuffer() const
 {
   return 0;
index dff49ac5bd91cc7abdfda839decbeee4517677cd..c69991ac2454b8abd238baa20ca9d220366cf937 100644 (file)
@@ -526,6 +526,16 @@ public:
    */
   bool IsAlwaysOnTop() override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
+   */
+  void SetBottom(bool enable) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()
+   */
+  bool IsBottom() override;
+
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer()
    */
index 7ff6b7fec4944b3e66bb5a61c3099496291a20f6..f1164d1e42b3c9ed1c162715b9b1a1d3e15edeee 100644 (file)
@@ -1049,6 +1049,15 @@ bool WindowBaseX::IsAlwaysOnTop()
   return false;
 }
 
+void WindowBaseX::SetBottom(bool enable)
+{
+}
+
+bool WindowBaseX::IsBottom()
+{
+  return false;
+}
+
 Any WindowBaseX::GetNativeBuffer()
 {
   return 0;
index 004bc3d233dbb2eed687dc377b1d0978dcaf3a10..fd3c9f474cfd42f676e30b673826d3ff2d221ebe 100644 (file)
@@ -549,6 +549,16 @@ public:
    */
   bool IsAlwaysOnTop() override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
+   */
+  void SetBottom(bool enable) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()
+   */
+  bool IsBottom() override;
+
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer()
    */