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 //A Flag to check who called Dispose(). (By User or DisposeQueue)
34 private bool isDisposeQueued = false;
35 //A Flat to check if it is already disposed.
36 protected bool disposed = false;
42 isDisposeQueued = true;
43 DisposeQueue.Instance.Add(this);
49 //Throw excpetion if Dispose() is called in separate thread.
50 if (!Window.IsInstalled())
52 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
57 Dispose(DisposeTypes.Implicit);
61 Dispose(DisposeTypes.Explicit);
62 System.GC.SuppressFinalize(this);
66 protected virtual void Dispose(DisposeTypes type)
73 if(type == DisposeTypes.Explicit)
76 //Release your own managed resources here.
77 //You should release all of your own disposable objects here.
80 //Release your own unmanaged resources here.
81 //You should not access any managed member here except static instance.
82 //because the execution order of Finalizes is non-deterministic.
84 if (swigCPtr.Handle != global::System.IntPtr.Zero)
89 NDalicPINVOKE.delete_Rectangle(swigCPtr);
91 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
97 /// Equality operator.
99 /// <param name="a">First operand</param>
100 /// <param name="b">Second operand</param>
101 /// <returns>True if boxes are exactly same</returns>
102 public static bool operator ==(Rectangle a, Rectangle b)
104 // If both are null, or both are same instance, return true.
105 if (System.Object.ReferenceEquals(a, b))
110 // If one is null, but not both, return false.
111 if (((object)a == null) || ((object)b == null))
116 // Return true if the fields match:
117 return a.X == b.X && a.Y == b.Y && a.Width == b.Width && a.Height == b.Height;
121 /// Inequality operator.
123 /// <param name="a">The first rectangle</param>
124 /// <param name="b">The second rectangle</param>
125 /// <returns>True if rectangles are not identical</returns>
126 public static bool operator !=(Rectangle a, Rectangle b)
132 /// X position of the rectangle
147 /// Y position of the rectangle
162 /// Width of the rectangle
177 /// Height of the rectangle
194 public Rectangle() : this(NDalicPINVOKE.new_Rectangle__SWIG_0(), true)
196 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
202 /// <param name="x">X coordinate (or left)</param>
203 /// <param name="y">Y coordinate (or right)</param>
204 /// <param name="width">Width (or bottom)</param>
205 /// <param name="height">Height (or top)</param>
206 public Rectangle(int x, int y, int width, int height) : this(NDalicPINVOKE.new_Rectangle__SWIG_1(x, y, width, height), true)
208 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
212 /// Assignment from individual values.
214 /// <param name="newX">X coordinate</param>
215 /// <param name="newY">Y coordinate</param>
216 /// <param name="newWidth">Width</param>
217 /// <param name="newHeight">Height</param>
218 public void Set(int newX, int newY, int newWidth, int newHeight)
220 NDalicPINVOKE.Rectangle_Set(swigCPtr, newX, newY, newWidth, newHeight);
221 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225 /// Determines whether or not this Rectangle is empty.
227 /// <returns>True if width or height are zero</returns>
228 public bool IsEmpty()
230 bool ret = NDalicPINVOKE.Rectangle_IsEmpty(swigCPtr);
231 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236 /// Gets the left of the rectangle.
238 /// <returns>The left edge of the rectangle</returns>
241 int ret = NDalicPINVOKE.Rectangle_Left(swigCPtr);
242 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
247 /// Gets the right of the rectangle.
249 /// <returns>The right edge of the rectangle</returns>
252 int ret = NDalicPINVOKE.Rectangle_Right(swigCPtr);
253 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
258 /// Gets the top of the rectangle.
260 /// <returns>The top of the rectangle</returns>
263 int ret = NDalicPINVOKE.Rectangle_Top(swigCPtr);
264 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
269 /// Gets the bottom of the rectangle.
271 /// <returns>The bottom of the rectangle</returns>
274 int ret = NDalicPINVOKE.Rectangle_Bottom(swigCPtr);
275 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
280 /// Gets the area of the rectangle.
282 /// <returns>The area of the rectangle</returns>
285 int ret = NDalicPINVOKE.Rectangle_Area(swigCPtr);
286 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
291 /// Determines whether or not this rectangle and the specified rectangle intersect.
293 /// <param name="other">The other rectangle to test against this rectangle</param>
294 /// <returns>True if the rectangles intersect</returns>
295 public bool Intersects(Rectangle other)
297 bool ret = NDalicPINVOKE.Rectangle_Intersects(swigCPtr, Rectangle.getCPtr(other));
298 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
303 /// Determines whether or not this Rectangle contains the specified rectangle.
305 /// <param name="other">The other rectangle to test against this rectangle</param>
306 /// <returns>True if the specified rectangle is contained</returns>
307 public bool Contains(Rectangle other)
309 bool ret = NDalicPINVOKE.Rectangle_Contains(swigCPtr, Rectangle.getCPtr(other));
310 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
318 NDalicPINVOKE.Rectangle_x_set(swigCPtr, value);
319 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
323 int ret = NDalicPINVOKE.Rectangle_x_get(swigCPtr);
324 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
333 NDalicPINVOKE.Rectangle_left_set(swigCPtr, value);
334 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
338 int ret = NDalicPINVOKE.Rectangle_left_get(swigCPtr);
339 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
348 NDalicPINVOKE.Rectangle_y_set(swigCPtr, value);
349 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
353 int ret = NDalicPINVOKE.Rectangle_y_get(swigCPtr);
354 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
363 NDalicPINVOKE.Rectangle_right_set(swigCPtr, value);
364 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
368 int ret = NDalicPINVOKE.Rectangle_right_get(swigCPtr);
369 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
378 NDalicPINVOKE.Rectangle_width_set(swigCPtr, value);
379 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
383 int ret = NDalicPINVOKE.Rectangle_width_get(swigCPtr);
384 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
393 NDalicPINVOKE.Rectangle_bottom_set(swigCPtr, value);
394 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
398 int ret = NDalicPINVOKE.Rectangle_bottom_get(swigCPtr);
399 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
408 NDalicPINVOKE.Rectangle_height_set(swigCPtr, value);
409 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
413 int ret = NDalicPINVOKE.Rectangle_height_get(swigCPtr);
414 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
423 NDalicPINVOKE.Rectangle_top_set(swigCPtr, value);
424 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
428 int ret = NDalicPINVOKE.Rectangle_top_get(swigCPtr);
429 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();