1 /*!
2 	@file
3 	@author		Albert Semenov
4 	@date		01/2009
5 	@module
6 */
7 #pragma once
8 
9 #include <MyGUI.h>
10 #include "Config.h"
11 #include "Marshaling.h"
12 
13 namespace MyGUI
14 {
15 	namespace Managed
16 	{
17 
18 		#ifndef MMYGUI_USING_EXTERNAL_TYPE
19 
20 		public value struct IntRect
21 		{
22 			int left, top, right, bottom;
23 
IntRectIntRect24 			IntRect( int _left, int _top, int _right, int _bottom ) : left( _left ), top( _top ), right( _right ), bottom( _bottom ) { }
25 
26 			static bool operator == ( IntRect lvalue, IntRect rvalue )
27 			{
28 				return ( lvalue.left == rvalue.left && lvalue.top == rvalue.top && lvalue.right == rvalue.right && lvalue.bottom == rvalue.bottom );
29 			}
EqualsIntRect30 			virtual bool Equals(IntRect other)
31 			{
32 				return *this == other;
33 			}
34 			static bool operator != ( IntRect lvalue, IntRect rvalue )
35 			{
36 				return !(lvalue == rvalue);
37 			}
38 
39 		};
40 
41 		#else
42 
43 		typedef MMYGUI_EXTERNAL_NAMESPACE IntRect IntRect;
44 
45 		#endif // MMYGUI_USING_EXTERNAL_TYPE
46 
47 		template <> struct Convert<const MyGUI::IntRect&>
48 		{
49 			typedef IntRect Type;
50 			inline static const IntRect& To(const MyGUI::IntRect& _value)
51 			{
52 				return reinterpret_cast<const IntRect&>(_value);
53 			}
54 			inline static MyGUI::IntRect& From(IntRect& _value)
55 			{
56 				return reinterpret_cast<MyGUI::IntRect&>(_value);
57 			}
58 		};
59 		template <> struct Convert<MyGUI::IntRect>
60 		{
61 			typedef IntRect Type;
62 			inline static const IntRect& To(const MyGUI::IntRect& _value)
63 			{
64 				return reinterpret_cast<const IntRect&>(_value);
65 			}
66 			inline static MyGUI::IntRect& From(IntRect& _value)
67 			{
68 				return reinterpret_cast<MyGUI::IntRect&>(_value);
69 			}
70 		};
71 		template <> struct Convert<MyGUI::IntRect&>
72 		{
73 			typedef IntRect % Type;
74 			inline static IntRect % To(MyGUI::IntRect& _value)
75 			{
76 				return reinterpret_cast<IntRect&>(_value);
77 			}
78 		};
79 
80 	} // namespace Managed
81 } // namespace MyGUI
82