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;
35 DisposeQueue.Instance.Add(this);
38 public virtual void Dispose()
40 if (!Window.IsInstalled())
42 DisposeQueue.Instance.Add(this);
48 if (swigCPtr.Handle != global::System.IntPtr.Zero)
53 NDalicPINVOKE.delete_Rectangle(swigCPtr);
55 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
57 global::System.GC.SuppressFinalize(this);
62 /// Equality operator.
64 /// <param name="a">First operand</param>
65 /// <param name="b">Second operand</param>
66 /// <returns>True if boxes are exactly same</returns>
67 public static bool operator ==(Rectangle a, Rectangle b)
69 // If both are null, or both are same instance, return true.
70 if (System.Object.ReferenceEquals(a, b))
75 // If one is null, but not both, return false.
76 if (((object)a == null) || ((object)b == null))
81 // Return true if the fields match:
82 return a.X == b.X && a.Y == b.Y && a.Width == b.Width && a.Height == b.Height;
86 /// Inequality operator.
88 /// <param name="a">The first rectangle</param>
89 /// <param name="b">The second rectangle</param>
90 /// <returns>True if rectangles are not identical</returns>
91 public static bool operator !=(Rectangle a, Rectangle b)
97 /// X position of the rectangle
112 /// Y position of the rectangle
127 /// Width of the rectangle
142 /// Height of the rectangle
159 public Rectangle() : this(NDalicPINVOKE.new_Rectangle__SWIG_0(), true)
161 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
167 /// <param name="x">X coordinate (or left)</param>
168 /// <param name="y">Y coordinate (or right)</param>
169 /// <param name="width">Width (or bottom)</param>
170 /// <param name="height">Height (or top)</param>
171 public Rectangle(int x, int y, int width, int height) : this(NDalicPINVOKE.new_Rectangle__SWIG_1(x, y, width, height), true)
173 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
177 /// Copy constructor.
179 /// <param name="rhs">The original object</param>
180 public Rectangle(Rectangle rhs) : this(NDalicPINVOKE.new_Rectangle__SWIG_2(Rectangle.getCPtr(rhs)), true)
182 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
186 /// Make reference of original Rectangle object.
188 /// <param name="rhs">The original object</param>
189 /// <returns>Reference to this</returns>
190 public Rectangle Assign(Rectangle rhs)
192 Rectangle ret = new Rectangle(NDalicPINVOKE.Rectangle_Assign(swigCPtr, Rectangle.getCPtr(rhs)), false);
193 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
198 /// Assignment from individual values.
200 /// <param name="newX">X coordinate</param>
201 /// <param name="newY">Y coordinate</param>
202 /// <param name="newWidth">Width</param>
203 /// <param name="newHeight">Height</param>
204 public void Set(int newX, int newY, int newWidth, int newHeight)
206 NDalicPINVOKE.Rectangle_Set(swigCPtr, newX, newY, newWidth, newHeight);
207 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
211 /// Determines whether or not this Rectangle is empty.
213 /// <returns>True if width or height are zero</returns>
214 public bool IsEmpty()
216 bool ret = NDalicPINVOKE.Rectangle_IsEmpty(swigCPtr);
217 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
222 /// Gets the left of the rectangle.
224 /// <returns>The left edge of the rectangle</returns>
227 int ret = NDalicPINVOKE.Rectangle_Left(swigCPtr);
228 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
233 /// Gets the right of the rectangle.
235 /// <returns>The right edge of the rectangle</returns>
238 int ret = NDalicPINVOKE.Rectangle_Right(swigCPtr);
239 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
244 /// Gets the top of the rectangle.
246 /// <returns>The top of the rectangle</returns>
249 int ret = NDalicPINVOKE.Rectangle_Top(swigCPtr);
250 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
255 /// Gets the bottom of the rectangle.
257 /// <returns>The bottom of the rectangle</returns>
260 int ret = NDalicPINVOKE.Rectangle_Bottom(swigCPtr);
261 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
266 /// Gets the area of the rectangle.
268 /// <returns>The area of the rectangle</returns>
271 int ret = NDalicPINVOKE.Rectangle_Area(swigCPtr);
272 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
277 /// Determines whether or not this rectangle and the specified rectangle intersect.
279 /// <param name="other">The other rectangle to test against this rectangle</param>
280 /// <returns>True if the rectangles intersect</returns>
281 public bool Intersects(Rectangle other)
283 bool ret = NDalicPINVOKE.Rectangle_Intersects(swigCPtr, Rectangle.getCPtr(other));
284 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
289 /// Determines whether or not this Rectangle contains the specified rectangle.
291 /// <param name="other">The other rectangle to test against this rectangle</param>
292 /// <returns>True if the specified rectangle is contained</returns>
293 public bool Contains(Rectangle other)
295 bool ret = NDalicPINVOKE.Rectangle_Contains(swigCPtr, Rectangle.getCPtr(other));
296 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
304 NDalicPINVOKE.Rectangle_x_set(swigCPtr, value);
305 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
309 int ret = NDalicPINVOKE.Rectangle_x_get(swigCPtr);
310 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
319 NDalicPINVOKE.Rectangle_left_set(swigCPtr, value);
320 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
324 int ret = NDalicPINVOKE.Rectangle_left_get(swigCPtr);
325 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
334 NDalicPINVOKE.Rectangle_y_set(swigCPtr, value);
335 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
339 int ret = NDalicPINVOKE.Rectangle_y_get(swigCPtr);
340 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
349 NDalicPINVOKE.Rectangle_right_set(swigCPtr, value);
350 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
354 int ret = NDalicPINVOKE.Rectangle_right_get(swigCPtr);
355 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
364 NDalicPINVOKE.Rectangle_width_set(swigCPtr, value);
365 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
369 int ret = NDalicPINVOKE.Rectangle_width_get(swigCPtr);
370 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
379 NDalicPINVOKE.Rectangle_bottom_set(swigCPtr, value);
380 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
384 int ret = NDalicPINVOKE.Rectangle_bottom_get(swigCPtr);
385 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
394 NDalicPINVOKE.Rectangle_height_set(swigCPtr, value);
395 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
399 int ret = NDalicPINVOKE.Rectangle_height_get(swigCPtr);
400 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
409 NDalicPINVOKE.Rectangle_top_set(swigCPtr, value);
410 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
414 int ret = NDalicPINVOKE.Rectangle_top_get(swigCPtr);
415 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();