/*
- * Copyright(c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2019 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.
*
*/
using System;
+using System.ComponentModel;
using Tizen.NUI.Binding;
namespace Tizen.NUI
/// A three-dimensional vector.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- [TypeConverter(typeof(Vector3TypeConverter))]
- public class Vector3 : Disposable
+ [Binding.TypeConverter(typeof(Vector3TypeConverter))]
+ public class Vector3 : Disposable, ICloneable
{
/// <summary>
- /// swigCMemOwn.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- protected bool swigCMemOwn;
- private global::System.Runtime.InteropServices.HandleRef swigCPtr;
-
- /// <summary>
/// The constructor.
/// </summary>
/// <since_tizen> 3 </since_tizen>
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal Vector3(global::System.IntPtr cPtr, bool cMemoryOwn)
+ internal Vector3(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+ {
+ }
+
+ internal Vector3(Vector3ChangedCallback cb, float x, float y, float z) : this(Interop.Vector3.new_Vector3__SWIG_1(x, y, z), true)
{
- swigCMemOwn = cMemoryOwn;
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ callback = cb;
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
+ internal delegate void Vector3ChangedCallback(float x, float y, float z);
+ private Vector3ChangedCallback callback = null;
/// <summary>
/// (1.0f,1.0f,1.0f).
{
Interop.Vector3.Vector3_X_set(swigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ callback?.Invoke(X, Y, Z);
}
get
{
{
Interop.Vector3.Vector3_Width_set(swigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ callback?.Invoke(X, Y, Z);
}
get
{
{
Interop.Vector3.Vector3_r_set(swigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ callback?.Invoke(X, Y, Z);
}
get
{
{
Interop.Vector3.Vector3_Y_set(swigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ callback?.Invoke(X, Y, Z);
}
get
{
{
Interop.Vector3.Vector3_Height_set(swigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ callback?.Invoke(X, Y, Z);
}
get
{
{
Interop.Vector3.Vector3_g_set(swigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ callback?.Invoke(X, Y, Z);
}
get
{
{
Interop.Vector3.Vector3_Z_set(swigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ callback?.Invoke(X, Y, Z);
}
get
{
{
Interop.Vector3.Vector3_Depth_set(swigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ callback?.Invoke(X, Y, Z);
}
get
{
{
Interop.Vector3.Vector3_b_set(swigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ callback?.Invoke(X, Y, Z);
}
get
{
return ret;
}
+ /// <inheritdoc/>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public object Clone() => new Vector3(X, Y, Z);
+
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Vector3 obj)
{
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
return ret;
}
- /// <summary>
- /// Dispose.
- /// </summary>
- /// <param name="type">The dispose type</param>
- /// <since_tizen> 3 </since_tizen>
- protected override void Dispose(DisposeTypes type)
+ /// This will not be public opened.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
{
- if (disposed)
- {
- return;
- }
-
- //Release your own unmanaged resources here.
- //You should not access any managed member here except static instance.
- //because the execution order of Finalizes is non-deterministic.
-
- if (swigCPtr.Handle != global::System.IntPtr.Zero)
- {
- if (swigCMemOwn)
- {
- swigCMemOwn = false;
- Interop.Vector3.delete_Vector3(swigCPtr);
- }
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
- }
- base.Dispose(type);
+ Interop.Vector3.delete_Vector3(swigCPtr);
}
private Vector3 Add(Vector3 rhs)