global_constants.cpp 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  1. /*************************************************************************/
  2. /* global_constants.cpp */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
  9. /* Copyright (c) 2014-2019 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_BUTTON_0);
  364. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_1);
  365. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_2);
  366. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_3);
  367. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_4);
  368. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_5);
  369. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_6);
  370. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_7);
  371. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_8);
  372. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_9);
  373. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_10);
  374. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_11);
  375. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_12);
  376. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_13);
  377. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_14);
  378. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_15);
  379. BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_MAX);
  380. BIND_GLOBAL_ENUM_CONSTANT(JOY_SONY_CIRCLE);
  381. BIND_GLOBAL_ENUM_CONSTANT(JOY_SONY_X);
  382. BIND_GLOBAL_ENUM_CONSTANT(JOY_SONY_SQUARE);
  383. BIND_GLOBAL_ENUM_CONSTANT(JOY_SONY_TRIANGLE);
  384. BIND_GLOBAL_ENUM_CONSTANT(JOY_XBOX_B);
  385. BIND_GLOBAL_ENUM_CONSTANT(JOY_XBOX_A);
  386. BIND_GLOBAL_ENUM_CONSTANT(JOY_XBOX_X);
  387. BIND_GLOBAL_ENUM_CONSTANT(JOY_XBOX_Y);
  388. BIND_GLOBAL_ENUM_CONSTANT(JOY_DS_A);
  389. BIND_GLOBAL_ENUM_CONSTANT(JOY_DS_B);
  390. BIND_GLOBAL_ENUM_CONSTANT(JOY_DS_X);
  391. BIND_GLOBAL_ENUM_CONSTANT(JOY_DS_Y);
  392. BIND_GLOBAL_ENUM_CONSTANT(JOY_SELECT);
  393. BIND_GLOBAL_ENUM_CONSTANT(JOY_START);
  394. BIND_GLOBAL_ENUM_CONSTANT(JOY_DPAD_UP);
  395. BIND_GLOBAL_ENUM_CONSTANT(JOY_DPAD_DOWN);
  396. BIND_GLOBAL_ENUM_CONSTANT(JOY_DPAD_LEFT);
  397. BIND_GLOBAL_ENUM_CONSTANT(JOY_DPAD_RIGHT);
  398. BIND_GLOBAL_ENUM_CONSTANT(JOY_L);
  399. BIND_GLOBAL_ENUM_CONSTANT(JOY_L2);
  400. BIND_GLOBAL_ENUM_CONSTANT(JOY_L3);
  401. BIND_GLOBAL_ENUM_CONSTANT(JOY_R);
  402. BIND_GLOBAL_ENUM_CONSTANT(JOY_R2);
  403. BIND_GLOBAL_ENUM_CONSTANT(JOY_R3);
  404. BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_0);
  405. BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_1);
  406. BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_2);
  407. BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_3);
  408. BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_4);
  409. BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_5);
  410. BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_6);
  411. BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_7);
  412. BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_8);
  413. BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_9);
  414. BIND_GLOBAL_ENUM_CONSTANT(JOY_AXIS_MAX);
  415. BIND_GLOBAL_ENUM_CONSTANT(JOY_ANALOG_LX);
  416. BIND_GLOBAL_ENUM_CONSTANT(JOY_ANALOG_LY);
  417. BIND_GLOBAL_ENUM_CONSTANT(JOY_ANALOG_RX);
  418. BIND_GLOBAL_ENUM_CONSTANT(JOY_ANALOG_RY);
  419. BIND_GLOBAL_ENUM_CONSTANT(JOY_ANALOG_L2);
  420. BIND_GLOBAL_ENUM_CONSTANT(JOY_ANALOG_R2);
  421. // midi
  422. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_NOTE_OFF);
  423. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_NOTE_ON);
  424. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_AFTERTOUCH);
  425. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_CONTROL_CHANGE);
  426. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_PROGRAM_CHANGE);
  427. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_CHANNEL_PRESSURE);
  428. BIND_GLOBAL_ENUM_CONSTANT(MIDI_MESSAGE_PITCH_BEND);
  429. // error list
  430. BIND_GLOBAL_ENUM_CONSTANT(OK);
  431. BIND_GLOBAL_ENUM_CONSTANT(FAILED); ///< Generic fail error
  432. BIND_GLOBAL_ENUM_CONSTANT(ERR_UNAVAILABLE); ///< What is requested is unsupported/unavailable
  433. BIND_GLOBAL_ENUM_CONSTANT(ERR_UNCONFIGURED); ///< The object being used hasn't been properly set up yet
  434. BIND_GLOBAL_ENUM_CONSTANT(ERR_UNAUTHORIZED); ///< Missing credentials for requested resource
  435. BIND_GLOBAL_ENUM_CONSTANT(ERR_PARAMETER_RANGE_ERROR); ///< Parameter given out of range
  436. BIND_GLOBAL_ENUM_CONSTANT(ERR_OUT_OF_MEMORY); ///< Out of memory
  437. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_NOT_FOUND);
  438. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_BAD_DRIVE);
  439. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_BAD_PATH);
  440. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_NO_PERMISSION);
  441. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_ALREADY_IN_USE);
  442. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_CANT_OPEN);
  443. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_CANT_WRITE);
  444. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_CANT_READ);
  445. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_UNRECOGNIZED);
  446. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_CORRUPT);
  447. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_MISSING_DEPENDENCIES);
  448. BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_EOF);
  449. BIND_GLOBAL_ENUM_CONSTANT(ERR_CANT_OPEN); ///< Can't open a resource/socket/file
  450. BIND_GLOBAL_ENUM_CONSTANT(ERR_CANT_CREATE);
  451. BIND_GLOBAL_ENUM_CONSTANT(ERR_PARSE_ERROR);
  452. BIND_GLOBAL_ENUM_CONSTANT(ERR_QUERY_FAILED);
  453. BIND_GLOBAL_ENUM_CONSTANT(ERR_ALREADY_IN_USE);
  454. BIND_GLOBAL_ENUM_CONSTANT(ERR_LOCKED); ///< resource is locked
  455. BIND_GLOBAL_ENUM_CONSTANT(ERR_TIMEOUT);
  456. BIND_GLOBAL_ENUM_CONSTANT(ERR_CANT_ACQUIRE_RESOURCE);
  457. BIND_GLOBAL_ENUM_CONSTANT(ERR_INVALID_DATA); ///< Data passed is invalid
  458. BIND_GLOBAL_ENUM_CONSTANT(ERR_INVALID_PARAMETER); ///< Parameter passed is invalid
  459. BIND_GLOBAL_ENUM_CONSTANT(ERR_ALREADY_EXISTS); ///< When adding ), item already exists
  460. BIND_GLOBAL_ENUM_CONSTANT(ERR_DOES_NOT_EXIST); ///< When retrieving/erasing ), it item does not exist
  461. BIND_GLOBAL_ENUM_CONSTANT(ERR_DATABASE_CANT_READ); ///< database is full
  462. BIND_GLOBAL_ENUM_CONSTANT(ERR_DATABASE_CANT_WRITE); ///< database is full
  463. BIND_GLOBAL_ENUM_CONSTANT(ERR_COMPILATION_FAILED);
  464. BIND_GLOBAL_ENUM_CONSTANT(ERR_METHOD_NOT_FOUND);
  465. BIND_GLOBAL_ENUM_CONSTANT(ERR_LINK_FAILED);
  466. BIND_GLOBAL_ENUM_CONSTANT(ERR_SCRIPT_FAILED);
  467. BIND_GLOBAL_ENUM_CONSTANT(ERR_CYCLIC_LINK);
  468. BIND_GLOBAL_ENUM_CONSTANT(ERR_BUSY);
  469. BIND_GLOBAL_ENUM_CONSTANT(ERR_HELP); ///< user requested help!!
  470. BIND_GLOBAL_ENUM_CONSTANT(ERR_BUG); ///< a bug in the software certainly happened ), due to a double check failing or unexpected behavior.
  471. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_NONE);
  472. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_RANGE);
  473. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_EXP_RANGE);
  474. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_ENUM);
  475. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_EXP_EASING);
  476. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_LENGTH);
  477. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_KEY_ACCEL);
  478. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_FLAGS);
  479. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_LAYERS_2D_RENDER);
  480. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_LAYERS_2D_PHYSICS);
  481. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_LAYERS_3D_RENDER);
  482. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_LAYERS_3D_PHYSICS);
  483. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_FILE);
  484. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_DIR);
  485. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_GLOBAL_FILE);
  486. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_GLOBAL_DIR);
  487. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_RESOURCE_TYPE);
  488. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_MULTILINE_TEXT);
  489. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_PLACEHOLDER_TEXT);
  490. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_COLOR_NO_ALPHA);
  491. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_IMAGE_COMPRESS_LOSSY);
  492. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS);
  493. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_STORAGE);
  494. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_EDITOR);
  495. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_NETWORK);
  496. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_EDITOR_HELPER);
  497. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_CHECKABLE);
  498. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_CHECKED);
  499. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_INTERNATIONALIZED);
  500. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_GROUP);
  501. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_CATEGORY);
  502. //deprecated, replaced by ClassDB function to check default value
  503. //BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_STORE_IF_NONZERO);
  504. //BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_STORE_IF_NONONE);
  505. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_NO_INSTANCE_STATE);
  506. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_RESTART_IF_CHANGED);
  507. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_SCRIPT_VARIABLE);
  508. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_DEFAULT);
  509. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_DEFAULT_INTL);
  510. BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_NOEDITOR);
  511. BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAG_NORMAL);
  512. BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAG_EDITOR);
  513. BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAG_NOSCRIPT);
  514. BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAG_CONST);
  515. BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAG_REVERSE);
  516. BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAG_VIRTUAL);
  517. BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAG_FROM_SCRIPT);
  518. BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAGS_DEFAULT);
  519. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_NIL", Variant::NIL);
  520. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_BOOL", Variant::BOOL);
  521. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_INT", Variant::INT);
  522. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_REAL", Variant::REAL);
  523. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_STRING", Variant::STRING);
  524. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2", Variant::VECTOR2); // 5
  525. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_RECT2", Variant::RECT2);
  526. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR3", Variant::VECTOR3);
  527. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_TRANSFORM2D", Variant::TRANSFORM2D);
  528. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_PLANE", Variant::PLANE);
  529. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_QUAT", Variant::QUAT); // 10
  530. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_AABB", Variant::AABB);
  531. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_BASIS", Variant::BASIS);
  532. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_TRANSFORM", Variant::TRANSFORM);
  533. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_COLOR", Variant::COLOR);
  534. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_NODE_PATH", Variant::NODE_PATH); // 15
  535. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_RID", Variant::_RID);
  536. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_OBJECT", Variant::OBJECT);
  537. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_DICTIONARY", Variant::DICTIONARY); // 20
  538. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_ARRAY", Variant::ARRAY);
  539. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_RAW_ARRAY", Variant::POOL_BYTE_ARRAY);
  540. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_INT_ARRAY", Variant::POOL_INT_ARRAY);
  541. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_REAL_ARRAY", Variant::POOL_REAL_ARRAY);
  542. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_STRING_ARRAY", Variant::POOL_STRING_ARRAY);
  543. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2_ARRAY", Variant::POOL_VECTOR2_ARRAY); // 25
  544. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR3_ARRAY", Variant::POOL_VECTOR3_ARRAY);
  545. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_COLOR_ARRAY", Variant::POOL_COLOR_ARRAY);
  546. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_MAX", Variant::VARIANT_MAX);
  547. //comparison
  548. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_EQUAL", Variant::OP_EQUAL);
  549. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_NOT_EQUAL", Variant::OP_NOT_EQUAL);
  550. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_LESS", Variant::OP_LESS);
  551. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_LESS_EQUAL", Variant::OP_LESS_EQUAL);
  552. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_GREATER", Variant::OP_GREATER);
  553. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_GREATER_EQUAL", Variant::OP_GREATER_EQUAL);
  554. //mathematic
  555. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_ADD", Variant::OP_ADD);
  556. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_SUBTRACT", Variant::OP_SUBTRACT);
  557. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_MULTIPLY", Variant::OP_MULTIPLY);
  558. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_DIVIDE", Variant::OP_DIVIDE);
  559. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_NEGATE", Variant::OP_NEGATE);
  560. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_POSITIVE", Variant::OP_POSITIVE);
  561. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_MODULE", Variant::OP_MODULE);
  562. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_STRING_CONCAT", Variant::OP_STRING_CONCAT);
  563. //bitwise
  564. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_SHIFT_LEFT", Variant::OP_SHIFT_LEFT);
  565. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_SHIFT_RIGHT", Variant::OP_SHIFT_RIGHT);
  566. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_BIT_AND", Variant::OP_BIT_AND);
  567. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_BIT_OR", Variant::OP_BIT_OR);
  568. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_BIT_XOR", Variant::OP_BIT_XOR);
  569. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_BIT_NEGATE", Variant::OP_BIT_NEGATE);
  570. //logic
  571. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_AND", Variant::OP_AND);
  572. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_OR", Variant::OP_OR);
  573. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_XOR", Variant::OP_XOR);
  574. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_NOT", Variant::OP_NOT);
  575. //containment
  576. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_IN", Variant::OP_IN);
  577. BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("OP_MAX", Variant::OP_MAX);
  578. }
  579. void unregister_global_constants() {
  580. _global_constants.clear();
  581. }
  582. int GlobalConstants::get_global_constant_count() {
  583. return _global_constants.size();
  584. }
  585. #ifdef DEBUG_METHODS_ENABLED
  586. StringName GlobalConstants::get_global_constant_enum(int p_idx) {
  587. return _global_constants[p_idx].enum_name;
  588. }
  589. #else
  590. StringName GlobalConstants::get_global_constant_enum(int p_idx) {
  591. return StringName();
  592. }
  593. #endif
  594. const char *GlobalConstants::get_global_constant_name(int p_idx) {
  595. return _global_constants[p_idx].name;
  596. }
  597. int GlobalConstants::get_global_constant_value(int p_idx) {
  598. return _global_constants[p_idx].value;
  599. }