[AT-SPI] Add resource id to window attribute 28/272828/7
authorShinwoo Kim <cinoo.kim@samsung.com>
Fri, 25 Mar 2022 07:53:38 +0000 (16:53 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Wed, 30 Mar 2022 08:24:07 +0000 (17:24 +0900)
The window resource id is unique value in the system.
This value can be used in screen-reader to support multi-window.
The screen-reader will use this to find a window at xy position.

Change-Id: Icf27d260790eca5ae7768a7df4bdd906d5fd2e23

16 files changed:
dali/devel-api/adaptor-framework/accessibility.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-wl/window-base-ecore-wl.cpp
dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h
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

index 2a2088b..dc9484a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020  Samsung Electronics Co., Ltd
+ * Copyright 2022  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.
@@ -43,6 +43,7 @@
 #include <dali/devel-api/atspi-interfaces/text.h>
 #include <dali/devel-api/atspi-interfaces/value.h>
 #include <dali/internal/adaptor/common/adaptor-impl.h>
+#include <dali/internal/window-system/common/window-impl.h>
 #include <dali/public-api/dali-adaptor-common.h>
 
 using namespace Dali::Accessibility;
@@ -391,11 +392,20 @@ public:
 
   Attributes GetAttributes() const override
   {
+    Attributes attributes;
+
+    if(mRoot)
+    {
+      Dali::Window window                         = Dali::DevelWindow::Get(Self());
+      Dali::Internal::Adaptor::Window& windowImpl = Dali::GetImplementation(window);
+      attributes["resID"]                         = windowImpl.GetNativeResourceId();
+    }
+
     Dali::TypeInfo type;
     Self().GetTypeInfo(type);
-    return {
-      {"class", type.GetName()},
-    };
+    attributes["class"] = type.GetName();
+
+    return attributes;
   }
 
   bool DoGesture(const GestureInfo& gestureInfo) override
index 842bcb1..1693b34 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -125,6 +125,11 @@ int WindowBaseAndroid::GetNativeWindowId()
   return 0;
 }
 
+std::string WindowBaseAndroid::GetNativeWindowResourceId()
+{
+  return std::string();
+}
+
 EGLNativeWindowType WindowBaseAndroid::CreateEglWindow(int width, int height)
 {
   // from eglplatform.h header
index abfe727..cb80b83 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WINDOWSYSTEM_ANDROID_WINDOW_BASE_ANDROID_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -124,6 +124,11 @@ public:
   int GetNativeWindowId() override;
 
   /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindowResourceId()
+   */
+  std::string GetNativeWindowResourceId() override;
+
+  /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::CreateEglWindow()
    */
   EGLNativeWindowType CreateEglWindow(int width, int height) override;
index d84e528..8003802 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_BASE_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -111,6 +111,12 @@ public:
   virtual int GetNativeWindowId() = 0;
 
   /**
+   * @brief Get the native window resource id assinged by window manager
+   * @return The native window resource id
+   */
+  virtual std::string GetNativeWindowResourceId() = 0;
+
+  /**
    * @brief Create the egl window
    */
   virtual EGLNativeWindowType CreateEglWindow(int width, int height) = 0;
index fff3338..cdd80ab 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -271,6 +271,11 @@ Dali::RenderTaskList Window::GetRenderTaskList() const
   return mScene.GetRenderTaskList();
 }
 
+std::string Window::GetNativeResourceId() const
+{
+  return mWindowBase->GetNativeWindowResourceId();
+}
+
 void Window::AddAvailableOrientation(WindowOrientation orientation)
 {
   if(IsOrientationAvailable(orientation) == false)
index dff9c28..a0ede7c 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_IMPL_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -152,6 +152,12 @@ public:
   Dali::RenderTaskList GetRenderTaskList() const;
 
   /**
+   * @brief Get window resource ID assigned by window manager
+   * @return The resource ID of the window
+   */
+  std::string GetNativeResourceId() const;
+
+  /**
    * @copydoc Dali::Window::AddAvailableOrientation()
    */
   void AddAvailableOrientation(WindowOrientation orientation);
index eef4f6e..ef88a7b 100644 (file)
@@ -1,7 +1,7 @@
 #pragma once
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -53,6 +53,11 @@ public:
   int GetNativeWindowId() override;
 
   /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindowResourceId()
+   */
+  std::string GetNativeWindowResourceId() override;
+
+  /**
   * @copydoc Dali::Internal::Adaptor::WindowBase::CreateEglWindow()
    */
   EGLNativeWindowType CreateEglWindow(int width, int height) override;
index 6ca0681..efadeda 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -376,6 +376,11 @@ int WindowBaseCocoa::GetNativeWindowId()
   return mImpl->mWindow.windowNumber;
 }
 
