mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
refactor(compositor): expose new embeddermsg
This commit is contained in:
parent
b396a2f6ca
commit
2071245e5f
3 changed files with 16 additions and 1 deletions
|
@ -9,6 +9,7 @@ use compositor::CompositingReason;
|
||||||
use gfx_traits::Epoch;
|
use gfx_traits::Epoch;
|
||||||
use ipc_channel::ipc::IpcSender;
|
use ipc_channel::ipc::IpcSender;
|
||||||
use msg::constellation_msg::{InputMethodType, Key, KeyModifiers, KeyState, PipelineId, TopLevelBrowsingContextId};
|
use msg::constellation_msg::{InputMethodType, Key, KeyModifiers, KeyState, PipelineId, TopLevelBrowsingContextId};
|
||||||
|
use net_traits::filemanager_thread::FilterPattern;
|
||||||
use net_traits::image::base::Image;
|
use net_traits::image::base::Image;
|
||||||
use profile_traits::mem;
|
use profile_traits::mem;
|
||||||
use profile_traits::time;
|
use profile_traits::time;
|
||||||
|
@ -143,6 +144,8 @@ pub enum EmbedderMsg {
|
||||||
Panic(TopLevelBrowsingContextId, String, Option<String>),
|
Panic(TopLevelBrowsingContextId, String, Option<String>),
|
||||||
/// Open dialog to select bluetooth device.
|
/// Open dialog to select bluetooth device.
|
||||||
GetSelectedBluetoothDevice(Vec<String>, IpcSender<Option<String>>),
|
GetSelectedBluetoothDevice(Vec<String>, IpcSender<Option<String>>),
|
||||||
|
/// Open file dialog to select files. Set boolean flag to true allows to select multiple files.
|
||||||
|
GetSelectedFiles(Vec<FilterPattern>, bool, IpcSender<Option<Vec<String>>>),
|
||||||
/// Request to present an IME to the user when an editable element is focused.
|
/// Request to present an IME to the user when an editable element is focused.
|
||||||
ShowIME(TopLevelBrowsingContextId, InputMethodType),
|
ShowIME(TopLevelBrowsingContextId, InputMethodType),
|
||||||
/// Request to hide the IME when the editable element is blurred.
|
/// Request to hide the IME when the editable element is blurred.
|
||||||
|
@ -248,6 +251,7 @@ impl Debug for EmbedderMsg {
|
||||||
EmbedderMsg::LoadComplete(..) => write!(f, "LoadComplete"),
|
EmbedderMsg::LoadComplete(..) => write!(f, "LoadComplete"),
|
||||||
EmbedderMsg::Panic(..) => write!(f, "Panic"),
|
EmbedderMsg::Panic(..) => write!(f, "Panic"),
|
||||||
EmbedderMsg::GetSelectedBluetoothDevice(..) => write!(f, "GetSelectedBluetoothDevice"),
|
EmbedderMsg::GetSelectedBluetoothDevice(..) => write!(f, "GetSelectedBluetoothDevice"),
|
||||||
|
EmbedderMsg::GetSelectedFiles(..) => write!(f, "SelectFileDialog"),
|
||||||
EmbedderMsg::ShowIME(..) => write!(f, "ShowIME"),
|
EmbedderMsg::ShowIME(..) => write!(f, "ShowIME"),
|
||||||
EmbedderMsg::HideIME(..) => write!(f, "HideIME"),
|
EmbedderMsg::HideIME(..) => write!(f, "HideIME"),
|
||||||
EmbedderMsg::Shutdown => write!(f, "Shutdown"),
|
EmbedderMsg::Shutdown => write!(f, "Shutdown"),
|
||||||
|
|
|
@ -115,6 +115,7 @@ use msg::constellation_msg::{BrowsingContextId, PipelineId, HistoryStateId, TopL
|
||||||
use msg::constellation_msg::{Key, KeyModifiers, KeyState};
|
use msg::constellation_msg::{Key, KeyModifiers, KeyState};
|
||||||
use msg::constellation_msg::{PipelineNamespace, PipelineNamespaceId, TraversalDirection};
|
use msg::constellation_msg::{PipelineNamespace, PipelineNamespaceId, TraversalDirection};
|
||||||
use net_traits::{self, IpcSend, FetchResponseMsg, ResourceThreads};
|
use net_traits::{self, IpcSend, FetchResponseMsg, ResourceThreads};
|
||||||
|
use net_traits::filemanager_thread::FilterPattern;
|
||||||
use net_traits::pub_domains::reg_host;
|
use net_traits::pub_domains::reg_host;
|
||||||
use net_traits::request::RequestInit;
|
use net_traits::request::RequestInit;
|
||||||
use net_traits::storage_thread::{StorageThreadMsg, StorageType};
|
use net_traits::storage_thread::{StorageThreadMsg, StorageType};
|
||||||
|
@ -1013,7 +1014,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
||||||
self.handle_set_cursor_msg(cursor)
|
self.handle_set_cursor_msg(cursor)
|
||||||
}
|
}
|
||||||
FromCompositorMsg::OpenFileSelectDialog(patterns, multiple_files, sender) => {
|
FromCompositorMsg::OpenFileSelectDialog(patterns, multiple_files, sender) => {
|
||||||
return;
|
self.handle_open_file_select_dialog_msg(patterns, multiple_files, sender);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1741,6 +1742,14 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
||||||
self.embedder_proxy.send(EmbedderMsg::SetCursor(cursor))
|
self.embedder_proxy.send(EmbedderMsg::SetCursor(cursor))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn handle_open_file_select_dialog_msg(&mut self,
|
||||||
|
patterns: Vec<FilterPattern>,
|
||||||
|
multiple_files: bool,
|
||||||
|
sender: IpcSender<Option<Vec<String>>>) {
|
||||||
|
let msg = EmbedderMsg::GetSelectedFiles(patterns, multiple_files, sender);
|
||||||
|
self.embedder_proxy.send(msg);
|
||||||
|
}
|
||||||
|
|
||||||
fn handle_change_running_animations_state(&mut self,
|
fn handle_change_running_animations_state(&mut self,
|
||||||
pipeline_id: PipelineId,
|
pipeline_id: PipelineId,
|
||||||
animation_state: AnimationState) {
|
animation_state: AnimationState) {
|
||||||
|
|
|
@ -294,6 +294,8 @@ impl Browser {
|
||||||
},
|
},
|
||||||
EmbedderMsg::GetSelectedBluetoothDevice(devices, sender) => {
|
EmbedderMsg::GetSelectedBluetoothDevice(devices, sender) => {
|
||||||
platform_get_selected_devices(devices, sender);
|
platform_get_selected_devices(devices, sender);
|
||||||
|
},
|
||||||
|
EmbedderMsg::GetSelectedFiles(patterns, multiple_files, sender) => {
|
||||||
}
|
}
|
||||||
EmbedderMsg::ShowIME(_browser_id, _kind) => {
|
EmbedderMsg::ShowIME(_browser_id, _kind) => {
|
||||||
debug!("ShowIME received");
|
debug!("ShowIME received");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue