remove ScriptListener

ref #7175
This commit is contained in:
vectorijk 2015-08-13 06:53:25 -07:00
parent 7c63c7d7c1
commit 14ac1ef75a
7 changed files with 24 additions and 70 deletions

View file

@ -7,7 +7,6 @@ use constellation_msg::{Key, KeyState, KeyModifiers};
use euclid::point::Point2D;
use euclid::rect::Rect;
use euclid::Matrix4;
use ipc_channel::ipc::IpcSender;
use layers::platform::surface::NativeDisplay;
use layers::layers::{BufferRequest, LayerBufferSet};
use std::fmt::{Formatter, Debug};
@ -126,39 +125,3 @@ pub enum ScriptToCompositorMsg {
Exit,
}
/// The interface used by the script task to tell the compositor to update its ready state,
/// which is used in displaying the appropriate message in the window's title.
#[derive(Clone)]
pub struct ScriptListener(IpcSender<ScriptToCompositorMsg>);
impl ScriptListener {
pub fn new(sender: IpcSender<ScriptToCompositorMsg>) -> ScriptListener {
ScriptListener(sender)
}
pub fn scroll_fragment_point(&mut self,
pipeline_id: PipelineId,
layer_id: LayerId,
point: Point2D<f32>) {
self.0
.send(ScriptToCompositorMsg::ScrollFragmentPoint(pipeline_id, layer_id, point))
.unwrap()
}
pub fn close(&mut self) {
self.0.send(ScriptToCompositorMsg::Exit).unwrap()
}
pub fn dup(&mut self) -> ScriptListener {
self.clone()
}
pub fn set_title(&mut self, pipeline_id: PipelineId, title: Option<String>) {
self.0.send(ScriptToCompositorMsg::SetTitle(pipeline_id, title)).unwrap()
}
pub fn send_key_event(&mut self, key: Key, state: KeyState, modifiers: KeyModifiers) {
self.0.send(ScriptToCompositorMsg::SendKeyEvent(key, state, modifiers)).unwrap()
}
}