From a47741699d3ca194a0070f0394c74a78d353ab8b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Artur=20=C5=9Awigo=C5=84?= Date: Fri, 6 May 2022 18:12:42 +0200 Subject: [PATCH] [AT-SPI] Make ToolkitName customizable Change-Id: I0758bf378e28798486cabb7ef1b8de16127eca53 --- dali/devel-api/adaptor-framework/accessibility-bridge.h | 9 +++++++++ dali/internal/accessibility/bridge/bridge-base.h | 11 ++++++++++- dali/internal/accessibility/bridge/dummy-atspi.h | 4 ++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/dali/devel-api/adaptor-framework/accessibility-bridge.h b/dali/devel-api/adaptor-framework/accessibility-bridge.h index 21296d3..db09b45 100644 --- a/dali/devel-api/adaptor-framework/accessibility-bridge.h +++ b/dali/devel-api/adaptor-framework/accessibility-bridge.h @@ -132,6 +132,15 @@ struct DALI_ADAPTOR_API Bridge virtual void SetApplicationName(std::string name) = 0; /** + * @brief Sets the name of the GUI toolkit that AT-SPI clients can query. + * + * The default name is "dali". + * + * @param toolkitName The toolkit name + */ + virtual void SetToolkitName(std::string_view toolkitName) = 0; + + /** * @brief Gets object being root of accessibility tree. * * @return handler to accessibility object diff --git a/dali/internal/accessibility/bridge/bridge-base.h b/dali/internal/accessibility/bridge/bridge-base.h index bf2a22c..2449842 100644 --- a/dali/internal/accessibility/bridge/bridge-base.h +++ b/dali/internal/accessibility/bridge/bridge-base.h @@ -41,6 +41,7 @@ public: Dali::Accessibility::ProxyAccessible mParent; std::vector mChildren; std::string mName; + std::string mToolkitName{"dali"}; std::string GetName() const override { @@ -148,7 +149,7 @@ public: std::string GetToolkitName() const override { - return {"dali"}; + return mToolkitName; } std::string GetVersion() const override @@ -484,6 +485,14 @@ public: mApplication.mName = std::move(name); } + /** + * @copydoc Dali::Accessibility::Bridge::SetToolkitName() + */ + void SetToolkitName(std::string_view toolkitName) override + { + mApplication.mToolkitName = std::string{toolkitName}; + } + protected: mutable ApplicationAccessible mApplication; std::vector mDefaultLabels; diff --git a/dali/internal/accessibility/bridge/dummy-atspi.h b/dali/internal/accessibility/bridge/dummy-atspi.h index 4fd0678..b8cbc03 100644 --- a/dali/internal/accessibility/bridge/dummy-atspi.h +++ b/dali/internal/accessibility/bridge/dummy-atspi.h @@ -63,6 +63,10 @@ struct DummyBridge : Dali::Accessibility::Bridge { } + void SetToolkitName(std::string_view toolkitName) override + { + } + Accessibility::Accessible* GetApplication() const override { return nullptr; -- 2.7.4