[NUI][AT-SPI] Improve StringToVoid implementation (#2839)
authorBartłomiej Grzelewski <grzelewski@users.noreply.github.com>
Thu, 8 Apr 2021 10:00:32 +0000 (12:00 +0200)
committerhuiyueun <35286162+huiyueun@users.noreply.github.com>
Tue, 20 Apr 2021 06:13:00 +0000 (15:13 +0900)
* Add SetResult function.
* Rename function ConvertParam1 to GetResult.
* Remove Emit function. This should be used only by bridge.

src/Tizen.NUI/src/internal/Common/StringToVoidSignal.cs
src/Tizen.NUI/src/internal/Interop/Interop.StringToVoidSignal.cs
src/Tizen.NUI/src/public/BaseComponents/ViewAccessibilityEvent.cs

index fd94101..0abbd78 100755 (executable)
@@ -35,14 +35,21 @@ namespace Tizen.NUI
         }
 
         [EditorBrowsable(EditorBrowsableState.Never)]
-        static internal string ConvertParam1(global::System.IntPtr data)
+        static internal string GetResult(global::System.IntPtr data)
         {
-            string result = Interop.StringToVoidSignal.ConvertParam1(data);
+            string result = Interop.StringToVoidSignal.GetResult(data);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return result;
         }
 
         [EditorBrowsable(EditorBrowsableState.Never)]
+        static internal void SetResult(global::System.IntPtr data, string res)
+        {
+            Interop.StringToVoidSignal.SetResult(data, res);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
         {
             Interop.StringToVoidSignal.Delete(swigCPtr);
@@ -89,13 +96,6 @@ namespace Tizen.NUI
                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             }
         }
-
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public void Emit()
-        {
-            Interop.StringToVoidSignal.Emit(SwigCPtr);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-        }
     }
 }
 
index ea160e0..37567c3 100755 (executable)
@@ -42,11 +42,11 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Signal_StringToVoid_Disconnect")]
             public static extern void Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
 
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Signal_StringToVoid_Emit")]
-            public static extern void Emit(global::System.Runtime.InteropServices.HandleRef jarg1);
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Signal_StringToVoid_GetResult")]
+            public static extern string GetResult(global::System.IntPtr jarg1);
 
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Signal_StringToVoid_Convert_Param1")]
-            public static extern string ConvertParam1(global::System.IntPtr jarg1);
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Signal_StringToVoid_SetResult")]
+            public static extern void SetResult(global::System.IntPtr jarg1, string jarg2);
         }
     }
 }
index 086fc07..6068c71 100755 (executable)
@@ -106,13 +106,13 @@ namespace Tizen.NUI.BaseComponents
     [EditorBrowsable(EditorBrowsableState.Never)]
     public class GetDescriptionEventArgs : EventArgs
     {
-        public string Description { get; internal set; }
+        public string Description { get; set; }
     }
 
     [EditorBrowsable(EditorBrowsableState.Never)]
     public class GetNameEventArgs : EventArgs
     {
-        public string Description { get; internal set; }
+        public string Name { get; set; }
     }
 
     /// <summary>
@@ -229,9 +229,11 @@ namespace Tizen.NUI.BaseComponents
                 return;
 
             var arg = new GetDescriptionEventArgs();
-            arg.Description = StringToVoidSignal.ConvertParam1(data);
+            arg.Description = StringToVoidSignal.GetResult(data);
 
             getDescriptionHandler?.Invoke(this, arg);
+
+            StringToVoidSignal.SetResult(data, arg.Description);
         }
 
         // This uses GetDescription signal from C++ API.
@@ -283,9 +285,11 @@ namespace Tizen.NUI.BaseComponents
                 return;
 
             var arg = new GetNameEventArgs();
-            arg.Description = StringToVoidSignal.ConvertParam1(data);
+            arg.Name = StringToVoidSignal.GetResult(data);
 
             getNameHandler?.Invoke(this, arg);
+
+            StringToVoidSignal.SetResult(data, arg.Name);
         }
 
         // This uses GetName signal from C++ API.