+std::string WindowBaseCocoa::GetNativeWindowResourceId()
+{
+  return std::string();
+}
+
 EGLNativeWindowType WindowBaseCocoa::CreateEglWindow(int width, int height)
 {
   // XXX: this method is called from a secondary thread, but
index 6be7165..42a522c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -1188,6 +1188,11 @@ int WindowBaseEcoreWl::GetNativeWindowId()
   return ecore_wl_window_id_get(mEcoreWindow);
 }
 
+std::string WindowBaseEcoreWl::GetNativeWindowResourceId()
+{
+  return std::string();
+}
+
 EGLNativeWindowType WindowBaseEcoreWl::CreateEglWindow(int width, int height)
 {
   mEglWindow = wl_egl_window_create(mWlSurface, width, height);
index 6bdbd10..d2dad57 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WINDOWSYSTEM_TIZENWAYLAND_WINDOW_BASE_ECORE_WL_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -191,6 +191,11 @@ public:
   int GetNativeWindowId() override;
 
   /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindowResourceId()
+   */
+  std::string GetNativeWindowResourceId() override;
+
+  /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::CreateEglWindow()
    */
   EGLNativeWindowType CreateEglWindow(int width, int height) override;
index dd15ec4..c5f0c73 100644 (file)
@@ -1532,6 +1532,11 @@ int WindowBaseEcoreWl2::GetNativeWindowId()
   return ecore_wl2_window_id_get(mEcoreWindow);
 }
 
+std::string WindowBaseEcoreWl2::GetNativeWindowResourceId()
+{
+  return std::to_string(ecore_wl2_window_resource_id_get(mEcoreWindow));
+}
+
 EGLNativeWindowType WindowBaseEcoreWl2::CreateEglWindow(int width, int height)
 {
   int totalAngle = (mWindowRotationAngle + mScreenRotationAngle) % 360;
index bf43ea3..159e230 100644 (file)
@@ -230,6 +230,11 @@ public:
   int GetNativeWindowId() override;
 
   /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindowResourceId()
+   */
+  std::string GetNativeWindowResourceId() override;
+
+  /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::CreateEglWindow()
    */
   EGLNativeWindowType CreateEglWindow(int width, int height) override;
index 3e00080..bb1a9cb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -634,6 +634,11 @@ int WindowBaseEcoreX::GetNativeWindowId()
   return mEcoreWindow;
 }
 
+std::string WindowBaseEcoreX::GetNativeWindowResourceId()
+{
+  return std::string();
+}
+
 EGLNativeWindowType WindowBaseEcoreX::CreateEglWindow(int width, int height)
 {
   // need to create X handle as in 64bit system ECore handle is 32 bit whereas EGLnative and XWindow are 64 bit
index 1e0e569..1fff77f 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WINDOWSYSTEM_ECOREX_WINDOW_BASE_ECORE_X_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -125,6 +125,11 @@ public:
   int GetNativeWindowId() override;
 
   /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindowResourceId()
+   */
+  std::string GetNativeWindowResourceId() override;
+
+  /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::CreateEglWindow()
    */
   EGLNativeWindowType CreateEglWindow(int width, int height) override;
index 3bac5a4..2837754 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -250,6 +250,11 @@ int WindowBaseWin::GetNativeWindowId()
   return mWin32Window;
 }
 
+std::string WindowBaseWin::GetNativeWindowResourceId()
+{
+  return std::string();
+}
+
 EGLNativeWindowType WindowBaseWin::CreateEglWindow(int width, int height)
 {
   return reinterpret_cast<EGLNativeWindowType>(mWin32Window);
index ae3a8c2..bbc403f 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WINDOWSYSTEM_WINDOW_BASE_WIN_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -112,6 +112,11 @@ public:
   int GetNativeWindowId() override;
 
   /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindowResourceId()
+   */
+  std:string GetNativeWindowResourceId() override;
+
+  /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::CreateEglWindow()
    */
   EGLNativeWindowType CreateEglWindow(int width, int height) override;