diff options
Diffstat (limited to 'components/msg/constellation_msg.rs')
-rw-r--r-- | components/msg/constellation_msg.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/components/msg/constellation_msg.rs b/components/msg/constellation_msg.rs index 027d8efddd8..d7ff06de6a4 100644 --- a/components/msg/constellation_msg.rs +++ b/components/msg/constellation_msg.rs @@ -7,6 +7,7 @@ use canvas_traits::CanvasMsg; use compositor_msg::Epoch; +use euclid::point::Point2D; use euclid::scale_factor::ScaleFactor; use euclid::size::{Size2D, TypedSize2D}; use hyper::header::Headers; @@ -283,6 +284,10 @@ pub enum ScriptMsg { Failure(Failure), /// Notifies the constellation that this frame has received focus. Focus(PipelineId), + /// Re-send a mouse button event that was sent to the parent window. + ForwardMouseButtonEvent(PipelineId, MouseEventType, MouseButton, Point2D<f32>), + /// Re-send a mouse move event that was sent to the parent window. + ForwardMouseMoveEvent(PipelineId, Point2D<f32>), /// Requests that the constellation retrieve the current contents of the clipboard GetClipboardContents(IpcSender<String>), /// <head> tag finished parsing @@ -307,6 +312,24 @@ pub enum ScriptMsg { ViewportConstrained(PipelineId, ViewportConstraints), } +#[derive(Deserialize, HeapSizeOf, Serialize)] +pub enum MouseEventType { + Click, + MouseDown, + MouseUp, +} + +/// The mouse button involved in the event. +#[derive(Clone, Copy, Debug, Deserialize, Serialize)] +pub enum MouseButton { + /// The left mouse button. + Left, + /// The middle mouse button. + Middle, + /// The right mouse button. + Right, +} + /// Messages from the paint task to the constellation. #[derive(Deserialize, Serialize)] pub enum PaintMsg { |