From: Shinwoo Kim Date: Fri, 25 Mar 2022 07:53:38 +0000 (+0900) Subject: [AT-SPI] Add resource id to window attribute X-Git-Tag: dali_2.1.18~8^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F28%2F272828%2F7;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git [AT-SPI] Add resource id to window attribute 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 --- diff --git a/dali/devel-api/adaptor-framework/accessibility.cpp b/dali/devel-api/adaptor-framework/accessibility.cpp index 2a2088b..dc9484a 100644 --- a/dali/devel-api/adaptor-framework/accessibility.cpp +++ b/dali/devel-api/adaptor-framework/accessibility.cpp @@ -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 #include #include +#include #include 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 diff --git a/dali/internal/window-system/android/window-base-android.cpp b/dali/internal/window-system/android/window-base-android.cpp index 842bcb1..1693b34 100644 --- a/dali/internal/window-system/android/window-base-android.cpp +++ b/dali/internal/window-system/android/window-base-android.cpp @@ -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 diff --git a/dali/internal/window-system/android/window-base-android.h b/dali/internal/window-system/android/window-base-android.h index abfe727..cb80b83 100644 --- a/dali/internal/window-system/android/window-base-android.h +++ b/dali/internal/window-system/android/window-base-android.h @@ -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; diff --git a/dali/internal/window-system/common/window-base.h b/dali/internal/window-system/common/window-base.h index d84e528..8003802 100644 --- a/dali/internal/window-system/common/window-base.h +++ b/dali/internal/window-system/common/window-base.h @@ -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; diff --git a/dali/internal/window-system/common/window-impl.cpp b/dali/internal/window-system/common/window-impl.cpp index fff3338..cdd80ab 100644 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -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) diff --git a/dali/internal/window-system/common/window-impl.h b/dali/internal/window-system/common/window-impl.h index dff9c28..a0ede7c 100644 --- a/dali/internal/window-system/common/window-impl.h +++ b/dali/internal/window-system/common/window-impl.h @@ -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); diff --git a/dali/internal/window-system/macos/window-base-mac.h b/dali/internal/window-system/macos/window-base-mac.h index eef4f6e..ef88a7b 100644 --- a/dali/internal/window-system/macos/window-base-mac.h +++ b/dali/internal/window-system/macos/window-base-mac.h @@ -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; diff --git a/dali/internal/window-system/macos/window-base-mac.mm b/dali/internal/window-system/macos/window-base-mac.mm index 6ca0681..efadeda 100644 --- a/dali/internal/window-system/macos/window-base-mac.mm +++ b/dali/internal/window-system/macos/window-base-mac.mm @@ -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 diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp index 6be7165..42a522c 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp @@ -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); diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h index 6bdbd10..d2dad57 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h @@ -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; diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp index dd15ec4..c5f0c73 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp @@ -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; diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h index bf43ea3..159e230 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h @@ -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; diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp index 3e00080..bb1a9cb 100644 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp @@ -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 diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h index 1e0e569..1fff77f 100644 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h @@ -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; diff --git a/dali/internal/window-system/windows/window-base-win.cpp b/dali/internal/window-system/windows/window-base-win.cpp index 3bac5a4..2837754 100644 --- a/dali/internal/window-system/windows/window-base-win.cpp +++ b/dali/internal/window-system/windows/window-base-win.cpp @@ -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(mWin32Window); diff --git a/dali/internal/window-system/windows/window-base-win.h b/dali/internal/window-system/windows/window-base-win.h index ae3a8c2..bbc403f 100644 --- a/dali/internal/window-system/windows/window-base-win.h +++ b/dali/internal/window-system/windows/window-base-win.h @@ -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;