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 /// Copy constructor.
216 /// <param name="rhs">The original object</param>
217 public Rectangle(Rectangle rhs) : this(NDalicPINVOKE.new_Rectangle__SWIG_2(Rectangle.getCPtr(rhs)), true)
219 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223 /// Make reference of original Rectangle object.
225 /// <param name="rhs">The original object</param>
226 /// <returns>Reference to this</returns>
227 public Rectangle Assign(Rectangle rhs)
229 Rectangle ret = new Rectangle(NDalicPINVOKE.Rectangle_Assign(swigCPtr, Rectangle.getCPtr(rhs)), false);
230 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
235 /// Assignment from individual values.
237 /// <param name="newX">X coordinate</param>
238 /// <param name="newY">Y coordinate</param>
239 /// <param name="newWidth">Width</param>
240 /// <param name="newHeight">Height</param>
241 public void Set(int newX, int newY, int newWidth, int newHeight)
243 NDalicPINVOKE.Rectangle_Set(swigCPtr, newX, newY, newWidth, newHeight);
244 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
248 /// Determines whether or not this Rectangle is empty.
250 /// <returns>True if width or height are zero</returns>
251 public bool IsEmpty()
253 bool ret = NDalicPINVOKE.Rectangle_IsEmpty(swigCPtr);
254 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
259 /// Gets the left of the rectangle.
261 /// <returns>The left edge of the rectangle</returns>
264 int ret = NDalicPINVOKE.Rectangle_Left(swigCPtr);
265 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
270 /// Gets the right of the rectangle.
272 /// <returns>The right edge of the rectangle</returns>
275 int ret = NDalicPINVOKE.Rectangle_Right(swigCPtr);
276 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
281 /// Gets the top of the rectangle.
283 /// <returns>The top of the rectangle</returns>
286 int ret = NDalicPINVOKE.Rectangle_Top(swigCPtr);
287 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
292 /// Gets the bottom of the rectangle.
294 /// <returns>The bottom of the rectangle</returns>
297 int ret = NDalicPINVOKE.Rectangle_Bottom(swigCPtr);
298 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
303 /// Gets the area of the rectangle.
305 /// <returns>The area of the rectangle</returns>
308 int ret = NDalicPINVOKE.Rectangle_Area(swigCPtr);
309 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
314 /// Determines whether or not this rectangle and the specified rectangle intersect.
316 /// <param name="other">The other rectangle to test against this rectangle</param>
317 /// <returns>True if the rectangles intersect</returns>
318 public bool Intersects(Rectangle other)
320 bool ret = NDalicPINVOKE.Rectangle_Intersects(swigCPtr, Rectangle.getCPtr(other));
321 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
326 /// Determines whether or not this Rectangle contains the specified rectangle.
328 /// <param name="other">The other rectangle to test against this rectangle</param>
329 /// <returns>True if the specified rectangle is contained</returns>
330 public bool Contains(Rectangle other)
332 bool ret = NDalicPINVOKE.Rectangle_Contains(swigCPtr, Rectangle.getCPtr(other));
333 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
341 NDalicPINVOKE.Rectangle_x_set(swigCPtr, value);
342 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
346 int ret = NDalicPINVOKE.Rectangle_x_get(swigCPtr);
347 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
356 NDalicPINVOKE.Rectangle_left_set(swigCPtr, value);
357 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
361 int ret = NDalicPINVOKE.Rectangle_left_get(swigCPtr);
362 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
371 NDalicPINVOKE.Rectangle_y_set(swigCPtr, value);
372 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
376 int ret = NDalicPINVOKE.Rectangle_y_get(swigCPtr);
377 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
386 NDalicPINVOKE.Rectangle_right_set(swigCPtr, value);
387 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
391 int ret = NDalicPINVOKE.Rectangle_right_get(swigCPtr);
392 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
401 NDalicPINVOKE.Rectangle_width_set(swigCPtr, value);
402 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
406 int ret = NDalicPINVOKE.Rectangle_width_get(swigCPtr);
407 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
416 NDalicPINVOKE.Rectangle_bottom_set(swigCPtr, value);
417 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
421 int ret = NDalicPINVOKE.Rectangle_bottom_get(swigCPtr);
422 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
431 NDalicPINVOKE.Rectangle_height_set(swigCPtr, value);
432 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
436 int ret = NDalicPINVOKE.Rectangle_height_get(swigCPtr);
437 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
446 NDalicPINVOKE.Rectangle_top_set(swigCPtr, value);
447 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
451 int ret = NDalicPINVOKE.Rectangle_top_get(swigCPtr);
452 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();