diff options
author | Paul Rouget <me@paulrouget.com> | 2020-07-02 10:38:36 +0200 |
---|---|---|
committer | Paul Rouget <me@paulrouget.com> | 2020-07-02 10:57:34 +0200 |
commit | 34265c872e8be99bf09df432e5293a2baa8947a6 (patch) | |
tree | 60eaf6d95a9ba4397700812b1e42cfca94a117a0 /ports/libsimpleservo/api/src | |
parent | 19b36bd7952630d2e4a749565c570d3cca217658 (diff) | |
download | servo-34265c872e8be99bf09df432e5293a2baa8947a6.tar.gz servo-34265c872e8be99bf09df432e5293a2baa8947a6.zip |
UWP: support virtual keyboard
Diffstat (limited to 'ports/libsimpleservo/api/src')
-rw-r--r-- | ports/libsimpleservo/api/src/lib.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/ports/libsimpleservo/api/src/lib.rs b/ports/libsimpleservo/api/src/lib.rs index e0d2f46e71a..adf7cfe15d4 100644 --- a/ports/libsimpleservo/api/src/lib.rs +++ b/ports/libsimpleservo/api/src/lib.rs @@ -11,7 +11,9 @@ pub use servo::config::prefs::{add_user_prefs, PrefValue}; pub use servo::embedder_traits::{ ContextMenuResult, MediaSessionPlaybackState, PermissionPrompt, PermissionRequest, PromptResult, }; +pub use servo::msg::constellation_msg::InputMethodType; pub use servo::script_traits::{MediaSessionActionType, MouseButton}; +pub use servo::webrender_api::units::DeviceIntRect; use getopts::Options; use ipc_channel::ipc::IpcSender; @@ -133,7 +135,9 @@ pub trait HostTrait { /// Servo finished shutting down. fn on_shutdown_complete(&self); /// A text input is focused. - fn on_ime_state_changed(&self, show: bool); + fn on_ime_show(&self, input_type: InputMethodType, text: Option<String>, bounds: DeviceIntRect); + /// Input lost focus + fn on_ime_hide(&self); /// Gets sytem clipboard contents. fn get_clipboard_contents(&self) -> Option<String>; /// Sets system clipboard contents. @@ -721,11 +725,13 @@ impl ServoGlue { let _ = sender.send(result); }, - EmbedderMsg::ShowIME(..) => { - self.callbacks.host_callbacks.on_ime_state_changed(true); + EmbedderMsg::ShowIME(kind, text, bounds) => { + self.callbacks + .host_callbacks + .on_ime_show(kind, text, bounds); }, EmbedderMsg::HideIME => { - self.callbacks.host_callbacks.on_ime_state_changed(false); + self.callbacks.host_callbacks.on_ime_hide(); }, EmbedderMsg::MediaSessionEvent(event) => { match event { |