global_constants.cpp 28 KB

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