Simple SFML GUI  0.2a
Enums.hpp
1 #ifndef ENUMS_HPP
2 #define ENUMS_HPP
3 
4 #include <utility>
5 
6 enum class Align {
7  Left,
8  Center,
9  Right,
10  Justify
11 };
12 
13 enum class VAlign {
14  Top,
15  Middle,
16  Bottom
17 };
18 
19 namespace StateId {
20  typedef unsigned char Type;
21  const Type Disabled = 8;
22  const Type Pressed = 16;
23  const Type PressedAlt = 24;
24  const Type Hover = 32;
25  const Type Focus = 40;
26  const Type Selected = 48;
27  const Type UserDefined = 127;
28  const Type Default = 255;
29 };
30 
31 typedef std::pair<const bool*, bool> PairState; //State ptr, Inversion Mode
32 
33 namespace ColorId {
34  typedef unsigned char Type;
35  const Type Background = 0;
36  const Type Outline = 1;
37  const Type FontFill = 2;
38  const Type FontOutline = 3;
39  const Type CursorFill = 4;
40  const Type CursorOutline = 5;
41  const Type UserDefined = 127;
42 };
43 
44 enum class Orientation {
45  Horizontal,
46  Vertical
47 };
48 
49 enum class PositionType {
50  Absolute,
51  Percent
52 };
53 
54 enum class MarginMode : int {
55  None = 0,
56  Top = 1,
57  Bottom = 2,
58  Left = 4,
59  Right = 8,
60  Horizontal = 16,
61  Vertical = 32,
62  Full = Top | Bottom | Left | Right | Horizontal | Vertical
63 };
64 
65 inline MarginMode operator|(MarginMode m1, MarginMode m2) {
66  return static_cast<MarginMode>(static_cast<int>(m1) | static_cast<int>(m2));
67 }
68 
69 inline MarginMode operator^(MarginMode m1, MarginMode m2) {
70  return static_cast<MarginMode>(static_cast<int>(m1) ^ static_cast<int>(m2));
71 }
72 
73 inline bool operator&(MarginMode m1, MarginMode m2) {
74  return static_cast<int>(m1) & static_cast<int>(m2);
75 }
76 
77 enum class MarginUnit {
78  Absolute,
79  WidthPercent,
80  HeightPercent
81 };
82 
83 enum class ScrollType {
84  AutoTransparent,
85  AutoSolid,
86  Transparent,
87  Solid
88 };
89 
90 enum class ScrollEnable : int {
91  None = 0,
92  Horizontal = 1,
93  Vertical = 2,
94  Both = Horizontal | Vertical
95 };
96 
97 inline bool operator& (ScrollEnable s1, ScrollEnable s2) {
98  return static_cast<int>(s1) & static_cast<int>(s2);
99 }
100 
101 enum class MaximizationMode : int {
102  Horizontal = 1,
103  Vertical = 2,
104  Both = Horizontal | Vertical
105 };
106 
107 inline bool operator& (MaximizationMode m1, MaximizationMode m2) {
108  return static_cast<int>(m1) & static_cast<int>(m2);
109 }
110 
111 enum class LogLevel : unsigned char {
112  None = 0,
113  CriticalError = 1,
114  Error = 2,
115  Warning = 4,
116  Info = 8,
117  DebugInfo = 16,
118  Full = CriticalError | Error | Warning | Info | DebugInfo
119 };
120 
121 inline bool operator& (LogLevel l1, LogLevel l2) {
122  return static_cast<unsigned char>(l1) & static_cast<unsigned char>(l2);
123 }
124 
125 inline LogLevel operator- (LogLevel l1, LogLevel l2) {
126  if(l1 & l2) {
127  return static_cast<LogLevel>(
128  static_cast<unsigned char>(l1) - static_cast<unsigned char>(l2)
129  ) ;
130  }
131  return l1;
132 }
133 
134 enum class LogWrite {
135  Append = 1,
136  OverWrite = 2
137 };
138 
139 enum class CBState : unsigned {
140  Unchecked=0,
141  Checked=1,
142  Partly=2,
143  Count
144 };
145 
146 constexpr inline unsigned toId(CBState state) {
147  return static_cast<unsigned>(state);
148 }
149 
150 enum class GradientType {
151  None,
152  Vertical,
153  Horizontal
154 };
155 
156 enum class TabMode {
157  Fixed,
158  Auto
159 };
160 
161 enum class TabPosition {
162  Top,
163  Bottom,
164  Left,
165  Right,
166  Hidden
167 };
168 
169 #endif // ENUMS_HPP
Definition: Enums.hpp:19
Definition: Enums.hpp:33