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.
20 public class Size : global::System.IDisposable {
21 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
22 protected bool swigCMemOwn;
24 internal Size(global::System.IntPtr cPtr, bool cMemoryOwn) {
25 swigCMemOwn = cMemoryOwn;
26 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
29 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Size obj) {
30 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
34 DisposeQueue.Instance.Add(this);
37 public virtual void Dispose() {
38 if (!Window.IsInstalled()) {
39 DisposeQueue.Instance.Add(this);
44 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
47 NDalicPINVOKE.delete_Vector3(swigCPtr);
49 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
51 global::System.GC.SuppressFinalize(this);
56 public static Size operator+(Size arg1, Size arg2) {
57 return arg1.Add(arg2);
60 public static Size operator-(Size arg1, Size arg2) {
61 return arg1.Subtract(arg2);
64 public static Size operator-(Size arg1) {
65 return arg1.Subtract();
68 public static Size operator*(Size arg1, Size arg2) {
69 return arg1.Multiply(arg2);
72 public static Size operator*(Size arg1, float arg2) {
73 return arg1.Multiply(arg2);
76 public static Size operator/(Size arg1, Size arg2) {
77 return arg1.Divide(arg2);
80 public static Size operator/(Size arg1, float arg2) {
81 return arg1.Divide(arg2);
84 public float this[uint index]
88 return ValueOfIndex(index);
92 internal static Size GetSizeFromPtr(global::System.IntPtr cPtr) {
93 Size ret = new Size(cPtr, false);
94 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
99 public Size() : this(NDalicPINVOKE.new_Vector3__SWIG_0(), true) {
100 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
103 public Size(float x, float y, float z) : this(NDalicPINVOKE.new_Vector3__SWIG_1(x, y, z), true) {
104 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
107 public Size(Size2D size2d) : this(NDalicPINVOKE.new_Vector3__SWIG_3(Size2D.getCPtr(size2d)), true) {
108 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
112 public static Size Zero {
114 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZERO_get();
115 Size ret = (cPtr == global::System.IntPtr.Zero) ? null : new Size(cPtr, false);
116 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
121 private Size Add(Size rhs) {
122 Size ret = new Size(NDalicPINVOKE.Vector3_Add(swigCPtr, Size.getCPtr(rhs)), true);
123 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
127 private Size Subtract(Size rhs) {
128 Size ret = new Size(NDalicPINVOKE.Vector3_Subtract__SWIG_0(swigCPtr, Size.getCPtr(rhs)), true);
129 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
133 private Size Multiply(Size rhs) {
134 Size ret = new Size(NDalicPINVOKE.Vector3_Multiply__SWIG_0(swigCPtr, Size.getCPtr(rhs)), true);
135 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139 private Size Multiply(float rhs) {
140 Size ret = new Size(NDalicPINVOKE.Vector3_Multiply__SWIG_1(swigCPtr, rhs), true);
141 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
145 private Size Divide(Size rhs) {
146 Size ret = new Size(NDalicPINVOKE.Vector3_Divide__SWIG_0(swigCPtr, Size.getCPtr(rhs)), true);
147 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
151 private Size Divide(float rhs) {
152 Size ret = new Size(NDalicPINVOKE.Vector3_Divide__SWIG_1(swigCPtr, rhs), true);
153 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157 private Size Subtract() {
158 Size ret = new Size(NDalicPINVOKE.Vector3_Subtract__SWIG_1(swigCPtr), true);
159 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
163 private float ValueOfIndex(uint index) {
164 float ret = NDalicPINVOKE.Vector3_ValueOfIndex__SWIG_0(swigCPtr, index);
165 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
169 public bool EqualTo(Size rhs) {
170 bool ret = NDalicPINVOKE.Vector3_EqualTo(swigCPtr, Size.getCPtr(rhs));
171 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175 public bool NotEqualTo(Size rhs) {
176 bool ret = NDalicPINVOKE.Vector3_NotEqualTo(swigCPtr, Size.getCPtr(rhs));
177 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184 NDalicPINVOKE.Vector3_Width_set(swigCPtr, value);
185 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
188 float ret = NDalicPINVOKE.Vector3_Width_get(swigCPtr);
189 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
194 public float Height {
196 NDalicPINVOKE.Vector3_Height_set(swigCPtr, value);
197 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200 float ret = NDalicPINVOKE.Vector3_Height_get(swigCPtr);
201 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
208 NDalicPINVOKE.Vector3_Depth_set(swigCPtr, value);
209 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
212 float ret = NDalicPINVOKE.Vector3_Depth_get(swigCPtr);
213 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
219 public static implicit operator Vector3(Size size)
221 return new Vector3(size.Width, size.Height, size.Depth);
224 public static implicit operator Size(Vector3 vec)
226 return new Size(vec.Width, vec.Height, vec.Depth);