diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/bind/core_bind.cpp | 22 | ||||
-rw-r--r-- | core/bind/core_bind.h | 5 | ||||
-rw-r--r-- | core/os/os.h | 7 | ||||
-rw-r--r-- | core/variant_call.cpp | 11 |
4 files changed, 43 insertions, 2 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 95d03a0f95..10f44d357b 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -678,6 +678,22 @@ String _OS::get_unique_id() const { return OS::get_singleton()->get_unique_id(); } +int _OS::get_tablet_driver_count() const { + return OS::get_singleton()->get_tablet_driver_count(); +} + +String _OS::get_tablet_driver_name(int p_driver) const { + return OS::get_singleton()->get_tablet_driver_name(p_driver); +} + +String _OS::get_current_tablet_driver() const { + return OS::get_singleton()->get_current_tablet_driver(); +} + +void _OS::set_current_tablet_driver(const String &p_driver) { + OS::get_singleton()->set_current_tablet_driver(p_driver); +} + _OS *_OS::singleton = nullptr; void _OS::_bind_methods() { @@ -762,9 +778,15 @@ void _OS::_bind_methods() { ClassDB::bind_method(D_METHOD("request_permissions"), &_OS::request_permissions); ClassDB::bind_method(D_METHOD("get_granted_permissions"), &_OS::get_granted_permissions); + ClassDB::bind_method(D_METHOD("get_tablet_driver_count"), &_OS::get_tablet_driver_count); + ClassDB::bind_method(D_METHOD("get_tablet_driver_name", "idx"), &_OS::get_tablet_driver_name); + ClassDB::bind_method(D_METHOD("get_current_tablet_driver"), &_OS::get_current_tablet_driver); + ClassDB::bind_method(D_METHOD("set_current_tablet_driver", "name"), &_OS::set_current_tablet_driver); + ADD_PROPERTY(PropertyInfo(Variant::INT, "exit_code"), "set_exit_code", "get_exit_code"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "low_processor_usage_mode"), "set_low_processor_usage_mode", "is_in_low_processor_usage_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "low_processor_usage_mode_sleep_usec"), "set_low_processor_usage_mode_sleep_usec", "get_low_processor_usage_mode_sleep_usec"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "tablet_driver"), "set_current_tablet_driver", "get_current_tablet_driver"); // Those default values need to be specified for the docs generator, // to avoid using values from the documentation writer's own OS instance. diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 32ddcf2c74..e5bd70262d 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -243,6 +243,11 @@ public: bool request_permissions(); Vector<String> get_granted_permissions() const; + int get_tablet_driver_count() const; + String get_tablet_driver_name(int p_driver) const; + String get_current_tablet_driver() const; + void set_current_tablet_driver(const String &p_driver); + static _OS *get_singleton() { return singleton; } _OS() { singleton = this; } diff --git a/core/os/os.h b/core/os/os.h index 9296e17bb2..9ca034a01c 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -58,7 +58,6 @@ class OS { bool _allow_layered = false; bool _use_vsync; bool _vsync_via_compositor; - bool _disable_wintab; char *last_error; @@ -148,7 +147,11 @@ public: bool is_layered_allowed() const { return _allow_layered; } bool is_hidpi_allowed() const { return _allow_hidpi; } - bool is_wintab_disabled() const { return _disable_wintab; } + + virtual int get_tablet_driver_count() const { return 0; }; + virtual String get_tablet_driver_name(int p_driver) const { return ""; }; + virtual String get_current_tablet_driver() const { return ""; }; + virtual void set_current_tablet_driver(const String &p_driver){}; void ensure_user_data_dir(); diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 82b1f29805..404468a7b4 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -1174,6 +1174,9 @@ struct _VariantCall { List<StringName> value_ordered; #endif Map<StringName, Variant> variant_value; +#ifdef DEBUG_ENABLED + List<StringName> variant_value_ordered; +#endif }; static ConstantData *constant_data; @@ -1187,6 +1190,9 @@ struct _VariantCall { static void add_variant_constant(int p_type, StringName p_constant_name, const Variant &p_constant_value) { constant_data[p_type].variant_value[p_constant_name] = p_constant_value; +#ifdef DEBUG_ENABLED + constant_data[p_type].variant_value_ordered.push_back(p_constant_name); +#endif } }; @@ -1652,8 +1658,13 @@ void Variant::get_constants_for_type(Variant::Type p_type, List<StringName> *p_c #endif } +#ifdef DEBUG_ENABLED + for (List<StringName>::Element *E = cd.variant_value_ordered.front(); E; E = E->next()) { + p_constants->push_back(E->get()); +#else for (Map<StringName, Variant>::Element *E = cd.variant_value.front(); E; E = E->next()) { p_constants->push_back(E->key()); +#endif } } |