~ubuntu-branches/ubuntu/vivid/mygui/vivid

« back to all changes in this revision

Viewing changes to Wrappers/MyGUI_Managed/FloatCoord.h

  • Committer: Package Import Robot
  • Author(s): Scott Howard, Bret Curtis, Scott Howard
  • Date: 2014-09-18 17:57:48 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140918175748-dd8va78mvpw1jbes
Tags: 3.2.1-1
[ Bret Curtis ]
* Updated license for majority of files from LGPL to Expat (MIT)

[ Scott Howard ]
* New upstream release
* Updated patch to add build option for system GLEW libraries
* All patches accepted upstream except shared_libraries.patch
* Bumped SONAME due to dropped symbols, updated *.symbols and package
  names
* Updated license of debian/* to Expat with permission of all authors
* Don't install Doxygen autogenerated md5 and map files (thanks
  lintian)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 FloatCoord
 
21
                {
 
22
                        float left, top, width, height;
 
23
 
 
24
                        FloatCoord( float _left, float _top, float _width, float _height ) : left( _left ), top( _top ), width( _width ), height( _height ) { }
 
25
 
 
26
                        static bool operator == ( FloatCoord lvalue, FloatCoord rvalue )
 
27
                        {
 
28
                                return ( lvalue.left == rvalue.left && lvalue.top == rvalue.top && lvalue.width == rvalue.width && lvalue.height == rvalue.height );
 
29
                        }
 
30
                        virtual bool Equals(FloatCoord other)
 
31
                        {
 
32
                                return *this == other;
 
33
                        }
 
34
                        static bool operator != ( FloatCoord lvalue, FloatCoord rvalue )
 
35
                        {
 
36
                                return !(lvalue == rvalue);
 
37
                        }
 
38
 
 
39
                };
 
40
 
 
41
                #else
 
42
 
 
43
                typedef MMYGUI_EXTERNAL_NAMESPACE FloatCoord FloatCoord;
 
44
 
 
45
                #endif // MMYGUI_USING_EXTERNAL_TYPE
 
46
 
 
47
                template <> struct Convert<const MyGUI::FloatCoord&>
 
48
                {
 
49
                        typedef FloatCoord Type;
 
50
                        inline static const FloatCoord& To(const MyGUI::FloatCoord& _value)
 
51
                        {
 
52
                                return reinterpret_cast<const FloatCoord&>(_value);
 
53
                        }
 
54
                        inline static MyGUI::FloatCoord& From(FloatCoord& _value)
 
55
                        {
 
56
                                return reinterpret_cast<MyGUI::FloatCoord&>(_value);
 
57
                        }
 
58
                };
 
59
                template <> struct Convert<MyGUI::FloatCoord>
 
60
                {
 
61
                        typedef FloatCoord Type;
 
62
                        inline static const FloatCoord& To(const MyGUI::FloatCoord& _value)
 
63
                        {
 
64
                                return reinterpret_cast<const FloatCoord&>(_value);
 
65
                        }
 
66
                        inline static MyGUI::FloatCoord& From(FloatCoord& _value)
 
67
                        {
 
68
                                return reinterpret_cast<MyGUI::FloatCoord&>(_value);
 
69
                        }
 
70
                };
 
71
                template <> struct Convert<MyGUI::FloatCoord&>
 
72
                {
 
73
                        typedef FloatCoord % Type;
 
74
                        inline static FloatCoord % To(MyGUI::FloatCoord& _value)
 
75
                        {
 
76
                                return reinterpret_cast<FloatCoord&>(_value);
 
77
                        }
 
78
                };
 
79
 
 
80
        } // namespace Managed
 
81
} // namespace MyGUI