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 (!Stage.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 Rectangle(Rectangle rhs) : this(NDalicPINVOKE.new_Rectangle__SWIG_2(Rectangle.getCPtr(rhs)), true) {
137 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
140 public Rectangle Assign(Rectangle rhs) {
141 Rectangle ret = new Rectangle(NDalicPINVOKE.Rectangle_Assign(swigCPtr, Rectangle.getCPtr(rhs)), false);
142 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
146 public void Set(int newX, int newY, int newWidth, int newHeight) {
147 NDalicPINVOKE.Rectangle_Set(swigCPtr, newX, newY, newWidth, newHeight);
148 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
151 public bool IsEmpty() {
152 bool ret = NDalicPINVOKE.Rectangle_IsEmpty(swigCPtr);
153 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
158 int ret = NDalicPINVOKE.Rectangle_Left(swigCPtr);
159 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
164 int ret = NDalicPINVOKE.Rectangle_Right(swigCPtr);
165 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
170 int ret = NDalicPINVOKE.Rectangle_Top(swigCPtr);
171 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175 public int Bottom() {
176 int ret = NDalicPINVOKE.Rectangle_Bottom(swigCPtr);
177 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
182 int ret = NDalicPINVOKE.Rectangle_Area(swigCPtr);
183 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
187 public bool Intersects(Rectangle other) {
188 bool ret = NDalicPINVOKE.Rectangle_Intersects(swigCPtr, Rectangle.getCPtr(other));
189 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
193 public bool Contains(Rectangle other) {
194 bool ret = NDalicPINVOKE.Rectangle_Contains(swigCPtr, Rectangle.getCPtr(other));
195 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
201 NDalicPINVOKE.Rectangle_x_set(swigCPtr, value);
202 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
205 int ret = NDalicPINVOKE.Rectangle_x_get(swigCPtr);
206 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
213 NDalicPINVOKE.Rectangle_left_set(swigCPtr, value);
214 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
217 int ret = NDalicPINVOKE.Rectangle_left_get(swigCPtr);
218 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225 NDalicPINVOKE.Rectangle_y_set(swigCPtr, value);
226 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
229 int ret = NDalicPINVOKE.Rectangle_y_get(swigCPtr);
230 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
237 NDalicPINVOKE.Rectangle_right_set(swigCPtr, value);
238 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
241 int ret = NDalicPINVOKE.Rectangle_right_get(swigCPtr);
242 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
249 NDalicPINVOKE.Rectangle_width_set(swigCPtr, value);
250 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
253 int ret = NDalicPINVOKE.Rectangle_width_get(swigCPtr);
254 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
261 NDalicPINVOKE.Rectangle_bottom_set(swigCPtr, value);
262 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
265 int ret = NDalicPINVOKE.Rectangle_bottom_get(swigCPtr);
266 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
273 NDalicPINVOKE.Rectangle_height_set(swigCPtr, value);
274 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
277 int ret = NDalicPINVOKE.Rectangle_height_get(swigCPtr);
278 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
285 NDalicPINVOKE.Rectangle_top_set(swigCPtr, value);
286 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
289 int ret = NDalicPINVOKE.Rectangle_top_get(swigCPtr);
290 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();