forked from Oen44/OTUIEditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
const.h
52 lines (44 loc) · 1.41 KB
/
const.h
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
#ifndef CONST_H
#define CONST_H
#include <iterator>
#include <unordered_map>
namespace OTUI {
enum Pivot {
NoPivot = 0,
TopLeft,
Top,
TopRight,
Left,
Right,
BottomLeft,
Bottom,
BottomRight
};
enum AlignmentFlag {
AlignNone = 0,
AlignLeft = 1,
AlignRight = 2,
AlignTop = 4,
AlignBottom = 8,
AlignHorizontalCenter = 16,
AlignVerticalCenter = 32,
AlignTopLeft = AlignTop | AlignLeft, // 5
AlignTopRight = AlignTop | AlignRight, // 6
AlignBottomLeft = AlignBottom | AlignLeft, // 9
AlignBottomRight = AlignBottom | AlignRight, // 10
AlignLeftCenter = AlignLeft | AlignVerticalCenter, // 33
AlignRightCenter = AlignRight | AlignVerticalCenter, // 34
AlignTopCenter = AlignTop | AlignHorizontalCenter, // 20
AlignBottomCenter = AlignBottom | AlignHorizontalCenter, // 24
AlignCenter = AlignVerticalCenter | AlignHorizontalCenter // 48
};
template <typename T>
struct reversion_wrapper { T& iterable; };
template <typename T>
auto begin (reversion_wrapper<T> w) { return std::rbegin(w.iterable); }
template <typename T>
auto end (reversion_wrapper<T> w) { return std::rend(w.iterable); }
template <typename T>
reversion_wrapper<T> reverse (T&& iterable) { return { iterable }; }
}
#endif // CONST_H