1 //------------------------------------------------------------------------------
4 // This file was automatically generated by SWIG (http://www.swig.org).
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
13 public class Rectangle : global::System.IDisposable {
14 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
15 protected bool swigCMemOwn;
17 internal Rectangle(global::System.IntPtr cPtr, bool cMemoryOwn) {
18 swigCMemOwn = cMemoryOwn;
19 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
22 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Rectangle obj) {
23 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
27 DisposeQueue.Instance.Add(this);
30 public virtual void Dispose() {
31 if (!Window.IsInstalled()) {
32 DisposeQueue.Instance.Add(this);
37 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
40 NDalicPINVOKE.delete_Rectangle(swigCPtr);
42 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
44 global::System.GC.SuppressFinalize(this);
49 public Rectangle(float x, float y, float width, float height) : this( (int)x, (int)y, (int)width, (int)height )
53 public static bool operator ==(Rectangle a, Rectangle b)
55 // If both are null, or both are same instance, return true.
56 if (System.Object.ReferenceEquals(a, b))
61 // If one is null, but not both, return false.
62 if (((object)a == null) || ((object)b == null))
67 // Return true if the fields match:
68 return a.X == b.X && a.Y == b.Y && a.Width == b.Width && a.Height == b.Height;
71 public static bool operator !=(Rectangle a, Rectangle b)
76 ///< X position of the rectangle, values after the decimal point are ignored, float type provided for convenience.
89 ///< Y position of the rectangle, values after the decimal point are ignored, float type provided for convenience.
102 ///< Width of the rectangle, values after the decimal point are ignored, float type provided for convenience.
107 width = (int)( value );
115 ///< Height of the rectangle, values after the decimal point are ignored, float type provided for convenience.
120 height = (int)( value );
128 public Rectangle() : this(NDalicPINVOKE.new_Rectangle__SWIG_0(), true) {
129 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
132 public Rectangle(int x, int y, int width, int height) : this(NDalicPINVOKE.new_Rectangle__SWIG_1(x, y, width, height), true) {
133 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
136 public void Set(int newX, int newY, int newWidth, int newHeight) {
137 NDalicPINVOKE.Rectangle_Set(swigCPtr, newX, newY, newWidth, newHeight);
138 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
141 public bool IsEmpty() {
142 bool ret = NDalicPINVOKE.Rectangle_IsEmpty(swigCPtr);
143 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
148 int ret = NDalicPINVOKE.Rectangle_Left(swigCPtr);
149 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
154 int ret = NDalicPINVOKE.Rectangle_Right(swigCPtr);
155 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
160 int ret = NDalicPINVOKE.Rectangle_Top(swigCPtr);
161 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
165 public int Bottom() {
166 int ret = NDalicPINVOKE.Rectangle_Bottom(swigCPtr);
167 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
172 int ret = NDalicPINVOKE.Rectangle_Area(swigCPtr);
173 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
177 public bool Intersects(Rectangle other) {
178 bool ret = NDalicPINVOKE.Rectangle_Intersects(swigCPtr, Rectangle.getCPtr(other));
179 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
183 public bool Contains(Rectangle other) {
184 bool ret = NDalicPINVOKE.Rectangle_Contains(swigCPtr, Rectangle.getCPtr(other));
185 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
191 NDalicPINVOKE.Rectangle_x_set(swigCPtr, value);
192 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195 int ret = NDalicPINVOKE.Rectangle_x_get(swigCPtr);
196 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203 NDalicPINVOKE.Rectangle_left_set(swigCPtr, value);
204 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
207 int ret = NDalicPINVOKE.Rectangle_left_get(swigCPtr);
208 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
215 NDalicPINVOKE.Rectangle_y_set(swigCPtr, value);
216 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
219 int ret = NDalicPINVOKE.Rectangle_y_get(swigCPtr);
220 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
227 NDalicPINVOKE.Rectangle_right_set(swigCPtr, value);
228 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
231 int ret = NDalicPINVOKE.Rectangle_right_get(swigCPtr);
232 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
239 NDalicPINVOKE.Rectangle_width_set(swigCPtr, value);
240 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243 int ret = NDalicPINVOKE.Rectangle_width_get(swigCPtr);
244 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
251 NDalicPINVOKE.Rectangle_bottom_set(swigCPtr, value);
252 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
255 int ret = NDalicPINVOKE.Rectangle_bottom_get(swigCPtr);
256 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
263 NDalicPINVOKE.Rectangle_height_set(swigCPtr, value);
264 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
267 int ret = NDalicPINVOKE.Rectangle_height_get(swigCPtr);
268 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
275 NDalicPINVOKE.Rectangle_top_set(swigCPtr, value);
276 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
279 int ret = NDalicPINVOKE.Rectangle_top_get(swigCPtr);
280 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();