[NUI] Make NativeImageQueue generate valid url
authorEunki Hong <eunkiki.hong@samsung.com>
Thu, 26 Oct 2023 10:42:44 +0000 (19:42 +0900)
committerTaehyub Kim <taehyub.kim@samsung.com>
Mon, 30 Oct 2023 12:38:47 +0000 (21:38 +0900)
Previously NativeImageQueue.GenerateUrl() binded to
invalid csharp API.

It will make some crash. So let we use valid bind API instead.

Signed-off-by: Eunki Hong <eunkiki.hong@samsung.com>
src/Tizen.NUI/src/internal/Common/NativeImageInterface.cs
src/Tizen.NUI/src/internal/Interop/Interop.NativeImageInterface.cs
src/Tizen.NUI/src/internal/Interop/Interop.NativeImageQueue.cs
src/Tizen.NUI/src/public/Images/NativeImageQueue.cs
src/Tizen.NUI/src/public/Images/NativeImageSource.cs

index be32543d2e4d8fc9fbc12a422ad755740226e9b7..dce818013fc3e284a4173cea6cd0b55b66d2ab50 100755 (executable)
@@ -77,5 +77,12 @@ namespace Tizen.NUI
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
+
+        public virtual ImageUrl GenerateUrl()
+        {
+            ImageUrl ret = new ImageUrl(Interop.NativeImageInterface.GenerateUrl(SwigCPtr), true);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
     }
 }
index ab0eb4e33a3106461425c06596579be85a385a30..dddf062dec7929c03bd273101f7acd1806546d34 100755 (executable)
@@ -44,6 +44,9 @@ namespace Tizen.NUI
             [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
             public static extern bool RequiresBlending(global::System.Runtime.InteropServices.HandleRef jarg1);
 
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NativeImageInterface_GenerateUrl")]
+            public static extern global::System.IntPtr GenerateUrl(global::System.Runtime.InteropServices.HandleRef jarg1);
+
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NativeImageInterface_SWIGUpcast")]
             public static extern global::System.IntPtr Upcast(global::System.IntPtr jarg1);
         }
index f62344d9f0c48c40b9a3ea799cbd02fd76df5bde..0ded63659976e139d26da76bce6f5370d9a334b3 100644 (file)
@@ -40,6 +40,9 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NativeImageQueue_EnqueueBuffer")]
             [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
             public static extern bool EnqueueBuffer(IntPtr queue, IntPtr buffer);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NativeImageQueue_GenerateUrl")]
+            public static extern IntPtr GenerateUrl(IntPtr queue);
         }
     }
 }
index 11153d4ab4c8ff60f0d7df073831e6addc5959d8..4057e45642e4827ce5fb68b213712bd056aad3c9 100644 (file)
@@ -105,10 +105,10 @@ namespace Tizen.NUI
         /// </remarks>
         /// <returns>The ImageUrl of NativeImageQueue.</returns>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public ImageUrl GenerateUrl()
+        public override ImageUrl GenerateUrl()
         {
-            ImageUrl ret = new ImageUrl(Interop.NativeImageSource.GenerateUrl(this.SwigCPtr.Handle), true);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
+            ImageUrl ret = new ImageUrl(Interop.NativeImageQueue.GenerateUrl(this.SwigCPtr.Handle), true);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
index 4e3bfe909e2191ae9e323f61552f810c439ff0bd..ea4df308e41b81e74836ad38831b2cf4320287a7 100644 (file)
@@ -44,10 +44,10 @@ namespace Tizen.NUI
         /// This API should not be called at worker thread.
         /// </remarks>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public ImageUrl GenerateUrl()
+        public override ImageUrl GenerateUrl()
         {
             ImageUrl ret = new ImageUrl(Interop.NativeImageSource.GenerateUrl(this.SwigCPtr.Handle), true);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }