const.h

main 300 lines · 8.1 KB Raw
Alex Alex Commit Client Upload Part 2 19/10/2026 00:06
1/*
2 * Copyright (c) 2010-2017 OTClient <https://github.com/edubart/otclient>
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 */
22
23#ifndef FRAMEWORK_CONST_H
24#define FRAMEWORK_CONST_H
25
26#include "stdext/compiler.h"
27
28#define DEG_TO_RAD (acos(-1)/180.0)
29#define RAD_TO_DEC (180.0/acos(-1))
30
31#ifndef BUILD_COMMIT
32#define BUILD_COMMIT "dev"
33#endif
34
35#ifndef BUILD_REVISION
36#define BUILD_REVISION 0
37#endif
38
39#ifndef BUILD_TYPE
40#define BUILD_TYPE "unknown"
41#endif
42
43#ifndef BUILD_ARCH
44#if defined(__amd64) || defined(_M_X64)
45#define BUILD_ARCH "x64"
46#elif defined(__i386) || defined(_M_IX86) || defined(_X86_)
47#define BUILD_ARCH "x86"
48#else
49#define BUILD_ARCH "unknown"
50#endif
51#endif
52
53namespace Fw
54{
55 static const float pi = 3.14159265;
56 static const float MIN_ALPHA = 0.003f;
57 enum Key : unsigned char {
58 KeyUnknown = 0,
59 KeyEscape = 1,
60 KeyTab = 2,
61 KeyBackspace = 3,
62 //KeyReturn = 4,
63 KeyEnter = 5,
64 KeyInsert = 6,
65 KeyDelete = 7,
66 KeyPause = 8,
67 KeyPrintScreen = 9,
68 KeyHome = 10,
69 KeyEnd = 11,
70 KeyPageUp = 12,
71 KeyPageDown = 13,
72 KeyUp = 14,
73 KeyDown = 15,
74 KeyLeft = 16,
75 KeyRight = 17,
76 KeyNumLock = 18,
77 KeyScrollLock = 19,
78 KeyCapsLock = 20,
79 KeyCtrl = 21,
80 KeyShift = 22,
81 KeyAlt = 23,
82 //KeyAltGr = 24,
83 KeyMeta = 25,
84 KeyMenu = 26,
85 KeySpace = 32, // ' '
86 KeyExclamation = 33, // !
87 KeyQuote = 34, // "
88 KeyNumberSign = 35, // #
89 KeyDollar = 36, // $
90 KeyPercent = 37, // %
91 KeyAmpersand = 38, // &
92 KeyApostrophe = 39, // '
93 KeyLeftParen = 40, // (
94 KeyRightParen = 41, // )
95 KeyAsterisk = 42, // *
96 KeyPlus = 43, // +
97 KeyComma = 44, // ,
98 KeyMinus = 45, // -
99 KeyPeriod = 46, // .
100 KeySlash = 47, // /
101 Key0 = 48, // 0
102 Key1 = 49, // 1
103 Key2 = 50, // 2
104 Key3 = 51, // 3
105 Key4 = 52, // 4
106 Key5 = 53, // 5
107 Key6 = 54, // 6
108 Key7 = 55, // 7
109 Key8 = 56, // 8
110 Key9 = 57, // 9
111 KeyColon = 58, // :
112 KeySemicolon = 59, // ;
113 KeyLess = 60, // <
114 KeyEqual = 61, // =
115 KeyGreater = 62, // >
116 KeyQuestion = 63, // ?
117 KeyAtSign = 64, // @
118 KeyA = 65, // a
119 KeyB = 66, // b
120 KeyC = 67, // c
121 KeyD = 68, // d
122 KeyE = 69, // e
123 KeyF = 70, // f
124 KeyG = 71, // g
125 KeyH = 72, // h
126 KeyI = 73, // i
127 KeyJ = 74, // j
128 KeyK = 75, // k
129 KeyL = 76, // l
130 KeyM = 77, // m
131 KeyN = 78, // n
132 KeyO = 79, // o
133 KeyP = 80, // p
134 KeyQ = 81, // q
135 KeyR = 82, // r
136 KeyS = 83, // s
137 KeyT = 84, // t
138 KeyU = 85, // u
139 KeyV = 86, // v
140 KeyW = 87, // w
141 KeyX = 88, // x
142 KeyY = 89, // y
143 KeyZ = 90, // z
144 KeyLeftBracket = 91, // [
145 KeyBackslash = 92, // '\'
146 KeyRightBracket = 93, // ]
147 KeyCaret = 94, // ^
148 KeyUnderscore = 95, // _
149 KeyGrave = 96, // `
150 KeyLeftCurly = 123, // {
151 KeyBar = 124, // |
152 KeyRightCurly = 125, // }
153 KeyTilde = 126, // ~
154 KeyF1 = 128,
155 KeyF2 = 129,
156 KeyF3 = 130,
157 KeyF4 = 131,
158 KeyF5 = 132,
159 KeyF6 = 134,
160 KeyF7 = 135,
161 KeyF8 = 136,
162 KeyF9 = 137,
163 KeyF10 = 138,
164 KeyF11 = 139,
165 KeyF12 = 140,
166 KeyNumpad0 = 141,
167 KeyNumpad1 = 142,
168 KeyNumpad2 = 143,
169 KeyNumpad3 = 144,
170 KeyNumpad4 = 145,
171 KeyNumpad5 = 146,
172 KeyNumpad6 = 147,
173 KeyNumpad7 = 148,
174 KeyNumpad8 = 149,
175 KeyNumpad9 = 150
176 };
177
178 enum LogLevel {
179 LogDebug = 0,
180 LogInfo,
181 LogWarning,
182 LogError,
183 LogFatal
184 };
185
186 enum AspectRatioMode {
187 IgnoreAspectRatio,
188 KeepAspectRatio,
189 KeepAspectRatioByExpanding
190 };
191
192 enum AlignmentFlag {
193 AlignNone = 0,
194 AlignLeft = 1,
195 AlignRight = 2,
196 AlignTop = 4,
197 AlignBottom = 8,
198 AlignHorizontalCenter = 16,
199 AlignVerticalCenter = 32,
200 AlignTopLeft = AlignTop | AlignLeft, // 5
201 AlignTopRight = AlignTop | AlignRight, // 6
202 AlignBottomLeft = AlignBottom | AlignLeft, // 9
203 AlignBottomRight = AlignBottom | AlignRight, // 10
204 AlignLeftCenter = AlignLeft | AlignVerticalCenter, // 33
205 AlignRightCenter = AlignRight | AlignVerticalCenter, // 34
206 AlignTopCenter = AlignTop | AlignHorizontalCenter, // 20
207 AlignBottomCenter = AlignBottom | AlignHorizontalCenter, // 24
208 AlignCenter = AlignVerticalCenter | AlignHorizontalCenter // 48
209 };
210
211 enum AnchorEdge {
212 AnchorNone = 0,
213 AnchorTop,
214 AnchorBottom,
215 AnchorLeft,
216 AnchorRight,
217 AnchorVerticalCenter,
218 AnchorHorizontalCenter
219 };
220
221 enum FocusReason {
222 MouseFocusReason = 0,
223 KeyboardFocusReason,
224 ActiveFocusReason,
225 OtherFocusReason
226 };
227
228 enum AutoFocusPolicy {
229 AutoFocusNone = 0,
230 AutoFocusFirst,
231 AutoFocusLast
232 };
233
234 enum InputEventType {
235 NoInputEvent = 0,
236 KeyTextInputEvent,
237 KeyDownInputEvent,
238 KeyPressInputEvent,
239 KeyUpInputEvent,
240 MousePressInputEvent,
241 MouseReleaseInputEvent,
242 MouseMoveInputEvent,
243 MouseWheelInputEvent
244 };
245
246 enum MouseButton {
247 MouseNoButton = 0,
248 MouseLeftButton,
249 MouseRightButton,
250 MouseMidButton,
251 MouseTouch,
252 MouseTouch2,
253 MouseTouch3,
254 MouseButton4,
255 MouseButton5,
256 MouseButtonLast = MouseButton5
257 };
258
259 enum MouseWheelDirection {
260 MouseNoWheel = 0,
261 MouseWheelUp,
262 MouseWheelDown
263 };
264
265 enum KeyboardModifier {
266 KeyboardNoModifier = 0,
267 KeyboardCtrlModifier = 1,
268 KeyboardAltModifier = 2,
269 KeyboardShiftModifier = 4
270 };
271
272 enum WidgetState {
273 InvalidState = -1,
274 DefaultState = 0,
275 ActiveState = 1,
276 FocusState = 2,
277 HoverState = 4,
278 PressedState = 8,
279 DisabledState = 16,
280 CheckedState = 32,
281 OnState = 64,
282 FirstState = 128,
283 MiddleState = 256,
284 LastState = 512,
285 AlternateState = 1024,
286 DraggingState = 2048,
287 HiddenState = 4096,
288 MobileState = 8192,
289 LastWidgetState = 16384
290 };
291
292 enum DrawPane {
293 ForegroundPane = 1,
294 MapBackgroundPane = 2,
295 MapForegroundPane = 3,
296 };
297}
298
299#endif
300
Top