summaryrefslogtreecommitdiff
path: root/src/gui/interface/Border.h
blob: a1ceb81e1e0a7b4eabde5017f842e1f6d21a37ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#pragma once
#include "Platform.h"

namespace ui
{
	
	struct Border
	{
#if ENABLE_FLOAT_UI
# define BORDER_T float
#else
# define BORDER_T int
#endif
		
		BORDER_T Top;
		BORDER_T Right;
		BORDER_T Bottom;
		BORDER_T Left;
		
		Border(BORDER_T all):
		Top(all),
		Right(all),
		Bottom(all),
		Left(all)
		{
		}
		
		Border(BORDER_T v, BORDER_T h):
		Top(v),
		Right(h),
		Bottom(v),
		Left(h)
		{
		}
		
		Border(BORDER_T top, BORDER_T right, BORDER_T bottom, BORDER_T left):
		Top(top),
		Right(right),
		Bottom(bottom),
		Left(left)
		{
		}

		inline bool operator == (const int& v) const
		{
			return (Top == v && Right == v && Bottom == v && Left == v);
		}
		
		inline bool operator == (const Border& v) const
		{
			return (Top == v.Top && Right == v.Right && Bottom == v.Bottom && Left == v.Left);
		}
		
		inline bool operator != (const Border& v) const
		{
			return (Top != v.Top || Right != v.Right || Bottom != v.Bottom || Left != v.Left);
		}
		
		inline void operator = (const Border& v)
		{
			Top = v.Top;
			Right = v.Right;
			Bottom = v.Bottom;
			Left = v.Left;
		}
		
	};
	
}