core_constants.cpp 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860
  1. /**************************************************************************/
  2. /* core_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 "core_constants.h"
  31. #include "core/input/input_event.h"
  32. #include "core/object/class_db.h"
  33. #include "core/os/keyboard.h"
  34. #include "core/templates/hash_set.h"
  35. #include "core/variant/variant.h"
  36. struct _CoreConstant {
  37. #ifdef DEBUG_METHODS_ENABLED
  38. bool ignore_value_in_docs = false;
  39. bool is_bitfield = false;
  40. #endif
  41. StringName enum_name;
  42. const char *name = nullptr;
  43. int64_t value = 0;
  44. _CoreConstant() {}
  45. #ifdef DEBUG_METHODS_ENABLED
  46. _CoreConstant(const StringName &p_enum_name, const char *p_name, int64_t p_value, bool p_ignore_value_in_docs = false, bool p_is_bitfield = false) :
  47. ignore_value_in_docs(p_ignore_value_in_docs),
  48. is_bitfield(p_is_bitfield),
  49. enum_name(p_enum_name),
  50. name(p_name),
  51. value(p_value) {
  52. }
  53. #else
  54. _CoreConstant(const StringName &p_enum_name, const char *p_name, int64_t p_value) :
  55. enum_name(p_enum_name),
  56. name(p_name),
  57. value(p_value) {
  58. }
  59. #endif
  60. };
  61. static Vector<_CoreConstant> _global_constants;
  62. static HashMap<StringName, int> _global_constants_map;
  63. static HashMap<StringName, Vector<_CoreConstant>> _global_enums;
  64. #ifdef DEBUG_METHODS_ENABLED
  65. #define BIND_CORE_CONSTANT(m_constant) \
  66. _global_constants.push_back(_CoreConstant(StringName(), #m_constant, m_constant)); \
  67. _global_constants_map[#m_constant] = _global_constants.size() - 1;
  68. #define BIND_CORE_ENUM_CONSTANT(m_constant) \
  69. { \
  70. StringName enum_name = __constant_get_enum_name(m_constant, #m_constant); \
  71. _global_constants.push_back(_CoreConstant(enum_name, #m_constant, m_constant)); \
  72. _global_constants_map[#m_constant] = _global_constants.size() - 1; \
  73. _global_enums[enum_name].push_back((_global_constants.ptr())[_global_constants.size() - 1]); \
  74. }
  75. #define BIND_CORE_BITFIELD_FLAG(m_constant) \
  76. { \
  77. StringName enum_name = __constant_get_bitfield_name(m_constant, #m_constant); \
  78. _global_constants.push_back(_CoreConstant(enum_name, #m_constant, m_constant, false, true)); \
  79. _global_constants_map[#m_constant] = _global_constants.size() - 1; \
  80. _global_enums[enum_name].push_back((_global_constants.ptr())[_global_constants.size() - 1]); \
  81. }
  82. // This just binds enum classes as if they were regular enum constants.
  83. #define BIND_CORE_ENUM_CLASS_CONSTANT(m_enum, m_prefix, m_member) \
  84. { \
  85. StringName enum_name = __constant_get_enum_name(m_enum::m_member, #m_prefix "_" #m_member); \
  86. _global_constants.push_back(_CoreConstant(enum_name, #m_prefix "_" #m_member, (int64_t)m_enum::m_member)); \
  87. _global_constants_map[#m_prefix "_" #m_member] = _global_constants.size() - 1; \
  88. _global_enums[enum_name].push_back((_global_constants.ptr())[_global_constants.size() - 1]); \
  89. }
  90. #define BIND_CORE_BITFIELD_CLASS_FLAG(m_enum, m_prefix, m_member) \
  91. { \
  92. StringName enum_name = __constant_get_bitfield_name(m_enum::m_member, #m_prefix "_" #m_member); \
  93. _global_constants.push_back(_CoreConstant(enum_name, #m_prefix "_" #m_member, (int64_t)m_enum::m_member, false, true)); \
  94. _global_constants_map[#m_prefix "_" #m_member] = _global_constants.size() - 1; \
  95. _global_enums[enum_name].push_back((_global_constants.ptr())[_global_constants.size() - 1]); \
  96. }
  97. #define BIND_CORE_ENUM_CLASS_CONSTANT_CUSTOM(m_enum, m_name, m_member) \
  98. { \
  99. StringName enum_name = __constant_get_enum_name(m_enum::m_member, #m_name); \
  100. _global_constants.push_back(_CoreConstant(enum_name, #m_name, (int64_t)m_enum::m_member)); \
  101. _global_constants_map[#m_name] = _global_constants.size() - 1; \
  102. _global_enums[enum_name].push_back((_global_constants.ptr())[_global_constants.size() - 1]); \
  103. }
  104. #define BIND_CORE_BITFIELD_CLASS_FLAG_CUSTOM(m_enum, m_name, m_member) \
  105. { \
  106. StringName enum_name = __constant_get_bitfield_name(m_enum::m_member, #m_name); \
  107. _global_constants.push_back(_CoreConstant(enum_name, #m_name, (int64_t)m_enum::m_member, false, true)); \
  108. _global_constants_map[#m_name] = _global_constants.size() - 1; \
  109. _global_enums[enum_name].push_back((_global_constants.ptr())[_global_constants.size() - 1]); \
  110. }
  111. #define BIND_CORE_ENUM_CLASS_CONSTANT_NO_VAL(m_enum, m_prefix, m_member) \
  112. { \
  113. StringName enum_name = __constant_get_enum_name(m_enum::m_member, #m_prefix "_" #m_member); \
  114. _global_constants.push_back(_CoreConstant(enum_name, #m_prefix "_" #m_member, (int64_t)m_enum::m_member, true)); \
  115. _global_constants_map[#m_prefix "_" #m_member] = _global_constants.size() - 1; \
  116. _global_enums[enum_name].push_back((_global_constants.ptr())[_global_constants.size() - 1]); \
  117. }
  118. #define BIND_CORE_ENUM_CONSTANT_CUSTOM(m_custom_name, m_constant) \
  119. { \
  120. StringName enum_name = __constant_get_enum_name(m_constant, #m_constant); \
  121. _global_constants.push_back(_CoreConstant(enum_name, m_custom_name, m_constant)); \
  122. _global_constants_map[m_custom_name] = _global_constants.size() - 1; \
  123. _global_enums[enum_name].push_back((_global_constants.ptr())[_global_constants.size() - 1]); \
  124. }
  125. #define BIND_CORE_CONSTANT_NO_VAL(m_constant) \
  126. _global_constants.push_back(_CoreConstant(StringName(), #m_constant, m_constant, true)); \
  127. _global_constants_map[#m_constant] = _global_constants.size() - 1;
  128. #define BIND_CORE_ENUM_CONSTANT_NO_VAL(m_constant) \
  129. { \
  130. StringName enum_name = __constant_get_enum_name(m_constant, #m_constant); \
  131. _global_constants.push_back(_CoreConstant(enum_name, #m_constant, m_constant, true)); \
  132. _global_constants_map[#m_constant] = _global_constants.size() - 1; \
  133. _global_enums[enum_name].push_back((_global_constants.ptr())[_global_constants.size() - 1]); \
  134. }
  135. #define BIND_CORE_ENUM_CONSTANT_CUSTOM_NO_VAL(m_custom_name, m_constant) \
  136. { \
  137. StringName enum_name = __constant_get_enum_name(m_constant, #m_constant); \
  138. _global_constants.push_back(_CoreConstant(enum_name, m_custom_name, m_constant, true)); \
  139. _global_constants_map[m_custom_name] = _global_constants.size() - 1; \
  140. _global_enums[enum_name].push_back((_global_constants.ptr())[_global_constants.size() - 1]); \
  141. }
  142. #else
  143. #define BIND_CORE_CONSTANT(m_constant) \
  144. _global_constants.push_back(_CoreConstant(StringName(), #m_constant, m_constant)); \
  145. _global_constants_map[#m_constant] = _global_constants.size() - 1;
  146. #define BIND_CORE_ENUM_CONSTANT(m_constant) \
  147. { \
  148. StringName enum_name = __constant_get_enum_name(m_constant, #m_constant); \
  149. _global_constants.push_back(_CoreConstant(enum_name, #m_constant, m_constant)); \
  150. _global_constants_map[#m_constant] = _global_constants.size() - 1; \
  151. _global_enums[enum_name].push_back((_global_constants.ptr())[_global_constants.size() - 1]); \
  152. }
  153. #define BIND_CORE_BITFIELD_FLAG(m_constant) \
  154. { \
  155. StringName enum_name = __constant_get_bitfield_name(m_constant, #m_constant); \
  156. _global_constants.push_back(_CoreConstant(enum_name, #m_constant, m_constant)); \
  157. _global_constants_map[#m_constant] = _global_constants.size() - 1; \
  158. _global_enums[enum_name].push_back((_global_constants.ptr())[_global_constants.size() - 1]); \
  159. }
  160. // This just binds enum classes as if they were regular enum constants.
  161. #define BIND_CORE_ENUM_CLASS_CONSTANT(m_enum, m_prefix, m_member) \
  162. { \
  163. StringName enum_name = __constant_get_enum_name(m_enum::m_member, #m_prefix "_" #m_member); \
  164. _global_constants.push_back(_CoreConstant(enum_name, #m_prefix "_" #m_member, (int64_t)m_enum::m_member)); \
  165. _global_constants_map[#m_prefix "_" #m_member] = _global_constants.size() - 1; \
  166. _global_enums[enum_name].push_back((_global_constants.ptr())[_global_constants.size() - 1]); \
  167. }
  168. #define BIND_CORE_BITFIELD_CLASS_FLAG(m_enum, m_prefix, m_member) \
  169. { \
  170. StringName enum_name = __constant_get_bitfield_name(m_enum::m_member, #m_prefix "_" #m_member); \
  171. _global_constants.push_back(_CoreConstant(enum_name, #m_prefix "_" #m_member, (int64_t)m_enum::m_member)); \
  172. _global_constants_map[#m_prefix "_" #m_member] = _global_constants.size() - 1; \
  173. _global_enums[enum_name].push_back((_global_constants.ptr())[_global_constants.size() - 1]); \
  174. }
  175. #define BIND_CORE_ENUM_CLASS_CONSTANT_CUSTOM(m_enum, m_name, m_member) \
  176. { \
  177. StringName enum_name = __constant_get_enum_name(m_enum::m_member, #m_name); \
  178. _global_constants.push_back(_CoreConstant(enum_name, #m_name, (int64_t)m_enum::m_member)); \
  179. _global_constants_map[#m_name] = _global_constants.size() - 1; \
  180. _global_enums[enum_name].push_back((_global_constants.ptr())[_global_constants.size() - 1]); \
  181. }
  182. #define BIND_CORE_BITFIELD_CLASS_FLAG_CUSTOM(m_enum, m_name, m_member) \
  183. { \
  184. StringName enum_name = __constant_get_bitfield_name(m_enum::m_member, #m_name); \
  185. _global_constants.push_back(_CoreConstant(enum_name, #m_name, (int64_t)m_enum::m_member)); \
  186. _global_constants_map[#m_name] = _global_constants.size() - 1; \
  187. _global_enums[enum_name].push_back((_global_constants.ptr())[_global_constants.size() - 1]); \
  188. }
  189. #define BIND_CORE_ENUM_CLASS_CONSTANT_NO_VAL(m_enum, m_prefix, m_member) \
  190. { \
  191. StringName enum_name = __constant_get_enum_name(m_enum::m_member, #m_prefix "_" #m_member); \
  192. _global_constants.push_back(_CoreConstant(enum_name, #m_prefix "_" #m_member, (int64_t)m_enum::m_member)); \
  193. _global_constants_map[#m_prefix "_" #m_member] = _global_constants.size() - 1; \
  194. _global_enums[enum_name].push_back((_global_constants.ptr())[_global_constants.size() - 1]); \
  195. }
  196. #define BIND_CORE_ENUM_CONSTANT_CUSTOM(m_custom_name, m_constant) \
  197. { \
  198. StringName enum_name = __constant_get_enum_name(m_constant, #m_constant); \
  199. _global_constants.push_back(_CoreConstant(enum_name, m_custom_name, m_constant)); \
  200. _global_constants_map[m_custom_name] = _global_constants.size() - 1; \
  201. _global_enums[enum_name].push_back((_global_constants.ptr())[_global_constants.size() - 1]); \
  202. }
  203. #define BIND_CORE_CONSTANT_NO_VAL(m_constant) \
  204. _global_constants.push_back(_CoreConstant(StringName(), #m_constant, m_constant)); \
  205. _global_constants_map[#m_constant] = _global_constants.size() - 1;
  206. #define BIND_CORE_ENUM_CONSTANT_NO_VAL(m_constant) \
  207. { \
  208. StringName enum_name = __constant_get_enum_name(m_constant, #m_constant); \
  209. _global_constants.push_back(_CoreConstant(enum_name, #m_constant, m_constant)); \
  210. _global_constants_map[#m_constant] = _global_constants.size() - 1; \
  211. _global_enums[enum_name].push_back((_global_constants.ptr())[_global_constants.size() - 1]); \
  212. }
  213. #define BIND_CORE_ENUM_CONSTANT_CUSTOM_NO_VAL(m_custom_name, m_constant) \
  214. { \
  215. StringName enum_name = __constant_get_enum_name(m_constant, #m_constant); \
  216. _global_constants.push_back(_CoreConstant(enum_name, m_custom_name, m_constant)); \
  217. _global_constants_map[m_custom_name] = _global_constants.size() - 1; \
  218. _global_enums[enum_name].push_back((_global_constants.ptr())[_global_constants.size() - 1]); \
  219. }
  220. #endif
  221. void register_global_constants() {
  222. BIND_CORE_ENUM_CONSTANT(SIDE_LEFT);
  223. BIND_CORE_ENUM_CONSTANT(SIDE_TOP);
  224. BIND_CORE_ENUM_CONSTANT(SIDE_RIGHT);
  225. BIND_CORE_ENUM_CONSTANT(SIDE_BOTTOM);
  226. BIND_CORE_ENUM_CONSTANT(CORNER_TOP_LEFT);
  227. BIND_CORE_ENUM_CONSTANT(CORNER_TOP_RIGHT);
  228. BIND_CORE_ENUM_CONSTANT(CORNER_BOTTOM_RIGHT);
  229. BIND_CORE_ENUM_CONSTANT(CORNER_BOTTOM_LEFT);
  230. BIND_CORE_ENUM_CONSTANT(VERTICAL);
  231. BIND_CORE_ENUM_CONSTANT(HORIZONTAL);
  232. BIND_CORE_ENUM_CONSTANT(CLOCKWISE);
  233. BIND_CORE_ENUM_CONSTANT(COUNTERCLOCKWISE);
  234. BIND_CORE_ENUM_CONSTANT(HORIZONTAL_ALIGNMENT_LEFT);
  235. BIND_CORE_ENUM_CONSTANT(HORIZONTAL_ALIGNMENT_CENTER);
  236. BIND_CORE_ENUM_CONSTANT(HORIZONTAL_ALIGNMENT_RIGHT);
  237. BIND_CORE_ENUM_CONSTANT(HORIZONTAL_ALIGNMENT_FILL);
  238. BIND_CORE_ENUM_CONSTANT(VERTICAL_ALIGNMENT_TOP);
  239. BIND_CORE_ENUM_CONSTANT(VERTICAL_ALIGNMENT_CENTER);
  240. BIND_CORE_ENUM_CONSTANT(VERTICAL_ALIGNMENT_BOTTOM);
  241. BIND_CORE_ENUM_CONSTANT(VERTICAL_ALIGNMENT_FILL);
  242. BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_TOP_TO);
  243. BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_CENTER_TO);
  244. BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_BASELINE_TO);
  245. BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_BOTTOM_TO);
  246. BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_TO_TOP);
  247. BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_TO_CENTER);
  248. BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_TO_BASELINE);
  249. BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_TO_BOTTOM);
  250. BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_TOP);
  251. BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_CENTER);
  252. BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_BOTTOM);
  253. BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_IMAGE_MASK);
  254. BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_TEXT_MASK);
  255. BIND_CORE_ENUM_CLASS_CONSTANT(EulerOrder, EULER_ORDER, XYZ);
  256. BIND_CORE_ENUM_CLASS_CONSTANT(EulerOrder, EULER_ORDER, XZY);
  257. BIND_CORE_ENUM_CLASS_CONSTANT(EulerOrder, EULER_ORDER, YXZ);
  258. BIND_CORE_ENUM_CLASS_CONSTANT(EulerOrder, EULER_ORDER, YZX);
  259. BIND_CORE_ENUM_CLASS_CONSTANT(EulerOrder, EULER_ORDER, ZXY);
  260. BIND_CORE_ENUM_CLASS_CONSTANT(EulerOrder, EULER_ORDER, ZYX);
  261. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, NONE);
  262. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, SPECIAL);
  263. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, ESCAPE);
  264. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, TAB);
  265. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, BACKTAB);
  266. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, BACKSPACE);
  267. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, ENTER);
  268. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, KP_ENTER);
  269. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, INSERT);
  270. BIND_CORE_ENUM_CLASS_CONSTANT_CUSTOM(Key, KEY_DELETE, KEY_DELETE);
  271. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, PAUSE);
  272. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, PRINT);
  273. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, SYSREQ);
  274. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, CLEAR);
  275. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, HOME);
  276. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, END);
  277. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, LEFT);
  278. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, UP);
  279. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, RIGHT);
  280. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, DOWN);
  281. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, PAGEUP);
  282. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, PAGEDOWN);
  283. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, SHIFT);
  284. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, CTRL);
  285. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, META);
  286. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, ALT);
  287. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, CAPSLOCK);
  288. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, NUMLOCK);
  289. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, SCROLLLOCK);
  290. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F1);
  291. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F2);
  292. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F3);
  293. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F4);
  294. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F5);
  295. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F6);
  296. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F7);
  297. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F8);
  298. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F9);
  299. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F10);
  300. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F11);
  301. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F12);
  302. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F13);
  303. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F14);
  304. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F15);
  305. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F16);
  306. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F17);
  307. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F18);
  308. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F19);
  309. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F20);
  310. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F21);
  311. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F22);
  312. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F23);
  313. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F24);
  314. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F25);
  315. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F26);
  316. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F27);
  317. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F28);
  318. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F29);
  319. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F30);
  320. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F31);
  321. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F32);
  322. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F33);
  323. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F34);
  324. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F35);
  325. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, KP_MULTIPLY);
  326. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, KP_DIVIDE);
  327. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, KP_SUBTRACT);
  328. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, KP_PERIOD);
  329. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, KP_ADD);
  330. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, KP_0);
  331. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, KP_1);
  332. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, KP_2);
  333. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, KP_3);
  334. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, KP_4);
  335. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, KP_5);
  336. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, KP_6);
  337. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, KP_7);
  338. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, KP_8);
  339. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, KP_9);
  340. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, MENU);
  341. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, HYPER);
  342. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, HELP);
  343. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, BACK);
  344. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, FORWARD);
  345. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, STOP);
  346. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, REFRESH);
  347. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, VOLUMEDOWN);
  348. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, VOLUMEMUTE);
  349. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, VOLUMEUP);
  350. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, MEDIAPLAY);
  351. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, MEDIASTOP);
  352. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, MEDIAPREVIOUS);
  353. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, MEDIANEXT);
  354. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, MEDIARECORD);
  355. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, HOMEPAGE);
  356. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, FAVORITES);
  357. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, SEARCH);
  358. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, STANDBY);
  359. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, OPENURL);
  360. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, LAUNCHMAIL);
  361. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, LAUNCHMEDIA);
  362. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, LAUNCH0);
  363. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, LAUNCH1);
  364. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, LAUNCH2);
  365. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, LAUNCH3);
  366. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, LAUNCH4);
  367. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, LAUNCH5);
  368. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, LAUNCH6);
  369. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, LAUNCH7);
  370. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, LAUNCH8);
  371. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, LAUNCH9);
  372. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, LAUNCHA);
  373. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, LAUNCHB);
  374. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, LAUNCHC);
  375. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, LAUNCHD);
  376. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, LAUNCHE);
  377. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, LAUNCHF);
  378. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, GLOBE);
  379. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, KEYBOARD);
  380. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, JIS_EISU);
  381. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, JIS_KANA);
  382. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, UNKNOWN);
  383. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, SPACE);
  384. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, EXCLAM);
  385. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, QUOTEDBL);
  386. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, NUMBERSIGN);
  387. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, DOLLAR);
  388. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, PERCENT);
  389. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, AMPERSAND);
  390. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, APOSTROPHE);
  391. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, PARENLEFT);
  392. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, PARENRIGHT);
  393. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, ASTERISK);
  394. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, PLUS);
  395. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, COMMA);
  396. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, MINUS);
  397. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, PERIOD);
  398. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, SLASH);
  399. BIND_CORE_ENUM_CLASS_CONSTANT_CUSTOM(Key, KEY_0, KEY_0);
  400. BIND_CORE_ENUM_CLASS_CONSTANT_CUSTOM(Key, KEY_1, KEY_1);
  401. BIND_CORE_ENUM_CLASS_CONSTANT_CUSTOM(Key, KEY_2, KEY_2);
  402. BIND_CORE_ENUM_CLASS_CONSTANT_CUSTOM(Key, KEY_3, KEY_3);
  403. BIND_CORE_ENUM_CLASS_CONSTANT_CUSTOM(Key, KEY_4, KEY_4);
  404. BIND_CORE_ENUM_CLASS_CONSTANT_CUSTOM(Key, KEY_5, KEY_5);
  405. BIND_CORE_ENUM_CLASS_CONSTANT_CUSTOM(Key, KEY_6, KEY_6);
  406. BIND_CORE_ENUM_CLASS_CONSTANT_CUSTOM(Key, KEY_7, KEY_7);
  407. BIND_CORE_ENUM_CLASS_CONSTANT_CUSTOM(Key, KEY_8, KEY_8);
  408. BIND_CORE_ENUM_CLASS_CONSTANT_CUSTOM(Key, KEY_9, KEY_9);
  409. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, COLON);
  410. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, SEMICOLON);
  411. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, LESS);
  412. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, EQUAL);
  413. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, GREATER);
  414. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, QUESTION);
  415. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, AT);
  416. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, A);
  417. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, B);
  418. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, C);
  419. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, D);
  420. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, E);
  421. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F);
  422. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, G);
  423. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, H);
  424. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, I);
  425. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, J);
  426. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, K);
  427. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, L);
  428. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, M);
  429. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, N);
  430. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, O);
  431. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, P);
  432. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, Q);
  433. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, R);
  434. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, S);
  435. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, T);
  436. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, U);
  437. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, V);
  438. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, W);
  439. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, X);
  440. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, Y);
  441. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, Z);
  442. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, BRACKETLEFT);
  443. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, BACKSLASH);
  444. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, BRACKETRIGHT);
  445. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, ASCIICIRCUM);
  446. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, UNDERSCORE);
  447. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, QUOTELEFT);
  448. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, BRACELEFT);
  449. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, BAR);
  450. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, BRACERIGHT);
  451. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, ASCIITILDE);
  452. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, YEN);
  453. BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, SECTION);
  454. BIND_CORE_BITFIELD_CLASS_FLAG_CUSTOM(KeyModifierMask, KEY_CODE_MASK, CODE_MASK);
  455. BIND_CORE_BITFIELD_CLASS_FLAG_CUSTOM(KeyModifierMask, KEY_MODIFIER_MASK, MODIFIER_MASK);
  456. BIND_CORE_BITFIELD_CLASS_FLAG(KeyModifierMask, KEY_MASK, CMD_OR_CTRL);
  457. BIND_CORE_BITFIELD_CLASS_FLAG(KeyModifierMask, KEY_MASK, SHIFT);
  458. BIND_CORE_BITFIELD_CLASS_FLAG(KeyModifierMask, KEY_MASK, ALT);
  459. BIND_CORE_BITFIELD_CLASS_FLAG(KeyModifierMask, KEY_MASK, META);
  460. BIND_CORE_BITFIELD_CLASS_FLAG(KeyModifierMask, KEY_MASK, CTRL);
  461. BIND_CORE_BITFIELD_CLASS_FLAG(KeyModifierMask, KEY_MASK, KPAD);
  462. BIND_CORE_BITFIELD_CLASS_FLAG(KeyModifierMask, KEY_MASK, GROUP_SWITCH);
  463. BIND_CORE_ENUM_CLASS_CONSTANT(KeyLocation, KEY_LOCATION, UNSPECIFIED);
  464. BIND_CORE_ENUM_CLASS_CONSTANT(KeyLocation, KEY_LOCATION, LEFT);
  465. BIND_CORE_ENUM_CLASS_CONSTANT(KeyLocation, KEY_LOCATION, RIGHT);
  466. BIND_CORE_ENUM_CLASS_CONSTANT(MouseButton, MOUSE_BUTTON, NONE);
  467. BIND_CORE_ENUM_CLASS_CONSTANT(MouseButton, MOUSE_BUTTON, LEFT);
  468. BIND_CORE_ENUM_CLASS_CONSTANT(MouseButton, MOUSE_BUTTON, RIGHT);
  469. BIND_CORE_ENUM_CLASS_CONSTANT(MouseButton, MOUSE_BUTTON, MIDDLE);
  470. BIND_CORE_ENUM_CLASS_CONSTANT(MouseButton, MOUSE_BUTTON, WHEEL_UP);
  471. BIND_CORE_ENUM_CLASS_CONSTANT(MouseButton, MOUSE_BUTTON, WHEEL_DOWN);
  472. BIND_CORE_ENUM_CLASS_CONSTANT(MouseButton, MOUSE_BUTTON, WHEEL_LEFT);
  473. BIND_CORE_ENUM_CLASS_CONSTANT(MouseButton, MOUSE_BUTTON, WHEEL_RIGHT);
  474. BIND_CORE_ENUM_CLASS_CONSTANT_CUSTOM(MouseButton, MOUSE_BUTTON_XBUTTON1, MB_XBUTTON1);
  475. BIND_CORE_ENUM_CLASS_CONSTANT_CUSTOM(MouseButton, MOUSE_BUTTON_XBUTTON2, MB_XBUTTON2);
  476. BIND_CORE_BITFIELD_CLASS_FLAG(MouseButtonMask, MOUSE_BUTTON_MASK, LEFT);
  477. BIND_CORE_BITFIELD_CLASS_FLAG(MouseButtonMask, MOUSE_BUTTON_MASK, RIGHT);
  478. BIND_CORE_BITFIELD_CLASS_FLAG(MouseButtonMask, MOUSE_BUTTON_MASK, MIDDLE);
  479. BIND_CORE_BITFIELD_CLASS_FLAG(MouseButtonMask, MOUSE_BUTTON_MASK, MB_XBUTTON1);
  480. BIND_CORE_BITFIELD_CLASS_FLAG(MouseButtonMask, MOUSE_BUTTON_MASK, MB_XBUTTON2);
  481. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, INVALID);
  482. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, A);
  483. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, B);
  484. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, X);
  485. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, Y);
  486. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, BACK);
  487. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, GUIDE);
  488. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, START);
  489. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, LEFT_STICK);
  490. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, RIGHT_STICK);
  491. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, LEFT_SHOULDER);
  492. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, RIGHT_SHOULDER);
  493. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, DPAD_UP);
  494. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, DPAD_DOWN);
  495. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, DPAD_LEFT);
  496. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, DPAD_RIGHT);
  497. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, MISC1);
  498. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, PADDLE1);
  499. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, PADDLE2);
  500. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, PADDLE3);
  501. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, PADDLE4);
  502. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, TOUCHPAD);
  503. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, SDL_MAX);
  504. BIND_CORE_ENUM_CLASS_CONSTANT(JoyButton, JOY_BUTTON, MAX);
  505. BIND_CORE_ENUM_CLASS_CONSTANT(JoyAxis, JOY_AXIS, INVALID);
  506. BIND_CORE_ENUM_CLASS_CONSTANT(JoyAxis, JOY_AXIS, LEFT_X);
  507. BIND_CORE_ENUM_CLASS_CONSTANT(JoyAxis, JOY_AXIS, LEFT_Y);
  508. BIND_CORE_ENUM_CLASS_CONSTANT(JoyAxis, JOY_AXIS, RIGHT_X);
  509. BIND_CORE_ENUM_CLASS_CONSTANT(JoyAxis, JOY_AXIS, RIGHT_Y);
  510. BIND_CORE_ENUM_CLASS_CONSTANT(JoyAxis, JOY_AXIS, TRIGGER_LEFT);
  511. BIND_CORE_ENUM_CLASS_CONSTANT(JoyAxis, JOY_AXIS, TRIGGER_RIGHT);
  512. BIND_CORE_ENUM_CLASS_CONSTANT(JoyAxis, JOY_AXIS, SDL_MAX);
  513. BIND_CORE_ENUM_CLASS_CONSTANT(JoyAxis, JOY_AXIS, MAX);
  514. BIND_CORE_ENUM_CLASS_CONSTANT(MIDIMessage, MIDI_MESSAGE, NONE);
  515. BIND_CORE_ENUM_CLASS_CONSTANT(MIDIMessage, MIDI_MESSAGE, NOTE_OFF);
  516. BIND_CORE_ENUM_CLASS_CONSTANT(MIDIMessage, MIDI_MESSAGE, NOTE_ON);
  517. BIND_CORE_ENUM_CLASS_CONSTANT(MIDIMessage, MIDI_MESSAGE, AFTERTOUCH);
  518. BIND_CORE_ENUM_CLASS_CONSTANT(MIDIMessage, MIDI_MESSAGE, CONTROL_CHANGE);
  519. BIND_CORE_ENUM_CLASS_CONSTANT(MIDIMessage, MIDI_MESSAGE, PROGRAM_CHANGE);
  520. BIND_CORE_ENUM_CLASS_CONSTANT(MIDIMessage, MIDI_MESSAGE, CHANNEL_PRESSURE);
  521. BIND_CORE_ENUM_CLASS_CONSTANT(MIDIMessage, MIDI_MESSAGE, PITCH_BEND);
  522. BIND_CORE_ENUM_CLASS_CONSTANT(MIDIMessage, MIDI_MESSAGE, SYSTEM_EXCLUSIVE);
  523. BIND_CORE_ENUM_CLASS_CONSTANT(MIDIMessage, MIDI_MESSAGE, QUARTER_FRAME);
  524. BIND_CORE_ENUM_CLASS_CONSTANT(MIDIMessage, MIDI_MESSAGE, SONG_POSITION_POINTER);
  525. BIND_CORE_ENUM_CLASS_CONSTANT(MIDIMessage, MIDI_MESSAGE, SONG_SELECT);
  526. BIND_CORE_ENUM_CLASS_CONSTANT(MIDIMessage, MIDI_MESSAGE, TUNE_REQUEST);
  527. BIND_CORE_ENUM_CLASS_CONSTANT(MIDIMessage, MIDI_MESSAGE, TIMING_CLOCK);
  528. BIND_CORE_ENUM_CLASS_CONSTANT(MIDIMessage, MIDI_MESSAGE, START);
  529. BIND_CORE_ENUM_CLASS_CONSTANT(MIDIMessage, MIDI_MESSAGE, CONTINUE);
  530. BIND_CORE_ENUM_CLASS_CONSTANT(MIDIMessage, MIDI_MESSAGE, STOP);
  531. BIND_CORE_ENUM_CLASS_CONSTANT(MIDIMessage, MIDI_MESSAGE, ACTIVE_SENSING);
  532. BIND_CORE_ENUM_CLASS_CONSTANT(MIDIMessage, MIDI_MESSAGE, SYSTEM_RESET);
  533. // error list
  534. BIND_CORE_ENUM_CONSTANT(OK); // (0)
  535. BIND_CORE_ENUM_CONSTANT(FAILED);
  536. BIND_CORE_ENUM_CONSTANT(ERR_UNAVAILABLE);
  537. BIND_CORE_ENUM_CONSTANT(ERR_UNCONFIGURED);
  538. BIND_CORE_ENUM_CONSTANT(ERR_UNAUTHORIZED);
  539. BIND_CORE_ENUM_CONSTANT(ERR_PARAMETER_RANGE_ERROR); // (5)
  540. BIND_CORE_ENUM_CONSTANT(ERR_OUT_OF_MEMORY);
  541. BIND_CORE_ENUM_CONSTANT(ERR_FILE_NOT_FOUND);
  542. BIND_CORE_ENUM_CONSTANT(ERR_FILE_BAD_DRIVE);
  543. BIND_CORE_ENUM_CONSTANT(ERR_FILE_BAD_PATH);
  544. BIND_CORE_ENUM_CONSTANT(ERR_FILE_NO_PERMISSION); // (10)
  545. BIND_CORE_ENUM_CONSTANT(ERR_FILE_ALREADY_IN_USE);
  546. BIND_CORE_ENUM_CONSTANT(ERR_FILE_CANT_OPEN);
  547. BIND_CORE_ENUM_CONSTANT(ERR_FILE_CANT_WRITE);
  548. BIND_CORE_ENUM_CONSTANT(ERR_FILE_CANT_READ);
  549. BIND_CORE_ENUM_CONSTANT(ERR_FILE_UNRECOGNIZED); // (15)
  550. BIND_CORE_ENUM_CONSTANT(ERR_FILE_CORRUPT);
  551. BIND_CORE_ENUM_CONSTANT(ERR_FILE_MISSING_DEPENDENCIES);
  552. BIND_CORE_ENUM_CONSTANT(ERR_FILE_EOF);
  553. BIND_CORE_ENUM_CONSTANT(ERR_CANT_OPEN);
  554. BIND_CORE_ENUM_CONSTANT(ERR_CANT_CREATE); // (20)
  555. BIND_CORE_ENUM_CONSTANT(ERR_QUERY_FAILED);
  556. BIND_CORE_ENUM_CONSTANT(ERR_ALREADY_IN_USE);
  557. BIND_CORE_ENUM_CONSTANT(ERR_LOCKED);
  558. BIND_CORE_ENUM_CONSTANT(ERR_TIMEOUT);
  559. BIND_CORE_ENUM_CONSTANT(ERR_CANT_CONNECT); // (25)
  560. BIND_CORE_ENUM_CONSTANT(ERR_CANT_RESOLVE);
  561. BIND_CORE_ENUM_CONSTANT(ERR_CONNECTION_ERROR);
  562. BIND_CORE_ENUM_CONSTANT(ERR_CANT_ACQUIRE_RESOURCE);
  563. BIND_CORE_ENUM_CONSTANT(ERR_CANT_FORK);
  564. BIND_CORE_ENUM_CONSTANT(ERR_INVALID_DATA); // (30)
  565. BIND_CORE_ENUM_CONSTANT(ERR_INVALID_PARAMETER);
  566. BIND_CORE_ENUM_CONSTANT(ERR_ALREADY_EXISTS);
  567. BIND_CORE_ENUM_CONSTANT(ERR_DOES_NOT_EXIST);
  568. BIND_CORE_ENUM_CONSTANT(ERR_DATABASE_CANT_READ);
  569. BIND_CORE_ENUM_CONSTANT(ERR_DATABASE_CANT_WRITE); // (35)
  570. BIND_CORE_ENUM_CONSTANT(ERR_COMPILATION_FAILED);
  571. BIND_CORE_ENUM_CONSTANT(ERR_METHOD_NOT_FOUND);
  572. BIND_CORE_ENUM_CONSTANT(ERR_LINK_FAILED);
  573. BIND_CORE_ENUM_CONSTANT(ERR_SCRIPT_FAILED);
  574. BIND_CORE_ENUM_CONSTANT(ERR_CYCLIC_LINK); // (40)
  575. BIND_CORE_ENUM_CONSTANT(ERR_INVALID_DECLARATION);
  576. BIND_CORE_ENUM_CONSTANT(ERR_DUPLICATE_SYMBOL);
  577. BIND_CORE_ENUM_CONSTANT(ERR_PARSE_ERROR);
  578. BIND_CORE_ENUM_CONSTANT(ERR_BUSY);
  579. BIND_CORE_ENUM_CONSTANT(ERR_SKIP); // (45)
  580. BIND_CORE_ENUM_CONSTANT(ERR_HELP);
  581. BIND_CORE_ENUM_CONSTANT(ERR_BUG);
  582. BIND_CORE_ENUM_CONSTANT(ERR_PRINTER_ON_FIRE);
  583. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_NONE);
  584. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_RANGE);
  585. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_ENUM);
  586. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_ENUM_SUGGESTION);
  587. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_EXP_EASING);
  588. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_LINK);
  589. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_FLAGS);
  590. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_LAYERS_2D_RENDER);
  591. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_LAYERS_2D_PHYSICS);
  592. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_LAYERS_2D_NAVIGATION);
  593. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_LAYERS_3D_RENDER);
  594. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_LAYERS_3D_PHYSICS);
  595. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_LAYERS_3D_NAVIGATION);
  596. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_LAYERS_AVOIDANCE);
  597. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_FILE);
  598. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_DIR);
  599. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_GLOBAL_FILE);
  600. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_GLOBAL_DIR);
  601. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_RESOURCE_TYPE);
  602. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_MULTILINE_TEXT);
  603. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_EXPRESSION);
  604. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_PLACEHOLDER_TEXT);
  605. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_COLOR_NO_ALPHA);
  606. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_OBJECT_ID);
  607. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_TYPE_STRING);
  608. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE);
  609. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_OBJECT_TOO_BIG);
  610. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_NODE_PATH_VALID_TYPES);
  611. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_SAVE_FILE);
  612. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_GLOBAL_SAVE_FILE);
  613. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_INT_IS_OBJECTID);
  614. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_INT_IS_POINTER);
  615. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_ARRAY_TYPE);
  616. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_LOCALE_ID);
  617. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_LOCALIZABLE_STRING);
  618. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_NODE_TYPE);
  619. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_HIDE_QUATERNION_EDIT);
  620. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_PASSWORD);
  621. BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_MAX);
  622. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_NONE);
  623. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_STORAGE);
  624. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_EDITOR);
  625. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_INTERNAL);
  626. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_CHECKABLE);
  627. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_CHECKED);
  628. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_GROUP);
  629. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_CATEGORY);
  630. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_SUBGROUP);
  631. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_CLASS_IS_BITFIELD);
  632. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_NO_INSTANCE_STATE);
  633. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_RESTART_IF_CHANGED);
  634. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_SCRIPT_VARIABLE);
  635. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_STORE_IF_NULL);
  636. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED);
  637. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE);
  638. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_CLASS_IS_ENUM);
  639. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_NIL_IS_VARIANT);
  640. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_ARRAY);
  641. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_ALWAYS_DUPLICATE);
  642. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_NEVER_DUPLICATE);
  643. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_HIGH_END_GFX);
  644. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT);
  645. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT);
  646. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_KEYING_INCREMENTS);
  647. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_DEFERRED_SET_RESOURCE);
  648. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT);
  649. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_EDITOR_BASIC_SETTING);
  650. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_READ_ONLY);
  651. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_SECRET);
  652. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_DEFAULT);
  653. BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_NO_EDITOR);
  654. BIND_CORE_BITFIELD_FLAG(METHOD_FLAG_NORMAL);
  655. BIND_CORE_BITFIELD_FLAG(METHOD_FLAG_EDITOR);
  656. BIND_CORE_BITFIELD_FLAG(METHOD_FLAG_CONST);
  657. BIND_CORE_BITFIELD_FLAG(METHOD_FLAG_VIRTUAL);
  658. BIND_CORE_BITFIELD_FLAG(METHOD_FLAG_VARARG);
  659. BIND_CORE_BITFIELD_FLAG(METHOD_FLAG_STATIC);
  660. BIND_CORE_BITFIELD_FLAG(METHOD_FLAG_OBJECT_CORE);
  661. BIND_CORE_BITFIELD_FLAG(METHOD_FLAGS_DEFAULT);
  662. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_NIL", Variant::NIL);
  663. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_BOOL", Variant::BOOL);
  664. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_INT", Variant::INT);
  665. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_FLOAT", Variant::FLOAT);
  666. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_STRING", Variant::STRING);
  667. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2", Variant::VECTOR2);
  668. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2I", Variant::VECTOR2I);
  669. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_RECT2", Variant::RECT2);
  670. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_RECT2I", Variant::RECT2I);
  671. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR3", Variant::VECTOR3);
  672. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR3I", Variant::VECTOR3I);
  673. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_TRANSFORM2D", Variant::TRANSFORM2D);
  674. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR4", Variant::VECTOR4);
  675. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR4I", Variant::VECTOR4I);
  676. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_PLANE", Variant::PLANE);
  677. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_QUATERNION", Variant::QUATERNION);
  678. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_AABB", Variant::AABB);
  679. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_BASIS", Variant::BASIS);
  680. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_TRANSFORM3D", Variant::TRANSFORM3D);
  681. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_PROJECTION", Variant::PROJECTION);
  682. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_COLOR", Variant::COLOR);
  683. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_STRING_NAME", Variant::STRING_NAME);
  684. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_NODE_PATH", Variant::NODE_PATH);
  685. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_RID", Variant::RID);
  686. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_OBJECT", Variant::OBJECT);
  687. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_CALLABLE", Variant::CALLABLE);
  688. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_SIGNAL", Variant::SIGNAL);
  689. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_DICTIONARY", Variant::DICTIONARY);
  690. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_ARRAY", Variant::ARRAY);
  691. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_PACKED_BYTE_ARRAY", Variant::PACKED_BYTE_ARRAY);
  692. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_PACKED_INT32_ARRAY", Variant::PACKED_INT32_ARRAY);
  693. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_PACKED_INT64_ARRAY", Variant::PACKED_INT64_ARRAY);
  694. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_PACKED_FLOAT32_ARRAY", Variant::PACKED_FLOAT32_ARRAY);
  695. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_PACKED_FLOAT64_ARRAY", Variant::PACKED_FLOAT64_ARRAY);
  696. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_PACKED_STRING_ARRAY", Variant::PACKED_STRING_ARRAY);
  697. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_PACKED_VECTOR2_ARRAY", Variant::PACKED_VECTOR2_ARRAY);
  698. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_PACKED_VECTOR3_ARRAY", Variant::PACKED_VECTOR3_ARRAY);
  699. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_PACKED_COLOR_ARRAY", Variant::PACKED_COLOR_ARRAY);
  700. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_PACKED_VECTOR4_ARRAY", Variant::PACKED_VECTOR4_ARRAY);
  701. BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_MAX", Variant::VARIANT_MAX);
  702. //comparison
  703. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_EQUAL", Variant::OP_EQUAL);
  704. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_NOT_EQUAL", Variant::OP_NOT_EQUAL);
  705. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_LESS", Variant::OP_LESS);
  706. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_LESS_EQUAL", Variant::OP_LESS_EQUAL);
  707. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_GREATER", Variant::OP_GREATER);
  708. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_GREATER_EQUAL", Variant::OP_GREATER_EQUAL);
  709. //mathematic
  710. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_ADD", Variant::OP_ADD);
  711. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_SUBTRACT", Variant::OP_SUBTRACT);
  712. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_MULTIPLY", Variant::OP_MULTIPLY);
  713. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_DIVIDE", Variant::OP_DIVIDE);
  714. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_NEGATE", Variant::OP_NEGATE);
  715. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_POSITIVE", Variant::OP_POSITIVE);
  716. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_MODULE", Variant::OP_MODULE);
  717. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_POWER", Variant::OP_POWER);
  718. //bitwise
  719. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_SHIFT_LEFT", Variant::OP_SHIFT_LEFT);
  720. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_SHIFT_RIGHT", Variant::OP_SHIFT_RIGHT);
  721. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_BIT_AND", Variant::OP_BIT_AND);
  722. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_BIT_OR", Variant::OP_BIT_OR);
  723. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_BIT_XOR", Variant::OP_BIT_XOR);
  724. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_BIT_NEGATE", Variant::OP_BIT_NEGATE);
  725. //logic
  726. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_AND", Variant::OP_AND);
  727. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_OR", Variant::OP_OR);
  728. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_XOR", Variant::OP_XOR);
  729. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_NOT", Variant::OP_NOT);
  730. //containment
  731. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_IN", Variant::OP_IN);
  732. BIND_CORE_ENUM_CONSTANT_CUSTOM("OP_MAX", Variant::OP_MAX);
  733. }
  734. void unregister_global_constants() {
  735. _global_constants.clear();
  736. _global_constants_map.clear();
  737. _global_enums.clear();
  738. }
  739. int CoreConstants::get_global_constant_count() {
  740. return _global_constants.size();
  741. }
  742. StringName CoreConstants::get_global_constant_enum(int p_idx) {
  743. return _global_constants[p_idx].enum_name;
  744. }
  745. #ifdef DEBUG_METHODS_ENABLED
  746. bool CoreConstants::is_global_constant_bitfield(int p_idx) {
  747. return _global_constants[p_idx].is_bitfield;
  748. }
  749. bool CoreConstants::get_ignore_value_in_docs(int p_idx) {
  750. return _global_constants[p_idx].ignore_value_in_docs;
  751. }
  752. #else
  753. bool CoreConstants::is_global_constant_bitfield(int p_idx) {
  754. return false;
  755. }
  756. bool CoreConstants::get_ignore_value_in_docs(int p_idx) {
  757. return false;
  758. }
  759. #endif
  760. const char *CoreConstants::get_global_constant_name(int p_idx) {
  761. return _global_constants[p_idx].name;
  762. }
  763. int64_t CoreConstants::get_global_constant_value(int p_idx) {
  764. return _global_constants[p_idx].value;
  765. }
  766. bool CoreConstants::is_global_constant(const StringName &p_name) {
  767. return _global_constants_map.has(p_name);
  768. }
  769. int CoreConstants::get_global_constant_index(const StringName &p_name) {
  770. ERR_FAIL_COND_V_MSG(!_global_constants_map.has(p_name), -1, "Trying to get index of non-existing constant.");
  771. return _global_constants_map[p_name];
  772. }
  773. bool CoreConstants::is_global_enum(const StringName &p_enum) {
  774. return _global_enums.has(p_enum);
  775. }
  776. void CoreConstants::get_enum_values(const StringName &p_enum, HashMap<StringName, int64_t> *p_values) {
  777. ERR_FAIL_NULL_MSG(p_values, "Trying to get enum values with null map.");
  778. ERR_FAIL_COND_MSG(!_global_enums.has(p_enum), "Trying to get values of non-existing enum.");
  779. for (const _CoreConstant &constant : _global_enums[p_enum]) {
  780. (*p_values)[constant.name] = constant.value;
  781. }
  782. }