mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Add IME callback for embedders.
This commit is contained in:
parent
9358b6a2fb
commit
256011a652
3 changed files with 11 additions and 0 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue