diff options
Diffstat (limited to 'core/bind')
-rw-r--r-- | core/bind/core_bind.cpp | 41 | ||||
-rw-r--r-- | core/bind/core_bind.h | 7 |
2 files changed, 37 insertions, 11 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index a3ff4bf13e..8641af84d9 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -378,12 +378,20 @@ bool _OS::get_borderless_window() const { void _OS::set_ime_active(const bool p_active) { - return OS::get_singleton()->set_ime_active(p_active); + OS::get_singleton()->set_ime_active(p_active); } void _OS::set_ime_position(const Point2 &p_pos) { - return OS::get_singleton()->set_ime_position(p_pos); + OS::get_singleton()->set_ime_position(p_pos); +} + +Point2 _OS::get_ime_selection() const { + return OS::get_singleton()->get_ime_selection(); +} + +String _OS::get_ime_text() const { + return OS::get_singleton()->get_ime_text(); } void _OS::set_use_file_access_save_and_swap(bool p_enable) { @@ -1020,6 +1028,11 @@ void _OS::center_window() { OS::get_singleton()->center_window(); } +void _OS::move_window_to_foreground() { + + OS::get_singleton()->move_window_to_foreground(); +} + bool _OS::is_debug_build() const { #ifdef DEBUG_ENABLED @@ -1121,6 +1134,7 @@ void _OS::_bind_methods() { ClassDB::bind_method(D_METHOD("request_attention"), &_OS::request_attention); ClassDB::bind_method(D_METHOD("get_real_window_size"), &_OS::get_real_window_size); ClassDB::bind_method(D_METHOD("center_window"), &_OS::center_window); + ClassDB::bind_method(D_METHOD("move_window_to_foreground"), &_OS::move_window_to_foreground); ClassDB::bind_method(D_METHOD("set_borderless_window", "borderless"), &_OS::set_borderless_window); ClassDB::bind_method(D_METHOD("get_borderless_window"), &_OS::get_borderless_window); @@ -1128,7 +1142,10 @@ void _OS::_bind_methods() { ClassDB::bind_method(D_METHOD("get_window_per_pixel_transparency_enabled"), &_OS::get_window_per_pixel_transparency_enabled); ClassDB::bind_method(D_METHOD("set_window_per_pixel_transparency_enabled", "enabled"), &_OS::set_window_per_pixel_transparency_enabled); + ClassDB::bind_method(D_METHOD("set_ime_active", "active"), &_OS::set_ime_active); ClassDB::bind_method(D_METHOD("set_ime_position", "position"), &_OS::set_ime_position); + ClassDB::bind_method(D_METHOD("get_ime_selection"), &_OS::get_ime_selection); + ClassDB::bind_method(D_METHOD("get_ime_text"), &_OS::get_ime_text); ClassDB::bind_method(D_METHOD("set_screen_orientation", "orientation"), &_OS::set_screen_orientation); ClassDB::bind_method(D_METHOD("get_screen_orientation"), &_OS::get_screen_orientation); @@ -1748,9 +1765,9 @@ String _File::get_line() const { return f->get_line(); } -Vector<String> _File::get_csv_line(String delim) const { +Vector<String> _File::get_csv_line(const String &p_delim) const { ERR_FAIL_COND_V(!f, Vector<String>()); - return f->get_csv_line(delim); + return f->get_csv_line(p_delim); } /**< use this for files WRITTEN in _big_ endian machines (ie, amiga/mac) @@ -1847,6 +1864,11 @@ void _File::store_line(const String &p_string) { f->store_line(p_string); } +void _File::store_csv_line(const Vector<String> &p_values, const String &p_delim) { + ERR_FAIL_COND(!f); + f->store_csv_line(p_values, p_delim); +} + void _File::store_buffer(const PoolVector<uint8_t> &p_buffer) { ERR_FAIL_COND(!f); @@ -1930,6 +1952,7 @@ void _File::_bind_methods() { ClassDB::bind_method(D_METHOD("get_real"), &_File::get_real); ClassDB::bind_method(D_METHOD("get_buffer", "len"), &_File::get_buffer); ClassDB::bind_method(D_METHOD("get_line"), &_File::get_line); + ClassDB::bind_method(D_METHOD("get_csv_line", "delim"), &_File::get_csv_line, DEFVAL(",")); ClassDB::bind_method(D_METHOD("get_as_text"), &_File::get_as_text); ClassDB::bind_method(D_METHOD("get_md5", "path"), &_File::get_md5); ClassDB::bind_method(D_METHOD("get_sha256", "path"), &_File::get_sha256); @@ -1937,7 +1960,6 @@ void _File::_bind_methods() { ClassDB::bind_method(D_METHOD("set_endian_swap", "enable"), &_File::set_endian_swap); ClassDB::bind_method(D_METHOD("get_error"), &_File::get_error); ClassDB::bind_method(D_METHOD("get_var"), &_File::get_var); - ClassDB::bind_method(D_METHOD("get_csv_line", "delim"), &_File::get_csv_line, DEFVAL(",")); ClassDB::bind_method(D_METHOD("store_8", "value"), &_File::store_8); ClassDB::bind_method(D_METHOD("store_16", "value"), &_File::store_16); @@ -1948,6 +1970,7 @@ void _File::_bind_methods() { ClassDB::bind_method(D_METHOD("store_real", "value"), &_File::store_real); ClassDB::bind_method(D_METHOD("store_buffer", "buffer"), &_File::store_buffer); ClassDB::bind_method(D_METHOD("store_line", "line"), &_File::store_line); + ClassDB::bind_method(D_METHOD("store_csv_line", "values", "delim"), &_File::store_csv_line, DEFVAL(",")); ClassDB::bind_method(D_METHOD("store_string", "string"), &_File::store_string); ClassDB::bind_method(D_METHOD("store_var", "value"), &_File::store_var); @@ -2860,10 +2883,10 @@ void JSONParseResult::_bind_methods() { ClassDB::bind_method(D_METHOD("set_error_line", "error_line"), &JSONParseResult::set_error_line); ClassDB::bind_method(D_METHOD("set_result", "result"), &JSONParseResult::set_result); - ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT, "error", PROPERTY_HINT_NONE, "Error", PROPERTY_USAGE_CLASS_IS_ENUM), "set_error", "get_error"); - ADD_PROPERTYNZ(PropertyInfo(Variant::STRING, "error_string"), "set_error_string", "get_error_string"); - ADD_PROPERTYNZ(PropertyInfo(Variant::INT, "error_line"), "set_error_line", "get_error_line"); - ADD_PROPERTYNZ(PropertyInfo(Variant::NIL, "result", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT), "set_result", "get_result"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "error", PROPERTY_HINT_NONE, "Error", PROPERTY_USAGE_CLASS_IS_ENUM), "set_error", "get_error"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "error_string"), "set_error_string", "get_error_string"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "error_line"), "set_error_line", "get_error_line"); + ADD_PROPERTY(PropertyInfo(Variant::NIL, "result", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT), "set_result", "get_result"); } void JSONParseResult::set_error(Error p_error) { diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 79403879ac..4cdf09d522 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -185,6 +185,7 @@ public: virtual bool is_window_always_on_top() const; virtual void request_attention(); virtual void center_window(); + virtual void move_window_to_foreground(); virtual void set_borderless_window(bool p_borderless); virtual bool get_borderless_window() const; @@ -194,6 +195,8 @@ public: virtual void set_ime_active(const bool p_active); virtual void set_ime_position(const Point2 &p_pos); + virtual Point2 get_ime_selection() const; + virtual String get_ime_text() const; Error native_video_play(String p_path, float p_volume, String p_audio_track, String p_subtitle_track); bool native_video_is_playing(); @@ -454,6 +457,7 @@ public: PoolVector<uint8_t> get_buffer(int p_length) const; ///< get an array of bytes String get_line() const; + Vector<String> get_csv_line(const String &p_delim = ",") const; String get_as_text() const; String get_md5(const String &p_path) const; String get_sha256(const String &p_path) const; @@ -479,12 +483,11 @@ public: void store_string(const String &p_string); void store_line(const String &p_string); + void store_csv_line(const Vector<String> &p_values, const String &p_delim = ","); virtual void store_pascal_string(const String &p_string); virtual String get_pascal_string(); - Vector<String> get_csv_line(String delim = ",") const; - void store_buffer(const PoolVector<uint8_t> &p_buffer); ///< store an array of bytes void store_var(const Variant &p_var); |