[NUI] Remove unsafe functions
authorjmm <j0064423.lee@samsung.com>
Wed, 13 Sep 2023 12:21:56 +0000 (21:21 +0900)
committerbshsqa <32317749+bshsqa@users.noreply.github.com>
Thu, 14 Sep 2023 10:40:33 +0000 (19:40 +0900)
src/Tizen.NUI/src/internal/Interop/Interop.ParticleEmitter.cs
src/Tizen.NUI/src/public/ParticleSystem/ParticleEmitter.cs

index c463e81..b6e04ae 100644 (file)
@@ -112,11 +112,23 @@ namespace Tizen.NUI.ParticleSystem
             internal static extern int NewParticle(global::System.IntPtr emitter, float lifetime);
 
             // ParticleList
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ParticleList_AddLocalStream")]
-            internal unsafe static extern uint AddLocalStream(global::System.Runtime.InteropServices.HandleRef jarg1, uint streamType, void* defaultValue, uint typeSize );
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ParticleList_AddLocalStreami_Int")]
+            internal static extern uint AddLocalStream_Int(global::System.Runtime.InteropServices.HandleRef jarg1, uint streamType, int defaultValue, uint typeSize );
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ParticleList_AddLocalStream_Float")]
+            internal static extern uint AddLocalStream_Float(global::System.Runtime.InteropServices.HandleRef jarg1, uint streamType, float defaultValue, uint typeSize );
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ParticleList_AddLocalStream_Vector2")]
+            internal static extern uint AddLocalStream_Vector2(global::System.Runtime.InteropServices.HandleRef jarg1, uint streamType, global::System.IntPtr defaultValue, uint typeSize );
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ParticleList_AddLocalStream_Vector3")]
+            internal static extern uint AddLocalStream_Vector3(global::System.Runtime.InteropServices.HandleRef jarg1, uint streamType, global::System.IntPtr defaultValue, uint typeSize );
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ParticleList_AddLocalStream_Vector4")]
+            internal static extern uint AddLocalStream_Vector4(global::System.Runtime.InteropServices.HandleRef jarg1, uint streamType, global::System.IntPtr defaultValue, uint typeSize );
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ParticleList_GetDefaultStreamIndex")]
-            internal unsafe static extern int GetDefaultStreamIndex(global::System.Runtime.InteropServices.HandleRef jarg1, uint builtInStream );
+            internal static extern int GetDefaultStreamIndex(global::System.Runtime.InteropServices.HandleRef jarg1, uint builtInStream );
 
         }
     }
index 44c32d5..1a0660c 100644 (file)
@@ -324,9 +324,9 @@ namespace Tizen.NUI.ParticleSystem
         /// <param name="defaultValue">Default value to fill the stream with</param>
         /// <returns>Index of newly created data stream</returns>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public unsafe uint AddLocalStreamFloat(float defaultValue)
+        public uint AddLocalStreamFloat(float defaultValue)
         {
-            var result = Interop.ParticleEmitter.AddLocalStream(SwigCPtr, (uint)StreamType.Float, &defaultValue, sizeof(float));
+            var result = Interop.ParticleEmitter.AddLocalStream_Float(SwigCPtr, (uint)StreamType.Float, defaultValue, sizeof(float));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return result;
         }
@@ -340,9 +340,9 @@ namespace Tizen.NUI.ParticleSystem
         /// <param name="defaultValue">Default value to fill the stream with</param>
         /// <returns>Index of newly created data stream</returns>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public unsafe uint AddLocalStreamVector2(Vector2 defaultValue)
+        public uint AddLocalStreamVector2(Vector2 defaultValue)
         {
-            var result = Interop.ParticleEmitter.AddLocalStream(SwigCPtr, (uint)StreamType.FloatVector2, (void*)defaultValue.SwigCPtr.Handle, sizeof(float)*2);
+            var result = Interop.ParticleEmitter.AddLocalStream_Vector2(SwigCPtr, (uint)StreamType.FloatVector2, defaultValue.SwigCPtr.Handle, sizeof(float)*2);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return result;
         }
@@ -356,9 +356,9 @@ namespace Tizen.NUI.ParticleSystem
         /// <param name="defaultValue">Default value to fill the stream with</param>
         /// <returns>Index of newly created data stream</returns>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public unsafe uint AddLocalStreamVector3(Vector3 defaultValue)
+        public uint AddLocalStreamVector3(Vector3 defaultValue)
         {
-            var result = Interop.ParticleEmitter.AddLocalStream(SwigCPtr, (uint)StreamType.FloatVector3, (void*)defaultValue.SwigCPtr.Handle, sizeof(float)*3);
+            var result = Interop.ParticleEmitter.AddLocalStream_Vector3(SwigCPtr, (uint)StreamType.FloatVector3, defaultValue.SwigCPtr.Handle, sizeof(float)*3);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return result;
         }
@@ -372,9 +372,9 @@ namespace Tizen.NUI.ParticleSystem
         /// <param name="defaultValue">Default value to fill the stream with</param>
         /// <returns>Index of newly created data stream</returns>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public unsafe uint AddLocalStreamVector4(Vector4 defaultValue)
+        public uint AddLocalStreamVector4(Vector4 defaultValue)
         {
-            var result = Interop.ParticleEmitter.AddLocalStream(SwigCPtr, (uint)StreamType.FloatVector4, (void*)defaultValue.SwigCPtr.Handle, sizeof(float)*4);
+            var result = Interop.ParticleEmitter.AddLocalStream_Vector4(SwigCPtr, (uint)StreamType.FloatVector4, defaultValue.SwigCPtr.Handle, sizeof(float)*4);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return result;
         }