diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-12-11 18:00:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-11 18:00:48 +0100 |
commit | 4c41e29c8e796f97a714da784a7cecae8933b202 (patch) | |
tree | c36b06c9a91503d5af39c4f973908cff39194608 /core/os | |
parent | 573956915efefb1cda0a5349c7e7aaeb0363df1d (diff) | |
parent | 4554c682e6c9749116c79313d6f08cd6e8b7e6e6 (diff) |
Merge pull request #23923 from bruvzg/ime_gdscript
Changes IME to make it possible to use it from gdscript/gdnative
Diffstat (limited to 'core/os')
-rw-r--r-- | core/os/main_loop.cpp | 1 | ||||
-rw-r--r-- | core/os/main_loop.h | 1 | ||||
-rw-r--r-- | core/os/os.h | 3 |
3 files changed, 4 insertions, 1 deletions
diff --git a/core/os/main_loop.cpp b/core/os/main_loop.cpp index 0945cdd512..6e0b914367 100644 --- a/core/os/main_loop.cpp +++ b/core/os/main_loop.cpp @@ -60,6 +60,7 @@ void MainLoop::_bind_methods() { BIND_CONSTANT(NOTIFICATION_TRANSLATION_CHANGED); BIND_CONSTANT(NOTIFICATION_WM_ABOUT); BIND_CONSTANT(NOTIFICATION_CRASH); + BIND_CONSTANT(NOTIFICATION_OS_IME_UPDATE); }; void MainLoop::set_init_script(const Ref<Script> &p_init_script) { diff --git a/core/os/main_loop.h b/core/os/main_loop.h index 43f74302a8..e9b331ee45 100644 --- a/core/os/main_loop.h +++ b/core/os/main_loop.h @@ -65,6 +65,7 @@ public: NOTIFICATION_TRANSLATION_CHANGED = 90, NOTIFICATION_WM_ABOUT = 91, NOTIFICATION_CRASH = 92, + NOTIFICATION_OS_IME_UPDATE = 93, }; virtual void input_event(const Ref<InputEvent> &p_event); diff --git a/core/os/os.h b/core/os/os.h index 53a5ebde01..05ec3ac424 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -242,7 +242,8 @@ public: virtual void set_ime_active(const bool p_active) {} virtual void set_ime_position(const Point2 &p_pos) {} - virtual void set_ime_intermediate_text_callback(ImeCallback p_callback, void *p_inp) {} + virtual Point2 get_ime_selection() const { return Point2(); } + virtual String get_ime_text() const { return String(); } virtual Error open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path = false) { return ERR_UNAVAILABLE; } virtual Error close_dynamic_library(void *p_library_handle) { return ERR_UNAVAILABLE; } |