Skip to content
Permalink
Browse files

Add IME callback for embedders.

  • Loading branch information...
jdm committed Jan 22, 2019
1 parent 9358b6a commit 256011a6521bed5d94a16924ce2fac87ad5eef68
@@ -81,6 +81,8 @@ pub trait HostTrait {
fn on_animating_changed(&self, animating: bool); fn on_animating_changed(&self, animating: bool);
/// Servo finished shutting down. /// Servo finished shutting down.
fn on_shutdown_complete(&self); fn on_shutdown_complete(&self);
/// A text input is focused.
fn on_ime_state_changed(&self, show: bool);
} }


pub struct ServoGlue { pub struct ServoGlue {
@@ -40,6 +40,7 @@ pub struct CHostCallbacks {
pub on_history_changed: extern "C" fn(can_go_back: bool, can_go_forward: bool), pub on_history_changed: extern "C" fn(can_go_back: bool, can_go_forward: bool),
pub on_animating_changed: extern "C" fn(animating: bool), pub on_animating_changed: extern "C" fn(animating: bool),
pub on_shutdown_complete: extern "C" fn(), pub on_shutdown_complete: extern "C" fn(),
pub on_ime_state_changed: extern "C" fn(show: bool),
} }


/// Servo options /// Servo options
@@ -330,4 +331,9 @@ impl HostTrait for HostCallbacks {
debug!("on_shutdown_complete"); debug!("on_shutdown_complete");
(self.0.on_shutdown_complete)(); (self.0.on_shutdown_complete)();
} }

fn on_ime_state_changed(&self, show: bool) {
debug!("on_ime_state_changed");
(self.0.on_ime_state_changed)(show);
}
} }
@@ -454,6 +454,9 @@ impl HostTrait for HostCallbacks {
) )
.unwrap(); .unwrap();
} }

fn on_ime_state_changed(&self, _show: bool) {
}
} }


fn initialize_android_glue(env: &JNIEnv, activity: JObject) { fn initialize_android_glue(env: &JNIEnv, activity: JObject) {

0 comments on commit 256011a

Please sign in to comment.
You can’t perform that action at this time.