Otclient  14/8/2020
const.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2020 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 "devel"
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 
53 namespace Fw
54 {
55  static const float pi = 3.14159265;
56  static const float MIN_ALPHA = 0.003f;
57  enum Key : unsigned char {
59  KeyEscape = 1,
60  KeyTab = 2,
62  //KeyReturn = 4,
63  KeyEnter = 5,
64  KeyInsert = 6,
65  KeyDelete = 7,
66  KeyPause = 8,
68  KeyHome = 10,
69  KeyEnd = 11,
70  KeyPageUp = 12,
72  KeyUp = 14,
73  KeyDown = 15,
74  KeyLeft = 16,
75  KeyRight = 17,
76  KeyNumLock = 18,
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,
176  };
177 
178  enum LogLevel {
179  LogDebug = 0,
184  };
185 
190  };
191 
196  AlignTop = 4,
209  };
210 
211  enum AnchorEdge {
219  };
220 
221  enum FocusReason {
226  };
227 
232  };
233 
244  };
245 
246  enum MouseButton {
251  };
252 
257  };
258 
264  };
265 
266  enum WidgetState {
275  OnState = 64,
276  FirstState = 128,
277  MiddleState = 256,
278  LastState = 512,
281  HiddenState = 4096,
283  };
284 
285  enum DrawPane {
289  };
290 
291 #ifdef FW_SQL
292  enum DatabaseEngine {
293  DatabaseNone = 0,
295  };
296 #endif
297 }
298 
299 #endif
Fw::KeyUp
@ KeyUp
Definition: const.h:72
Fw::KeyComma
@ KeyComma
Definition: const.h:97
Fw::KeyNumpad9
@ KeyNumpad9
Definition: const.h:175
Fw::KeyRightParen
@ KeyRightParen
Definition: const.h:94
Fw::KeyUnknown
@ KeyUnknown
Definition: const.h:58
Fw::KeyEscape
@ KeyEscape
Definition: const.h:59
Fw::KeyBackspace
@ KeyBackspace
Definition: const.h:61
Fw::FirstState
@ FirstState
Definition: const.h:276
Fw::KeyF10
@ KeyF10
Definition: const.h:163
Fw::KeyEnter
@ KeyEnter
Definition: const.h:63
Fw::FocusState
@ FocusState
Definition: const.h:270
Fw::MouseNoButton
@ MouseNoButton
Definition: const.h:247
Fw::KeyR
@ KeyR
Definition: const.h:135
Fw::KeyCapsLock
@ KeyCapsLock
Definition: const.h:78
Fw::AlignBottomCenter
@ AlignBottomCenter
Definition: const.h:207
Fw::KeyMenu
@ KeyMenu
Definition: const.h:84
Fw::KeyNumpad1
@ KeyNumpad1
Definition: const.h:167
Fw::KeyN
@ KeyN
Definition: const.h:131
Fw::KeyI
@ KeyI
Definition: const.h:126
Fw::ActiveFocusReason
@ ActiveFocusReason
Definition: const.h:224
Fw::KeyB
@ KeyB
Definition: const.h:119
Fw::MouseWheelInputEvent
@ MouseWheelInputEvent
Definition: const.h:243
Fw::KeyNumpad6
@ KeyNumpad6
Definition: const.h:172
Fw::KeyZ
@ KeyZ
Definition: const.h:143
Fw::KeyNumpad3
@ KeyNumpad3
Definition: const.h:169
Fw::Key7
@ Key7
Definition: const.h:108
Fw::KeyW
@ KeyW
Definition: const.h:140
Fw::KeyExclamation
@ KeyExclamation
Definition: const.h:86
Fw::LogWarning
@ LogWarning
Definition: const.h:181
Fw::ActiveState
@ ActiveState
Definition: const.h:269
Fw::WidgetState
WidgetState
Definition: const.h:266
Fw::AnchorRight
@ AnchorRight
Definition: const.h:216
Fw::KeyGreater
@ KeyGreater
Definition: const.h:115
Fw::AlignCenter
@ AlignCenter
Definition: const.h:208
Fw::KeyColon
@ KeyColon
Definition: const.h:111
Fw::LogLevel
LogLevel
Definition: const.h:178
Fw::DraggingState
@ DraggingState
Definition: const.h:280
Fw::AlignBottomRight
@ AlignBottomRight
Definition: const.h:203
DatabaseMySQL
Definition: mysql.h:36
Fw::MouseMidButton
@ MouseMidButton
Definition: const.h:250
Fw::KeyboardNoModifier
@ KeyboardNoModifier
Definition: const.h:260
Fw::KeyPeriod
@ KeyPeriod
Definition: const.h:99
Fw::LogError
@ LogError
Definition: const.h:182
Fw::KeyNumpad5
@ KeyNumpad5
Definition: const.h:171
Fw::KeepAspectRatio
@ KeepAspectRatio
Definition: const.h:188
Fw::AlignTopLeft
@ AlignTopLeft
Definition: const.h:200
Fw::KeyP
@ KeyP
Definition: const.h:133
Fw::KeyF9
@ KeyF9
Definition: const.h:162
Fw::Key3
@ Key3
Definition: const.h:104
Fw::KeyF2
@ KeyF2
Definition: const.h:155
Fw::KeyAsterisk
@ KeyAsterisk
Definition: const.h:95
Fw::AnchorEdge
AnchorEdge
Definition: const.h:211
Fw::KeyRight
@ KeyRight
Definition: const.h:75
Fw::KeyInsert
@ KeyInsert
Definition: const.h:64
Fw::KeyT
@ KeyT
Definition: const.h:137
Fw::KeyUpInputEvent
@ KeyUpInputEvent
Definition: const.h:239
Fw::KeyBackslash
@ KeyBackslash
Definition: const.h:145
Fw::KeyX
@ KeyX
Definition: const.h:141
Fw::KeyboardFocusReason
@ KeyboardFocusReason
Definition: const.h:223
Fw::KeyC
@ KeyC
Definition: const.h:120
Fw::KeyTextInputEvent
@ KeyTextInputEvent
Definition: const.h:236
Fw::Key
Key
Definition: const.h:57
Fw::MouseFocusReason
@ MouseFocusReason
Definition: const.h:222
Fw::KeyNumberSign
@ KeyNumberSign
Definition: const.h:88
Fw::AnchorLeft
@ AnchorLeft
Definition: const.h:215
Fw::KeyL
@ KeyL
Definition: const.h:129
Fw::BackgroundPane
@ BackgroundPane
Definition: const.h:287
Fw::KeyNumpad2
@ KeyNumpad2
Definition: const.h:168
Fw::HoverState
@ HoverState
Definition: const.h:271
Fw::KeyboardShiftModifier
@ KeyboardShiftModifier
Definition: const.h:263
Fw::KeyLeft
@ KeyLeft
Definition: const.h:74
Fw::KeyRightCurly
@ KeyRightCurly
Definition: const.h:152
Fw::AutoFocusLast
@ AutoFocusLast
Definition: const.h:231
Fw::LogDebug
@ LogDebug
Definition: const.h:179
Fw::MousePressInputEvent
@ MousePressInputEvent
Definition: const.h:240
Fw::AlignBottomLeft
@ AlignBottomLeft
Definition: const.h:202
Fw::KeyNumpad8
@ KeyNumpad8
Definition: const.h:174
Fw::KeyPressInputEvent
@ KeyPressInputEvent
Definition: const.h:238
Fw::Key8
@ Key8
Definition: const.h:109
Fw::FocusReason
FocusReason
Definition: const.h:221
Fw::KeySemicolon
@ KeySemicolon
Definition: const.h:112
Fw::MouseLeftButton
@ MouseLeftButton
Definition: const.h:248
Fw::KeySlash
@ KeySlash
Definition: const.h:100
Fw::MouseMoveInputEvent
@ MouseMoveInputEvent
Definition: const.h:242
Fw::KeyScrollLock
@ KeyScrollLock
Definition: const.h:77
Fw::LastWidgetState
@ LastWidgetState
Definition: const.h:282
Fw::MiddleState
@ MiddleState
Definition: const.h:277
Fw::KeyShift
@ KeyShift
Definition: const.h:80
Fw::KeepAspectRatioByExpanding
@ KeepAspectRatioByExpanding
Definition: const.h:189
Fw::KeyQ
@ KeyQ
Definition: const.h:134
Fw::AlignTopCenter
@ AlignTopCenter
Definition: const.h:206
Fw::AutoFocusFirst
@ AutoFocusFirst
Definition: const.h:230
Fw::KeyDollar
@ KeyDollar
Definition: const.h:89
Fw::Key2
@ Key2
Definition: const.h:103
Fw::KeyAtSign
@ KeyAtSign
Definition: const.h:117
Fw::KeyPause
@ KeyPause
Definition: const.h:66
Fw::KeyD
@ KeyD
Definition: const.h:121
Fw::KeyLeftCurly
@ KeyLeftCurly
Definition: const.h:150
Fw::AlignNone
@ AlignNone
Definition: const.h:193
Fw::KeyLess
@ KeyLess
Definition: const.h:113
Fw::KeyU
@ KeyU
Definition: const.h:138
Fw::KeyJ
@ KeyJ
Definition: const.h:127
Fw::KeyH
@ KeyH
Definition: const.h:125
Fw::LogInfo
@ LogInfo
Definition: const.h:180
Fw::KeyEnd
@ KeyEnd
Definition: const.h:69
Fw::IgnoreAspectRatio
@ IgnoreAspectRatio
Definition: const.h:187
Fw::KeyF12
@ KeyF12
Definition: const.h:165
Fw::KeyAlt
@ KeyAlt
Definition: const.h:81
Fw::KeyF11
@ KeyF11
Definition: const.h:164
Fw::KeyF4
@ KeyF4
Definition: const.h:157
Fw::AlignHorizontalCenter
@ AlignHorizontalCenter
Definition: const.h:198
Fw::BothPanes
@ BothPanes
Definition: const.h:288
Fw::KeyPlus
@ KeyPlus
Definition: const.h:96
Fw::KeyboardModifier
KeyboardModifier
Definition: const.h:259
Fw::OnState
@ OnState
Definition: const.h:275
Fw::AnchorNone
@ AnchorNone
Definition: const.h:212
Fw::KeyS
@ KeyS
Definition: const.h:136
Fw::KeyNumpad4
@ KeyNumpad4
Definition: const.h:170
Fw::KeyO
@ KeyO
Definition: const.h:132
Fw::KeyHome
@ KeyHome
Definition: const.h:68
compiler.h
Fw::AnchorTop
@ AnchorTop
Definition: const.h:213
Fw::KeyA
@ KeyA
Definition: const.h:118
Fw::KeyGrave
@ KeyGrave
Definition: const.h:149
Fw::KeyY
@ KeyY
Definition: const.h:142
Fw::KeyQuote
@ KeyQuote
Definition: const.h:87
Fw::KeyboardAltModifier
@ KeyboardAltModifier
Definition: const.h:262
Fw::KeyF7
@ KeyF7
Definition: const.h:160
Fw::KeyF
@ KeyF
Definition: const.h:123
Fw::KeyLeftParen
@ KeyLeftParen
Definition: const.h:93
Fw::AlignmentFlag
AlignmentFlag
Definition: const.h:192
Fw::MouseRightButton
@ MouseRightButton
Definition: const.h:249
Fw::MouseWheelUp
@ MouseWheelUp
Definition: const.h:255
Fw::PressedState
@ PressedState
Definition: const.h:272
Fw::Key9
@ Key9
Definition: const.h:110
Fw::KeyBar
@ KeyBar
Definition: const.h:151
Fw::AlignLeftCenter
@ AlignLeftCenter
Definition: const.h:204
Fw::KeyRightBracket
@ KeyRightBracket
Definition: const.h:146
Fw::KeyNumpad7
@ KeyNumpad7
Definition: const.h:173
Fw::KeyMinus
@ KeyMinus
Definition: const.h:98
Fw::MouseNoWheel
@ MouseNoWheel
Definition: const.h:254
Fw::AlternateState
@ AlternateState
Definition: const.h:279
Fw::DisabledState
@ DisabledState
Definition: const.h:273
Fw::Key0
@ Key0
Definition: const.h:101
Fw::KeyF8
@ KeyF8
Definition: const.h:161
Fw::NoInputEvent
@ NoInputEvent
Definition: const.h:235
Fw::KeyM
@ KeyM
Definition: const.h:130
Fw::KeyEqual
@ KeyEqual
Definition: const.h:114
Fw::MouseWheelDirection
MouseWheelDirection
Definition: const.h:253
Fw::KeyPrintScreen
@ KeyPrintScreen
Definition: const.h:67
Fw::KeyG
@ KeyG
Definition: const.h:124
Fw::DrawPane
DrawPane
Definition: const.h:285
Fw::KeyV
@ KeyV
Definition: const.h:139
Fw::InvalidState
@ InvalidState
Definition: const.h:267
Fw::KeyE
@ KeyE
Definition: const.h:122
Fw::ForegroundPane
@ ForegroundPane
Definition: const.h:286
Fw::AlignTopRight
@ AlignTopRight
Definition: const.h:201
Fw::KeyNumpad0
@ KeyNumpad0
Definition: const.h:166
Fw::KeyF6
@ KeyF6
Definition: const.h:159
Fw::KeyQuestion
@ KeyQuestion
Definition: const.h:116
Fw::KeyAmpersand
@ KeyAmpersand
Definition: const.h:91
Fw::Key1
@ Key1
Definition: const.h:102
Fw::AlignTop
@ AlignTop
Definition: const.h:196
Fw::KeyDown
@ KeyDown
Definition: const.h:73
Fw::MouseReleaseInputEvent
@ MouseReleaseInputEvent
Definition: const.h:241
Fw::KeyCaret
@ KeyCaret
Definition: const.h:147
Fw::KeyApostrophe
@ KeyApostrophe
Definition: const.h:92
Fw::KeyboardCtrlModifier
@ KeyboardCtrlModifier
Definition: const.h:261
Fw::Key5
@ Key5
Definition: const.h:106
Fw::KeyPageUp
@ KeyPageUp
Definition: const.h:70
Fw::KeyTilde
@ KeyTilde
Definition: const.h:153
Fw::CheckedState
@ CheckedState
Definition: const.h:274
Fw::AlignBottom
@ AlignBottom
Definition: const.h:197
Fw::HiddenState
@ HiddenState
Definition: const.h:281
Fw::Key4
@ Key4
Definition: const.h:105
Fw::AlignLeft
@ AlignLeft
Definition: const.h:194
Fw::AnchorVerticalCenter
@ AnchorVerticalCenter
Definition: const.h:217
Fw::InputEventType
InputEventType
Definition: const.h:234
Fw::AnchorBottom
@ AnchorBottom
Definition: const.h:214
Fw::KeyDownInputEvent
@ KeyDownInputEvent
Definition: const.h:237
Fw::KeyLeftBracket
@ KeyLeftBracket
Definition: const.h:144
Fw::KeyPercent
@ KeyPercent
Definition: const.h:90
Fw::AlignVerticalCenter
@ AlignVerticalCenter
Definition: const.h:199
Fw::MouseWheelDown
@ MouseWheelDown
Definition: const.h:256
Fw::AutoFocusPolicy
AutoFocusPolicy
Definition: const.h:228
Fw::Key6
@ Key6
Definition: const.h:107
Fw::KeyMeta
@ KeyMeta
Definition: const.h:83
Fw::AspectRatioMode
AspectRatioMode
Definition: const.h:186
Fw::KeyF5
@ KeyF5
Definition: const.h:158
Fw::AlignRightCenter
@ AlignRightCenter
Definition: const.h:205
Fw::KeyF1
@ KeyF1
Definition: const.h:154
Fw::KeyCtrl
@ KeyCtrl
Definition: const.h:79
Fw::KeyF3
@ KeyF3
Definition: const.h:156
Fw::DefaultState
@ DefaultState
Definition: const.h:268
Fw::KeyUnderscore
@ KeyUnderscore
Definition: const.h:148
Fw::KeyK
@ KeyK
Definition: const.h:128
Fw::LogFatal
@ LogFatal
Definition: const.h:183
Fw::LastState
@ LastState
Definition: const.h:278
Fw::MouseButton
MouseButton
Definition: const.h:246
Fw
Definition: const.h:53
Fw::KeyDelete
@ KeyDelete
Definition: const.h:65
Fw::AlignRight
@ AlignRight
Definition: const.h:195
Fw::OtherFocusReason
@ OtherFocusReason
Definition: const.h:225
Fw::KeyPageDown
@ KeyPageDown
Definition: const.h:71
Fw::KeyTab
@ KeyTab
Definition: const.h:60
Fw::AutoFocusNone
@ AutoFocusNone
Definition: const.h:229
Fw::AnchorHorizontalCenter
@ AnchorHorizontalCenter
Definition: const.h:218
Fw::KeyNumLock
@ KeyNumLock
Definition: const.h:76
Fw::KeySpace
@ KeySpace
Definition: const.h:85