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 //------------------------------------------------------------------------------
17 public class Rectangle : global::System.IDisposable
19 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20 protected bool swigCMemOwn;
22 internal Rectangle(global::System.IntPtr cPtr, bool cMemoryOwn)
24 swigCMemOwn = cMemoryOwn;
25 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
28 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Rectangle obj)
30 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
33 //NUI Dispose Pattern written by Jinwoo Nam(jjw.nam)
35 //A Flag to check who called Dispose(). (By User or DisposeQueue)
36 private bool isDisposeQueued = false;
37 //A Flat to check if it is already disposed.
38 protected bool disposed = false;
44 isDisposeQueued = true;
45 DisposeQueue.Instance.Add(this);
51 //Throw excpetion if Dispose() is called in separate thread.
52 if (!Window.IsInstalled())
54 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
59 Dispose(DisposeTypes.Implicit);
63 Dispose(DisposeTypes.Explicit);
64 System.GC.SuppressFinalize(this);
68 protected virtual void Dispose(DisposeTypes type)
75 if(type == DisposeTypes.Explicit)
78 //Release your own managed resources here.
79 //You should release all of your own disposable objects here.
82 //Release your own unmanaged resources here.
83 //You should not access any managed member here except static instance.
84 //because the execution order of Finalizes is non-deterministic.
86 if (swigCPtr.Handle != global::System.IntPtr.Zero)
91 NDalicPINVOKE.delete_Rectangle(swigCPtr);
93 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
99 /// Equality operator.
101 /// <param name="a">First operand</param>
102 /// <param name="b">Second operand</param>
103 /// <returns>True if boxes are exactly same</returns>
104 public static bool operator ==(Rectangle a, Rectangle b)
106 // If both are null, or both are same instance, return true.
107 if (System.Object.ReferenceEquals(a, b))
112 // If one is null, but not both, return false.
113 if (((object)a == null) || ((object)b == null))
118 // Return true if the fields match:
119 return a.X == b.X && a.Y == b.Y && a.Width == b.Width && a.Height == b.Height;
123 /// Inequality operator.
125 /// <param name="a">The first rectangle</param>
126 /// <param name="b">The second rectangle</param>
127 /// <returns>True if rectangles are not identical</returns>
128 public static bool operator !=(Rectangle a, Rectangle b)
134 /// X position of the rectangle
149 /// Y position of the rectangle
164 /// Width of the rectangle
179 /// Height of the rectangle
196 public Rectangle() : this(NDalicPINVOKE.new_Rectangle__SWIG_0(), true)
198 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
204 /// <param name="x">X coordinate (or left)</param>
205 /// <param name="y">Y coordinate (or right)</param>
206 /// <param name="width">Width (or bottom)</param>
207 /// <param name="height">Height (or top)</param>
208 public Rectangle(int x, int y, int width, int height) : this(NDalicPINVOKE.new_Rectangle__SWIG_1(x, y, width, height), true)
210 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
214 /// Assignment from individual values.
216 /// <param name="newX">X coordinate</param>
217 /// <param name="newY">Y coordinate</param>
218 /// <param name="newWidth">Width</param>
219 /// <param name="newHeight">Height</param>
220 public void Set(int newX, int newY, int newWidth, int newHeight)
222 NDalicPINVOKE.Rectangle_Set(swigCPtr, newX, newY, newWidth, newHeight);
223 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
227 /// Determines whether or not this Rectangle is empty.
229 /// <returns>True if width or height are zero</returns>
230 public bool IsEmpty()
232 bool ret = NDalicPINVOKE.Rectangle_IsEmpty(swigCPtr);
233 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
238 /// Gets the left of the rectangle.
240 /// <returns>The left edge of the rectangle</returns>
243 int ret = NDalicPINVOKE.Rectangle_Left(swigCPtr);
244 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
249 /// Gets the right of the rectangle.
251 /// <returns>The right edge of the rectangle</returns>
254 int ret = NDalicPINVOKE.Rectangle_Right(swigCPtr);
255 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
260 /// Gets the top of the rectangle.
262 /// <returns>The top of the rectangle</returns>
265 int ret = NDalicPINVOKE.Rectangle_Top(swigCPtr);
266 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
271 /// Gets the bottom of the rectangle.
273 /// <returns>The bottom of the rectangle</returns>
276 int ret = NDalicPINVOKE.Rectangle_Bottom(swigCPtr);
277 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
282 /// Gets the area of the rectangle.
284 /// <returns>The area of the rectangle</returns>
287 int ret = NDalicPINVOKE.Rectangle_Area(swigCPtr);
288 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
293 /// Determines whether or not this rectangle and the specified rectangle intersect.
295 /// <param name="other">The other rectangle to test against this rectangle</param>
296 /// <returns>True if the rectangles intersect</returns>
297 public bool Intersects(Rectangle other)
299 bool ret = NDalicPINVOKE.Rectangle_Intersects(swigCPtr, Rectangle.getCPtr(other));
300 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
305 /// Determines whether or not this Rectangle contains the specified rectangle.
307 /// <param name="other">The other rectangle to test against this rectangle</param>
308 /// <returns>True if the specified rectangle is contained</returns>
309 public bool Contains(Rectangle other)
311 bool ret = NDalicPINVOKE.Rectangle_Contains(swigCPtr, Rectangle.getCPtr(other));
312 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
320 NDalicPINVOKE.Rectangle_x_set(swigCPtr, value);
321 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
325 int ret = NDalicPINVOKE.Rectangle_x_get(swigCPtr);
326 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
335 NDalicPINVOKE.Rectangle_left_set(swigCPtr, value);
336 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
340 int ret = NDalicPINVOKE.Rectangle_left_get(swigCPtr);
341 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
350 NDalicPINVOKE.Rectangle_y_set(swigCPtr, value);
351 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
355 int ret = NDalicPINVOKE.Rectangle_y_get(swigCPtr);
356 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
365 NDalicPINVOKE.Rectangle_right_set(swigCPtr, value);
366 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
370 int ret = NDalicPINVOKE.Rectangle_right_get(swigCPtr);
371 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
380 NDalicPINVOKE.Rectangle_width_set(swigCPtr, value);
381 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
385 int ret = NDalicPINVOKE.Rectangle_width_get(swigCPtr);
386 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
395 NDalicPINVOKE.Rectangle_bottom_set(swigCPtr, value);
396 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
400 int ret = NDalicPINVOKE.Rectangle_bottom_get(swigCPtr);
401 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
410 NDalicPINVOKE.Rectangle_height_set(swigCPtr, value);
411 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
415 int ret = NDalicPINVOKE.Rectangle_height_get(swigCPtr);
416 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
425 NDalicPINVOKE.Rectangle_top_set(swigCPtr, value);
426 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
430 int ret = NDalicPINVOKE.Rectangle_top_get(swigCPtr);
431 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();