From f36e321de74468d3ca8bd2dc69bcd21d4ab191dc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Artur=20=C5=9Awigo=C5=84?= Date: Mon, 17 May 2021 02:04:54 +0200 Subject: [PATCH] [NUI][AT-SPI] Add API for blocking automatic Bridge initialization (#2955) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Co-authored-by: Artur Świgoń --- .../src/internal/Interop/Interop.Accessibility.cs | 6 +++++ .../src/public/Accessibility/Accessibility.cs | 27 ++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Accessibility.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Accessibility.cs index c1caf8c..e0af291 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Accessibility.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.Accessibility.cs @@ -35,6 +35,12 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "csharp_dali_accessibility_supress_screen_reader")] public static extern bool SuppressScreenReader(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "csharp_dali_accessibility_BridgeEnableAutoInit")] + public static extern void BridgeEnableAutoInit(); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "csharp_dali_accessibility_BridgeDisableAutoInit")] + public static extern void BridgeDisableAutoInit(); } } } diff --git a/src/Tizen.NUI/src/public/Accessibility/Accessibility.cs b/src/Tizen.NUI/src/public/Accessibility/Accessibility.cs index 24ee8ee..7494fa2 100755 --- a/src/Tizen.NUI/src/public/Accessibility/Accessibility.cs +++ b/src/Tizen.NUI/src/public/Accessibility/Accessibility.cs @@ -135,6 +135,33 @@ namespace Tizen.NUI.Accessibility } /// + /// Re-enables auto-initialization of AT-SPI bridge + /// + /// + /// Normal applications do not have to call this function. The AT-SPI bridge is initialized on demand. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static void BridgeEnableAutoInit() + { + Interop.Accessibility.BridgeEnableAutoInit(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Blocks auto-initialization of AT-SPI bridge + /// + /// + /// Use this only if your application starts before DBus does, and call it early in Main(). + /// When DBus is ready, call BridgeEnableAutoInit(). + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static void BridgeDisableAutoInit() + { + Interop.Accessibility.BridgeDisableAutoInit(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// /// Get View that is used to highlight widget. /// // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) -- 2.7.4