--- /dev/null
+/*
+ * Copyright(c) 2025 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tizen.NUI
+{
+ internal class IntPtrPool
+ {
+ private System.Collections.Generic.Stack<IntPtr> pool = new System.Collections.Generic.Stack<IntPtr>();
+ private CreatePtrCallback createPtrCb;
+
+ public delegate IntPtr CreatePtrCallback();
+
+ public IntPtrPool(CreatePtrCallback createPtrCb)
+ {
+ this.createPtrCb = createPtrCb;
+ }
+
+ public IntPtr GetPtr()
+ {
+ IntPtr ret = IntPtr.Zero;
+
+ if (0 == pool.Count)
+ {
+ if (null == createPtrCb)
+ {
+ throw new Exception("createPtrCb can't be null");
+ }
+
+ ret = createPtrCb();
+ }
+ else
+ {
+ ret = pool.Pop();
+ }
+
+ return ret;
+ }
+
+ public void PutPtr(IntPtr ptr)
+ {
+ pool.Push(ptr);
+ }
+ }
+}
private static readonly Position one = new Position(1.0f, 1.0f, 1.0f);
private static readonly Position zero = new Position(0.0f, 0.0f, 0.0f);
+ private static IntPtrPool ptrPool;
+
+ private static IntPtrPool PtrPool
+ {
+ get
+ {
+ if (null == ptrPool)
+ {
+ ptrPool = new IntPtrPool(CreateEmptryPtr);
+ }
+
+ return ptrPool;
+ }
+ }
+
+ private static IntPtr CreateEmptryPtr()
+ {
+ return Interop.Vector3.NewVector3();
+ }
+
internal static new void Preload()
{
// Do nothing. Just call for load static values.
/// view.Position = new Position2D(10, 10); // be aware that here the z value is 0.0f by default. <br />
/// </remarks>
/// <since_tizen> 3 </since_tizen>
- public Position() : this(Interop.Vector3.NewVector3(), true)
+ public Position() : this(PtrPool.GetPtr(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// view.Position = new Position2D(10, 10); // be aware that here the z value is 0.0f by default. <br />
/// </remarks>
/// <since_tizen> 3 </since_tizen>
- public Position(float x, float y, float z = 0.0f) : this(Interop.Vector3.NewVector3(x, y, z), true)
+ public Position(float x, float y, float z = 0.0f) : this(PtrPool.GetPtr(), true)
{
+ Interop.Vector3.XSet(SwigCPtr, x);
+ Interop.Vector3.YSet(SwigCPtr, y);
+ Interop.Vector3.ZSet(SwigCPtr, z);
+
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// </summary>
/// <param name="position2d">Position2D to create this vector from.</param>
/// <since_tizen> 3 </since_tizen>
- public Position(Position2D position2d) : this(Interop.Vector3.NewVector3WithVector2(Position2D.getCPtr(position2d)), true)
+ public Position(Position2D position2d) : this(PtrPool.GetPtr(), true)
{
+ if (null == position2d)
+ {
+ throw new ArgumentNullException(nameof(position2d));
+ }
+
+ Interop.Vector3.XSet(SwigCPtr, position2d.X);
+ Interop.Vector3.YSet(SwigCPtr, position2d.Y);
+
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
return ret;
}
+ /// This will not be public opened.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new void Dispose()
+ {
+ if (!disposed)
+ {
+ disposed = true;
+ PtrPool.PutPtr(SwigCPtr.Handle);
+ SwigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+ }
+ }
+
+ /// This will not be public opened.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override void Dispose(bool disposing)
+ {
+ if (!disposed)
+ {
+ disposed = true;
+ PtrPool.PutPtr(SwigCPtr.Handle);
+ SwigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+ }
+ }
+
/// This will not be public opened.
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
internal delegate void PositionChangedCallback(float x, float y, float z);
- internal Position(PositionChangedCallback cb, float x, float y, float z) : this(Interop.Vector3.NewVector3(x, y, z), true)
+ internal Position(PositionChangedCallback cb, float x, float y, float z) : this(PtrPool.GetPtr(), true)
{
callback = cb;
+
+ Interop.Vector3.XSet(SwigCPtr, x);
+ Interop.Vector3.YSet(SwigCPtr, y);
+ Interop.Vector3.ZSet(SwigCPtr, z);
+
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
{
private Position2DChangedCallback callback = null;
+ private static IntPtrPool ptrPool;
+
+ private static IntPtrPool PtrPool
+ {
+ get
+ {
+ if (null == ptrPool)
+ {
+ ptrPool = new IntPtrPool(CreateEmptryPtr);
+ }
+
+ return ptrPool;
+ }
+ }
+
+ private static IntPtr CreateEmptryPtr()
+ {
+ return Interop.Vector2.NewVector2();
+ }
+
/// <summary>
/// The constructor.
/// </summary>
/// view.Position = new Position2D(10, 10); // be aware that here the z value is 0.0f by default. <br />
/// </remarks>
/// <since_tizen> 3 </since_tizen>
- public Position2D() : this(Interop.Vector2.NewVector2(), true)
+ public Position2D() : this(PtrPool.GetPtr(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// </summary>
/// <param name="position">Position to create this vector from</param>
/// <since_tizen> 3 </since_tizen>
- public Position2D(Position position) : this(Interop.Vector2.NewVector2WithVector3(Position.getCPtr(position)), true)
+ public Position2D(Position position) : this(PtrPool.GetPtr(), true)
{
+ if (null == position)
+ {
+ throw new ArgumentNullException(nameof(position));
+ }
+
+ Interop.Vector2.XSet(SwigCPtr, position.X);
+ Interop.Vector2.YSet(SwigCPtr, position.Y);
+
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// view.Position = new Position2D(10, 10); // be aware that here the z value is 0.0f by default. <br />
/// </remarks>
/// <since_tizen> 3 </since_tizen>
- public Position2D(int x, int y) : this(Interop.Vector2.NewVector2((float)x, (float)y), true)
+ public Position2D(int x, int y) : this(PtrPool.GetPtr(), true)
{
+ Interop.Vector2.XSet(SwigCPtr, x);
+ Interop.Vector2.YSet(SwigCPtr, y);
+
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
{
}
- internal Position2D(Position2DChangedCallback cb, int x, int y) : this(Interop.Vector2.NewVector2((float)x, (float)y), true)
+ internal Position2D(Position2DChangedCallback cb, int x, int y) : this(PtrPool.GetPtr(), true)
{
+ Interop.Vector2.XSet(SwigCPtr, x);
+ Interop.Vector2.YSet(SwigCPtr, y);
+
callback = cb;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
return ret;
}
+ /// This will not be public opened.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new void Dispose()
+ {
+ if (!disposed)
+ {
+ disposed = true;
+ PtrPool.PutPtr(SwigCPtr.Handle);
+ SwigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+ }
+ }
+
+ /// This will not be public opened.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override void Dispose(bool disposing)
+ {
+ if (!disposed)
+ {
+ disposed = true;
+ PtrPool.PutPtr(SwigCPtr.Handle);
+ SwigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+ }
+ }
+
/// This will not be public opened.
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
namespace Tizen.NUI
{
-
/// <summary>
/// A two-dimensional vector.
/// </summary>
private static readonly Vector2 negativeXaxis = new Vector2(-1.0f, 0.0f);
private static readonly Vector2 negativeYaxis = new Vector2(0.0f, -1.0f);
+ private static IntPtrPool ptrPool;
+
+ private static IntPtrPool PtrPool
+ {
+ get
+ {
+ if (null == ptrPool)
+ {
+ ptrPool = new IntPtrPool(CreateEmptryPtr);
+ }
+
+ return ptrPool;
+ }
+ }
+
+ private static IntPtr CreateEmptryPtr()
+ {
+ return Interop.Vector2.NewVector2();
+ }
+
internal static new void Preload()
{
// Do nothing. Just call for load static values.
/// The default constructor initializes the vector to 0.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public Vector2() : this(Interop.Vector2.NewVector2(), true)
+ public Vector2() : this(PtrPool.GetPtr(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <param name="x">The x or width component.</param>
/// <param name="y">The y or height component.</param>
/// <since_tizen> 3 </since_tizen>
- public Vector2(float x, float y) : this(Interop.Vector2.NewVector2(x, y), true)
+ public Vector2(float x, float y) : this(PtrPool.GetPtr(), true)
{
+ Interop.Vector2.XSet(SwigCPtr, x);
+ Interop.Vector2.YSet(SwigCPtr, y);
+
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// </summary>
/// <param name="array">The array of xy.</param>
/// <since_tizen> 3 </since_tizen>
- public Vector2(float[] array) : this(Interop.Vector2.NewVector2(array), true)
+ public Vector2(float[] array) : this(PtrPool.GetPtr(), true)
{
+ if (null == array)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ Interop.Vector2.XSet(SwigCPtr, array[0]);
+ Interop.Vector2.YSet(SwigCPtr, array[1]);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// </summary>
/// <param name="vec3">Vector3 to create this vector from.</param>
/// <since_tizen> 3 </since_tizen>
- public Vector2(Vector3 vec3) : this(Interop.Vector2.NewVector2WithVector3(Vector3.getCPtr(vec3)), true)
+ public Vector2(Vector3 vec3) : this(PtrPool.GetPtr(), true)
{
+ if (null == vec3)
+ {
+ throw new ArgumentNullException(nameof(vec3));
+ }
+
+ Interop.Vector2.XSet(SwigCPtr, vec3.X);
+ Interop.Vector2.YSet(SwigCPtr, vec3.Y);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// </summary>
/// <param name="vec4">Vector4 to create this vector from.</param>
/// <since_tizen> 3 </since_tizen>
- public Vector2(Vector4 vec4) : this(Interop.Vector2.NewVector2WithVector4(Vector4.getCPtr(vec4)), true)
+ public Vector2(Vector4 vec4) : this(PtrPool.GetPtr(), true)
{
+ if (null == vec4)
+ {
+ throw new ArgumentNullException(nameof(vec4));
+ }
+
+ Interop.Vector2.XSet(SwigCPtr, vec4.X);
+ Interop.Vector2.YSet(SwigCPtr, vec4.Y);
+
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
{
}
- internal Vector2(Vector2ChangedCallback cb, float x, float y) : this(Interop.Vector2.NewVector2(x, y), true)
+ internal Vector2(Vector2ChangedCallback cb, float x, float y) : this(PtrPool.GetPtr(), true)
{
+ Interop.Vector2.XSet(SwigCPtr, x);
+ Interop.Vector2.YSet(SwigCPtr, y);
callback = cb;
+
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
return ret;
}
+ /// This will not be public opened.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new void Dispose()
+ {
+ if (!disposed)
+ {
+ disposed = true;
+ PtrPool.PutPtr(SwigCPtr.Handle);
+ SwigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+ }
+ }
+
+ /// This will not be public opened.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override void Dispose(bool disposing)
+ {
+ if (!disposed)
+ {
+ disposed = true;
+ PtrPool.PutPtr(SwigCPtr.Handle);
+ SwigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+ }
+ }
+
/// This will not be public opened.
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
private static readonly Vector3 negativeYaxis = new Vector3(0.0f, -1.0f, 0.0f);
private static readonly Vector3 negativeZaxis = new Vector3(0.0f, 0.0f, -1.0f);
+ private static IntPtrPool ptrPool;
+
+ private static IntPtrPool PtrPool
+ {
+ get
+ {
+ if (null == ptrPool)
+ {
+ ptrPool = new IntPtrPool(CreateEmptryPtr);
+ }
+
+ return ptrPool;
+ }
+ }
+
+ private static IntPtr CreateEmptryPtr()
+ {
+ return Interop.Vector3.NewVector3();
+ }
+
internal static new void Preload()
{
// Do nothing. Just call for load static values.
/// The default constructor of Vector3 class.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public Vector3() : this(Interop.Vector3.NewVector3(), true)
+ public Vector3() : this(PtrPool.GetPtr(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <param name="y">The y (or height) component.</param>
/// <param name="z">The z (or depth) component.</param>
/// <since_tizen> 3 </since_tizen>
- public Vector3(float x, float y, float z) : this(Interop.Vector3.NewVector3(x, y, z), true)
+ public Vector3(float x, float y, float z) : this(PtrPool.GetPtr(), true)
{
+ Interop.Vector3.XSet(SwigCPtr, x);
+ Interop.Vector3.YSet(SwigCPtr, y);
+ Interop.Vector3.ZSet(SwigCPtr, z);
+
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// </summary>
/// <param name="array">An array of xyz.</param>
/// <since_tizen> 3 </since_tizen>
- public Vector3(float[] array) : this(Interop.Vector3.NewVector3(array), true)
+ public Vector3(float[] array) : this(PtrPool.GetPtr(), true)
{
+ if (null == array)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ Interop.Vector3.XSet(SwigCPtr, array[0]);
+ Interop.Vector3.YSet(SwigCPtr, array[1]);
+ Interop.Vector3.ZSet(SwigCPtr, array[2]);
+
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// </summary>
/// <param name="vec2">Vector2 to create this vector from.</param>
/// <since_tizen> 3 </since_tizen>
- public Vector3(Vector2 vec2) : this(Interop.Vector3.NewVector3WithVector2(Vector2.getCPtr(vec2)), true)
+ public Vector3(Vector2 vec2) : this(PtrPool.GetPtr(), true)
{
+ if (null == vec2)
+ {
+ throw new ArgumentNullException(nameof(vec2));
+ }
+
+ Interop.Vector3.XSet(SwigCPtr, vec2.X);
+ Interop.Vector3.YSet(SwigCPtr, vec2.Y);
+
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// </summary>
/// <param name="vec4">Vector4 to create this vector from.</param>
/// <since_tizen> 3 </since_tizen>
- public Vector3(Vector4 vec4) : this(Interop.Vector3.NewVector3WithVector4(Vector4.getCPtr(vec4)), true)
+ public Vector3(Vector4 vec4) : this(PtrPool.GetPtr(), true)
{
+ if (null == vec4)
+ {
+ throw new ArgumentNullException(nameof(vec4));
+ }
+
+ Interop.Vector3.XSet(SwigCPtr, vec4.X);
+ Interop.Vector3.YSet(SwigCPtr, vec4.Y);
+ Interop.Vector3.ZSet(SwigCPtr, vec4.Z);
+
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
{
}
- internal Vector3(Vector3ChangedCallback cb, float x, float y, float z) : this(Interop.Vector3.NewVector3(x, y, z), true)
+ internal Vector3(Vector3ChangedCallback cb, float x, float y, float z) : this(PtrPool.GetPtr(), true)
{
+ Interop.Vector3.XSet(SwigCPtr, x);
+ Interop.Vector3.YSet(SwigCPtr, y);
+ Interop.Vector3.ZSet(SwigCPtr, z);
+
callback = cb;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
return ret;
}
+ /// This will not be public opened.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new void Dispose()
+ {
+ if (!disposed)
+ {
+ disposed = true;
+ PtrPool.PutPtr(SwigCPtr.Handle);
+ SwigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+ }
+ }
+
+ /// This will not be public opened.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override void Dispose(bool disposing)
+ {
+ if (!disposed)
+ {
+ disposed = true;
+ PtrPool.PutPtr(SwigCPtr.Handle);
+ SwigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+ }
+ }
+
/// This will not be public opened.
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
private static readonly Vector4 yaxis = new Vector4(0.0f, 1.0f, 0.0f, 0.0f);
private static readonly Vector4 zaxis = new Vector4(0.0f, 0.0f, 1.0f, 0.0f);
+ private static IntPtrPool ptrPool;
+
+ private static IntPtrPool PtrPool
+ {
+ get
+ {
+ if (null == ptrPool)
+ {
+ ptrPool = new IntPtrPool(CreateEmptryPtr);
+ }
+
+ return ptrPool;
+ }
+ }
+
+ private static IntPtr CreateEmptryPtr()
+ {
+ return Interop.Vector4.NewVector4();
+ }
+
internal static new void Preload()
{
// Do nothing. Just call for load static values.
/// The default constructor initializes the vector to 0.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public Vector4() : this(Interop.Vector4.NewVector4(), true)
+ public Vector4() : this(PtrPool.GetPtr(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <param name="z">The z (or b/p) component.</param>
/// <param name="w">The w (or a/q) component.</param>
/// <since_tizen> 3 </since_tizen>
- public Vector4(float x, float y, float z, float w) : this(Interop.Vector4.NewVector4(x, y, z, w), true)
+ public Vector4(float x, float y, float z, float w) : this(PtrPool.GetPtr(), true)
{
+ Interop.Vector4.XSet(SwigCPtr, x);
+ Interop.Vector4.YSet(SwigCPtr, y);
+ Interop.Vector4.ZSet(SwigCPtr, z);
+ Interop.Vector4.WSet(SwigCPtr, w);
+
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// </summary>
/// <param name="array">The array of either xyzw/rgba/stpq.</param>
/// <since_tizen> 3 </since_tizen>
- public Vector4(float[] array) : this(Interop.Vector4.NewVector4(array), true)
+ public Vector4(float[] array) : this(PtrPool.GetPtr(), true)
{
+ if (null == array)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ Interop.Vector4.XSet(SwigCPtr, array[0]);
+ Interop.Vector4.YSet(SwigCPtr, array[1]);
+ Interop.Vector4.ZSet(SwigCPtr, array[2]);
+ Interop.Vector4.WSet(SwigCPtr, array[3]);
+
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// </summary>
/// <param name="vec2">Vector2 to copy from, z and w are initialized to 0.</param>
/// <since_tizen> 3 </since_tizen>
- public Vector4(Vector2 vec2) : this(Interop.Vector4.NewVector4WithVector2(Vector2.getCPtr(vec2)), true)
+ public Vector4(Vector2 vec2) : this(PtrPool.GetPtr(), true)
{
+ if (null == vec2)
+ {
+ throw new ArgumentNullException(nameof(vec2));
+ }
+
+ Interop.Vector4.XSet(SwigCPtr, vec2.X);
+ Interop.Vector4.YSet(SwigCPtr, vec2.Y);
+
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// </summary>
/// <param name="vec3">Vector3 to copy from, w is initialized to 0.</param>
/// <since_tizen> 3 </since_tizen>
- public Vector4(Vector3 vec3) : this(Interop.Vector4.NewVector4WithVector3(Vector3.getCPtr(vec3)), true)
+ public Vector4(Vector3 vec3) : this(PtrPool.GetPtr(), true)
{
+ if (null == vec3)
+ {
+ throw new ArgumentNullException(nameof(vec3));
+ }
+
+ Interop.Vector4.XSet(SwigCPtr, vec3.X);
+ Interop.Vector4.YSet(SwigCPtr, vec3.Y);
+ Interop.Vector4.ZSet(SwigCPtr, vec3.Z);
+
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
{
}
- internal Vector4(Vector4ChangedCallback cb, float x, float y, float z, float w) : this(Interop.Vector4.NewVector4(x, y, z, w), true)
+ internal Vector4(Vector4ChangedCallback cb, float x, float y, float z, float w) : this(PtrPool.GetPtr(), true)
{
+ Interop.Vector4.XSet(SwigCPtr, x);
+ Interop.Vector4.YSet(SwigCPtr, y);
+ Interop.Vector4.ZSet(SwigCPtr, z);
+ Interop.Vector4.WSet(SwigCPtr, w);
+
callback = cb;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
return ret;
}
+ /// This will not be public opened.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new void Dispose()
+ {
+ if (!disposed)
+ {
+ disposed = true;
+ PtrPool.PutPtr(SwigCPtr.Handle);
+ SwigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+ }
+ }
+
+ /// This will not be public opened.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override void Dispose(bool disposing)
+ {
+ if (!disposed)
+ {
+ disposed = true;
+ PtrPool.PutPtr(SwigCPtr.Handle);
+ SwigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+ }
+ }
+
/// This will not be public opened.
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)