2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 public class Size : global::System.IDisposable
\r
23 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
\r
24 protected bool swigCMemOwn;
\r
26 internal Size(global::System.IntPtr cPtr, bool cMemoryOwn)
\r
28 swigCMemOwn = cMemoryOwn;
\r
29 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
\r
32 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Size obj)
\r
34 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
\r
39 DisposeQueue.Instance.Add(this);
\r
42 public virtual void Dispose()
\r
44 if (!Stage.IsInstalled())
\r
46 DisposeQueue.Instance.Add(this);
\r
52 if (swigCPtr.Handle != global::System.IntPtr.Zero)
\r
56 swigCMemOwn = false;
\r
57 NDalicPINVOKE.delete_Vector3(swigCPtr);
\r
59 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
\r
61 global::System.GC.SuppressFinalize(this);
\r
66 public static Size operator +(Size arg1, Size arg2)
\r
68 return arg1.Add(arg2);
\r
71 public static Size operator -(Size arg1, Size arg2)
\r
73 return arg1.Subtract(arg2);
\r
76 public static Size operator -(Size arg1)
\r
78 return arg1.Subtract();
\r
81 public static Size operator *(Size arg1, Size arg2)
\r
83 return arg1.Multiply(arg2);
\r
86 public static Size operator *(Size arg1, float arg2)
\r
88 return arg1.Multiply(arg2);
\r
91 public static Size operator /(Size arg1, Size arg2)
\r
93 return arg1.Divide(arg2);
\r
96 public static Size operator /(Size arg1, float arg2)
\r
98 return arg1.Divide(arg2);
\r
101 public float this[uint index]
\r
105 return ValueOfIndex(index);
\r
109 public static Size GetSizeFromPtr(global::System.IntPtr cPtr)
\r
111 Size ret = new Size(cPtr, false);
\r
112 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
117 public Size() : this(NDalicPINVOKE.new_Vector3__SWIG_0(), true)
\r
119 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
122 public Size(float x, float y, float z) : this(NDalicPINVOKE.new_Vector3__SWIG_1(x, y, z), true)
\r
124 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
127 public Size(Size2D size2d) : this(NDalicPINVOKE.new_Vector3__SWIG_3(Size2D.getCPtr(size2d)), true)
\r
129 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
133 public static Size Zero
\r
137 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZERO_get();
\r
138 Size ret = (cPtr == global::System.IntPtr.Zero) ? null : new Size(cPtr, false);
\r
139 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
144 private Size Add(Size rhs)
\r
146 Size ret = new Size(NDalicPINVOKE.Vector3_Add(swigCPtr, Size.getCPtr(rhs)), true);
\r
147 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
151 private Size Subtract(Size rhs)
\r
153 Size ret = new Size(NDalicPINVOKE.Vector3_Subtract__SWIG_0(swigCPtr, Size.getCPtr(rhs)), true);
\r
154 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
158 private Size Multiply(Size rhs)
\r
160 Size ret = new Size(NDalicPINVOKE.Vector3_Multiply__SWIG_0(swigCPtr, Size.getCPtr(rhs)), true);
\r
161 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
165 private Size Multiply(float rhs)
\r
167 Size ret = new Size(NDalicPINVOKE.Vector3_Multiply__SWIG_1(swigCPtr, rhs), true);
\r
168 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
172 private Size Divide(Size rhs)
\r
174 Size ret = new Size(NDalicPINVOKE.Vector3_Divide__SWIG_0(swigCPtr, Size.getCPtr(rhs)), true);
\r
175 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
179 private Size Divide(float rhs)
\r
181 Size ret = new Size(NDalicPINVOKE.Vector3_Divide__SWIG_1(swigCPtr, rhs), true);
\r
182 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
186 private Size Subtract()
\r
188 Size ret = new Size(NDalicPINVOKE.Vector3_Subtract__SWIG_1(swigCPtr), true);
\r
189 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
193 private float ValueOfIndex(uint index)
\r
195 float ret = NDalicPINVOKE.Vector3_ValueOfIndex__SWIG_0(swigCPtr, index);
\r
196 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
200 public bool EqualTo(Size rhs)
\r
202 bool ret = NDalicPINVOKE.Vector3_EqualTo(swigCPtr, Size.getCPtr(rhs));
\r
203 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
207 public bool NotEqualTo(Size rhs)
\r
209 bool ret = NDalicPINVOKE.Vector3_NotEqualTo(swigCPtr, Size.getCPtr(rhs));
\r
210 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
219 NDalicPINVOKE.Vector3_Width_set(swigCPtr, value);
\r
220 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
224 float ret = NDalicPINVOKE.Vector3_Width_get(swigCPtr);
\r
225 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
230 public float Height
\r
234 NDalicPINVOKE.Vector3_Height_set(swigCPtr, value);
\r
235 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
239 float ret = NDalicPINVOKE.Vector3_Height_get(swigCPtr);
\r
240 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
249 NDalicPINVOKE.Vector3_Depth_set(swigCPtr, value);
\r
250 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
254 float ret = NDalicPINVOKE.Vector3_Depth_get(swigCPtr);
\r
255 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
261 public static implicit operator Vector3(Size size)
\r
263 return new Vector3(size.Width, size.Height, size.Depth);
\r
266 public static implicit operator Size(Vector3 vec)
\r
268 return new Size(vec.Width, vec.Height, vec.Depth);
\r