diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/bind/core_bind.cpp | 120 | ||||
-rw-r--r-- | core/bind/core_bind.h | 9 | ||||
-rw-r--r-- | core/class_db.cpp | 83 | ||||
-rw-r--r-- | core/class_db.h | 27 | ||||
-rw-r--r-- | core/global_constants.cpp | 1011 | ||||
-rw-r--r-- | core/global_constants.h | 3 | ||||
-rw-r--r-- | core/image.cpp | 112 | ||||
-rw-r--r-- | core/io/http_client.cpp | 140 | ||||
-rw-r--r-- | core/io/http_client.h | 1 | ||||
-rw-r--r-- | core/io/ip.cpp | 16 | ||||
-rw-r--r-- | core/io/networked_multiplayer_peer.cpp | 12 | ||||
-rw-r--r-- | core/io/stream_peer_ssl.cpp | 9 | ||||
-rw-r--r-- | core/io/stream_peer_tcp.cpp | 8 | ||||
-rw-r--r-- | core/io/xml_parser.cpp | 14 | ||||
-rw-r--r-- | core/method_bind.h | 26 | ||||
-rw-r--r-- | core/object.cpp | 6 | ||||
-rw-r--r-- | core/os/input.cpp | 8 | ||||
-rw-r--r-- | core/register_core_types.cpp | 4 | ||||
-rw-r--r-- | core/simple_type.h | 74 | ||||
-rw-r--r-- | core/type_info.h | 63 | ||||
-rw-r--r-- | core/undo_redo.cpp | 6 |
21 files changed, 941 insertions, 811 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 273ef78669..e28fa16cfd 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -151,12 +151,12 @@ void _ResourceSaver::_bind_methods() { ClassDB::bind_method(D_METHOD("save", "path", "resource", "flags"), &_ResourceSaver::save, DEFVAL(0)); ClassDB::bind_method(D_METHOD("get_recognized_extensions", "type"), &_ResourceSaver::get_recognized_extensions); - BIND_CONSTANT(FLAG_RELATIVE_PATHS); - BIND_CONSTANT(FLAG_BUNDLE_RESOURCES); - BIND_CONSTANT(FLAG_CHANGE_PATH); - BIND_CONSTANT(FLAG_OMIT_EDITOR_PROPERTIES); - BIND_CONSTANT(FLAG_SAVE_BIG_ENDIAN); - BIND_CONSTANT(FLAG_COMPRESS); + BIND_ENUM_CONSTANT(FLAG_RELATIVE_PATHS); + BIND_ENUM_CONSTANT(FLAG_BUNDLE_RESOURCES); + BIND_ENUM_CONSTANT(FLAG_CHANGE_PATH); + BIND_ENUM_CONSTANT(FLAG_OMIT_EDITOR_PROPERTIES); + BIND_ENUM_CONSTANT(FLAG_SAVE_BIG_ENDIAN); + BIND_ENUM_CONSTANT(FLAG_COMPRESS); } _ResourceSaver::_ResourceSaver() { @@ -1104,49 +1104,49 @@ void _OS::_bind_methods() { ClassDB::bind_method(D_METHOD("get_power_seconds_left"), &_OS::get_power_seconds_left); ClassDB::bind_method(D_METHOD("get_power_percent_left"), &_OS::get_power_percent_left); - BIND_CONSTANT(DAY_SUNDAY); - BIND_CONSTANT(DAY_MONDAY); - BIND_CONSTANT(DAY_TUESDAY); - BIND_CONSTANT(DAY_WEDNESDAY); - BIND_CONSTANT(DAY_THURSDAY); - BIND_CONSTANT(DAY_FRIDAY); - BIND_CONSTANT(DAY_SATURDAY); - - BIND_CONSTANT(MONTH_JANUARY); - BIND_CONSTANT(MONTH_FEBRUARY); - BIND_CONSTANT(MONTH_MARCH); - BIND_CONSTANT(MONTH_APRIL); - BIND_CONSTANT(MONTH_MAY); - BIND_CONSTANT(MONTH_JUNE); - BIND_CONSTANT(MONTH_JULY); - BIND_CONSTANT(MONTH_AUGUST); - BIND_CONSTANT(MONTH_SEPTEMBER); - BIND_CONSTANT(MONTH_OCTOBER); - BIND_CONSTANT(MONTH_NOVEMBER); - BIND_CONSTANT(MONTH_DECEMBER); - - BIND_CONSTANT(SCREEN_ORIENTATION_LANDSCAPE); - BIND_CONSTANT(SCREEN_ORIENTATION_PORTRAIT); - BIND_CONSTANT(SCREEN_ORIENTATION_REVERSE_LANDSCAPE); - BIND_CONSTANT(SCREEN_ORIENTATION_REVERSE_PORTRAIT); - BIND_CONSTANT(SCREEN_ORIENTATION_SENSOR_LANDSCAPE); - BIND_CONSTANT(SCREEN_ORIENTATION_SENSOR_PORTRAIT); - BIND_CONSTANT(SCREEN_ORIENTATION_SENSOR); - - BIND_CONSTANT(SYSTEM_DIR_DESKTOP); - BIND_CONSTANT(SYSTEM_DIR_DCIM); - BIND_CONSTANT(SYSTEM_DIR_DOCUMENTS); - BIND_CONSTANT(SYSTEM_DIR_DOWNLOADS); - BIND_CONSTANT(SYSTEM_DIR_MOVIES); - BIND_CONSTANT(SYSTEM_DIR_MUSIC); - BIND_CONSTANT(SYSTEM_DIR_PICTURES); - BIND_CONSTANT(SYSTEM_DIR_RINGTONES); - - BIND_CONSTANT(POWERSTATE_UNKNOWN); - BIND_CONSTANT(POWERSTATE_ON_BATTERY); - BIND_CONSTANT(POWERSTATE_NO_BATTERY); - BIND_CONSTANT(POWERSTATE_CHARGING); - BIND_CONSTANT(POWERSTATE_CHARGED); + BIND_ENUM_CONSTANT(DAY_SUNDAY); + BIND_ENUM_CONSTANT(DAY_MONDAY); + BIND_ENUM_CONSTANT(DAY_TUESDAY); + BIND_ENUM_CONSTANT(DAY_WEDNESDAY); + BIND_ENUM_CONSTANT(DAY_THURSDAY); + BIND_ENUM_CONSTANT(DAY_FRIDAY); + BIND_ENUM_CONSTANT(DAY_SATURDAY); + + BIND_ENUM_CONSTANT(MONTH_JANUARY); + BIND_ENUM_CONSTANT(MONTH_FEBRUARY); + BIND_ENUM_CONSTANT(MONTH_MARCH); + BIND_ENUM_CONSTANT(MONTH_APRIL); + BIND_ENUM_CONSTANT(MONTH_MAY); + BIND_ENUM_CONSTANT(MONTH_JUNE); + BIND_ENUM_CONSTANT(MONTH_JULY); + BIND_ENUM_CONSTANT(MONTH_AUGUST); + BIND_ENUM_CONSTANT(MONTH_SEPTEMBER); + BIND_ENUM_CONSTANT(MONTH_OCTOBER); + BIND_ENUM_CONSTANT(MONTH_NOVEMBER); + BIND_ENUM_CONSTANT(MONTH_DECEMBER); + + BIND_ENUM_CONSTANT(SCREEN_ORIENTATION_LANDSCAPE); + BIND_ENUM_CONSTANT(SCREEN_ORIENTATION_PORTRAIT); + BIND_ENUM_CONSTANT(SCREEN_ORIENTATION_REVERSE_LANDSCAPE); + BIND_ENUM_CONSTANT(SCREEN_ORIENTATION_REVERSE_PORTRAIT); + BIND_ENUM_CONSTANT(SCREEN_ORIENTATION_SENSOR_LANDSCAPE); + BIND_ENUM_CONSTANT(SCREEN_ORIENTATION_SENSOR_PORTRAIT); + BIND_ENUM_CONSTANT(SCREEN_ORIENTATION_SENSOR); + + BIND_ENUM_CONSTANT(SYSTEM_DIR_DESKTOP); + BIND_ENUM_CONSTANT(SYSTEM_DIR_DCIM); + BIND_ENUM_CONSTANT(SYSTEM_DIR_DOCUMENTS); + BIND_ENUM_CONSTANT(SYSTEM_DIR_DOWNLOADS); + BIND_ENUM_CONSTANT(SYSTEM_DIR_MOVIES); + BIND_ENUM_CONSTANT(SYSTEM_DIR_MUSIC); + BIND_ENUM_CONSTANT(SYSTEM_DIR_PICTURES); + BIND_ENUM_CONSTANT(SYSTEM_DIR_RINGTONES); + + BIND_ENUM_CONSTANT(POWERSTATE_UNKNOWN); + BIND_ENUM_CONSTANT(POWERSTATE_ON_BATTERY); + BIND_ENUM_CONSTANT(POWERSTATE_NO_BATTERY); + BIND_ENUM_CONSTANT(POWERSTATE_CHARGING); + BIND_ENUM_CONSTANT(POWERSTATE_CHARGED); } _OS::_OS() { @@ -1772,15 +1772,15 @@ void _File::_bind_methods() { ClassDB::bind_method(D_METHOD("file_exists", "path"), &_File::file_exists); ClassDB::bind_method(D_METHOD("get_modified_time", "file"), &_File::get_modified_time); - BIND_CONSTANT(READ); - BIND_CONSTANT(WRITE); - BIND_CONSTANT(READ_WRITE); - BIND_CONSTANT(WRITE_READ); + BIND_ENUM_CONSTANT(READ); + BIND_ENUM_CONSTANT(WRITE); + BIND_ENUM_CONSTANT(READ_WRITE); + BIND_ENUM_CONSTANT(WRITE_READ); - BIND_CONSTANT(COMPRESSION_FASTLZ); - BIND_CONSTANT(COMPRESSION_DEFLATE); - BIND_CONSTANT(COMPRESSION_ZSTD); - BIND_CONSTANT(COMPRESSION_GZIP); + BIND_ENUM_CONSTANT(COMPRESSION_FASTLZ); + BIND_ENUM_CONSTANT(COMPRESSION_DEFLATE); + BIND_ENUM_CONSTANT(COMPRESSION_ZSTD); + BIND_ENUM_CONSTANT(COMPRESSION_GZIP); } _File::_File() { @@ -2285,9 +2285,9 @@ void _Thread::_bind_methods() { ClassDB::bind_method(D_METHOD("is_active"), &_Thread::is_active); ClassDB::bind_method(D_METHOD("wait_to_finish"), &_Thread::wait_to_finish); - BIND_CONSTANT(PRIORITY_LOW); - BIND_CONSTANT(PRIORITY_NORMAL); - BIND_CONSTANT(PRIORITY_HIGH); + BIND_ENUM_CONSTANT(PRIORITY_LOW); + BIND_ENUM_CONSTANT(PRIORITY_NORMAL); + BIND_ENUM_CONSTANT(PRIORITY_HIGH); } _Thread::_Thread() { diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 61c80aaba3..22d1c2f52f 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -85,6 +85,8 @@ public: _ResourceSaver(); }; +VARIANT_ENUM_CAST(_ResourceSaver::SaverFlags); + class MainLoop; class _OS : public Object { @@ -310,6 +312,8 @@ public: _OS(); }; +VARIANT_ENUM_CAST(_OS::Weekday); +VARIANT_ENUM_CAST(_OS::Month); VARIANT_ENUM_CAST(_OS::SystemDir); VARIANT_ENUM_CAST(_OS::ScreenOrientation); @@ -447,6 +451,9 @@ public: virtual ~_File(); }; +VARIANT_ENUM_CAST(_File::ModeFlags); +VARIANT_ENUM_CAST(_File::CompressionMode); + class _Directory : public Reference { GDCLASS(_Directory, Reference); @@ -578,6 +585,8 @@ public: ~_Thread(); }; +VARIANT_ENUM_CAST(_Thread::Priority); + class _ClassDB : public Object { GDCLASS(_ClassDB, Object) diff --git a/core/class_db.cpp b/core/class_db.cpp index 0503f7c6fc..6cd7586a54 100644 --- a/core/class_db.cpp +++ b/core/class_db.cpp @@ -583,7 +583,7 @@ MethodBind *ClassDB::get_method(StringName p_class, StringName p_name) { return NULL; } -void ClassDB::bind_integer_constant(const StringName &p_class, const StringName &p_name, int p_constant) { +void ClassDB::bind_integer_constant(const StringName &p_class, const StringName &p_enum, const StringName &p_name, int p_constant) { OBJTYPE_WLOCK; @@ -600,6 +600,16 @@ void ClassDB::bind_integer_constant(const StringName &p_class, const StringName type->constant_map[p_name] = p_constant; #ifdef DEBUG_METHODS_ENABLED + List<StringName> *constants_list = type->enum_map.getptr(p_enum); + + if (constants_list) { + constants_list->push_back(p_name); + } else { + List<StringName> new_list; + new_list.push_back(p_name); + type->enum_map[p_enum] = new_list; + } + type->constant_order.push_back(p_name); #endif } @@ -655,6 +665,77 @@ int ClassDB::get_integer_constant(const StringName &p_class, const StringName &p return 0; } +#ifdef DEBUG_METHODS_ENABLED +StringName ClassDB::get_integer_constant_enum(const StringName &p_class, const StringName &p_name, bool p_no_inheritance) { + + OBJTYPE_RLOCK; + + ClassInfo *type = classes.getptr(p_class); + + while (type) { + + const StringName *k = NULL; + while ((k = type->enum_map.next(k))) { + + List<StringName> &constants_list = type->enum_map.get(*k); + const List<StringName>::Element *found = constants_list.find(p_name); + if (found) + return found->get(); + } + + if (p_no_inheritance) + break; + + type = type->inherits_ptr; + } + + return StringName(); +} + +void ClassDB::get_enum_list(const StringName &p_class, List<StringName> *p_enums, bool p_no_inheritance) { + + OBJTYPE_RLOCK; + + ClassInfo *type = classes.getptr(p_class); + + while (type) { + + const StringName *k = NULL; + while ((k = type->enum_map.next(k))) { + p_enums->push_back(*k); + } + + if (p_no_inheritance) + break; + + type = type->inherits_ptr; + } +} + +void ClassDB::get_enum_constants(const StringName &p_class, const StringName &p_enum, List<StringName> *p_constants, bool p_no_inheritance) { + + OBJTYPE_RLOCK; + + ClassInfo *type = classes.getptr(p_class); + + while (type) { + + const List<StringName> *constants = type->enum_map.getptr(p_enum); + + if (constants) { + for (const List<StringName>::Element *E = constants->front(); E; E = E->next()) { + p_constants->push_back(E->get()); + } + } + + if (p_no_inheritance) + break; + + type = type->inherits_ptr; + } +} +#endif + void ClassDB::add_signal(StringName p_class, const MethodInfo &p_signal) { OBJTYPE_WLOCK; diff --git a/core/class_db.h b/core/class_db.h index 4287c5990f..8d9192adcc 100644 --- a/core/class_db.h +++ b/core/class_db.h @@ -138,6 +138,7 @@ public: HashMap<StringName, MethodInfo, StringNameHasher> signal_map; List<PropertyInfo> property_list; #ifdef DEBUG_METHODS_ENABLED + HashMap<StringName, List<StringName> > enum_map; List<StringName> constant_order; List<StringName> method_order; Set<StringName> methods_in_properties; @@ -488,9 +489,16 @@ public: static void add_virtual_method(const StringName &p_class, const MethodInfo &p_method, bool p_virtual = true); static void get_virtual_methods(const StringName &p_class, List<MethodInfo> *p_methods, bool p_no_inheritance = false); - static void bind_integer_constant(const StringName &p_class, const StringName &p_name, int p_constant); + static void bind_integer_constant(const StringName &p_class, const StringName &p_enum, const StringName &p_name, int p_constant); static void get_integer_constant_list(const StringName &p_class, List<String> *p_constants, bool p_no_inheritance = false); static int get_integer_constant(const StringName &p_class, const StringName &p_name, bool *p_success = NULL); + +#ifdef DEBUG_METHODS_ENABLED + static StringName get_integer_constant_enum(const StringName &p_class, const StringName &p_name, bool p_no_inheritance = false); + static void get_enum_list(const StringName &p_class, List<StringName> *p_enums, bool p_no_inheritance = false); + static void get_enum_constants(const StringName &p_class, const StringName &p_enum, List<StringName> *p_constants, bool p_no_inheritance = false); +#endif + static StringName get_category(const StringName &p_node); static bool get_setter_and_type_for_property(const StringName &p_class, const StringName &p_prop, StringName &r_class, StringName &r_setter); @@ -509,8 +517,23 @@ public: static void cleanup(); }; +#ifdef DEBUG_METHODS_ENABLED + +#define BIND_CONSTANT(m_constant) \ + ClassDB::bind_integer_constant(get_class_static(), StringName(), #m_constant, m_constant); + +#define BIND_ENUM_CONSTANT(m_constant) \ + ClassDB::bind_integer_constant(get_class_static(), __constant_get_enum_name(m_constant, #m_constant), #m_constant, m_constant); + +#else + #define BIND_CONSTANT(m_constant) \ - ClassDB::bind_integer_constant(get_class_static(), #m_constant, m_constant); + ClassDB::bind_integer_constant(get_class_static(), StringName(), #m_constant, m_constant); + +#define BIND_ENUM_CONSTANT(m_constant) \ + ClassDB::bind_integer_constant(get_class_static(), StringName(), #m_constant, m_constant); + +#endif #ifdef TOOLS_ENABLED diff --git a/core/global_constants.cpp b/core/global_constants.cpp index 9e745ecb98..d296b678b9 100644 --- a/core/global_constants.cpp +++ b/core/global_constants.cpp @@ -10,7 +10,7 @@ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ +/* "Software") to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ @@ -36,504 +36,563 @@ struct _GlobalConstant { +#ifdef DEBUG_METHODS_ENABLED + StringName enum_name; +#endif const char *name; int value; + + _GlobalConstant() {} + +#ifdef DEBUG_METHODS_ENABLED + _GlobalConstant(const StringName &p_enum_name, const char *p_name, int p_value) { + enum_name = p_enum_name; + name = p_name; + value = p_value; + } +#else + _GlobalConstant(const char *p_name, int p_value) { + name = p_name; + value = p_value; + } +#endif }; +static Vector<_GlobalConstant> _global_constants; + +#ifdef DEBUG_METHODS_ENABLED + +#define BIND_GLOBAL_CONSTANT(m_constant) \ + _global_constants.push_back(_GlobalConstant(StringName(), #m_constant, m_constant)); + +#define BIND_GLOBAL_ENUM_CONSTANT(m_constant) \ + _global_constants.push_back(_GlobalConstant(__constant_get_enum_name(m_constant, #m_constant), #m_constant, m_constant)); + +#define BIND_GLOBAL_ENUM_CONSTANT_CUSTOM(m_custom_name, m_constant) \ + _global_constants.push_back(_GlobalConstant(__constant_get_enum_name(m_constant, #m_constant), m_custom_name, m_constant)); + +#else + #define BIND_GLOBAL_CONSTANT(m_constant) \ - { #m_constant, m_constant } + _global_constants.push_back(_GlobalConstant(#m_constant, m_constant)); + +#define BIND_GLOBAL_ENUM_CONSTANT(m_constant) \ + _global_constants.push_back(_GlobalConstant(#m_constant, m_constant)); + +#define BIND_GLOBAL_ENUM_CONSTANT_CUSTOM(m_custom_name, m_constant) \ + _global_constants.push_back(_GlobalConstant(m_custom_name, m_constant)); + +#endif + +VARIANT_ENUM_CAST(KeyList); +VARIANT_ENUM_CAST(KeyModifierMask); -static _GlobalConstant _global_constants[] = { +void register_global_constants() { //{ KEY_BACKSPACE, VK_BACK },// (0x08) // backspace - BIND_GLOBAL_CONSTANT(MARGIN_LEFT), - BIND_GLOBAL_CONSTANT(MARGIN_TOP), - BIND_GLOBAL_CONSTANT(MARGIN_RIGHT), - BIND_GLOBAL_CONSTANT(MARGIN_BOTTOM), - BIND_GLOBAL_CONSTANT(VERTICAL), - BIND_GLOBAL_CONSTANT(HORIZONTAL), - BIND_GLOBAL_CONSTANT(HALIGN_LEFT), - BIND_GLOBAL_CONSTANT(HALIGN_CENTER), - BIND_GLOBAL_CONSTANT(HALIGN_RIGHT), - BIND_GLOBAL_CONSTANT(VALIGN_TOP), - BIND_GLOBAL_CONSTANT(VALIGN_CENTER), - BIND_GLOBAL_CONSTANT(VALIGN_BOTTOM), + BIND_GLOBAL_ENUM_CONSTANT(MARGIN_LEFT); + BIND_GLOBAL_ENUM_CONSTANT(MARGIN_TOP); + BIND_GLOBAL_ENUM_CONSTANT(MARGIN_RIGHT); + BIND_GLOBAL_ENUM_CONSTANT(MARGIN_BOTTOM); + + BIND_GLOBAL_ENUM_CONSTANT(VERTICAL); + BIND_GLOBAL_ENUM_CONSTANT(HORIZONTAL); + + BIND_GLOBAL_ENUM_CONSTANT(HALIGN_LEFT); + BIND_GLOBAL_ENUM_CONSTANT(HALIGN_CENTER); + BIND_GLOBAL_ENUM_CONSTANT(HALIGN_RIGHT); + + BIND_GLOBAL_ENUM_CONSTANT(VALIGN_TOP); + BIND_GLOBAL_ENUM_CONSTANT(VALIGN_CENTER); + BIND_GLOBAL_ENUM_CONSTANT(VALIGN_BOTTOM); // hueg list of keys - BIND_GLOBAL_CONSTANT(SPKEY), - - BIND_GLOBAL_CONSTANT(KEY_ESCAPE), - BIND_GLOBAL_CONSTANT(KEY_TAB), - BIND_GLOBAL_CONSTANT(KEY_BACKTAB), - BIND_GLOBAL_CONSTANT(KEY_BACKSPACE), - BIND_GLOBAL_CONSTANT(KEY_ENTER), - BIND_GLOBAL_CONSTANT(KEY_KP_ENTER), - BIND_GLOBAL_CONSTANT(KEY_INSERT), - BIND_GLOBAL_CONSTANT(KEY_DELETE), - BIND_GLOBAL_CONSTANT(KEY_PAUSE), - BIND_GLOBAL_CONSTANT(KEY_PRINT), - BIND_GLOBAL_CONSTANT(KEY_SYSREQ), - BIND_GLOBAL_CONSTANT(KEY_CLEAR), - BIND_GLOBAL_CONSTANT(KEY_HOME), - BIND_GLOBAL_CONSTANT(KEY_END), - BIND_GLOBAL_CONSTANT(KEY_LEFT), - BIND_GLOBAL_CONSTANT(KEY_UP), - BIND_GLOBAL_CONSTANT(KEY_RIGHT), - BIND_GLOBAL_CONSTANT(KEY_DOWN), - BIND_GLOBAL_CONSTANT(KEY_PAGEUP), - BIND_GLOBAL_CONSTANT(KEY_PAGEDOWN), - BIND_GLOBAL_CONSTANT(KEY_SHIFT), - BIND_GLOBAL_CONSTANT(KEY_CONTROL), - BIND_GLOBAL_CONSTANT(KEY_META), - BIND_GLOBAL_CONSTANT(KEY_ALT), - BIND_GLOBAL_CONSTANT(KEY_CAPSLOCK), - BIND_GLOBAL_CONSTANT(KEY_NUMLOCK), - BIND_GLOBAL_CONSTANT(KEY_SCROLLLOCK), - BIND_GLOBAL_CONSTANT(KEY_F1), - BIND_GLOBAL_CONSTANT(KEY_F2), - BIND_GLOBAL_CONSTANT(KEY_F3), - BIND_GLOBAL_CONSTANT(KEY_F4), - BIND_GLOBAL_CONSTANT(KEY_F5), - BIND_GLOBAL_CONSTANT(KEY_F6), - BIND_GLOBAL_CONSTANT(KEY_F7), - BIND_GLOBAL_CONSTANT(KEY_F8), - BIND_GLOBAL_CONSTANT(KEY_F9), - BIND_GLOBAL_CONSTANT(KEY_F10), - BIND_GLOBAL_CONSTANT(KEY_F11), - BIND_GLOBAL_CONSTANT(KEY_F12), - BIND_GLOBAL_CONSTANT(KEY_F13), - BIND_GLOBAL_CONSTANT(KEY_F14), - BIND_GLOBAL_CONSTANT(KEY_F15), - BIND_GLOBAL_CONSTANT(KEY_F16), - BIND_GLOBAL_CONSTANT(KEY_KP_MULTIPLY), - BIND_GLOBAL_CONSTANT(KEY_KP_DIVIDE), - BIND_GLOBAL_CONSTANT(KEY_KP_SUBTRACT), - BIND_GLOBAL_CONSTANT(KEY_KP_PERIOD), - BIND_GLOBAL_CONSTANT(KEY_KP_ADD), - BIND_GLOBAL_CONSTANT(KEY_KP_0), - BIND_GLOBAL_CONSTANT(KEY_KP_1), - BIND_GLOBAL_CONSTANT(KEY_KP_2), - BIND_GLOBAL_CONSTANT(KEY_KP_3), - BIND_GLOBAL_CONSTANT(KEY_KP_4), - BIND_GLOBAL_CONSTANT(KEY_KP_5), - BIND_GLOBAL_CONSTANT(KEY_KP_6), - BIND_GLOBAL_CONSTANT(KEY_KP_7), - BIND_GLOBAL_CONSTANT(KEY_KP_8), - BIND_GLOBAL_CONSTANT(KEY_KP_9), - BIND_GLOBAL_CONSTANT(KEY_SUPER_L), - BIND_GLOBAL_CONSTANT(KEY_SUPER_R), - BIND_GLOBAL_CONSTANT(KEY_MENU), - BIND_GLOBAL_CONSTANT(KEY_HYPER_L), - BIND_GLOBAL_CONSTANT(KEY_HYPER_R), - BIND_GLOBAL_CONSTANT(KEY_HELP), - BIND_GLOBAL_CONSTANT(KEY_DIRECTION_L), - BIND_GLOBAL_CONSTANT(KEY_DIRECTION_R), - BIND_GLOBAL_CONSTANT(KEY_BACK), - BIND_GLOBAL_CONSTANT(KEY_FORWARD), - BIND_GLOBAL_CONSTANT(KEY_STOP), - BIND_GLOBAL_CONSTANT(KEY_REFRESH), - BIND_GLOBAL_CONSTANT(KEY_VOLUMEDOWN), - BIND_GLOBAL_CONSTANT(KEY_VOLUMEMUTE), - BIND_GLOBAL_CONSTANT(KEY_VOLUMEUP), - BIND_GLOBAL_CONSTANT(KEY_BASSBOOST), - BIND_GLOBAL_CONSTANT(KEY_BASSUP), - BIND_GLOBAL_CONSTANT(KEY_BASSDOWN), - BIND_GLOBAL_CONSTANT(KEY_TREBLEUP), - BIND_GLOBAL_CONSTANT(KEY_TREBLEDOWN), - BIND_GLOBAL_CONSTANT(KEY_MEDIAPLAY), - BIND_GLOBAL_CONSTANT(KEY_MEDIASTOP), - BIND_GLOBAL_CONSTANT(KEY_MEDIAPREVIOUS), - BIND_GLOBAL_CONSTANT(KEY_MEDIANEXT), - BIND_GLOBAL_CONSTANT(KEY_MEDIARECORD), - BIND_GLOBAL_CONSTANT(KEY_HOMEPAGE), - BIND_GLOBAL_CONSTANT(KEY_FAVORITES), - BIND_GLOBAL_CONSTANT(KEY_SEARCH), - BIND_GLOBAL_CONSTANT(KEY_STANDBY), - BIND_GLOBAL_CONSTANT(KEY_OPENURL), - BIND_GLOBAL_CONSTANT(KEY_LAUNCHMAIL), - BIND_GLOBAL_CONSTANT(KEY_LAUNCHMEDIA), - BIND_GLOBAL_CONSTANT(KEY_LAUNCH0), - BIND_GLOBAL_CONSTANT(KEY_LAUNCH1), - BIND_GLOBAL_CONSTANT(KEY_LAUNCH2), - BIND_GLOBAL_CONSTANT(KEY_LAUNCH3), - BIND_GLOBAL_CONSTANT(KEY_LAUNCH4), - BIND_GLOBAL_CONSTANT(KEY_LAUNCH5), - BIND_GLOBAL_CONSTANT(KEY_LAUNCH6), - BIND_GLOBAL_CONSTANT(KEY_LAUNCH7), - BIND_GLOBAL_CONSTANT(KEY_LAUNCH8), - BIND_GLOBAL_CONSTANT(KEY_LAUNCH9), - BIND_GLOBAL_CONSTANT(KEY_LAUNCHA), - BIND_GLOBAL_CONSTANT(KEY_LAUNCHB), - BIND_GLOBAL_CONSTANT(KEY_LAUNCHC), - BIND_GLOBAL_CONSTANT(KEY_LAUNCHD), - BIND_GLOBAL_CONSTANT(KEY_LAUNCHE), - BIND_GLOBAL_CONSTANT(KEY_LAUNCHF), - - BIND_GLOBAL_CONSTANT(KEY_UNKNOWN), - BIND_GLOBAL_CONSTANT(KEY_SPACE), - BIND_GLOBAL_CONSTANT(KEY_EXCLAM), - BIND_GLOBAL_CONSTANT(KEY_QUOTEDBL), - BIND_GLOBAL_CONSTANT(KEY_NUMBERSIGN), - BIND_GLOBAL_CONSTANT(KEY_DOLLAR), - BIND_GLOBAL_CONSTANT(KEY_PERCENT), - BIND_GLOBAL_CONSTANT(KEY_AMPERSAND), - BIND_GLOBAL_CONSTANT(KEY_APOSTROPHE), - BIND_GLOBAL_CONSTANT(KEY_PARENLEFT), - BIND_GLOBAL_CONSTANT(KEY_PARENRIGHT), - BIND_GLOBAL_CONSTANT(KEY_ASTERISK), - BIND_GLOBAL_CONSTANT(KEY_PLUS), - BIND_GLOBAL_CONSTANT(KEY_COMMA), - BIND_GLOBAL_CONSTANT(KEY_MINUS), - BIND_GLOBAL_CONSTANT(KEY_PERIOD), - BIND_GLOBAL_CONSTANT(KEY_SLASH), - BIND_GLOBAL_CONSTANT(KEY_0), - BIND_GLOBAL_CONSTANT(KEY_1), - BIND_GLOBAL_CONSTANT(KEY_2), - BIND_GLOBAL_CONSTANT(KEY_3), - BIND_GLOBAL_CONSTANT(KEY_4), - BIND_GLOBAL_CONSTANT(KEY_5), - BIND_GLOBAL_CONSTANT(KEY_6), - BIND_GLOBAL_CONSTANT(KEY_7), - BIND_GLOBAL_CONSTANT(KEY_8), - BIND_GLOBAL_CONSTANT(KEY_9), - BIND_GLOBAL_CONSTANT(KEY_COLON), - BIND_GLOBAL_CONSTANT(KEY_SEMICOLON), - BIND_GLOBAL_CONSTANT(KEY_LESS), - BIND_GLOBAL_CONSTANT(KEY_EQUAL), - BIND_GLOBAL_CONSTANT(KEY_GREATER), - BIND_GLOBAL_CONSTANT(KEY_QUESTION), - BIND_GLOBAL_CONSTANT(KEY_AT), - BIND_GLOBAL_CONSTANT(KEY_A), - BIND_GLOBAL_CONSTANT(KEY_B), - BIND_GLOBAL_CONSTANT(KEY_C), - BIND_GLOBAL_CONSTANT(KEY_D), - BIND_GLOBAL_CONSTANT(KEY_E), - BIND_GLOBAL_CONSTANT(KEY_F), - BIND_GLOBAL_CONSTANT(KEY_G), - BIND_GLOBAL_CONSTANT(KEY_H), - BIND_GLOBAL_CONSTANT(KEY_I), - BIND_GLOBAL_CONSTANT(KEY_J), - BIND_GLOBAL_CONSTANT(KEY_K), - BIND_GLOBAL_CONSTANT(KEY_L), - BIND_GLOBAL_CONSTANT(KEY_M), - BIND_GLOBAL_CONSTANT(KEY_N), - BIND_GLOBAL_CONSTANT(KEY_O), - BIND_GLOBAL_CONSTANT(KEY_P), - BIND_GLOBAL_CONSTANT(KEY_Q), - BIND_GLOBAL_CONSTANT(KEY_R), - BIND_GLOBAL_CONSTANT(KEY_S), - BIND_GLOBAL_CONSTANT(KEY_T), - BIND_GLOBAL_CONSTANT(KEY_U), - BIND_GLOBAL_CONSTANT(KEY_V), - BIND_GLOBAL_CONSTANT(KEY_W), - BIND_GLOBAL_CONSTANT(KEY_X), - BIND_GLOBAL_CONSTANT(KEY_Y), - BIND_GLOBAL_CONSTANT(KEY_Z), - BIND_GLOBAL_CONSTANT(KEY_BRACKETLEFT), - BIND_GLOBAL_CONSTANT(KEY_BACKSLASH), - BIND_GLOBAL_CONSTANT(KEY_BRACKETRIGHT), - BIND_GLOBAL_CONSTANT(KEY_ASCIICIRCUM), - BIND_GLOBAL_CONSTANT(KEY_UNDERSCORE), - BIND_GLOBAL_CONSTANT(KEY_QUOTELEFT), - BIND_GLOBAL_CONSTANT(KEY_BRACELEFT), - BIND_GLOBAL_CONSTANT(KEY_BAR), - BIND_GLOBAL_CONSTANT(KEY_BRACERIGHT), - BIND_GLOBAL_CONSTANT(KEY_ASCIITILDE), - BIND_GLOBAL_CONSTANT(KEY_NOBREAKSPACE), - BIND_GLOBAL_CONSTANT(KEY_EXCLAMDOWN), - BIND_GLOBAL_CONSTANT(KEY_CENT), - BIND_GLOBAL_CONSTANT(KEY_STERLING), - BIND_GLOBAL_CONSTANT(KEY_CURRENCY), - BIND_GLOBAL_CONSTANT(KEY_YEN), - BIND_GLOBAL_CONSTANT(KEY_BROKENBAR), - BIND_GLOBAL_CONSTANT(KEY_SECTION), - BIND_GLOBAL_CONSTANT(KEY_DIAERESIS), - BIND_GLOBAL_CONSTANT(KEY_COPYRIGHT), - BIND_GLOBAL_CONSTANT(KEY_ORDFEMININE), - BIND_GLOBAL_CONSTANT(KEY_GUILLEMOTLEFT), - BIND_GLOBAL_CONSTANT(KEY_NOTSIGN), - BIND_GLOBAL_CONSTANT(KEY_HYPHEN), - BIND_GLOBAL_CONSTANT(KEY_REGISTERED), - BIND_GLOBAL_CONSTANT(KEY_MACRON), - BIND_GLOBAL_CONSTANT(KEY_DEGREE), - BIND_GLOBAL_CONSTANT(KEY_PLUSMINUS), - BIND_GLOBAL_CONSTANT(KEY_TWOSUPERIOR), - BIND_GLOBAL_CONSTANT(KEY_THREESUPERIOR), - BIND_GLOBAL_CONSTANT(KEY_ACUTE), - BIND_GLOBAL_CONSTANT(KEY_MU), - BIND_GLOBAL_CONSTANT(KEY_PARAGRAPH), - BIND_GLOBAL_CONSTANT(KEY_PERIODCENTERED), - BIND_GLOBAL_CONSTANT(KEY_CEDILLA), - BIND_GLOBAL_CONSTANT(KEY_ONESUPERIOR), - BIND_GLOBAL_CONSTANT(KEY_MASCULINE), - BIND_GLOBAL_CONSTANT(KEY_GUILLEMOTRIGHT), - BIND_GLOBAL_CONSTANT(KEY_ONEQUARTER), - BIND_GLOBAL_CONSTANT(KEY_ONEHALF), - BIND_GLOBAL_CONSTANT(KEY_THREEQUARTERS), - BIND_GLOBAL_CONSTANT(KEY_QUESTIONDOWN), - BIND_GLOBAL_CONSTANT(KEY_AGRAVE), - BIND_GLOBAL_CONSTANT(KEY_AACUTE), - BIND_GLOBAL_CONSTANT(KEY_ACIRCUMFLEX), - BIND_GLOBAL_CONSTANT(KEY_ATILDE), - BIND_GLOBAL_CONSTANT(KEY_ADIAERESIS), - BIND_GLOBAL_CONSTANT(KEY_ARING), - BIND_GLOBAL_CONSTANT(KEY_AE), - BIND_GLOBAL_CONSTANT(KEY_CCEDILLA), - BIND_GLOBAL_CONSTANT(KEY_EGRAVE), - BIND_GLOBAL_CONSTANT(KEY_EACUTE), - BIND_GLOBAL_CONSTANT(KEY_ECIRCUMFLEX), - BIND_GLOBAL_CONSTANT(KEY_EDIAERESIS), - BIND_GLOBAL_CONSTANT(KEY_IGRAVE), - BIND_GLOBAL_CONSTANT(KEY_IACUTE), - BIND_GLOBAL_CONSTANT(KEY_ICIRCUMFLEX), - BIND_GLOBAL_CONSTANT(KEY_IDIAERESIS), - BIND_GLOBAL_CONSTANT(KEY_ETH), - BIND_GLOBAL_CONSTANT(KEY_NTILDE), - BIND_GLOBAL_CONSTANT(KEY_OGRAVE), - BIND_GLOBAL_CONSTANT(KEY_OACUTE), - BIND_GLOBAL_CONSTANT(KEY_OCIRCUMFLEX), - BIND_GLOBAL_CONSTANT(KEY_OTILDE), - BIND_GLOBAL_CONSTANT(KEY_ODIAERESIS), - BIND_GLOBAL_CONSTANT(KEY_MULTIPLY), - BIND_GLOBAL_CONSTANT(KEY_OOBLIQUE), - BIND_GLOBAL_CONSTANT(KEY_UGRAVE), - BIND_GLOBAL_CONSTANT(KEY_UACUTE), - BIND_GLOBAL_CONSTANT(KEY_UCIRCUMFLEX), - BIND_GLOBAL_CONSTANT(KEY_UDIAERESIS), - BIND_GLOBAL_CONSTANT(KEY_YACUTE), - BIND_GLOBAL_CONSTANT(KEY_THORN), - BIND_GLOBAL_CONSTANT(KEY_SSHARP), - - BIND_GLOBAL_CONSTANT(KEY_DIVISION), - BIND_GLOBAL_CONSTANT(KEY_YDIAERESIS), - - BIND_GLOBAL_CONSTANT(KEY_CODE_MASK), - BIND_GLOBAL_CONSTANT(KEY_MODIFIER_MASK), - - BIND_GLOBAL_CONSTANT(KEY_MASK_SHIFT), - BIND_GLOBAL_CONSTANT(KEY_MASK_ALT), - BIND_GLOBAL_CONSTANT(KEY_MASK_META), - BIND_GLOBAL_CONSTANT(KEY_MASK_CTRL), - BIND_GLOBAL_CONSTANT(KEY_MASK_CMD), - BIND_GLOBAL_CONSTANT(KEY_MASK_KPAD), - BIND_GLOBAL_CONSTANT(KEY_MASK_GROUP_SWITCH), + BIND_GLOBAL_CONSTANT(SPKEY); + + BIND_GLOBAL_ENUM_CONSTANT(KEY_ESCAPE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_TAB); + BIND_GLOBAL_ENUM_CONSTANT(KEY_BACKTAB); + BIND_GLOBAL_ENUM_CONSTANT(KEY_BACKSPACE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_ENTER); + BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_ENTER); + BIND_GLOBAL_ENUM_CONSTANT(KEY_INSERT); + BIND_GLOBAL_ENUM_CONSTANT(KEY_DELETE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_PAUSE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_PRINT); + BIND_GLOBAL_ENUM_CONSTANT(KEY_SYSREQ); + BIND_GLOBAL_ENUM_CONSTANT(KEY_CLEAR); + BIND_GLOBAL_ENUM_CONSTANT(KEY_HOME); + BIND_GLOBAL_ENUM_CONSTANT(KEY_END); + BIND_GLOBAL_ENUM_CONSTANT(KEY_LEFT); + BIND_GLOBAL_ENUM_CONSTANT(KEY_UP); + BIND_GLOBAL_ENUM_CONSTANT(KEY_RIGHT); + BIND_GLOBAL_ENUM_CONSTANT(KEY_DOWN); + BIND_GLOBAL_ENUM_CONSTANT(KEY_PAGEUP); + BIND_GLOBAL_ENUM_CONSTANT(KEY_PAGEDOWN); + BIND_GLOBAL_ENUM_CONSTANT(KEY_SHIFT); + BIND_GLOBAL_ENUM_CONSTANT(KEY_CONTROL); + BIND_GLOBAL_ENUM_CONSTANT(KEY_META); + BIND_GLOBAL_ENUM_CONSTANT(KEY_ALT); + BIND_GLOBAL_ENUM_CONSTANT(KEY_CAPSLOCK); + BIND_GLOBAL_ENUM_CONSTANT(KEY_NUMLOCK); + BIND_GLOBAL_ENUM_CONSTANT(KEY_SCROLLLOCK); + BIND_GLOBAL_ENUM_CONSTANT(KEY_F1); + BIND_GLOBAL_ENUM_CONSTANT(KEY_F2); + BIND_GLOBAL_ENUM_CONSTANT(KEY_F3); + BIND_GLOBAL_ENUM_CONSTANT(KEY_F4); + BIND_GLOBAL_ENUM_CONSTANT(KEY_F5); + BIND_GLOBAL_ENUM_CONSTANT(KEY_F6); + BIND_GLOBAL_ENUM_CONSTANT(KEY_F7); + BIND_GLOBAL_ENUM_CONSTANT(KEY_F8); + BIND_GLOBAL_ENUM_CONSTANT(KEY_F9); + BIND_GLOBAL_ENUM_CONSTANT(KEY_F10); + BIND_GLOBAL_ENUM_CONSTANT(KEY_F11); + BIND_GLOBAL_ENUM_CONSTANT(KEY_F12); + BIND_GLOBAL_ENUM_CONSTANT(KEY_F13); + BIND_GLOBAL_ENUM_CONSTANT(KEY_F14); + BIND_GLOBAL_ENUM_CONSTANT(KEY_F15); + BIND_GLOBAL_ENUM_CONSTANT(KEY_F16); + BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_MULTIPLY); + BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_DIVIDE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_SUBTRACT); + BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_PERIOD); + BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_ADD); + BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_0); + BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_1); + BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_2); + BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_3); + BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_4); + BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_5); + BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_6); + BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_7); + BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_8); + BIND_GLOBAL_ENUM_CONSTANT(KEY_KP_9); + BIND_GLOBAL_ENUM_CONSTANT(KEY_SUPER_L); + BIND_GLOBAL_ENUM_CONSTANT(KEY_SUPER_R); + BIND_GLOBAL_ENUM_CONSTANT(KEY_MENU); + BIND_GLOBAL_ENUM_CONSTANT(KEY_HYPER_L); + BIND_GLOBAL_ENUM_CONSTANT(KEY_HYPER_R); + BIND_GLOBAL_ENUM_CONSTANT(KEY_HELP); + BIND_GLOBAL_ENUM_CONSTANT(KEY_DIRECTION_L); + BIND_GLOBAL_ENUM_CONSTANT(KEY_DIRECTION_R); + BIND_GLOBAL_ENUM_CONSTANT(KEY_BACK); + BIND_GLOBAL_ENUM_CONSTANT(KEY_FORWARD); + BIND_GLOBAL_ENUM_CONSTANT(KEY_STOP); + BIND_GLOBAL_ENUM_CONSTANT(KEY_REFRESH); + BIND_GLOBAL_ENUM_CONSTANT(KEY_VOLUMEDOWN); + BIND_GLOBAL_ENUM_CONSTANT(KEY_VOLUMEMUTE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_VOLUMEUP); + BIND_GLOBAL_ENUM_CONSTANT(KEY_BASSBOOST); + BIND_GLOBAL_ENUM_CONSTANT(KEY_BASSUP); + BIND_GLOBAL_ENUM_CONSTANT(KEY_BASSDOWN); + BIND_GLOBAL_ENUM_CONSTANT(KEY_TREBLEUP); + BIND_GLOBAL_ENUM_CONSTANT(KEY_TREBLEDOWN); + BIND_GLOBAL_ENUM_CONSTANT(KEY_MEDIAPLAY); + BIND_GLOBAL_ENUM_CONSTANT(KEY_MEDIASTOP); + BIND_GLOBAL_ENUM_CONSTANT(KEY_MEDIAPREVIOUS); + BIND_GLOBAL_ENUM_CONSTANT(KEY_MEDIANEXT); + BIND_GLOBAL_ENUM_CONSTANT(KEY_MEDIARECORD); + BIND_GLOBAL_ENUM_CONSTANT(KEY_HOMEPAGE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_FAVORITES); + BIND_GLOBAL_ENUM_CONSTANT(KEY_SEARCH); + BIND_GLOBAL_ENUM_CONSTANT(KEY_STANDBY); + BIND_GLOBAL_ENUM_CONSTANT(KEY_OPENURL); + BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCHMAIL); + BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCHMEDIA); + BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCH0); + BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCH1); + BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCH2); + BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCH3); + BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCH4); + BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCH5); + BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCH6); + BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCH7); + BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCH8); + BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCH9); + BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCHA); + BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCHB); + BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCHC); + BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCHD); + BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCHE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_LAUNCHF); + + BIND_GLOBAL_ENUM_CONSTANT(KEY_UNKNOWN); + BIND_GLOBAL_ENUM_CONSTANT(KEY_SPACE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_EXCLAM); + BIND_GLOBAL_ENUM_CONSTANT(KEY_QUOTEDBL); + BIND_GLOBAL_ENUM_CONSTANT(KEY_NUMBERSIGN); + BIND_GLOBAL_ENUM_CONSTANT(KEY_DOLLAR); + BIND_GLOBAL_ENUM_CONSTANT(KEY_PERCENT); + BIND_GLOBAL_ENUM_CONSTANT(KEY_AMPERSAND); + BIND_GLOBAL_ENUM_CONSTANT(KEY_APOSTROPHE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_PARENLEFT); + BIND_GLOBAL_ENUM_CONSTANT(KEY_PARENRIGHT); + BIND_GLOBAL_ENUM_CONSTANT(KEY_ASTERISK); + BIND_GLOBAL_ENUM_CONSTANT(KEY_PLUS); + BIND_GLOBAL_ENUM_CONSTANT(KEY_COMMA); + BIND_GLOBAL_ENUM_CONSTANT(KEY_MINUS); + BIND_GLOBAL_ENUM_CONSTANT(KEY_PERIOD); + BIND_GLOBAL_ENUM_CONSTANT(KEY_SLASH); + BIND_GLOBAL_ENUM_CONSTANT(KEY_0); + BIND_GLOBAL_ENUM_CONSTANT(KEY_1); + BIND_GLOBAL_ENUM_CONSTANT(KEY_2); + BIND_GLOBAL_ENUM_CONSTANT(KEY_3); + BIND_GLOBAL_ENUM_CONSTANT(KEY_4); + BIND_GLOBAL_ENUM_CONSTANT(KEY_5); + BIND_GLOBAL_ENUM_CONSTANT(KEY_6); + BIND_GLOBAL_ENUM_CONSTANT(KEY_7); + BIND_GLOBAL_ENUM_CONSTANT(KEY_8); + BIND_GLOBAL_ENUM_CONSTANT(KEY_9); + BIND_GLOBAL_ENUM_CONSTANT(KEY_COLON); + BIND_GLOBAL_ENUM_CONSTANT(KEY_SEMICOLON); + BIND_GLOBAL_ENUM_CONSTANT(KEY_LESS); + BIND_GLOBAL_ENUM_CONSTANT(KEY_EQUAL); + BIND_GLOBAL_ENUM_CONSTANT(KEY_GREATER); + BIND_GLOBAL_ENUM_CONSTANT(KEY_QUESTION); + BIND_GLOBAL_ENUM_CONSTANT(KEY_AT); + BIND_GLOBAL_ENUM_CONSTANT(KEY_A); + BIND_GLOBAL_ENUM_CONSTANT(KEY_B); + BIND_GLOBAL_ENUM_CONSTANT(KEY_C); + BIND_GLOBAL_ENUM_CONSTANT(KEY_D); + BIND_GLOBAL_ENUM_CONSTANT(KEY_E); + BIND_GLOBAL_ENUM_CONSTANT(KEY_F); + BIND_GLOBAL_ENUM_CONSTANT(KEY_G); + BIND_GLOBAL_ENUM_CONSTANT(KEY_H); + BIND_GLOBAL_ENUM_CONSTANT(KEY_I); + BIND_GLOBAL_ENUM_CONSTANT(KEY_J); + BIND_GLOBAL_ENUM_CONSTANT(KEY_K); + BIND_GLOBAL_ENUM_CONSTANT(KEY_L); + BIND_GLOBAL_ENUM_CONSTANT(KEY_M); + BIND_GLOBAL_ENUM_CONSTANT(KEY_N); + BIND_GLOBAL_ENUM_CONSTANT(KEY_O); + BIND_GLOBAL_ENUM_CONSTANT(KEY_P); + BIND_GLOBAL_ENUM_CONSTANT(KEY_Q); + BIND_GLOBAL_ENUM_CONSTANT(KEY_R); + BIND_GLOBAL_ENUM_CONSTANT(KEY_S); + BIND_GLOBAL_ENUM_CONSTANT(KEY_T); + BIND_GLOBAL_ENUM_CONSTANT(KEY_U); + BIND_GLOBAL_ENUM_CONSTANT(KEY_V); + BIND_GLOBAL_ENUM_CONSTANT(KEY_W); + BIND_GLOBAL_ENUM_CONSTANT(KEY_X); + BIND_GLOBAL_ENUM_CONSTANT(KEY_Y); + BIND_GLOBAL_ENUM_CONSTANT(KEY_Z); + BIND_GLOBAL_ENUM_CONSTANT(KEY_BRACKETLEFT); + BIND_GLOBAL_ENUM_CONSTANT(KEY_BACKSLASH); + BIND_GLOBAL_ENUM_CONSTANT(KEY_BRACKETRIGHT); + BIND_GLOBAL_ENUM_CONSTANT(KEY_ASCIICIRCUM); + BIND_GLOBAL_ENUM_CONSTANT(KEY_UNDERSCORE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_QUOTELEFT); + BIND_GLOBAL_ENUM_CONSTANT(KEY_BRACELEFT); + BIND_GLOBAL_ENUM_CONSTANT(KEY_BAR); + BIND_GLOBAL_ENUM_CONSTANT(KEY_BRACERIGHT); + BIND_GLOBAL_ENUM_CONSTANT(KEY_ASCIITILDE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_NOBREAKSPACE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_EXCLAMDOWN); + BIND_GLOBAL_ENUM_CONSTANT(KEY_CENT); + BIND_GLOBAL_ENUM_CONSTANT(KEY_STERLING); + BIND_GLOBAL_ENUM_CONSTANT(KEY_CURRENCY); + BIND_GLOBAL_ENUM_CONSTANT(KEY_YEN); + BIND_GLOBAL_ENUM_CONSTANT(KEY_BROKENBAR); + BIND_GLOBAL_ENUM_CONSTANT(KEY_SECTION); + BIND_GLOBAL_ENUM_CONSTANT(KEY_DIAERESIS); + BIND_GLOBAL_ENUM_CONSTANT(KEY_COPYRIGHT); + BIND_GLOBAL_ENUM_CONSTANT(KEY_ORDFEMININE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_GUILLEMOTLEFT); + BIND_GLOBAL_ENUM_CONSTANT(KEY_NOTSIGN); + BIND_GLOBAL_ENUM_CONSTANT(KEY_HYPHEN); + BIND_GLOBAL_ENUM_CONSTANT(KEY_REGISTERED); + BIND_GLOBAL_ENUM_CONSTANT(KEY_MACRON); + BIND_GLOBAL_ENUM_CONSTANT(KEY_DEGREE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_PLUSMINUS); + BIND_GLOBAL_ENUM_CONSTANT(KEY_TWOSUPERIOR); + BIND_GLOBAL_ENUM_CONSTANT(KEY_THREESUPERIOR); + BIND_GLOBAL_ENUM_CONSTANT(KEY_ACUTE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_MU); + BIND_GLOBAL_ENUM_CONSTANT(KEY_PARAGRAPH); + BIND_GLOBAL_ENUM_CONSTANT(KEY_PERIODCENTERED); + BIND_GLOBAL_ENUM_CONSTANT(KEY_CEDILLA); + BIND_GLOBAL_ENUM_CONSTANT(KEY_ONESUPERIOR); + BIND_GLOBAL_ENUM_CONSTANT(KEY_MASCULINE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_GUILLEMOTRIGHT); + BIND_GLOBAL_ENUM_CONSTANT(KEY_ONEQUARTER); + BIND_GLOBAL_ENUM_CONSTANT(KEY_ONEHALF); + BIND_GLOBAL_ENUM_CONSTANT(KEY_THREEQUARTERS); + BIND_GLOBAL_ENUM_CONSTANT(KEY_QUESTIONDOWN); + BIND_GLOBAL_ENUM_CONSTANT(KEY_AGRAVE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_AACUTE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_ACIRCUMFLEX); + BIND_GLOBAL_ENUM_CONSTANT(KEY_ATILDE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_ADIAERESIS); + BIND_GLOBAL_ENUM_CONSTANT(KEY_ARING); + BIND_GLOBAL_ENUM_CONSTANT(KEY_AE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_CCEDILLA); + BIND_GLOBAL_ENUM_CONSTANT(KEY_EGRAVE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_EACUTE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_ECIRCUMFLEX); + BIND_GLOBAL_ENUM_CONSTANT(KEY_EDIAERESIS); + BIND_GLOBAL_ENUM_CONSTANT(KEY_IGRAVE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_IACUTE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_ICIRCUMFLEX); + BIND_GLOBAL_ENUM_CONSTANT(KEY_IDIAERESIS); + BIND_GLOBAL_ENUM_CONSTANT(KEY_ETH); + BIND_GLOBAL_ENUM_CONSTANT(KEY_NTILDE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_OGRAVE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_OACUTE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_OCIRCUMFLEX); + BIND_GLOBAL_ENUM_CONSTANT(KEY_OTILDE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_ODIAERESIS); + BIND_GLOBAL_ENUM_CONSTANT(KEY_MULTIPLY); + BIND_GLOBAL_ENUM_CONSTANT(KEY_OOBLIQUE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_UGRAVE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_UACUTE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_UCIRCUMFLEX); + BIND_GLOBAL_ENUM_CONSTANT(KEY_UDIAERESIS); + BIND_GLOBAL_ENUM_CONSTANT(KEY_YACUTE); + BIND_GLOBAL_ENUM_CONSTANT(KEY_THORN); + BIND_GLOBAL_ENUM_CONSTANT(KEY_SSHARP); + + BIND_GLOBAL_ENUM_CONSTANT(KEY_DIVISION); + BIND_GLOBAL_ENUM_CONSTANT(KEY_YDIAERESIS); + + BIND_GLOBAL_ENUM_CONSTANT(KEY_CODE_MASK); + BIND_GLOBAL_ENUM_CONSTANT(KEY_MODIFIER_MASK); + + BIND_GLOBAL_ENUM_CONSTANT(KEY_MASK_SHIFT); + BIND_GLOBAL_ENUM_CONSTANT(KEY_MASK_ALT); + BIND_GLOBAL_ENUM_CONSTANT(KEY_MASK_META); + BIND_GLOBAL_ENUM_CONSTANT(KEY_MASK_CTRL); + BIND_GLOBAL_ENUM_CONSTANT(KEY_MASK_CMD); + BIND_GLOBAL_ENUM_CONSTANT(KEY_MASK_KPAD); + BIND_GLOBAL_ENUM_CONSTANT(KEY_MASK_GROUP_SWITCH); // mouse - BIND_GLOBAL_CONSTANT(BUTTON_LEFT), - BIND_GLOBAL_CONSTANT(BUTTON_RIGHT), - BIND_GLOBAL_CONSTANT(BUTTON_MIDDLE), - BIND_GLOBAL_CONSTANT(BUTTON_WHEEL_UP), - BIND_GLOBAL_CONSTANT(BUTTON_WHEEL_DOWN), - BIND_GLOBAL_CONSTANT(BUTTON_WHEEL_LEFT), - BIND_GLOBAL_CONSTANT(BUTTON_WHEEL_RIGHT), - BIND_GLOBAL_CONSTANT(BUTTON_MASK_LEFT), - BIND_GLOBAL_CONSTANT(BUTTON_MASK_RIGHT), - BIND_GLOBAL_CONSTANT(BUTTON_MASK_MIDDLE), + BIND_GLOBAL_CONSTANT(BUTTON_LEFT); + BIND_GLOBAL_CONSTANT(BUTTON_RIGHT); + BIND_GLOBAL_CONSTANT(BUTTON_MIDDLE); + BIND_GLOBAL_CONSTANT(BUTTON_WHEEL_UP); + BIND_GLOBAL_CONSTANT(BUTTON_WHEEL_DOWN); + BIND_GLOBAL_CONSTANT(BUTTON_WHEEL_LEFT); + BIND_GLOBAL_CONSTANT(BUTTON_WHEEL_RIGHT); + BIND_GLOBAL_CONSTANT(BUTTON_MASK_LEFT); + BIND_GLOBAL_CONSTANT(BUTTON_MASK_RIGHT); + BIND_GLOBAL_CONSTANT(BUTTON_MASK_MIDDLE); //joypads - BIND_GLOBAL_CONSTANT(JOY_BUTTON_0), - BIND_GLOBAL_CONSTANT(JOY_BUTTON_1), - BIND_GLOBAL_CONSTANT(JOY_BUTTON_2), - BIND_GLOBAL_CONSTANT(JOY_BUTTON_3), - BIND_GLOBAL_CONSTANT(JOY_BUTTON_4), - BIND_GLOBAL_CONSTANT(JOY_BUTTON_5), - BIND_GLOBAL_CONSTANT(JOY_BUTTON_6), - BIND_GLOBAL_CONSTANT(JOY_BUTTON_7), - BIND_GLOBAL_CONSTANT(JOY_BUTTON_8), - BIND_GLOBAL_CONSTANT(JOY_BUTTON_9), - BIND_GLOBAL_CONSTANT(JOY_BUTTON_10), - BIND_GLOBAL_CONSTANT(JOY_BUTTON_11), - BIND_GLOBAL_CONSTANT(JOY_BUTTON_12), - BIND_GLOBAL_CONSTANT(JOY_BUTTON_13), - BIND_GLOBAL_CONSTANT(JOY_BUTTON_14), - BIND_GLOBAL_CONSTANT(JOY_BUTTON_15), - BIND_GLOBAL_CONSTANT(JOY_BUTTON_MAX), - - BIND_GLOBAL_CONSTANT(JOY_SONY_CIRCLE), - BIND_GLOBAL_CONSTANT(JOY_SONY_X), - BIND_GLOBAL_CONSTANT(JOY_SONY_SQUARE), - BIND_GLOBAL_CONSTANT(JOY_SONY_TRIANGLE), - - BIND_GLOBAL_CONSTANT(JOY_XBOX_B), - BIND_GLOBAL_CONSTANT(JOY_XBOX_A), - BIND_GLOBAL_CONSTANT(JOY_XBOX_X), - BIND_GLOBAL_CONSTANT(JOY_XBOX_Y), - - BIND_GLOBAL_CONSTANT(JOY_DS_A), - BIND_GLOBAL_CONSTANT(JOY_DS_B), - BIND_GLOBAL_CONSTANT(JOY_DS_X), - BIND_GLOBAL_CONSTANT(JOY_DS_Y), - - BIND_GLOBAL_CONSTANT(JOY_SELECT), - BIND_GLOBAL_CONSTANT(JOY_START), - BIND_GLOBAL_CONSTANT(JOY_DPAD_UP), - BIND_GLOBAL_CONSTANT(JOY_DPAD_DOWN), - BIND_GLOBAL_CONSTANT(JOY_DPAD_LEFT), - BIND_GLOBAL_CONSTANT(JOY_DPAD_RIGHT), - BIND_GLOBAL_CONSTANT(JOY_L), - BIND_GLOBAL_CONSTANT(JOY_L2), - BIND_GLOBAL_CONSTANT(JOY_L3), - BIND_GLOBAL_CONSTANT(JOY_R), - BIND_GLOBAL_CONSTANT(JOY_R2), - BIND_GLOBAL_CONSTANT(JOY_R3), - - BIND_GLOBAL_CONSTANT(JOY_AXIS_0), - BIND_GLOBAL_CONSTANT(JOY_AXIS_1), - BIND_GLOBAL_CONSTANT(JOY_AXIS_2), - BIND_GLOBAL_CONSTANT(JOY_AXIS_3), - BIND_GLOBAL_CONSTANT(JOY_AXIS_4), - BIND_GLOBAL_CONSTANT(JOY_AXIS_5), - BIND_GLOBAL_CONSTANT(JOY_AXIS_6), - BIND_GLOBAL_CONSTANT(JOY_AXIS_7), - BIND_GLOBAL_CONSTANT(JOY_AXIS_MAX), - - BIND_GLOBAL_CONSTANT(JOY_ANALOG_LX), - BIND_GLOBAL_CONSTANT(JOY_ANALOG_LY), - - BIND_GLOBAL_CONSTANT(JOY_ANALOG_RX), - BIND_GLOBAL_CONSTANT(JOY_ANALOG_RY), - - BIND_GLOBAL_CONSTANT(JOY_ANALOG_L2), - BIND_GLOBAL_CONSTANT(JOY_ANALOG_R2), + BIND_GLOBAL_CONSTANT(JOY_BUTTON_0); + BIND_GLOBAL_CONSTANT(JOY_BUTTON_1); + BIND_GLOBAL_CONSTANT(JOY_BUTTON_2); + BIND_GLOBAL_CONSTANT(JOY_BUTTON_3); + BIND_GLOBAL_CONSTANT(JOY_BUTTON_4); + BIND_GLOBAL_CONSTANT(JOY_BUTTON_5); + BIND_GLOBAL_CONSTANT(JOY_BUTTON_6); + BIND_GLOBAL_CONSTANT(JOY_BUTTON_7); + BIND_GLOBAL_CONSTANT(JOY_BUTTON_8); + BIND_GLOBAL_CONSTANT(JOY_BUTTON_9); + BIND_GLOBAL_CONSTANT(JOY_BUTTON_10); + BIND_GLOBAL_CONSTANT(JOY_BUTTON_11); + BIND_GLOBAL_CONSTANT(JOY_BUTTON_12); + BIND_GLOBAL_CONSTANT(JOY_BUTTON_13); + BIND_GLOBAL_CONSTANT(JOY_BUTTON_14); + BIND_GLOBAL_CONSTANT(JOY_BUTTON_15); + BIND_GLOBAL_CONSTANT(JOY_BUTTON_MAX); + + BIND_GLOBAL_CONSTANT(JOY_SONY_CIRCLE); + BIND_GLOBAL_CONSTANT(JOY_SONY_X); + BIND_GLOBAL_CONSTANT(JOY_SONY_SQUARE); + BIND_GLOBAL_CONSTANT(JOY_SONY_TRIANGLE); + + BIND_GLOBAL_CONSTANT(JOY_XBOX_B); + BIND_GLOBAL_CONSTANT(JOY_XBOX_A); + BIND_GLOBAL_CONSTANT(JOY_XBOX_X); + BIND_GLOBAL_CONSTANT(JOY_XBOX_Y); + + BIND_GLOBAL_CONSTANT(JOY_DS_A); + BIND_GLOBAL_CONSTANT(JOY_DS_B); + BIND_GLOBAL_CONSTANT(JOY_DS_X); + BIND_GLOBAL_CONSTANT(JOY_DS_Y); + + BIND_GLOBAL_CONSTANT(JOY_SELECT); + BIND_GLOBAL_CONSTANT(JOY_START); + BIND_GLOBAL_CONSTANT(JOY_DPAD_UP); + BIND_GLOBAL_CONSTANT(JOY_DPAD_DOWN); + BIND_GLOBAL_CONSTANT(JOY_DPAD_LEFT); + BIND_GLOBAL_CONSTANT(JOY_DPAD_RIGHT); + BIND_GLOBAL_CONSTANT(JOY_L); + BIND_GLOBAL_CONSTANT(JOY_L2); + BIND_GLOBAL_CONSTANT(JOY_L3); + BIND_GLOBAL_CONSTANT(JOY_R); + BIND_GLOBAL_CONSTANT(JOY_R2); + BIND_GLOBAL_CONSTANT(JOY_R3); + + BIND_GLOBAL_CONSTANT(JOY_AXIS_0); + BIND_GLOBAL_CONSTANT(JOY_AXIS_1); + BIND_GLOBAL_CONSTANT(JOY_AXIS_2); + BIND_GLOBAL_CONSTANT(JOY_AXIS_3); + BIND_GLOBAL_CONSTANT(JOY_AXIS_4); + BIND_GLOBAL_CONSTANT(JOY_AXIS_5); + BIND_GLOBAL_CONSTANT(JOY_AXIS_6); + BIND_GLOBAL_CONSTANT(JOY_AXIS_7); + BIND_GLOBAL_CONSTANT(JOY_AXIS_MAX); + + BIND_GLOBAL_CONSTANT(JOY_ANALOG_LX); + BIND_GLOBAL_CONSTANT(JOY_ANALOG_LY); + + BIND_GLOBAL_CONSTANT(JOY_ANALOG_RX); + BIND_GLOBAL_CONSTANT(JOY_ANALOG_RY); + + BIND_GLOBAL_CONSTANT(JOY_ANALOG_L2); + BIND_GLOBAL_CONSTANT(JOY_ANALOG_R2); // error list - BIND_GLOBAL_CONSTANT(OK), - BIND_GLOBAL_CONSTANT(FAILED), ///< Generic fail error - BIND_GLOBAL_CONSTANT(ERR_UNAVAILABLE), ///< What is requested is unsupported/unavailable - BIND_GLOBAL_CONSTANT(ERR_UNCONFIGURED), ///< The object being used hasn't been properly set up yet - BIND_GLOBAL_CONSTANT(ERR_UNAUTHORIZED), ///< Missing credentials for requested resource - BIND_GLOBAL_CONSTANT(ERR_PARAMETER_RANGE_ERROR), ///< Parameter given out of range - BIND_GLOBAL_CONSTANT(ERR_OUT_OF_MEMORY), ///< Out of memory - BIND_GLOBAL_CONSTANT(ERR_FILE_NOT_FOUND), - BIND_GLOBAL_CONSTANT(ERR_FILE_BAD_DRIVE), - BIND_GLOBAL_CONSTANT(ERR_FILE_BAD_PATH), - BIND_GLOBAL_CONSTANT(ERR_FILE_NO_PERMISSION), - BIND_GLOBAL_CONSTANT(ERR_FILE_ALREADY_IN_USE), - BIND_GLOBAL_CONSTANT(ERR_FILE_CANT_OPEN), - BIND_GLOBAL_CONSTANT(ERR_FILE_CANT_WRITE), - BIND_GLOBAL_CONSTANT(ERR_FILE_CANT_READ), - BIND_GLOBAL_CONSTANT(ERR_FILE_UNRECOGNIZED), - BIND_GLOBAL_CONSTANT(ERR_FILE_CORRUPT), - BIND_GLOBAL_CONSTANT(ERR_FILE_MISSING_DEPENDENCIES), - BIND_GLOBAL_CONSTANT(ERR_FILE_EOF), - BIND_GLOBAL_CONSTANT(ERR_CANT_OPEN), ///< Can't open a resource/socket/file - BIND_GLOBAL_CONSTANT(ERR_CANT_CREATE), - BIND_GLOBAL_CONSTANT(ERR_PARSE_ERROR), - BIND_GLOBAL_CONSTANT(ERR_QUERY_FAILED), - BIND_GLOBAL_CONSTANT(ERR_ALREADY_IN_USE), - BIND_GLOBAL_CONSTANT(ERR_LOCKED), ///< resource is locked - BIND_GLOBAL_CONSTANT(ERR_TIMEOUT), - BIND_GLOBAL_CONSTANT(ERR_CANT_AQUIRE_RESOURCE), - BIND_GLOBAL_CONSTANT(ERR_INVALID_DATA), ///< Data passed is invalid - BIND_GLOBAL_CONSTANT(ERR_INVALID_PARAMETER), ///< Parameter passed is invalid - BIND_GLOBAL_CONSTANT(ERR_ALREADY_EXISTS), ///< When adding ), item already exists - BIND_GLOBAL_CONSTANT(ERR_DOES_NOT_EXIST), ///< When retrieving/erasing ), it item does not exist - BIND_GLOBAL_CONSTANT(ERR_DATABASE_CANT_READ), ///< database is full - BIND_GLOBAL_CONSTANT(ERR_DATABASE_CANT_WRITE), ///< database is full - BIND_GLOBAL_CONSTANT(ERR_COMPILATION_FAILED), - BIND_GLOBAL_CONSTANT(ERR_METHOD_NOT_FOUND), - BIND_GLOBAL_CONSTANT(ERR_LINK_FAILED), - BIND_GLOBAL_CONSTANT(ERR_SCRIPT_FAILED), - BIND_GLOBAL_CONSTANT(ERR_CYCLIC_LINK), - BIND_GLOBAL_CONSTANT(ERR_BUSY), - BIND_GLOBAL_CONSTANT(ERR_HELP), ///< user requested help!! - BIND_GLOBAL_CONSTANT(ERR_BUG), ///< a bug in the software certainly happened ), due to a double check failing or unexpected behavior. - BIND_GLOBAL_CONSTANT(ERR_WTF), - - BIND_GLOBAL_CONSTANT(PROPERTY_HINT_NONE), - BIND_GLOBAL_CONSTANT(PROPERTY_HINT_RANGE), - BIND_GLOBAL_CONSTANT(PROPERTY_HINT_EXP_RANGE), - BIND_GLOBAL_CONSTANT(PROPERTY_HINT_ENUM), - BIND_GLOBAL_CONSTANT(PROPERTY_HINT_EXP_EASING), - BIND_GLOBAL_CONSTANT(PROPERTY_HINT_LENGTH), - BIND_GLOBAL_CONSTANT(PROPERTY_HINT_KEY_ACCEL), - BIND_GLOBAL_CONSTANT(PROPERTY_HINT_FLAGS), - - BIND_GLOBAL_CONSTANT(PROPERTY_HINT_LAYERS_2D_RENDER), - BIND_GLOBAL_CONSTANT(PROPERTY_HINT_LAYERS_2D_PHYSICS), - BIND_GLOBAL_CONSTANT(PROPERTY_HINT_LAYERS_3D_RENDER), - BIND_GLOBAL_CONSTANT(PROPERTY_HINT_LAYERS_3D_PHYSICS), - - BIND_GLOBAL_CONSTANT(PROPERTY_HINT_FILE), - BIND_GLOBAL_CONSTANT(PROPERTY_HINT_DIR), - BIND_GLOBAL_CONSTANT(PROPERTY_HINT_GLOBAL_FILE), - BIND_GLOBAL_CONSTANT(PROPERTY_HINT_GLOBAL_DIR), - BIND_GLOBAL_CONSTANT(PROPERTY_HINT_RESOURCE_TYPE), - BIND_GLOBAL_CONSTANT(PROPERTY_HINT_MULTILINE_TEXT), - BIND_GLOBAL_CONSTANT(PROPERTY_HINT_COLOR_NO_ALPHA), - BIND_GLOBAL_CONSTANT(PROPERTY_HINT_IMAGE_COMPRESS_LOSSY), - BIND_GLOBAL_CONSTANT(PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS), - - BIND_GLOBAL_CONSTANT(PROPERTY_USAGE_STORAGE), - BIND_GLOBAL_CONSTANT(PROPERTY_USAGE_EDITOR), - BIND_GLOBAL_CONSTANT(PROPERTY_USAGE_NETWORK), - - BIND_GLOBAL_CONSTANT(PROPERTY_USAGE_EDITOR_HELPER), - BIND_GLOBAL_CONSTANT(PROPERTY_USAGE_CHECKABLE), - BIND_GLOBAL_CONSTANT(PROPERTY_USAGE_CHECKED), - BIND_GLOBAL_CONSTANT(PROPERTY_USAGE_INTERNATIONALIZED), - BIND_GLOBAL_CONSTANT(PROPERTY_USAGE_GROUP), - BIND_GLOBAL_CONSTANT(PROPERTY_USAGE_CATEGORY), - BIND_GLOBAL_CONSTANT(PROPERTY_USAGE_STORE_IF_NONZERO), - BIND_GLOBAL_CONSTANT(PROPERTY_USAGE_STORE_IF_NONONE), - BIND_GLOBAL_CONSTANT(PROPERTY_USAGE_NO_INSTANCE_STATE), - BIND_GLOBAL_CONSTANT(PROPERTY_USAGE_RESTART_IF_CHANGED), - BIND_GLOBAL_CONSTANT(PROPERTY_USAGE_SCRIPT_VARIABLE), - - BIND_GLOBAL_CONSTANT(PROPERTY_USAGE_DEFAULT), - BIND_GLOBAL_CONSTANT(PROPERTY_USAGE_DEFAULT_INTL), - BIND_GLOBAL_CONSTANT(PROPERTY_USAGE_NOEDITOR), - - BIND_GLOBAL_CONSTANT(METHOD_FLAG_NORMAL), - BIND_GLOBAL_CONSTANT(METHOD_FLAG_EDITOR), - BIND_GLOBAL_CONSTANT(METHOD_FLAG_NOSCRIPT), - BIND_GLOBAL_CONSTANT(METHOD_FLAG_CONST), - BIND_GLOBAL_CONSTANT(METHOD_FLAG_REVERSE), - BIND_GLOBAL_CONSTANT(METHOD_FLAG_VIRTUAL), - BIND_GLOBAL_CONSTANT(METHOD_FLAG_FROM_SCRIPT), - BIND_GLOBAL_CONSTANT(METHOD_FLAGS_DEFAULT), - - { "TYPE_NIL", Variant::NIL }, - { "TYPE_BOOL", Variant::BOOL }, - { "TYPE_INT", Variant::INT }, - { "TYPE_REAL", Variant::REAL }, - { "TYPE_STRING", Variant::STRING }, - { "TYPE_VECTOR2", Variant::VECTOR2 }, // 5 - { "TYPE_RECT2", Variant::RECT2 }, - { "TYPE_VECTOR3", Variant::VECTOR3 }, - { "TYPE_TRANSFORM2D", Variant::TRANSFORM2D }, - { "TYPE_PLANE", Variant::PLANE }, - { "TYPE_QUAT", Variant::QUAT }, // 10 - { "TYPE_RECT3", Variant::RECT3 }, - { "TYPE_BASIS", Variant::BASIS }, - { "TYPE_TRANSFORM", Variant::TRANSFORM }, - { "TYPE_COLOR", Variant::COLOR }, - { "TYPE_NODE_PATH", Variant::NODE_PATH }, // 15 - { "TYPE_RID", Variant::_RID }, - { "TYPE_OBJECT", Variant::OBJECT }, - { "TYPE_DICTIONARY", Variant::DICTIONARY }, // 20 - { "TYPE_ARRAY", Variant::ARRAY }, - { "TYPE_RAW_ARRAY", Variant::POOL_BYTE_ARRAY }, - { "TYPE_INT_ARRAY", Variant::POOL_INT_ARRAY }, - { "TYPE_REAL_ARRAY", Variant::POOL_REAL_ARRAY }, - { "TYPE_STRING_ARRAY", Variant::POOL_STRING_ARRAY }, - { "TYPE_VECTOR2_ARRAY", Variant::POOL_VECTOR2_ARRAY }, // 25 - { "TYPE_VECTOR3_ARRAY", Variant::POOL_VECTOR3_ARRAY }, - { "TYPE_COLOR_ARRAY", Variant::POOL_COLOR_ARRAY }, - { "TYPE_MAX", Variant::VARIANT_MAX }, - { NULL, 0 } + BIND_GLOBAL_ENUM_CONSTANT(OK); + BIND_GLOBAL_ENUM_CONSTANT(FAILED); ///< Generic fail error + BIND_GLOBAL_ENUM_CONSTANT(ERR_UNAVAILABLE); ///< What is requested is unsupported/unavailable + BIND_GLOBAL_ENUM_CONSTANT(ERR_UNCONFIGURED); ///< The object being used hasn't been properly set up yet + BIND_GLOBAL_ENUM_CONSTANT(ERR_UNAUTHORIZED); ///< Missing credentials for requested resource + BIND_GLOBAL_ENUM_CONSTANT(ERR_PARAMETER_RANGE_ERROR); ///< Parameter given out of range + BIND_GLOBAL_ENUM_CONSTANT(ERR_OUT_OF_MEMORY); ///< Out of memory + BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_NOT_FOUND); + BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_BAD_DRIVE); + BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_BAD_PATH); + BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_NO_PERMISSION); + BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_ALREADY_IN_USE); + BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_CANT_OPEN); + BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_CANT_WRITE); + BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_CANT_READ); + BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_UNRECOGNIZED); + BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_CORRUPT); + BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_MISSING_DEPENDENCIES); + BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_EOF); + BIND_GLOBAL_ENUM_CONSTANT(ERR_CANT_OPEN); ///< Can't open a resource/socket/file + BIND_GLOBAL_ENUM_CONSTANT(ERR_CANT_CREATE); + BIND_GLOBAL_ENUM_CONSTANT(ERR_PARSE_ERROR); + BIND_GLOBAL_ENUM_CONSTANT(ERR_QUERY_FAILED); + BIND_GLOBAL_ENUM_CONSTANT(ERR_ALREADY_IN_USE); + BIND_GLOBAL_ENUM_CONSTANT(ERR_LOCKED); ///< resource is locked + BIND_GLOBAL_ENUM_CONSTANT(ERR_TIMEOUT); + BIND_GLOBAL_ENUM_CONSTANT(ERR_CANT_AQUIRE_RESOURCE); + BIND_GLOBAL_ENUM_CONSTANT(ERR_INVALID_DATA); ///< Data passed is invalid + BIND_GLOBAL_ENUM_CONSTANT(ERR_INVALID_PARAMETER); ///< Parameter passed is invalid + BIND_GLOBAL_ENUM_CONSTANT(ERR_ALREADY_EXISTS); ///< When adding ), item already exists + BIND_GLOBAL_ENUM_CONSTANT(ERR_DOES_NOT_EXIST); ///< When retrieving/erasing ), it item does not exist + BIND_GLOBAL_ENUM_CONSTANT(ERR_DATABASE_CANT_READ); ///< database is full + BIND_GLOBAL_ENUM_CONSTANT(ERR_DATABASE_CANT_WRITE); ///< database is full + BIND_GLOBAL_ENUM_CONSTANT(ERR_COMPILATION_FAILED); + BIND_GLOBAL_ENUM_CONSTANT(ERR_METHOD_NOT_FOUND); + BIND_GLOBAL_ENUM_CONSTANT(ERR_LINK_FAILED); + BIND_GLOBAL_ENUM_CONSTANT(ERR_SCRIPT_FAILED); + BIND_GLOBAL_ENUM_CONSTANT(ERR_CYCLIC_LINK); + BIND_GLOBAL_ENUM_CONSTANT(ERR_BUSY); + BIND_GLOBAL_ENUM_CONSTANT(ERR_HELP); ///< user requested help!! + BIND_GLOBAL_ENUM_CONSTANT(ERR_BUG); ///< a bug in the software certainly happened ), due to a double check failing or unexpected behavior. + BIND_GLOBAL_ENUM_CONSTANT(ERR_WTF); + + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_NONE); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_RANGE); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_EXP_RANGE); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_ENUM); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_EXP_EASING); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_LENGTH); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_KEY_ACCEL); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_FLAGS); + + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_LAYERS_2D_RENDER); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_LAYERS_2D_PHYSICS); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_LAYERS_3D_RENDER); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_LAYERS_3D_PHYSICS); + + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_FILE); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_DIR); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_GLOBAL_FILE); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_GLOBAL_DIR); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_RESOURCE_TYPE); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_MULTILINE_TEXT); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_COLOR_NO_ALPHA); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_IMAGE_COMPRESS_LOSSY); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS); + + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_STORAGE); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_EDITOR); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_NETWORK); + + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_EDITOR_HELPER); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_CHECKABLE); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_CHECKED); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_INTERNATIONALIZED); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_GROUP); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_CATEGORY); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_STORE_IF_NONZERO); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_STORE_IF_NONONE); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_NO_INSTANCE_STATE); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_RESTART_IF_CHANGED); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_SCRIPT_VARIABLE); + + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_DEFAULT); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_DEFAULT_INTL); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_NOEDITOR); + + BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAG_NORMAL); + BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAG_EDITOR); + BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAG_NOSCRIPT); + BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAG_CONST); + BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAG_REVERSE); + BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAG_VIRTUAL); + BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAG_FROM_SCRIPT); + BIND_GLOBAL_ENUM_CONSTANT(METHOD_FLAGS_DEFAULT); + + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_NIL", Variant::NIL); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_BOOL", Variant::BOOL); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_INT", Variant::INT); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_REAL", Variant::REAL); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_STRING", Variant::STRING); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2", Variant::VECTOR2); // 5 + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_RECT2", Variant::RECT2); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR3", Variant::VECTOR3); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_TRANSFORM2D", Variant::TRANSFORM2D); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_PLANE", Variant::PLANE); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_QUAT", Variant::QUAT); // 10 + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_RECT3", Variant::RECT3); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_BASIS", Variant::BASIS); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_TRANSFORM", Variant::TRANSFORM); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_COLOR", Variant::COLOR); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_NODE_PATH", Variant::NODE_PATH); // 15 + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_RID", Variant::_RID); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_OBJECT", Variant::OBJECT); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_DICTIONARY", Variant::DICTIONARY); // 20 + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_ARRAY", Variant::ARRAY); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_RAW_ARRAY", Variant::POOL_BYTE_ARRAY); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_INT_ARRAY", Variant::POOL_INT_ARRAY); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_REAL_ARRAY", Variant::POOL_REAL_ARRAY); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_STRING_ARRAY", Variant::POOL_STRING_ARRAY); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2_ARRAY", Variant::POOL_VECTOR2_ARRAY); // 25 + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR3_ARRAY", Variant::POOL_VECTOR3_ARRAY); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_COLOR_ARRAY", Variant::POOL_COLOR_ARRAY); + BIND_GLOBAL_ENUM_CONSTANT_CUSTOM("TYPE_MAX", Variant::VARIANT_MAX); +} -}; +void unregister_global_constants() { + + _global_constants.clear(); +} int GlobalConstants::get_global_constant_count() { - int i = 0; - while (_global_constants[i].name) - i++; - return i; + return _global_constants.size(); +} + +#ifdef DEBUG_METHODS_ENABLED +StringName GlobalConstants::get_global_constant_enum(int p_idx) { + + return _global_constants[p_idx].enum_name; +} +#else +StringName GlobalConstants::get_global_constant_enum(int p_idx) { + + return StringName(); } +#endif const char *GlobalConstants::get_global_constant_name(int p_idx) { diff --git a/core/global_constants.h b/core/global_constants.h index f298fc31c7..ad639d0afa 100644 --- a/core/global_constants.h +++ b/core/global_constants.h @@ -30,9 +30,12 @@ #ifndef GLOBAL_CONSTANTS_H #define GLOBAL_CONSTANTS_H +#include "string_db.h" + class GlobalConstants { public: static int get_global_constant_count(); + static StringName get_global_constant_enum(int p_idx); static const char *get_global_constant_name(int p_idx); static int get_global_constant_value(int p_idx); }; diff --git a/core/image.cpp b/core/image.cpp index a4864458b5..91572e44e4 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -2275,62 +2275,62 @@ void Image::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "_set_data", "_get_data"); - BIND_CONSTANT(FORMAT_L8); //luminance - BIND_CONSTANT(FORMAT_LA8); //luminance-alpha - BIND_CONSTANT(FORMAT_R8); - BIND_CONSTANT(FORMAT_RG8); - BIND_CONSTANT(FORMAT_RGB8); - BIND_CONSTANT(FORMAT_RGBA8); - BIND_CONSTANT(FORMAT_RGBA4444); - BIND_CONSTANT(FORMAT_RGBA5551); - BIND_CONSTANT(FORMAT_RF); //float - BIND_CONSTANT(FORMAT_RGF); - BIND_CONSTANT(FORMAT_RGBF); - BIND_CONSTANT(FORMAT_RGBAF); - BIND_CONSTANT(FORMAT_RH); //half float - BIND_CONSTANT(FORMAT_RGH); - BIND_CONSTANT(FORMAT_RGBH); - BIND_CONSTANT(FORMAT_RGBAH); - BIND_CONSTANT(FORMAT_RGBE9995); - BIND_CONSTANT(FORMAT_DXT1); //s3tc bc1 - BIND_CONSTANT(FORMAT_DXT3); //bc2 - BIND_CONSTANT(FORMAT_DXT5); //bc3 - BIND_CONSTANT(FORMAT_RGTC_R); - BIND_CONSTANT(FORMAT_RGTC_RG); - BIND_CONSTANT(FORMAT_BPTC_RGBA); //btpc bc6h - BIND_CONSTANT(FORMAT_BPTC_RGBF); //float / - BIND_CONSTANT(FORMAT_BPTC_RGBFU); //unsigned float - BIND_CONSTANT(FORMAT_PVRTC2); //pvrtc - BIND_CONSTANT(FORMAT_PVRTC2A); - BIND_CONSTANT(FORMAT_PVRTC4); - BIND_CONSTANT(FORMAT_PVRTC4A); - BIND_CONSTANT(FORMAT_ETC); //etc1 - BIND_CONSTANT(FORMAT_ETC2_R11); //etc2 - BIND_CONSTANT(FORMAT_ETC2_R11S); //signed ); NOT srgb. - BIND_CONSTANT(FORMAT_ETC2_RG11); - BIND_CONSTANT(FORMAT_ETC2_RG11S); - BIND_CONSTANT(FORMAT_ETC2_RGB8); - BIND_CONSTANT(FORMAT_ETC2_RGBA8); - BIND_CONSTANT(FORMAT_ETC2_RGB8A1); - BIND_CONSTANT(FORMAT_MAX); - - BIND_CONSTANT(INTERPOLATE_NEAREST); - BIND_CONSTANT(INTERPOLATE_BILINEAR); - BIND_CONSTANT(INTERPOLATE_CUBIC); - - BIND_CONSTANT(ALPHA_NONE); - BIND_CONSTANT(ALPHA_BIT); - BIND_CONSTANT(ALPHA_BLEND); - - BIND_CONSTANT(COMPRESS_S3TC); - BIND_CONSTANT(COMPRESS_PVRTC2); - BIND_CONSTANT(COMPRESS_PVRTC4); - BIND_CONSTANT(COMPRESS_ETC); - BIND_CONSTANT(COMPRESS_ETC2); - - BIND_CONSTANT(COMPRESS_SOURCE_GENERIC); - BIND_CONSTANT(COMPRESS_SOURCE_SRGB); - BIND_CONSTANT(COMPRESS_SOURCE_NORMAL); + BIND_ENUM_CONSTANT(FORMAT_L8); //luminance + BIND_ENUM_CONSTANT(FORMAT_LA8); //luminance-alpha + BIND_ENUM_CONSTANT(FORMAT_R8); + BIND_ENUM_CONSTANT(FORMAT_RG8); + BIND_ENUM_CONSTANT(FORMAT_RGB8); + BIND_ENUM_CONSTANT(FORMAT_RGBA8); + BIND_ENUM_CONSTANT(FORMAT_RGBA4444); + BIND_ENUM_CONSTANT(FORMAT_RGBA5551); + BIND_ENUM_CONSTANT(FORMAT_RF); //float + BIND_ENUM_CONSTANT(FORMAT_RGF); + BIND_ENUM_CONSTANT(FORMAT_RGBF); + BIND_ENUM_CONSTANT(FORMAT_RGBAF); + BIND_ENUM_CONSTANT(FORMAT_RH); //half float + BIND_ENUM_CONSTANT(FORMAT_RGH); + BIND_ENUM_CONSTANT(FORMAT_RGBH); + BIND_ENUM_CONSTANT(FORMAT_RGBAH); + BIND_ENUM_CONSTANT(FORMAT_RGBE9995); + BIND_ENUM_CONSTANT(FORMAT_DXT1); //s3tc bc1 + BIND_ENUM_CONSTANT(FORMAT_DXT3); //bc2 + BIND_ENUM_CONSTANT(FORMAT_DXT5); //bc3 + BIND_ENUM_CONSTANT(FORMAT_RGTC_R); + BIND_ENUM_CONSTANT(FORMAT_RGTC_RG); + BIND_ENUM_CONSTANT(FORMAT_BPTC_RGBA); //btpc bc6h + BIND_ENUM_CONSTANT(FORMAT_BPTC_RGBF); //float / + BIND_ENUM_CONSTANT(FORMAT_BPTC_RGBFU); //unsigned float + BIND_ENUM_CONSTANT(FORMAT_PVRTC2); //pvrtc + BIND_ENUM_CONSTANT(FORMAT_PVRTC2A); + BIND_ENUM_CONSTANT(FORMAT_PVRTC4); + BIND_ENUM_CONSTANT(FORMAT_PVRTC4A); + BIND_ENUM_CONSTANT(FORMAT_ETC); //etc1 + BIND_ENUM_CONSTANT(FORMAT_ETC2_R11); //etc2 + BIND_ENUM_CONSTANT(FORMAT_ETC2_R11S); //signed ); NOT srgb. + BIND_ENUM_CONSTANT(FORMAT_ETC2_RG11); + BIND_ENUM_CONSTANT(FORMAT_ETC2_RG11S); + BIND_ENUM_CONSTANT(FORMAT_ETC2_RGB8); + BIND_ENUM_CONSTANT(FORMAT_ETC2_RGBA8); + BIND_ENUM_CONSTANT(FORMAT_ETC2_RGB8A1); + BIND_ENUM_CONSTANT(FORMAT_MAX); + + BIND_ENUM_CONSTANT(INTERPOLATE_NEAREST); + BIND_ENUM_CONSTANT(INTERPOLATE_BILINEAR); + BIND_ENUM_CONSTANT(INTERPOLATE_CUBIC); + + BIND_ENUM_CONSTANT(ALPHA_NONE); + BIND_ENUM_CONSTANT(ALPHA_BIT); + BIND_ENUM_CONSTANT(ALPHA_BLEND); + + BIND_ENUM_CONSTANT(COMPRESS_S3TC); + BIND_ENUM_CONSTANT(COMPRESS_PVRTC2); + BIND_ENUM_CONSTANT(COMPRESS_PVRTC4); + BIND_ENUM_CONSTANT(COMPRESS_ETC); + BIND_ENUM_CONSTANT(COMPRESS_ETC2); + + BIND_ENUM_CONSTANT(COMPRESS_SOURCE_GENERIC); + BIND_ENUM_CONSTANT(COMPRESS_SOURCE_SRGB); + BIND_ENUM_CONSTANT(COMPRESS_SOURCE_NORMAL); } void Image::set_compress_bc_func(void (*p_compress_func)(Image *, CompressSource)) { diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 4d5b88cfa1..1c35c6edeb 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -650,84 +650,84 @@ void HTTPClient::_bind_methods() { ClassDB::bind_method(D_METHOD("query_string_from_dict", "fields"), &HTTPClient::query_string_from_dict); - BIND_CONSTANT(METHOD_GET); - BIND_CONSTANT(METHOD_HEAD); - BIND_CONSTANT(METHOD_POST); - BIND_CONSTANT(METHOD_PUT); - BIND_CONSTANT(METHOD_DELETE); - BIND_CONSTANT(METHOD_OPTIONS); - BIND_CONSTANT(METHOD_TRACE); - BIND_CONSTANT(METHOD_CONNECT); - BIND_CONSTANT(METHOD_MAX); - - BIND_CONSTANT(STATUS_DISCONNECTED); - BIND_CONSTANT(STATUS_RESOLVING); //resolving hostname (if passed a hostname) - BIND_CONSTANT(STATUS_CANT_RESOLVE); - BIND_CONSTANT(STATUS_CONNECTING); //connecting to ip - BIND_CONSTANT(STATUS_CANT_CONNECT); - BIND_CONSTANT(STATUS_CONNECTED); //connected ); requests only accepted here - BIND_CONSTANT(STATUS_REQUESTING); // request in progress - BIND_CONSTANT(STATUS_BODY); // request resulted in body ); which must be read - BIND_CONSTANT(STATUS_CONNECTION_ERROR); - BIND_CONSTANT(STATUS_SSL_HANDSHAKE_ERROR); - - BIND_CONSTANT(RESPONSE_CONTINUE); - BIND_CONSTANT(RESPONSE_SWITCHING_PROTOCOLS); - BIND_CONSTANT(RESPONSE_PROCESSING); + BIND_ENUM_CONSTANT(METHOD_GET); + BIND_ENUM_CONSTANT(METHOD_HEAD); + BIND_ENUM_CONSTANT(METHOD_POST); + BIND_ENUM_CONSTANT(METHOD_PUT); + BIND_ENUM_CONSTANT(METHOD_DELETE); + BIND_ENUM_CONSTANT(METHOD_OPTIONS); + BIND_ENUM_CONSTANT(METHOD_TRACE); + BIND_ENUM_CONSTANT(METHOD_CONNECT); + BIND_ENUM_CONSTANT(METHOD_MAX); + + BIND_ENUM_CONSTANT(STATUS_DISCONNECTED); + BIND_ENUM_CONSTANT(STATUS_RESOLVING); //resolving hostname (if passed a hostname) + BIND_ENUM_CONSTANT(STATUS_CANT_RESOLVE); + BIND_ENUM_CONSTANT(STATUS_CONNECTING); //connecting to ip + BIND_ENUM_CONSTANT(STATUS_CANT_CONNECT); + BIND_ENUM_CONSTANT(STATUS_CONNECTED); //connected ); requests only accepted here + BIND_ENUM_CONSTANT(STATUS_REQUESTING); // request in progress + BIND_ENUM_CONSTANT(STATUS_BODY); // request resulted in body ); which must be read + BIND_ENUM_CONSTANT(STATUS_CONNECTION_ERROR); + BIND_ENUM_CONSTANT(STATUS_SSL_HANDSHAKE_ERROR); + + BIND_ENUM_CONSTANT(RESPONSE_CONTINUE); + BIND_ENUM_CONSTANT(RESPONSE_SWITCHING_PROTOCOLS); + BIND_ENUM_CONSTANT(RESPONSE_PROCESSING); // 2xx successful - BIND_CONSTANT(RESPONSE_OK); - BIND_CONSTANT(RESPONSE_CREATED); - BIND_CONSTANT(RESPONSE_ACCEPTED); - BIND_CONSTANT(RESPONSE_NON_AUTHORITATIVE_INFORMATION); - BIND_CONSTANT(RESPONSE_NO_CONTENT); - BIND_CONSTANT(RESPONSE_RESET_CONTENT); - BIND_CONSTANT(RESPONSE_PARTIAL_CONTENT); - BIND_CONSTANT(RESPONSE_MULTI_STATUS); - BIND_CONSTANT(RESPONSE_IM_USED); + BIND_ENUM_CONSTANT(RESPONSE_OK); + BIND_ENUM_CONSTANT(RESPONSE_CREATED); + BIND_ENUM_CONSTANT(RESPONSE_ACCEPTED); + BIND_ENUM_CONSTANT(RESPONSE_NON_AUTHORITATIVE_INFORMATION); + BIND_ENUM_CONSTANT(RESPONSE_NO_CONTENT); + BIND_ENUM_CONSTANT(RESPONSE_RESET_CONTENT); + BIND_ENUM_CONSTANT(RESPONSE_PARTIAL_CONTENT); + BIND_ENUM_CONSTANT(RESPONSE_MULTI_STATUS); + BIND_ENUM_CONSTANT(RESPONSE_IM_USED); // 3xx redirection - BIND_CONSTANT(RESPONSE_MULTIPLE_CHOICES); - BIND_CONSTANT(RESPONSE_MOVED_PERMANENTLY); - BIND_CONSTANT(RESPONSE_FOUND); - BIND_CONSTANT(RESPONSE_SEE_OTHER); - BIND_CONSTANT(RESPONSE_NOT_MODIFIED); - BIND_CONSTANT(RESPONSE_USE_PROXY); - BIND_CONSTANT(RESPONSE_TEMPORARY_REDIRECT); + BIND_ENUM_CONSTANT(RESPONSE_MULTIPLE_CHOICES); + BIND_ENUM_CONSTANT(RESPONSE_MOVED_PERMANENTLY); + BIND_ENUM_CONSTANT(RESPONSE_FOUND); + BIND_ENUM_CONSTANT(RESPONSE_SEE_OTHER); + BIND_ENUM_CONSTANT(RESPONSE_NOT_MODIFIED); + BIND_ENUM_CONSTANT(RESPONSE_USE_PROXY); + BIND_ENUM_CONSTANT(RESPONSE_TEMPORARY_REDIRECT); // 4xx client error - BIND_CONSTANT(RESPONSE_BAD_REQUEST); - BIND_CONSTANT(RESPONSE_UNAUTHORIZED); - BIND_CONSTANT(RESPONSE_PAYMENT_REQUIRED); - BIND_CONSTANT(RESPONSE_FORBIDDEN); - BIND_CONSTANT(RESPONSE_NOT_FOUND); - BIND_CONSTANT(RESPONSE_METHOD_NOT_ALLOWED); - BIND_CONSTANT(RESPONSE_NOT_ACCEPTABLE); - BIND_CONSTANT(RESPONSE_PROXY_AUTHENTICATION_REQUIRED); - BIND_CONSTANT(RESPONSE_REQUEST_TIMEOUT); - BIND_CONSTANT(RESPONSE_CONFLICT); - BIND_CONSTANT(RESPONSE_GONE); - BIND_CONSTANT(RESPONSE_LENGTH_REQUIRED); - BIND_CONSTANT(RESPONSE_PRECONDITION_FAILED); - BIND_CONSTANT(RESPONSE_REQUEST_ENTITY_TOO_LARGE); - BIND_CONSTANT(RESPONSE_REQUEST_URI_TOO_LONG); - BIND_CONSTANT(RESPONSE_UNSUPPORTED_MEDIA_TYPE); - BIND_CONSTANT(RESPONSE_REQUESTED_RANGE_NOT_SATISFIABLE); - BIND_CONSTANT(RESPONSE_EXPECTATION_FAILED); - BIND_CONSTANT(RESPONSE_UNPROCESSABLE_ENTITY); - BIND_CONSTANT(RESPONSE_LOCKED); - BIND_CONSTANT(RESPONSE_FAILED_DEPENDENCY); - BIND_CONSTANT(RESPONSE_UPGRADE_REQUIRED); + BIND_ENUM_CONSTANT(RESPONSE_BAD_REQUEST); + BIND_ENUM_CONSTANT(RESPONSE_UNAUTHORIZED); + BIND_ENUM_CONSTANT(RESPONSE_PAYMENT_REQUIRED); + BIND_ENUM_CONSTANT(RESPONSE_FORBIDDEN); + BIND_ENUM_CONSTANT(RESPONSE_NOT_FOUND); + BIND_ENUM_CONSTANT(RESPONSE_METHOD_NOT_ALLOWED); + BIND_ENUM_CONSTANT(RESPONSE_NOT_ACCEPTABLE); + BIND_ENUM_CONSTANT(RESPONSE_PROXY_AUTHENTICATION_REQUIRED); + BIND_ENUM_CONSTANT(RESPONSE_REQUEST_TIMEOUT); + BIND_ENUM_CONSTANT(RESPONSE_CONFLICT); + BIND_ENUM_CONSTANT(RESPONSE_GONE); + BIND_ENUM_CONSTANT(RESPONSE_LENGTH_REQUIRED); + BIND_ENUM_CONSTANT(RESPONSE_PRECONDITION_FAILED); + BIND_ENUM_CONSTANT(RESPONSE_REQUEST_ENTITY_TOO_LARGE); + BIND_ENUM_CONSTANT(RESPONSE_REQUEST_URI_TOO_LONG); + BIND_ENUM_CONSTANT(RESPONSE_UNSUPPORTED_MEDIA_TYPE); + BIND_ENUM_CONSTANT(RESPONSE_REQUESTED_RANGE_NOT_SATISFIABLE); + BIND_ENUM_CONSTANT(RESPONSE_EXPECTATION_FAILED); + BIND_ENUM_CONSTANT(RESPONSE_UNPROCESSABLE_ENTITY); + BIND_ENUM_CONSTANT(RESPONSE_LOCKED); + BIND_ENUM_CONSTANT(RESPONSE_FAILED_DEPENDENCY); + BIND_ENUM_CONSTANT(RESPONSE_UPGRADE_REQUIRED); // 5xx server error - BIND_CONSTANT(RESPONSE_INTERNAL_SERVER_ERROR); - BIND_CONSTANT(RESPONSE_NOT_IMPLEMENTED); - BIND_CONSTANT(RESPONSE_BAD_GATEWAY); - BIND_CONSTANT(RESPONSE_SERVICE_UNAVAILABLE); - BIND_CONSTANT(RESPONSE_GATEWAY_TIMEOUT); - BIND_CONSTANT(RESPONSE_HTTP_VERSION_NOT_SUPPORTED); - BIND_CONSTANT(RESPONSE_INSUFFICIENT_STORAGE); - BIND_CONSTANT(RESPONSE_NOT_EXTENDED); + BIND_ENUM_CONSTANT(RESPONSE_INTERNAL_SERVER_ERROR); + BIND_ENUM_CONSTANT(RESPONSE_NOT_IMPLEMENTED); + BIND_ENUM_CONSTANT(RESPONSE_BAD_GATEWAY); + BIND_ENUM_CONSTANT(RESPONSE_SERVICE_UNAVAILABLE); + BIND_ENUM_CONSTANT(RESPONSE_GATEWAY_TIMEOUT); + BIND_ENUM_CONSTANT(RESPONSE_HTTP_VERSION_NOT_SUPPORTED); + BIND_ENUM_CONSTANT(RESPONSE_INSUFFICIENT_STORAGE); + BIND_ENUM_CONSTANT(RESPONSE_NOT_EXTENDED); } void HTTPClient::set_read_chunk_size(int p_size) { diff --git a/core/io/http_client.h b/core/io/http_client.h index 3cee1e0c6b..cc5f1ed935 100644 --- a/core/io/http_client.h +++ b/core/io/http_client.h @@ -197,6 +197,7 @@ public: ~HTTPClient(); }; +VARIANT_ENUM_CAST(HTTPClient::ResponseCode) VARIANT_ENUM_CAST(HTTPClient::Method); VARIANT_ENUM_CAST(HTTPClient::Status); diff --git a/core/io/ip.cpp b/core/io/ip.cpp index c869bdad9b..0e2b5ed519 100644 --- a/core/io/ip.cpp +++ b/core/io/ip.cpp @@ -242,18 +242,18 @@ void IP::_bind_methods() { ClassDB::bind_method(D_METHOD("get_local_addresses"), &IP::_get_local_addresses); ClassDB::bind_method(D_METHOD("clear_cache", "hostname"), &IP::clear_cache, DEFVAL("")); - BIND_CONSTANT(RESOLVER_STATUS_NONE); - BIND_CONSTANT(RESOLVER_STATUS_WAITING); - BIND_CONSTANT(RESOLVER_STATUS_DONE); - BIND_CONSTANT(RESOLVER_STATUS_ERROR); + BIND_ENUM_CONSTANT(RESOLVER_STATUS_NONE); + BIND_ENUM_CONSTANT(RESOLVER_STATUS_WAITING); + BIND_ENUM_CONSTANT(RESOLVER_STATUS_DONE); + BIND_ENUM_CONSTANT(RESOLVER_STATUS_ERROR); BIND_CONSTANT(RESOLVER_MAX_QUERIES); BIND_CONSTANT(RESOLVER_INVALID_ID); - BIND_CONSTANT(TYPE_NONE); - BIND_CONSTANT(TYPE_IPV4); - BIND_CONSTANT(TYPE_IPV6); - BIND_CONSTANT(TYPE_ANY); + BIND_ENUM_CONSTANT(TYPE_NONE); + BIND_ENUM_CONSTANT(TYPE_IPV4); + BIND_ENUM_CONSTANT(TYPE_IPV6); + BIND_ENUM_CONSTANT(TYPE_ANY); } IP *IP::singleton = NULL; diff --git a/core/io/networked_multiplayer_peer.cpp b/core/io/networked_multiplayer_peer.cpp index 105b8dce44..402526a52c 100644 --- a/core/io/networked_multiplayer_peer.cpp +++ b/core/io/networked_multiplayer_peer.cpp @@ -44,13 +44,13 @@ void NetworkedMultiplayerPeer::_bind_methods() { ClassDB::bind_method(D_METHOD("set_refuse_new_connections", "enable"), &NetworkedMultiplayerPeer::set_refuse_new_connections); ClassDB::bind_method(D_METHOD("is_refusing_new_connections"), &NetworkedMultiplayerPeer::is_refusing_new_connections); - BIND_CONSTANT(TRANSFER_MODE_UNRELIABLE); - BIND_CONSTANT(TRANSFER_MODE_UNRELIABLE_ORDERED); - BIND_CONSTANT(TRANSFER_MODE_RELIABLE); + BIND_ENUM_CONSTANT(TRANSFER_MODE_UNRELIABLE); + BIND_ENUM_CONSTANT(TRANSFER_MODE_UNRELIABLE_ORDERED); + BIND_ENUM_CONSTANT(TRANSFER_MODE_RELIABLE); - BIND_CONSTANT(CONNECTION_DISCONNECTED); - BIND_CONSTANT(CONNECTION_CONNECTING); - BIND_CONSTANT(CONNECTION_CONNECTED); + BIND_ENUM_CONSTANT(CONNECTION_DISCONNECTED); + BIND_ENUM_CONSTANT(CONNECTION_CONNECTING); + BIND_ENUM_CONSTANT(CONNECTION_CONNECTED); BIND_CONSTANT(TARGET_PEER_BROADCAST); BIND_CONSTANT(TARGET_PEER_SERVER); diff --git a/core/io/stream_peer_ssl.cpp b/core/io/stream_peer_ssl.cpp index ef3c264375..24f6473330 100644 --- a/core/io/stream_peer_ssl.cpp +++ b/core/io/stream_peer_ssl.cpp @@ -55,10 +55,11 @@ void StreamPeerSSL::_bind_methods() { ClassDB::bind_method(D_METHOD("connect_to_stream", "stream", "validate_certs", "for_hostname"), &StreamPeerSSL::connect_to_stream, DEFVAL(false), DEFVAL(String())); ClassDB::bind_method(D_METHOD("get_status"), &StreamPeerSSL::get_status); ClassDB::bind_method(D_METHOD("disconnect_from_stream"), &StreamPeerSSL::disconnect_from_stream); - BIND_CONSTANT(STATUS_DISCONNECTED); - BIND_CONSTANT(STATUS_CONNECTED); - BIND_CONSTANT(STATUS_ERROR_NO_CERTIFICATE); - BIND_CONSTANT(STATUS_ERROR_HOSTNAME_MISMATCH); + + BIND_ENUM_CONSTANT(STATUS_DISCONNECTED); + BIND_ENUM_CONSTANT(STATUS_CONNECTED); + BIND_ENUM_CONSTANT(STATUS_ERROR_NO_CERTIFICATE); + BIND_ENUM_CONSTANT(STATUS_ERROR_HOSTNAME_MISMATCH); } StreamPeerSSL::StreamPeerSSL() { diff --git a/core/io/stream_peer_tcp.cpp b/core/io/stream_peer_tcp.cpp index 5c859ea7c0..ae5603aa31 100644 --- a/core/io/stream_peer_tcp.cpp +++ b/core/io/stream_peer_tcp.cpp @@ -55,10 +55,10 @@ void StreamPeerTCP::_bind_methods() { ClassDB::bind_method(D_METHOD("get_connected_port"), &StreamPeerTCP::get_connected_port); ClassDB::bind_method(D_METHOD("disconnect_from_host"), &StreamPeerTCP::disconnect_from_host); - BIND_CONSTANT(STATUS_NONE); - BIND_CONSTANT(STATUS_CONNECTING); - BIND_CONSTANT(STATUS_CONNECTED); - BIND_CONSTANT(STATUS_ERROR); + BIND_ENUM_CONSTANT(STATUS_NONE); + BIND_ENUM_CONSTANT(STATUS_CONNECTING); + BIND_ENUM_CONSTANT(STATUS_CONNECTED); + BIND_ENUM_CONSTANT(STATUS_ERROR); } Ref<StreamPeerTCP> StreamPeerTCP::create_ref() { diff --git a/core/io/xml_parser.cpp b/core/io/xml_parser.cpp index e5f4433b8f..d8b69b0951 100644 --- a/core/io/xml_parser.cpp +++ b/core/io/xml_parser.cpp @@ -373,13 +373,13 @@ void XMLParser::_bind_methods() { ClassDB::bind_method(D_METHOD("open", "file"), &XMLParser::open); ClassDB::bind_method(D_METHOD("open_buffer", "buffer"), &XMLParser::open_buffer); - BIND_CONSTANT(NODE_NONE); - BIND_CONSTANT(NODE_ELEMENT); - BIND_CONSTANT(NODE_ELEMENT_END); - BIND_CONSTANT(NODE_TEXT); - BIND_CONSTANT(NODE_COMMENT); - BIND_CONSTANT(NODE_CDATA); - BIND_CONSTANT(NODE_UNKNOWN); + BIND_ENUM_CONSTANT(NODE_NONE); + BIND_ENUM_CONSTANT(NODE_ELEMENT); + BIND_ENUM_CONSTANT(NODE_ELEMENT_END); + BIND_ENUM_CONSTANT(NODE_TEXT); + BIND_ENUM_CONSTANT(NODE_COMMENT); + BIND_ENUM_CONSTANT(NODE_CDATA); + BIND_ENUM_CONSTANT(NODE_UNKNOWN); }; Error XMLParser::read() { diff --git a/core/method_bind.h b/core/method_bind.h index 9bf0323733..157a67ca20 100644 --- a/core/method_bind.h +++ b/core/method_bind.h @@ -124,6 +124,9 @@ struct VariantCaster<const T &> { #endif +// Object enum casts must go here +VARIANT_ENUM_CAST(Object::ConnectFlags); + #define CHECK_ARG(m_arg) \ if ((m_arg - 1) < p_arg_count) { \ Variant::Type argtype = get_argument_type(m_arg - 1); \ @@ -148,14 +151,35 @@ struct VariantCaster<const T &> { VARIANT_ENUM_CAST(Vector3::Axis); VARIANT_ENUM_CAST(Error); -VARIANT_ENUM_CAST(wchar_t); VARIANT_ENUM_CAST(Margin); VARIANT_ENUM_CAST(Corner); VARIANT_ENUM_CAST(Orientation); VARIANT_ENUM_CAST(HAlign); +VARIANT_ENUM_CAST(VAlign); +VARIANT_ENUM_CAST(PropertyHint); +VARIANT_ENUM_CAST(PropertyUsageFlags); +VARIANT_ENUM_CAST(MethodFlags); VARIANT_ENUM_CAST(Variant::Type); VARIANT_ENUM_CAST(Variant::Operator); +template <> +struct VariantCaster<wchar_t> { + static _FORCE_INLINE_ wchar_t cast(const Variant &p_variant) { + return (wchar_t)p_variant.operator int(); + } +}; +#ifdef PTRCALL_ENABLED +template <> +struct PtrToArg<wchar_t> { + _FORCE_INLINE_ static wchar_t convert(const void *p_ptr) { + return wchar_t(*reinterpret_cast<const int *>(p_ptr)); + } + _FORCE_INLINE_ static void encode(wchar_t p_val, const void *p_ptr) { + *(int *)p_ptr = p_val; + } +}; +#endif + class MethodBind { int method_id; diff --git a/core/object.cpp b/core/object.cpp index 06c2603b74..a43a9c85b1 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1737,9 +1737,9 @@ void Object::_bind_methods() { BIND_CONSTANT(NOTIFICATION_POSTINITIALIZE); BIND_CONSTANT(NOTIFICATION_PREDELETE); - BIND_CONSTANT(CONNECT_DEFERRED); - BIND_CONSTANT(CONNECT_PERSIST); - BIND_CONSTANT(CONNECT_ONESHOT); + BIND_ENUM_CONSTANT(CONNECT_DEFERRED); + BIND_ENUM_CONSTANT(CONNECT_PERSIST); + BIND_ENUM_CONSTANT(CONNECT_ONESHOT); } void Object::call_deferred(const StringName &p_method, VARIANT_ARG_DECLARE) { diff --git a/core/os/input.cpp b/core/os/input.cpp index c7b32b939a..81ca31da25 100644 --- a/core/os/input.cpp +++ b/core/os/input.cpp @@ -86,10 +86,10 @@ void Input::_bind_methods() { ClassDB::bind_method(D_METHOD("set_custom_mouse_cursor", "image", "hotspot"), &Input::set_custom_mouse_cursor, DEFVAL(Vector2())); ClassDB::bind_method(D_METHOD("parse_input_event", "event"), &Input::parse_input_event); - BIND_CONSTANT(MOUSE_MODE_VISIBLE); - BIND_CONSTANT(MOUSE_MODE_HIDDEN); - BIND_CONSTANT(MOUSE_MODE_CAPTURED); - BIND_CONSTANT(MOUSE_MODE_CONFINED); + BIND_ENUM_CONSTANT(MOUSE_MODE_VISIBLE); + BIND_ENUM_CONSTANT(MOUSE_MODE_HIDDEN); + BIND_ENUM_CONSTANT(MOUSE_MODE_CAPTURED); + BIND_ENUM_CONSTANT(MOUSE_MODE_CONFINED); ADD_SIGNAL(MethodInfo("joy_connection_changed", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::BOOL, "connected"))); } diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp index fca9afbf5e..e5441093ac 100644 --- a/core/register_core_types.cpp +++ b/core/register_core_types.cpp @@ -75,6 +75,8 @@ static _Geometry *_geometry = NULL; extern Mutex *_global_mutex; +extern void register_global_constants(); +extern void unregister_global_constants(); extern void register_variant_methods(); extern void unregister_variant_methods(); @@ -88,6 +90,7 @@ void register_core_types() { StringName::setup(); + register_global_constants(); register_variant_methods(); CoreStringNames::create(); @@ -218,6 +221,7 @@ void unregister_core_types() { ObjectDB::cleanup(); unregister_variant_methods(); + unregister_global_constants(); ClassDB::cleanup(); ResourceCache::clear(); diff --git a/core/simple_type.h b/core/simple_type.h index 6003bd393f..b4a6dd1fa8 100644 --- a/core/simple_type.h +++ b/core/simple_type.h @@ -33,95 +33,21 @@ /* Batch of specializations to obtain the actual simple type */ template <class T> -struct GetSimpleType { - - T type; -}; - -template <class T> struct GetSimpleTypeT { typedef T type_t; }; template <class T> -struct GetSimpleType<T &> { - - T type; -}; - -template <class T> struct GetSimpleTypeT<T &> { typedef T type_t; }; template <class T> -struct GetSimpleType<T const> { - - T type; - _FORCE_INLINE_ GetSimpleType() {} -}; - -template <class T> struct GetSimpleTypeT<T const> { typedef T type_t; }; -template <class T> -struct GetSimpleType<const T &> { - - T type; - _FORCE_INLINE_ GetSimpleType() {} -}; - -template <class T> -struct GetSimpleType<T *> { - - T *type; - _FORCE_INLINE_ GetSimpleType() { type = NULL; } -}; - -template <class T> -struct GetSimpleType<const T *> { - - T *type; - _FORCE_INLINE_ GetSimpleType() { type = NULL; } -}; - -#define SIMPLE_NUMERIC_TYPE(m_type) \ - template <> \ - struct GetSimpleType<m_type> { \ - m_type type; \ - _FORCE_INLINE_ GetSimpleType() { type = (m_type)0; } \ - }; \ - template <> \ - struct GetSimpleType<m_type const> { \ - m_type type; \ - _FORCE_INLINE_ GetSimpleType() { type = (m_type)0; } \ - }; \ - template <> \ - struct GetSimpleType<m_type &> { \ - m_type type; \ - _FORCE_INLINE_ GetSimpleType() { type = (m_type)0; } \ - }; \ - template <> \ - struct GetSimpleType<const m_type &> { \ - m_type type; \ - _FORCE_INLINE_ GetSimpleType() { type = (m_type)0; } \ - }; - -SIMPLE_NUMERIC_TYPE(bool); -SIMPLE_NUMERIC_TYPE(uint8_t); -SIMPLE_NUMERIC_TYPE(int8_t); -SIMPLE_NUMERIC_TYPE(uint16_t); -SIMPLE_NUMERIC_TYPE(int16_t); -SIMPLE_NUMERIC_TYPE(uint32_t); -SIMPLE_NUMERIC_TYPE(int32_t); -SIMPLE_NUMERIC_TYPE(int64_t); -SIMPLE_NUMERIC_TYPE(uint64_t); -SIMPLE_NUMERIC_TYPE(float); -SIMPLE_NUMERIC_TYPE(double); - #endif diff --git a/core/type_info.h b/core/type_info.h index 10912fd074..0603126996 100644 --- a/core/type_info.h +++ b/core/type_info.h @@ -1,6 +1,8 @@ #ifndef GET_TYPE_INFO_H #define GET_TYPE_INFO_H +#ifdef DEBUG_METHODS_ENABLED + template <bool C, typename T = void> struct EnableIf { @@ -40,8 +42,8 @@ struct GetTypeInfo { enum { VARIANT_TYPE = Variant::NIL }; static inline StringName get_class_name() { - ERR_PRINT("Fallback type info. Bug!"); - return ""; // Not "Nil", this is an error + ERR_PRINT("GetTypeInfo fallback. Bug!"); + return StringName(); // Not "Nil", this is an error } }; @@ -70,6 +72,7 @@ MAKE_TYPE_INFO(uint32_t, Variant::INT) MAKE_TYPE_INFO(int32_t, Variant::INT) MAKE_TYPE_INFO(int64_t, Variant::INT) MAKE_TYPE_INFO(uint64_t, Variant::INT) +MAKE_TYPE_INFO(wchar_t, Variant::INT) MAKE_TYPE_INFO(float, Variant::REAL) MAKE_TYPE_INFO(double, Variant::REAL) @@ -152,36 +155,6 @@ MAKE_TEMPLATE_TYPE_INFO(Vector, Plane, Variant::ARRAY) MAKE_TEMPLATE_TYPE_INFO(PoolVector, Plane, Variant::ARRAY) MAKE_TEMPLATE_TYPE_INFO(PoolVector, Face3, Variant::POOL_VECTOR3_ARRAY) -#define MAKE_ENUM_TYPE_INFO(m_enum) \ - template <> \ - struct GetTypeInfo<m_enum> { \ - enum { VARIANT_TYPE = Variant::INT }; \ - static inline StringName get_class_name() { \ - return Variant::get_type_name((Variant::Type)VARIANT_TYPE); \ - } \ - }; \ - template <> \ - struct GetTypeInfo<m_enum const> { \ - enum { VARIANT_TYPE = Variant::INT }; \ - static inline StringName get_class_name() { \ - return Variant::get_type_name((Variant::Type)VARIANT_TYPE); \ - } \ - }; \ - template <> \ - struct GetTypeInfo<m_enum &> { \ - enum { VARIANT_TYPE = Variant::INT }; \ - static inline StringName get_class_name() { \ - return Variant::get_type_name((Variant::Type)VARIANT_TYPE); \ - } \ - }; \ - template <> \ - struct GetTypeInfo<const m_enum &> { \ - enum { VARIANT_TYPE = Variant::INT }; \ - static inline StringName get_class_name() { \ - return Variant::get_type_name((Variant::Type)VARIANT_TYPE); \ - } \ - }; - template <typename T> struct GetTypeInfo<T *, typename EnableIf<TypeInherits<Object, T>::value>::type> { enum { VARIANT_TYPE = Variant::OBJECT }; @@ -200,4 +173,30 @@ struct GetTypeInfo<const T *, typename EnableIf<TypeInherits<Object, T>::value>: } }; +#define TEMPL_MAKE_ENUM_TYPE_INFO(m_enum, m_impl) \ + template <> \ + struct GetTypeInfo<m_impl> { \ + enum { VARIANT_TYPE = Variant::INT }; \ + static inline StringName get_class_name() { return "enum." #m_enum; } \ + }; + +#define MAKE_ENUM_TYPE_INFO(m_enum) \ + TEMPL_MAKE_ENUM_TYPE_INFO(m_enum, m_enum) \ + TEMPL_MAKE_ENUM_TYPE_INFO(m_enum, m_enum const) \ + TEMPL_MAKE_ENUM_TYPE_INFO(m_enum, m_enum &) \ + TEMPL_MAKE_ENUM_TYPE_INFO(m_enum, const m_enum &) + +template <typename T> +inline StringName __constant_get_enum_name(T param, const String &p_constant) { + if (GetTypeInfo<T>::VARIANT_TYPE == Variant::NIL) + ERR_PRINTS("Missing VARIANT_ENUM_CAST for constant's enum: " + p_constant); + return GetTypeInfo<T>::get_class_name(); +} + +#else + +#define MAKE_ENUM_TYPE_INFO(m_enum) + +#endif // DEBUG_METHODS_ENABLED + #endif // GET_TYPE_INFO_H diff --git a/core/undo_redo.cpp b/core/undo_redo.cpp index 19b9f161b7..bb70146396 100644 --- a/core/undo_redo.cpp +++ b/core/undo_redo.cpp @@ -504,7 +504,7 @@ void UndoRedo::_bind_methods() { ClassDB::bind_method(D_METHOD("get_current_action_name"), &UndoRedo::get_current_action_name); ClassDB::bind_method(D_METHOD("get_version"), &UndoRedo::get_version); - BIND_CONSTANT(MERGE_DISABLE); - BIND_CONSTANT(MERGE_ENDS); - BIND_CONSTANT(MERGE_ALL); + BIND_ENUM_CONSTANT(MERGE_DISABLE); + BIND_ENUM_CONSTANT(MERGE_ENDS); + BIND_ENUM_CONSTANT(MERGE_ALL); } |