[NUI][AT-SPI] Add API for blocking automatic Bridge initialization (#2955)
authorArtur Świgoń <aswigon@yandex.com>
Mon, 17 May 2021 00:04:54 +0000 (02:04 +0200)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Fri, 21 May 2021 07:37:43 +0000 (16:37 +0900)
Co-authored-by: Artur Świgoń <a.swigon@samsung.com>
src/Tizen.NUI/src/internal/Interop/Interop.Accessibility.cs
src/Tizen.NUI/src/public/Accessibility/Accessibility.cs

index c1caf8c..e0af291 100755 (executable)
@@ -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();
         }
     }
 }
index 24ee8ee..7494fa2 100755 (executable)
@@ -135,6 +135,33 @@ namespace Tizen.NUI.Accessibility
         }
 
         /// <summary>
+        /// Re-enables auto-initialization of AT-SPI bridge
+        /// </summary>
+        /// <remarks>
+        /// Normal applications do not have to call this function. The AT-SPI bridge is initialized on demand.
+        /// </remarks>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static void BridgeEnableAutoInit()
+        {
+            Interop.Accessibility.BridgeEnableAutoInit();
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Blocks auto-initialization of AT-SPI bridge
+        /// </summary>
+        /// <remarks>
+        /// Use this only if your application starts before DBus does, and call it early in Main().
+        /// When DBus is ready, call BridgeEnableAutoInit().
+        /// </remarks>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static void BridgeDisableAutoInit()
+        {
+            Interop.Accessibility.BridgeDisableAutoInit();
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
         ///  Get View that is used to highlight widget.
         /// </summary>
         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)