global_constants.cpp 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753
  1. /**************************************************************************/
  2. /* global_constants.cpp */
  3. /**************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /**************************************************************************/
  8. /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
  9. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /**************************************************************************/
  30. #include "global_constants.h"
  31. #include "core/object.h"
  32. #include "core/os/input_event.h"
  33. #include "core/os/keyboard.h"
  34. #include "core/variant.h"
  35. struct _GlobalConstant {
  36. #ifdef DEBUG_METHODS_ENABLED
  37. StringName enum_name;
  38. bool ignore_value_in_docs;
  39. #endif
  40. const char *name;
  41. int value;
  42. _GlobalConstant() {}
  43. #ifdef DEBUG_METHODS_ENABLED
  44. _GlobalConstant(const StringName &p_enum_name, const char *p_name, int p_value, bool p_ignore_value_in_docs = false) :
  45. enum_name(p_enum_name),
  46. ignore_value_in_docs(p_ignore_value_in_docs),
  47. name(p_name),
  48. value(p_value) {
  49. }
  50. #else
  51. _GlobalConstant(const char *p_name, int p_value) :
  52. name(p_name),
  53. value(p_value) {
  54. }
  55. #endif
  56. };
  57. static Vector<_GlobalConstant> _global_constants;
  58. #ifdef DEBUG_METHODS_ENABLED
  59. #define BIND_GLOBAL_CONSTANT(m_constant) \
  60. _global_constants.push_back(_GlobalConstant(StringName(), #m_constant, m_constant));
  61. #define BIND_GLOBAL_ENUM_CONSTANT(m_constant) \
  62. _global_constants.push_back(_GlobalConstant(__constant_get_enum_name(m_constant, #m_constant), #m_constant, m_constant));
  63. #define BIND_GLOBAL_ENUM_CONSTANT_CUSTOM(m_custom_name, m_constant) \
  64. _global_constants.push_back(_GlobalConstant(__constant_get_enum_name(m_constant, #m_constant), m_custom_name, m_constant));
  65. #define BIND_GLOBAL_CONSTANT_NO_VAL(m_constant) \
  66. _global_constants.push_back(_GlobalConstant(StringName(), #m_constant, m_constant, true));
  67. #define BIND_GLOBAL_ENUM_CONSTANT_NO_VAL(m_constant) \
  68. _global_constants.push_back(_GlobalConstant(__constant_get_enum_name(m_constant, #m_constant), #m_constant, m_constant, true));
  69. #define BIND_GLOBAL_ENUM_CONSTANT_CUSTOM_NO_VAL(m_custom_name, m_constant) \
  70. _global_constants.push_back(_GlobalConstant(__constant_get_enum_name(m_constant, #m_constant), m_custom_name, m_constant, true));
  71. #else
  72. #define BIND_GLOBAL_CONSTANT(m_constant) \
  73. _global_constants.push_back(_GlobalConstant(#m_constant, m_constant));
  74. #define BIND_GLOBAL_ENUM_CONSTANT(m_constant) \
  75. _global_constants.push_back(_GlobalConstant(#m_constant, m_constant));
  76. #define BIND_GLOBAL_ENUM_CONSTANT_CUSTOM(m_custom_name, m_constant) \
  77. _global_constants.push_back(_GlobalConstant(m_custom_name, m_constant));
  78. #define BIND_GLOBAL_CONSTANT_NO_VAL(m_constant) \
  79. _global_constants.push_back(_GlobalConstant(#m_constant, m_constant));
  80. #define BIND_GLOBAL_ENUM_CONSTANT_NO_VAL(m_constant) \
  81. _global_constants.push_back(_GlobalConstant(#m_constant, m_constant));
  82. #define BIND_GLOBAL_ENUM_CONSTANT_CUSTOM_NO_VAL(m_custom_name, m_constant) \
  83. _global_constants.push_back(_GlobalConstant(m_custom_name, m_constant));
  84. #endif
  85. VARIANT_ENUM_CAST(KeyList);
  86. VARIANT_ENUM_CAST(KeyModifierMask);
  87. VARIANT_ENUM_CAST(ButtonList);
  88. VARIANT_ENUM_CAST(JoystickList);
  89. VARIANT_ENUM_CAST(MidiMessageList);
  90. void register_global_constants() {
  91. //{ KEY_BACKSPACE, VK_BACK },// (0x08) // backspace
  92. BIND_GLOBAL_ENUM_CONSTANT(MARGIN_LEFT);
  93. BIND_GLOBAL_ENUM_CONSTANT(MARGIN_TOP);
  94. BIND_GLOBAL_ENUM_CONSTANT(MARGIN_RIGHT);
  95. BIND_GLOBAL_ENUM_CONSTANT(MARGIN_BOTTOM);
  96. BIND_GLOBAL_ENUM_CONSTANT(CORNER_TOP_LEFT);
  97. BIND_GLOBAL_ENUM_CONSTANT(CORNER_TOP_RIGHT);
  98. BIND_GLOBAL_ENUM_CONSTANT(CORNER_BOTTOM_RIGHT);
  99. BIND_GLOBAL_ENUM_CONSTANT(CORNER_BOTTOM_LEFT);
  100. BIND_GLOBAL_ENUM_CONSTANT(VERTICAL);
  101. BIND_GLOBAL_ENUM_CONSTANT(HORIZONTAL);
  102. BIND_GLOBAL_ENUM_CONSTANT(HALIGN_LEFT);
  103. BIND_GLOBAL_ENUM_CONSTANT(HALIGN_CENTER);
  104. BIND_GLOBAL_ENUM_CONSTANT(HALIGN_RIGHT);
  105. BIND_GLOBAL_ENUM_CONSTANT(VALIGN_TOP);
  106. BIND_GLOBAL_ENUM_CONSTANT(VALIGN_CENTER);
  107. BIND_GLOBAL_ENUM_CONSTANT(VALIGN_BOTTOM);
  108. // hueg list of keys
  109. BIND_GLOBAL_CONSTANT(SPKEY);
  110. BIND_GLOBAL_ENUM_CONSTANT(KEY_ESCAPE);
  111. BIND_GLOBAL_ENUM_CONSTANT(KEY_TAB);
  112. BIND_GLOBAL_ENUM_CONSTANT(KEY_BACKTAB);
  113. BIND_GLOBAL_ENUM_CONSTANT(KEY_BACKSPACE);
  114. BIND_GLOBAL_ENUM_CONSTANT(KEY_ENTER);
  115. BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_ENTER);
  116. BIND_GLOBAL_ENUM_CONSTANT(KEY_INSERT);
  117. BIND_GLOBAL_ENUM_CONSTANT(KEY_DELETE);
  118. BIND_GLOBAL_ENUM_CONSTANT(KEY_PAUSE);
  119. BIND_GLOBAL_ENUM_CONSTANT(KEY_PRINT);
  120. BIND_GLOBAL_ENUM_CONSTANT(KEY_SYSREQ);
  121. BIND_GLOBAL_ENUM_CONSTANT(KEY_CLEAR);
  122. BIND_GLOBAL_ENUM_CONSTANT(KEY_HOME);
  123. BIND_GLOBAL_ENUM_CONSTANT(KEY_END);
  124. BIND_GLOBAL_ENUM_CONSTANT(KEY_LEFT);
  125. BIND_GLOBAL_ENUM_CONSTANT(KEY_UP);
  126. BIND_GLOBAL_ENUM_CONSTANT(KEY_RIGHT);
  127. BIND_GLOBAL_ENUM_CONSTANT(KEY_DOWN);
  128. BIND_GLOBAL_ENUM_CONSTANT(KEY_PAGEUP);
  129. BIND_GLOBAL_ENUM_CONSTANT(KEY_PAGEDOWN);
  130. BIND_GLOBAL_ENUM_CONSTANT(KEY_SHIFT);
  131. BIND_GLOBAL_ENUM_CONSTANT(KEY_CONTROL);
  132. BIND_GLOBAL_ENUM_CONSTANT(KEY_META);
  133. BIND_GLOBAL_ENUM_CONSTANT(KEY_ALT);
  134. BIND_GLOBAL_ENUM_CONSTANT(KEY_CAPSLOCK);
  135. BIND_GLOBAL_ENUM_CONSTANT(KEY_NUMLOCK);
  136. BIND_GLOBAL_ENUM_CONSTANT(KEY_SCROLLLOCK);
  137. BIND_GLOBAL_ENUM_CONSTANT(KEY_F1);
  138. BIND_GLOBAL_ENUM_CONSTANT(KEY_F2);
  139. BIND_GLOBAL_ENUM_CONSTANT(KEY_F3);
  140. BIND_GLOBAL_ENUM_CONSTANT(KEY_F4);
  141. BIND_GLOBAL_ENUM_CONSTANT(KEY_F5);
  142. BIND_GLOBAL_ENUM_CONSTANT(KEY_F6);
  143. BIND_GLOBAL_ENUM_CONSTANT(KEY_F7);
  144. BIND_GLOBAL_ENUM_CONSTANT(KEY_F8);
  145. BIND_GLOBAL_ENUM_CONSTANT(KEY_F9);
  146. BIND_GLOBAL_ENUM_CONSTANT(KEY_F10);
  147. BIND_GLOBAL_ENUM_CONSTANT(KEY_F11);
  148. BIND_GLOBAL_ENUM_CONSTANT(KEY_F12);
  149. BIND_GLOBAL_ENUM_CONSTANT(KEY_F13);
  150. BIND_GLOBAL_ENUM_CONSTANT(KEY_F14);
  151. BIND_GLOBAL_ENUM_CONSTANT(KEY_F15);
  152. BIND_GLOBAL_ENUM_CONSTANT(KEY_F16);
  153. BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_MULTIPLY);
  154. BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_DIVIDE);
  155. BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_SUBTRACT);
  156. BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_PERIOD);
  157. BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_ADD);
  158. BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_0);
  159. BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_1);
  160. BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_2);
  161. BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_3);
  162. BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_4);
  163. BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_5);
  164. BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_6);
  165. BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_7);
  166. BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_8);
  167. BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_9);
  168. BIND_GLOBAL_ENUM_CONSTANT(KEY_SUPER_L);
  169. BIND_GLOBAL_ENUM_CONSTANT(KEY_SUPER_R);
  170. BIND_GLOBAL_ENUM_CONSTANT(KEY_MENU);
  171. BIND_GLOBAL_ENUM_CONSTANT(KEY_HYPER_L);
  172. BIND_GLOBAL_ENUM_CONSTANT(KEY_HYPER_R);
  173. BIND_GLOBAL_ENUM_CONSTANT(KEY_HELP);
  174. BIND_GLOBAL_ENUM_CONSTANT(KEY_DIRECTION_L);
  175. BIND_GLOBAL_ENUM_CONSTANT(KEY_DIRECTION_R);
  176. BIND_GLOBAL_ENUM_CONSTANT(KEY_BACK);
  177. BIND_GLOBAL_ENUM_CONSTANT(KEY_FORWARD);
  178. BIND_GLOBAL_ENUM_CONSTANT(KEY_STOP);
  179. BIND_GLOBAL_ENUM_CONSTANT(KEY_REFRESH);
  180. BIND_GLOBAL_ENUM_CONSTANT(KEY_VOLUMEDOWN);
  181. BIND_GLOBAL_ENUM_CONSTANT(KEY_VOLUMEMUTE);
  182. BIND_GLOBAL_ENUM_CONSTANT(KEY_VOLUMEUP);
  183. BIND_GLOBAL_ENUM_CONSTANT(KEY_BASSBOOST);
  184. BIND_GLOBAL_ENUM_CONSTANT(KEY_BASSUP);
  185. BIND_GLOBAL_ENUM_CONSTANT(KEY_BASSDOWN);
  186. BIND_GLOBAL_ENUM_CONSTANT(KEY_TREBLEUP);
  187. BIND_GLOBAL_ENUM_CONSTANT(KEY_TREBLEDOWN);
  188. BIND_GLOBAL_ENUM_CONSTANT(KEY_MEDIAPLAY);
  189. BIND_GLOBAL_ENUM_CONSTANT(KEY_MEDIASTOP);
  190. BIND_GLOBAL_ENUM_CONSTANT(KEY_MEDIAPREVIOUS);
  191. BIND_GLOBAL_ENUM_CONSTANT(KEY_MEDIANEXT);
  192. BIND_GLOBAL_ENUM_CONSTANT(KEY_MEDIARECORD);
  193. BIND_GLOBAL_ENUM_CONSTANT(KEY_HOMEPAGE);
  194. BIND_GLOBAL_ENUM_CONSTANT(KEY_FAVORITES);
  195. BIND_GLOBAL_ENUM_CONSTANT(KEY_SEARCH);
  196. BIND_GLOBAL_ENUM_CONSTANT(KEY_STANDBY);
  197. BIND_GLOBAL_ENUM_CONSTANT(KEY_OPENURL);
  198. BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCHMAIL);
  199. BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCHMEDIA);
  200. BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCH0);
  201. BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCH1);
  202. BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCH2);
  203. BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCH3);
  204. BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCH4);
  205. BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCH5);
  206. BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCH6);
  207. BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCH7);
  208. BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCH8);
  209. BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCH9);
  210. BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCHA);
  211. BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCHB);
  212. BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCHC);
  213. BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCHD);
  214. BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCHE);
  215. BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCHF);
  216. BIND_GLOBAL_ENUM_CONSTANT(KEY_UNKNOWN);
  217. BIND_GLOBAL_ENUM_CONSTANT(KEY_SPACE);
  218. BIND_GLOBAL_ENUM_CONSTANT(KEY_EXCLAM);
  219. BIND_GLOBAL_ENUM_CONSTANT(KEY_QUOTEDBL);
  220. BIND_GLOBAL_ENUM_CONSTANT(KEY_NUMBERSIGN);
  221. BIND_GLOBAL_ENUM_CONSTANT(KEY_DOLLAR);
  222. BIND_GLOBAL_ENUM_CONSTANT(KEY_PERCENT);
  223. BIND_GLOBAL_ENUM_CONSTANT(KEY_AMPERSAND);
  224. BIND_GLOBAL_ENUM_CONSTANT(KEY_APOSTROPHE);
  225. BIND_GLOBAL_ENUM_CONSTANT(KEY_PARENLEFT);
  226. BIND_GLOBAL_ENUM_CONSTANT(KEY_PARENRIGHT);
  227. BIND_GLOBAL_ENUM_CONSTANT(KEY_ASTERISK);
  228. BIND_GLOBAL_ENUM_CONSTANT(KEY_PLUS);
  229. BIND_GLOBAL_ENUM_CONSTANT(KEY_COMMA);
  230. BIND_GLOBAL_ENUM_CONSTANT(KEY_MINUS);
  231. BIND_GLOBAL_ENUM_CONSTANT(KEY_PERIOD);
  232. BIND_GLOBAL_ENUM_CONSTANT(KEY_SLASH);
  233. BIND_GLOBAL_ENUM_CONSTANT(KEY_0);
  234. BIND_GLOBAL_ENUM_CONSTANT(KEY_1);
  235. BIND_GLOBAL_ENUM_CONSTANT(KEY_2);
  236. BIND_GLOBAL_ENUM_CONSTANT(KEY_3);
  237. BIND_GLOBAL_ENUM_CONSTANT(KEY_4);
  238. BIND_GLOBAL_ENUM_CONSTANT(KEY_5);
  239. BIND_GLOBAL_ENUM_CONSTANT(KEY_6);
  240. BIND_GLOBAL_ENUM_CONSTANT(KEY_7);
  241. BIND_GLOBAL_ENUM_CONSTANT(KEY_8);
  242. BIND_GLOBAL_ENUM_CONSTANT(KEY_9);
  243. BIND_GLOBAL_ENUM_CONSTANT(KEY_COLON);
  244. BIND_GLOBAL_ENUM_CONSTANT(KEY_SEMICOLON);
  245. BIND_GLOBAL_ENUM_CONSTANT(KEY_LESS);
  246. BIND_GLOBAL_ENUM_CONSTANT(KEY_EQUAL);
  247. BIND_GLOBAL_ENUM_CONSTANT(KEY_GREATER);
  248. BIND_GLOBAL_ENUM_CONSTANT(KEY_QUESTION);
  249. BIND_GLOBAL_ENUM_CONSTANT(KEY_AT);
  250. BIND_GLOBAL_ENUM_CONSTANT(KEY_A);
  251. BIND_GLOBAL_ENUM_CONSTANT(KEY_B);
  252. BIND_GLOBAL_ENUM_CONSTANT(KEY_C);
  253. BIND_GLOBAL_ENUM_CONSTANT(KEY_D);
  254. BIND_GLOBAL_ENUM_CONSTANT(KEY_E);
  255. BIND_GLOBAL_ENUM_CONSTANT(KEY_F);
  256. BIND_GLOBAL_ENUM_CONSTANT(KEY_G);
  257. BIND_GLOBAL_ENUM_CONSTANT(KEY_H);
  258. BIND_GLOBAL_ENUM_CONSTANT(KEY_I);
  259. BIND_GLOBAL_ENUM_CONSTANT(KEY_J);
  260. BIND_GLOBAL_ENUM_CONSTANT(KEY_K);
  261. BIND_GLOBAL_ENUM_CONSTANT(KEY_L);
  262. BIND_GLOBAL_ENUM_CONSTANT(KEY_M);
  263. BIND_GLOBAL_ENUM_CONSTANT(KEY_N);
  264. BIND_GLOBAL_ENUM_CONSTANT(KEY_O);
  265. BIND_GLOBAL_ENUM_CONSTANT(KEY_P);
  266. BIND_GLOBAL_ENUM_CONSTANT(KEY_Q);
  267. BIND_GLOBAL_ENUM_CONSTANT(KEY_R);
  268. BIND_GLOBAL_ENUM_CONSTANT(KEY_S);
  269. BIND_GLOBAL_ENUM_CONSTANT(KEY_T);
  270. BIND_GLOBAL_ENUM_CONSTANT(KEY_U);
  271. BIND_GLOBAL_ENUM_CONSTANT(KEY_V);
  272. BIND_GLOBAL_ENUM_CONSTANT(KEY_W);
  273. BIND_GLOBAL_ENUM_CONSTANT(KEY_X);
  274. BIND_GLOBAL_ENUM_CONSTANT(KEY_Y);
  275. BIND_GLOBAL_ENUM_CONSTANT(KEY_Z);
  276. BIND_GLOBAL_ENUM_CONSTANT(KEY_BRACKETLEFT);
  277. BIND_GLOBAL_ENUM_CONSTANT(KEY_BACKSLASH);
  278. BIND_GLOBAL_ENUM_CONSTANT(KEY_BRACKETRIGHT);
  279. BIND_GLOBAL_ENUM_CONSTANT(KEY_ASCIICIRCUM);
  280. BIND_GLOBAL_ENUM_CONSTANT(KEY_UNDERSCORE);
  281. BIND_GLOBAL_ENUM_CONSTANT(KEY_QUOTELEFT);
  282. BIND_GLOBAL_ENUM_CONSTANT(KEY_BRACELEFT);
  283. BIND_GLOBAL_ENUM_CONSTANT(KEY_BAR);
  284. BIND_GLOBAL_ENUM_CONSTANT(KEY_BRACERIGHT);
  285. BIND_GLOBAL_ENUM_CONSTANT(KEY_ASCIITILDE);
  286. BIND_GLOBAL_ENUM_CONSTANT(KEY_NOBREAKSPACE);
  287. BIND_GLOBAL_ENUM_CONSTANT(KEY_EXCLAMDOWN);
  288. BIND_GLOBAL_ENUM_CONSTANT(KEY_CENT);
  289. BIND_GLOBAL_ENUM_CONSTANT(KEY_STERLING);
  290. BIND_GLOBAL_ENUM_CONSTANT(KEY_CURRENCY);
  291. BIND_GLOBAL_ENUM_CONSTANT(KEY_YEN);
  292. BIND_GLOBAL_ENUM_CONSTANT(KEY_BROKENBAR);
  293. BIND_GLOBAL_ENUM_CONSTANT(KEY_SECTION);
  294. BIND_GLOBAL_ENUM_CONSTANT(KEY_DIAERESIS);
  295. BIND_GLOBAL_ENUM_CONSTANT(KEY_COPYRIGHT);
  296. BIND_GLOBAL_ENUM_CONSTANT(KEY_ORDFEMININE);
  297. BIND_GLOBAL_ENUM_CONSTANT(KEY_GUILLEMOTLEFT);
  298. BIND_GLOBAL_ENUM_CONSTANT(KEY_NOTSIGN);
  299. BIND_GLOBAL_ENUM_CONSTANT(KEY_HYPHEN);
  300. BIND_GLOBAL_ENUM_CONSTANT(KEY_REGISTERED);
  301. BIND_GLOBAL_ENUM_CONSTANT(KEY_MACRON);
  302. BIND_GLOBAL_ENUM_CONSTANT(KEY_DEGREE);
  303. BIND_GLOBAL_ENUM_CONSTANT(KEY_PLUSMINUS);
  304. BIND_GLOBAL_ENUM_CONSTANT(KEY_TWOSUPERIOR);
  305. BIND_GLOBAL_ENUM_CONSTANT(KEY_THREESUPERIOR);
  306. BIND_GLOBAL_ENUM_CONSTANT(KEY_ACUTE);
  307. BIND_GLOBAL_ENUM_CONSTANT(KEY_MU);
  308. BIND_GLOBAL_ENUM_CONSTANT(KEY_PARAGRAPH);
  309. BIND_GLOBAL_ENUM_CONSTANT(KEY_PERIODCENTERED);
  310. BIND_GLOBAL_ENUM_CONSTANT(KEY_CEDILLA);
  311. BIND_GLOBAL_ENUM_CONSTANT(KEY_ONESUPERIOR);
  312. BIND_GLOBAL_ENUM_CONSTANT(KEY_MASCULINE);
  313. BIND_GLOBAL_ENUM_CONSTANT(KEY_GUILLEMOTRIGHT);
  314. BIND_GLOBAL_ENUM_CONSTANT(KEY_ONEQUARTER);
  315. BIND_GLOBAL_ENUM_CONSTANT(KEY_ONEHALF);
  316. BIND_GLOBAL_ENUM_CONSTANT(KEY_THREEQUARTERS);
  317. BIND_GLOBAL_ENUM_CONSTANT(KEY_QUESTIONDOWN);
  318. BIND_GLOBAL_ENUM_CONSTANT(KEY_AGRAVE);
  319. BIND_GLOBAL_ENUM_CONSTANT(KEY_AACUTE);
  320. BIND_GLOBAL_ENUM_CONSTANT(KEY_ACIRCUMFLEX);
  321. BIND_GLOBAL_ENUM_CONSTANT(KEY_ATILDE);
  322. BIND_GLOBAL_ENUM_CONSTANT(KEY_ADIAERESIS);
  323. BIND_GLOBAL_ENUM_CONSTANT(KEY_ARING);
  324. BIND_GLOBAL_ENUM_CONSTANT(KEY_AE);
  325. BIND_GLOBAL_ENUM_CONSTANT(KEY_CCEDILLA);
  326. BIND_GLOBAL_ENUM_CONSTANT(KEY_EGRAVE);
  327. BIND_GLOBAL_ENUM_CONSTANT(KEY_EACUTE);
  328. BIND_GLOBAL_ENUM_CONSTANT(KEY_ECIRCUMFLEX);
  329. BIND_GLOBAL_ENUM_CONSTANT(KEY_EDIAERESIS);
  330. BIND_GLOBAL_ENUM_CONSTANT(KEY_IGRAVE);
  331. BIND_GLOBAL_ENUM_CONSTANT(KEY_IACUTE);
  332. BIND_GLOBAL_ENUM_CONSTANT(KEY_ICIRCUMFLEX);
  333. BIND_GLOBAL_ENUM_CONSTANT(KEY_IDIAERESIS);
  334. BIND_GLOBAL_ENUM_CONSTANT(KEY_ETH);
  335. BIND_GLOBAL_ENUM_CONSTANT(KEY_NTILDE);
  336. BIND_GLOBAL_ENUM_CONSTANT(KEY_OGRAVE);
  337. BIND_GLOBAL_ENUM_CONSTANT(KEY_OACUTE);
  338. BIND_GLOBAL_ENUM_CONSTANT(KEY_OCIRCUMFLEX);
  339. BIND_GLOBAL_ENUM_CONSTANT(KEY_OTILDE);
  340. BIND_GLOBAL_ENUM_CONSTANT(KEY_ODIAERESIS);
  341. BIND_GLOBAL_ENUM_CONSTANT(KEY_MULTIPLY);
  342. BIND_GLOBAL_ENUM_CONSTANT(KEY_OOBLIQUE);
  343. BIND_GLOBAL_ENUM_CONSTANT(KEY_UGRAVE);
  344. BIND_GLOBAL_ENUM_CONSTANT(KEY_UACUTE);
  345. BIND_GLOBAL_ENUM_CONSTANT(KEY_UCIRCUMFLEX);
  346. BIND_GLOBAL_ENUM_CONSTANT(KEY_UDIAERESIS);
  347. BIND_GLOBAL_ENUM_CONSTANT(KEY_YACUTE);
  348. BIND_GLOBAL_ENUM_CONSTANT(KEY_THORN);
  349. BIND_GLOBAL_ENUM_CONSTANT(KEY_SSHARP);
  350. BIND_GLOBAL_ENUM_CONSTANT(KEY_DIVISION);
  351. BIND_GLOBAL_ENUM_CONSTANT(KEY_YDIAERESIS);
  352. BIND_GLOBAL_ENUM_CONSTANT(KEY_CODE_MASK);
  353. BIND_GLOBAL_ENUM_CONSTANT(KEY_MODIFIER_MASK);
  354. BIND_GLOBAL_ENUM_CONSTANT(KEY_MASK_SHIFT);
  355. BIND_GLOBAL_ENUM_CONSTANT(KEY_MASK_ALT);
  356. BIND_GLOBAL_ENUM_CONSTANT(KEY_MASK_META);
  357. BIND_GLOBAL_ENUM_CONSTANT(KEY_MASK_CTRL);
  358. BIND_GLOBAL_ENUM_CONSTANT_NO_VAL(KEY_MASK_CMD);
  359. BIND_GLOBAL_ENUM_CONSTANT(KEY_MASK_KPAD);
  360. BIND_GLOBAL_ENUM_CONSTANT(KEY_MASK_GROUP_SWITCH);
  361. // mouse
  362. BIND_GLOBAL_ENUM_CONSTANT(BUTTON_LEFT);
  363. BIND_GLOBAL_ENUM_CONSTANT(BUTTON_RIGHT);
  364. BIND_GLOBAL_ENUM_CONSTANT(BUTTON_MIDDLE);
  365. BIND_GLOBAL_ENUM_CONSTANT(BUTTON_XBUTTON1);
  366. BIND_GLOBAL_ENUM_CONSTANT(BUTTON_XBUTTON2);
  367. BIND_GLOBAL_ENUM_CONSTANT(BUTTON_WHEEL_UP);
  368. BIND_GLOBAL_ENUM_CONSTANT(BUTTON_WHEEL_DOWN);
  369. BIND_GLOBAL_ENUM_CONSTANT(BUTTON_WHEEL_LEFT);
  370. BIND_GLOBAL_ENUM_CONSTANT(BUTTON_WHEEL_RIGHT);
  371. BIND_GLOBAL_ENUM_CONSTANT(BUTTON_MASK_LEFT);
  372. BIND_GLOBAL_ENUM_CONSTANT(BUTTON_MASK_RIGHT);
  373. BIND_GLOBAL_ENUM_CONSTANT(BUTTON_MASK_MIDDLE);
  374. BIND_GLOBAL_ENUM_CONSTANT(BUTTON_MASK_XBUTTON1);
  375. BIND_GLOBAL_ENUM_CONSTANT(BUTTON_MASK_XBUTTON2);
  376. //joypads
  377. BIND_GLOBAL_ENUM_CONSTANT(JOY_INVALID_OPTION);
  378. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_0);
  379. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_1);
  380. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_2);
  381. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_3);
  382. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_4);
  383. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_5);
  384. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_6);
  385. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_7);
  386. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_8);
  387. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_9);
  388. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_10);
  389. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_11);
  390. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_12);
  391. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_13);
  392. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_14);
  393. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_15);
  394. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_16);
  395. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_17);
  396. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_18);
  397. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_19);
  398. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_20);
  399. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_21);
  400. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_22);
  401. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_MAX);
  402. BIND_GLOBAL_ENUM_CONSTANT(JOY_SONY_CIRCLE);
  403. BIND_GLOBAL_ENUM_CONSTANT(JOY_SONY_X);
  404. BIND_GLOBAL_ENUM_CONSTANT(JOY_SONY_SQUARE);
  405. BIND_GLOBAL_ENUM_CONSTANT(JOY_SONY_TRIANGLE);
  406. BIND_GLOBAL_ENUM_CONSTANT(JOY_XBOX_B);
  407. BIND_GLOBAL_ENUM_CONSTANT(JOY_XBOX_A);
  408. BIND_GLOBAL_ENUM_CONSTANT(JOY_XBOX_X);
  409. BIND_GLOBAL_ENUM_CONSTANT(JOY_XBOX_Y);
  410. BIND_GLOBAL_ENUM_CONSTANT(JOY_DS_A);
  411. BIND_GLOBAL_ENUM_CONSTANT(JOY_DS_B);
  412. BIND_GLOBAL_ENUM_CONSTANT(JOY_DS_X);
  413. BIND_GLOBAL_ENUM_CONSTANT(JOY_DS_Y);
  414. BIND_GLOBAL_ENUM_CONSTANT(JOY_VR_GRIP);
  415. BIND_GLOBAL_ENUM_CONSTANT(JOY_VR_PAD);
  416. BIND_GLOBAL_ENUM_CONSTANT(JOY_VR_TRIGGER);
  417. BIND_GLOBAL_ENUM_CONSTANT(JOY_OCULUS_AX);
  418. BIND_GLOBAL_ENUM_CONSTANT(JOY_OCULUS_BY);
  419. BIND_GLOBAL_ENUM_CONSTANT(JOY_OCULUS_MENU);
  420. BIND_GLOBAL_ENUM_CONSTANT(JOY_OPENVR_MENU);
  421. BIND_GLOBAL_ENUM_CONSTANT(JOY_SELECT);
  422. BIND_GLOBAL_ENUM_CONSTANT(JOY_START);
  423. BIND_GLOBAL_ENUM_CONSTANT(JOY_DPAD_UP);
  424. BIND_GLOBAL_ENUM_CONSTANT(JOY_DPAD_DOWN);
  425. BIND_GLOBAL_ENUM_CONSTANT(JOY_DPAD_LEFT);
  426. BIND_GLOBAL_ENUM_CONSTANT(JOY_DPAD_RIGHT);
  427. BIND_GLOBAL_ENUM_CONSTANT(JOY_GUIDE);
  428. BIND_GLOBAL_ENUM_CONSTANT(JOY_MISC1);
  429. BIND_GLOBAL_ENUM_CONSTANT(JOY_PADDLE1);
  430. BIND_GLOBAL_ENUM_CONSTANT(JOY_PADDLE2);
  431. BIND_GLOBAL_ENUM_CONSTANT(JOY_PADDLE3);
  432. BIND_GLOBAL_ENUM_CONSTANT(JOY_PADDLE4);
  433. BIND_GLOBAL_ENUM_CONSTANT(JOY_TOUCHPAD);
  434. BIND_GLOBAL_ENUM_CONSTANT(JOY_L);
  435. BIND_GLOBAL_ENUM_CONSTANT(JOY_L2);
  436. BIND_GLOBAL_ENUM_CONSTANT(JOY_L3);
  437. BIND_GLOBAL_ENUM_CONSTANT(JOY_R);
  438. BIND_GLOBAL_ENUM_CONSTANT(JOY_R2);
  439. BIND_GLOBAL_ENUM_CONSTANT(JOY_R3);
  440. BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_0);
  441. BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_1);
  442. BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_2);
  443. BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_3);
  444. BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_4);
  445. BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_5);
  446. BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_6);
  447. BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_7);
  448. BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_8);
  449. BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_9);
  450. BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_MAX);
  451. BIND_GLOBAL_ENUM_CONSTANT(JOY_ANALOG_LX);
  452. BIND_GLOBAL_ENUM_CONSTANT(JOY_ANALOG_LY);
  453. BIND_GLOBAL_ENUM_CONSTANT(JOY_ANALOG_RX);
  454. BIND_GLOBAL_ENUM_CONSTANT(JOY_ANALOG_RY);
  455. BIND_GLOBAL_ENUM_CONSTANT(JOY_ANALOG_L2);
  456. BIND_GLOBAL_ENUM_CONSTANT(JOY_ANALOG_R2);
  457. BIND_GLOBAL_ENUM_CONSTANT(JOY_VR_ANALOG_TRIGGER);
  458. BIND_GLOBAL_ENUM_CONSTANT(JOY_VR_ANALOG_GRIP);
  459. BIND_GLOBAL_ENUM_CONSTANT(JOY_OPENVR_TOUCHPADX);
  460. BIND_GLOBAL_ENUM_CONSTANT(JOY_OPENVR_TOUCHPADY);
  461. // midi
  462. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_NOTE_OFF);
  463. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_NOTE_ON);
  464. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_AFTERTOUCH);
  465. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_CONTROL_CHANGE);
  466. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_PROGRAM_CHANGE);
  467. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_CHANNEL_PRESSURE);
  468. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_PITCH_BEND);
  469. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_SYSTEM_EXCLUSIVE);
  470. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_QUARTER_FRAME);
  471. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_SONG_POSITION_POINTER);
  472. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_SONG_SELECT);
  473. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_TUNE_REQUEST);
  474. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_TIMING_CLOCK);
  475. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_START);
  476. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_CONTINUE);
  477. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_STOP);
  478. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_ACTIVE_SENSING);
  479. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_SYSTEM_RESET);
  480. // error list
  481. BIND_GLOBAL_ENUM_CONSTANT(OK); // (0)
  482. BIND_GLOBAL_ENUM_CONSTANT(FAILED);
  483. BIND_GLOBAL_ENUM_CONSTANT(ERR_UNAVAILABLE);
  484. BIND_GLOBAL_ENUM_CONSTANT(ERR_UNCONFIGURED);
  485. BIND_GLOBAL_ENUM_CONSTANT(ERR_UNAUTHORIZED);
  486. BIND_GLOBAL_ENUM_CONSTANT(ERR_PARAMETER_RANGE_ERROR); // (5)
  487. BIND_GLOBAL_ENUM_CONSTANT(ERR_OUT_OF_MEMORY);
  488. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_NOT_FOUND);
  489. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_BAD_DRIVE);
  490. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_BAD_PATH);
  491. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_NO_PERMISSION); // (10)
  492. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_ALREADY_IN_USE);
  493. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_CANT_OPEN);
  494. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_CANT_WRITE);
  495. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_CANT_READ);
  496. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_UNRECOGNIZED); // (15)
  497. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_CORRUPT);
  498. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_MISSING_DEPENDENCIES);
  499. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_EOF);
  500. BIND_GLOBAL_ENUM_CONSTANT(ERR_CANT_OPEN);
  501. BIND_GLOBAL_ENUM_CONSTANT(ERR_CANT_CREATE); // (20)
  502. BIND_GLOBAL_ENUM_CONSTANT(ERR_QUERY_FAILED);
  503. BIND_GLOBAL_ENUM_CONSTANT(ERR_ALREADY_IN_USE);
  504. BIND_GLOBAL_ENUM_CONSTANT(ERR_LOCKED);
  505. BIND_GLOBAL_ENUM_CONSTANT(ERR_TIMEOUT);
  506. BIND_GLOBAL_ENUM_CONSTANT(ERR_CANT_CONNECT); // (25)
  507. BIND_GLOBAL_ENUM_CONSTANT(ERR_CANT_RESOLVE);
  508. BIND_GLOBAL_ENUM_CONSTANT(ERR_CONNECTION_ERROR);
  509. BIND_GLOBAL_ENUM_CONSTANT(ERR_CANT_ACQUIRE_RESOURCE);
  510. BIND_GLOBAL_ENUM_CONSTANT(ERR_CANT_FORK);
  511. BIND_GLOBAL_ENUM_CONSTANT(ERR_INVALID_DATA); // (30)
  512. BIND_GLOBAL_ENUM_CONSTANT(ERR_INVALID_PARAMETER);
  513. BIND_GLOBAL_ENUM_CONSTANT(ERR_ALREADY_EXISTS);
  514. BIND_GLOBAL_ENUM_CONSTANT(ERR_DOES_NOT_EXIST);
  515. BIND_GLOBAL_ENUM_CONSTANT(ERR_DATABASE_CANT_READ);
  516. BIND_GLOBAL_ENUM_CONSTANT(ERR_DATABASE_CANT_WRITE); // (35)
  517. BIND_GLOBAL_ENUM_CONSTANT(ERR_COMPILATION_FAILED);
  518. BIND_GLOBAL_ENUM_CONSTANT(ERR_METHOD_NOT_FOUND);
  519. BIND_GLOBAL_ENUM_CONSTANT(ERR_LINK_FAILED);
  520. BIND_GLOBAL_ENUM_CONSTANT(ERR_SCRIPT_FAILED);
  521. BIND_GLOBAL_ENUM_CONSTANT(ERR_CYCLIC_LINK); // (40)
  522. BIND_GLOBAL_ENUM_CONSTANT(ERR_INVALID_DECLARATION);
  523. BIND_GLOBAL_ENUM_CONSTANT(ERR_DUPLICATE_SYMBOL);
  524. BIND_GLOBAL_ENUM_CONSTANT(ERR_PARSE_ERROR);
  525. BIND_GLOBAL_ENUM_CONSTANT(ERR_BUSY);
  526. BIND_GLOBAL_ENUM_CONSTANT(ERR_SKIP); // (45)
  527. BIND_GLOBAL_ENUM_CONSTANT(ERR_HELP);
  528. BIND_GLOBAL_ENUM_CONSTANT(ERR_BUG);
  529. BIND_GLOBAL_ENUM_CONSTANT(ERR_PRINTER_ON_FIRE);
  530. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_NONE);
  531. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_RANGE);
  532. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_EXP_RANGE);
  533. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_ENUM);
  534. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_ENUM_SUGGESTION);
  535. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_EXP_EASING);
  536. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_LENGTH);
  537. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_KEY_ACCEL);
  538. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_FLAGS);
  539. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_LAYERS_2D_RENDER);
  540. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_LAYERS_2D_PHYSICS);
  541. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_LAYERS_2D_NAVIGATION);
  542. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_LAYERS_3D_RENDER);
  543. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_LAYERS_3D_PHYSICS);
  544. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_LAYERS_3D_NAVIGATION);
  545. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_FILE);
  546. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_DIR);
  547. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_GLOBAL_FILE);
  548. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_GLOBAL_DIR);
  549. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_RESOURCE_TYPE);
  550. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_MULTILINE_TEXT);
  551. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_PLACEHOLDER_TEXT);
  552. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_COLOR_NO_ALPHA);
  553. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_IMAGE_COMPRESS_LOSSY);
  554. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS);
  555. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_OBJECT_ID);
  556. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_TYPE_STRING);
  557. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE);
  558. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_METHOD_OF_VARIANT_TYPE);
  559. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_METHOD_OF_BASE_TYPE);
  560. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_METHOD_OF_INSTANCE);
  561. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_METHOD_OF_SCRIPT);
  562. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE);
  563. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_PROPERTY_OF_BASE_TYPE);
  564. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_PROPERTY_OF_INSTANCE);
  565. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_PROPERTY_OF_SCRIPT);
  566. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_OBJECT_TOO_BIG);
  567. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_NODE_PATH_VALID_TYPES);
  568. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_SAVE_FILE);
  569. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_MAX);
  570. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_STORAGE);
  571. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_EDITOR);
  572. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_NETWORK);
  573. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_EDITOR_HELPER);
  574. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_CHECKABLE);
  575. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_CHECKED);
  576. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_INTERNATIONALIZED);
  577. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_GROUP);
  578. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_CATEGORY);
  579. //deprecated, replaced by ClassDB function to check default value
  580. //BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_STORE_IF_NONZERO);
  581. //BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_STORE_IF_NONONE);
  582. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_NO_INSTANCE_STATE);
  583. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_RESTART_IF_CHANGED);
  584. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_SCRIPT_VARIABLE);
  585. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_DEFAULT);
  586. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_DEFAULT_INTL);
  587. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_NOEDITOR);
  588. BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAG_NORMAL);
  589. BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAG_EDITOR);
  590. BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAG_NOSCRIPT);
  591. BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAG_CONST);
  592. BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAG_REVERSE);
  593. BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAG_VIRTUAL);
  594. BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAG_FROM_SCRIPT);
  595. BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAG_VARARG);
  596. BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAGS_DEFAULT);
  597. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_NIL", Variant::NIL);
  598. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_BOOL", Variant::BOOL);
  599. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_INT", Variant::INT);
  600. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_REAL", Variant::REAL);
  601. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_STRING", Variant::STRING);
  602. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2", Variant::VECTOR2); // 5
  603. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_RECT2", Variant::RECT2);
  604. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR3", Variant::VECTOR3);
  605. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_TRANSFORM2D", Variant::TRANSFORM2D);
  606. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_PLANE", Variant::PLANE);
  607. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_QUAT", Variant::QUAT); // 10
  608. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_AABB", Variant::AABB);
  609. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_BASIS", Variant::BASIS);
  610. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_TRANSFORM", Variant::TRANSFORM);
  611. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_COLOR", Variant::COLOR);
  612. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_NODE_PATH", Variant::NODE_PATH); // 15
  613. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_RID", Variant::_RID);
  614. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_OBJECT", Variant::OBJECT);
  615. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_DICTIONARY", Variant::DICTIONARY); // 20
  616. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_ARRAY", Variant::ARRAY);
  617. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_RAW_ARRAY", Variant::POOL_BYTE_ARRAY);
  618. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_INT_ARRAY", Variant::POOL_INT_ARRAY);
  619. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_REAL_ARRAY", Variant::POOL_REAL_ARRAY);
  620. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_STRING_ARRAY", Variant::POOL_STRING_ARRAY);
  621. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2_ARRAY", Variant::POOL_VECTOR2_ARRAY); // 25
  622. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR3_ARRAY", Variant::POOL_VECTOR3_ARRAY);
  623. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_COLOR_ARRAY", Variant::POOL_COLOR_ARRAY);
  624. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_MAX", Variant::VARIANT_MAX);
  625. //comparison
  626. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_EQUAL", Variant::OP_EQUAL);
  627. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_NOT_EQUAL", Variant::OP_NOT_EQUAL);
  628. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_LESS", Variant::OP_LESS);
  629. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_LESS_EQUAL", Variant::OP_LESS_EQUAL);
  630. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_GREATER", Variant::OP_GREATER);
  631. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_GREATER_EQUAL", Variant::OP_GREATER_EQUAL);
  632. //mathematic
  633. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_ADD", Variant::OP_ADD);
  634. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_SUBTRACT", Variant::OP_SUBTRACT);
  635. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_MULTIPLY", Variant::OP_MULTIPLY);
  636. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_DIVIDE", Variant::OP_DIVIDE);
  637. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_NEGATE", Variant::OP_NEGATE);
  638. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_POSITIVE", Variant::OP_POSITIVE);
  639. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_MODULE", Variant::OP_MODULE);
  640. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_STRING_CONCAT", Variant::OP_STRING_CONCAT);
  641. //bitwise
  642. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_SHIFT_LEFT", Variant::OP_SHIFT_LEFT);
  643. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_SHIFT_RIGHT", Variant::OP_SHIFT_RIGHT);
  644. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_BIT_AND", Variant::OP_BIT_AND);
  645. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_BIT_OR", Variant::OP_BIT_OR);
  646. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_BIT_XOR", Variant::OP_BIT_XOR);
  647. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_BIT_NEGATE", Variant::OP_BIT_NEGATE);
  648. //logic
  649. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_AND", Variant::OP_AND);
  650. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_OR", Variant::OP_OR);
  651. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_XOR", Variant::OP_XOR);
  652. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_NOT", Variant::OP_NOT);
  653. //containment
  654. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_IN", Variant::OP_IN);
  655. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_MAX", Variant::OP_MAX);
  656. }
  657. void unregister_global_constants() {
  658. _global_constants.clear();
  659. }
  660. int GlobalConstants::get_global_constant_count() {
  661. return _global_constants.size();
  662. }
  663. #ifdef DEBUG_METHODS_ENABLED
  664. StringName GlobalConstants::get_global_constant_enum(int p_idx) {
  665. return _global_constants[p_idx].enum_name;
  666. }
  667. bool GlobalConstants::get_ignore_value_in_docs(int p_idx) {
  668. return _global_constants[p_idx].ignore_value_in_docs;
  669. }
  670. #else
  671. StringName GlobalConstants::get_global_constant_enum(int p_idx) {
  672. return StringName();
  673. }
  674. bool GlobalConstants::get_ignore_value_in_docs(int p_idx) {
  675. return false;
  676. }
  677. #endif
  678. const char *GlobalConstants::get_global_constant_name(int p_idx) {
  679. return _global_constants[p_idx].name;
  680. }
  681. int GlobalConstants::get_global_constant_value(int p_idx) {
  682. return _global_constants[p_idx].value;
  683. }