aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/compositing/compositor.rs4
-rw-r--r--components/compositing/windowing.rs4
-rw-r--r--components/msg/constellation_msg.rs11
-rw-r--r--components/script/dom/document.rs4
-rw-r--r--components/script/script_thread.rs5
-rw-r--r--components/script_traits/lib.rs13
-rw-r--r--components/script_traits/script_msg.rs3
-rw-r--r--ports/cef/browser_host.rs3
-rw-r--r--ports/glutin/window.rs2
-rw-r--r--ports/gonk/Cargo.lock1
-rw-r--r--ports/gonk/Cargo.toml3
-rw-r--r--ports/gonk/src/input.rs2
-rw-r--r--ports/gonk/src/main.rs1
13 files changed, 31 insertions, 25 deletions
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs
index 524f59585c2..c2c38f7bc97 100644
--- a/components/compositing/compositor.rs
+++ b/components/compositing/compositor.rs
@@ -28,14 +28,14 @@ use layers::rendergl::RenderContext;
use layers::scene::Scene;
use layout_traits::LayoutControlChan;
use msg::constellation_msg::{Image, PixelFormat};
-use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData, MouseButton};
+use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData};
use msg::constellation_msg::{NavigationDirection, PipelineId, WindowSizeData};
use pipeline::CompositionPipeline;
use profile_traits::mem::{self, ReportKind, Reporter, ReporterRequest};
use profile_traits::time::{self, ProfilerCategory, profile};
use script_traits::CompositorEvent::{MouseMoveEvent, TouchEvent};
use script_traits::{AnimationState, ConstellationControlMsg, LayoutControlMsg};
-use script_traits::{TouchEventType, TouchId};
+use script_traits::{MouseButton, TouchEventType, TouchId};
use scrolling::ScrollingTimerProxy;
use std::collections::hash_map::Entry::{Occupied, Vacant};
use std::collections::{HashMap, HashSet};
diff --git a/components/compositing/windowing.rs b/components/compositing/windowing.rs
index 0dc4e1e46c8..181d7433f0f 100644
--- a/components/compositing/windowing.rs
+++ b/components/compositing/windowing.rs
@@ -11,9 +11,9 @@ use euclid::size::TypedSize2D;
use euclid::{Point2D, Size2D};
use layers::geometry::DevicePixel;
use layers::platform::surface::NativeDisplay;
-use msg::constellation_msg::{Key, KeyModifiers, KeyState, MouseButton};
+use msg::constellation_msg::{Key, KeyModifiers, KeyState};
use net_traits::net_error_list::NetError;
-use script_traits::{TouchEventType, TouchId};
+use script_traits::{MouseButton, TouchEventType, TouchId};
use std::fmt::{Debug, Error, Formatter};
use std::rc::Rc;
use url::Url;
diff --git a/components/msg/constellation_msg.rs b/components/msg/constellation_msg.rs
index 5794453cccb..1fdb333da3b 100644
--- a/components/msg/constellation_msg.rs
+++ b/components/msg/constellation_msg.rs
@@ -200,17 +200,6 @@ bitflags! {
}
}
-/// 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,
-}
-
#[derive(Deserialize, Serialize)]
pub enum WebDriverCommandMsg {
LoadUrl(PipelineId, LoadData, IpcSender<LoadStatus>),
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index d959452dfd2..0d1b9a9370b 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -82,13 +82,13 @@ use layout_interface::{HitTestResponse, MouseOverResponse};
use layout_interface::{LayoutChan, Msg, ReflowQueryType};
use msg::constellation_msg::{ALT, CONTROL, SHIFT, SUPER};
use msg::constellation_msg::{ConstellationChan, Key, KeyModifiers, KeyState};
-use msg::constellation_msg::{MouseButton, PipelineId, SubpageId};
+use msg::constellation_msg::{PipelineId, SubpageId};
use net_traits::ControlMsg::{GetCookiesForUrl, SetCookiesForUrl};
use net_traits::CookieSource::NonHTTP;
use net_traits::{AsyncResponseTarget, PendingAsyncLoad};
use num::ToPrimitive;
use script_thread::{MainThreadScriptMsg, Runnable};
-use script_traits::{AnimationState, MouseEventType, MozBrowserEvent};
+use script_traits::{AnimationState, MouseButton, MouseEventType, MozBrowserEvent};
use script_traits::{ScriptMsg as ConstellationMsg, ScriptToCompositorMsg};
use script_traits::{TouchEventType, TouchId, UntrustedNodeAddress};
use std::ascii::AsciiExt;
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index 1b42f35d716..c9b2d8c8687 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -64,8 +64,7 @@ use layout_interface::{self, LayoutChan, NewLayoutThreadInfo, ScriptLayoutChan};
use libc;
use mem::heap_size_of_self_and_children;
use msg::constellation_msg::{ConstellationChan, LoadData};
-use msg::constellation_msg::{MouseButton, PipelineId};
-use msg::constellation_msg::{PipelineNamespace};
+use msg::constellation_msg::{PipelineId, PipelineNamespace};
use msg::constellation_msg::{SubpageId, WindowSizeData};
use msg::webdriver_msg::WebDriverScriptCommand;
use net_traits::LoadData as NetLoadData;
@@ -81,7 +80,7 @@ use profile_traits::time::{self, ProfilerCategory, profile};
use script_traits::CompositorEvent::{KeyEvent, MouseButtonEvent, MouseMoveEvent, ResizeEvent};
use script_traits::CompositorEvent::{TouchEvent};
use script_traits::{CompositorEvent, ConstellationControlMsg, EventResult};
-use script_traits::{InitialScriptState, MouseEventType, MozBrowserEvent, NewLayoutInfo};
+use script_traits::{InitialScriptState, MouseButton, MouseEventType, MozBrowserEvent, NewLayoutInfo};
use script_traits::{LayoutMsg, OpaqueScriptLayoutChannel, ScriptMsg as ConstellationMsg};
use script_traits::{ScriptThreadFactory, ScriptToCompositorMsg, TimerEvent, TimerEventRequest, TimerSource};
use script_traits::{TouchEventType, TouchId};
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs
index 93db6cd52d2..a4d07966028 100644
--- a/components/script_traits/lib.rs
+++ b/components/script_traits/lib.rs
@@ -40,7 +40,7 @@ use gfx_traits::LayerId;
use ipc_channel::ipc::{IpcReceiver, IpcSender};
use libc::c_void;
use msg::constellation_msg::{ConstellationChan, Failure, PipelineId, WindowSizeData};
-use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData, MouseButton};
+use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData};
use msg::constellation_msg::{PipelineNamespaceId, SubpageId};
use msg::webdriver_msg::WebDriverScriptCommand;
use net_traits::ResourceThread;
@@ -189,6 +189,17 @@ pub enum TouchEventType {
#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize, Serialize)]
pub struct TouchId(pub i32);
+/// 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,
+}
+
/// The types of mouse events
#[derive(Deserialize, HeapSizeOf, Serialize)]
pub enum MouseEventType {
diff --git a/components/script_traits/script_msg.rs b/components/script_traits/script_msg.rs
index cc2104daf71..03a925c166e 100644
--- a/components/script_traits/script_msg.rs
+++ b/components/script_traits/script_msg.rs
@@ -5,6 +5,7 @@
use AnimationState;
use DocumentState;
use IFrameLoadInfo;
+use MouseButton;
use MouseEventType;
use MozBrowserEvent;
use canvas_traits::CanvasMsg;
@@ -12,7 +13,7 @@ use euclid::point::Point2D;
use euclid::size::Size2D;
use ipc_channel::ipc::IpcSender;
use msg::constellation_msg::{Failure, NavigationDirection, PipelineId};
-use msg::constellation_msg::{LoadData, MouseButton, SubpageId};
+use msg::constellation_msg::{LoadData, SubpageId};
use offscreen_gl_context::GLContextAttributes;
use style_traits::viewport::ViewportConstraints;
use url::Url;
diff --git a/ports/cef/browser_host.rs b/ports/cef/browser_host.rs
index 7dd6830fda1..73ddfdb0676 100644
--- a/ports/cef/browser_host.rs
+++ b/ports/cef/browser_host.rs
@@ -14,7 +14,8 @@ use compositing::windowing::{WindowEvent, MouseWindowEvent};
use euclid::point::Point2D;
use euclid::size::Size2D;
use libc::{c_double, c_int};
-use msg::constellation_msg::{self, KeyModifiers, KeyState, MouseButton};
+use msg::constellation_msg::{self, KeyModifiers, KeyState};
+use script_traits::MouseButton;
use std::cell::{Cell, RefCell};
pub struct ServoCefBrowserHost {
diff --git a/ports/glutin/window.rs b/ports/glutin/window.rs
index 217fd7c5157..542ab5d4597 100644
--- a/ports/glutin/window.rs
+++ b/ports/glutin/window.rs
@@ -253,7 +253,7 @@ impl Window {
/// Helper function to handle a click
fn handle_mouse(&self, button: glutin::MouseButton, action: glutin::ElementState, x: i32, y: i32) {
- use msg::constellation_msg::MouseButton;
+ use script_traits::MouseButton;
// FIXME(tkuehn): max pixel dist should be based on pixel density
let max_pixel_dist = 10f64;
diff --git a/ports/gonk/Cargo.lock b/ports/gonk/Cargo.lock
index cd3d39f5c56..c460150947d 100644
--- a/ports/gonk/Cargo.lock
+++ b/ports/gonk/Cargo.lock
@@ -16,6 +16,7 @@ dependencies = [
"net_traits 0.0.1",
"profile 0.0.1",
"script 0.0.1",
+ "script_traits 0.0.1",
"servo 0.0.1",
"servo-egl 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
diff --git a/ports/gonk/Cargo.toml b/ports/gonk/Cargo.toml
index 6e6eac6cf97..ac810b8faa9 100644
--- a/ports/gonk/Cargo.toml
+++ b/ports/gonk/Cargo.toml
@@ -18,6 +18,9 @@ path = "../../components/msg"
[dependencies.script]
path = "../../components/script"
+[dependencies.script_traits]
+path = "../../components/script_traits"
+
[dependencies.net_traits]
path = "../../components/net_traits"
diff --git a/ports/gonk/src/input.rs b/ports/gonk/src/input.rs
index b296db77583..e40900f7acf 100644
--- a/ports/gonk/src/input.rs
+++ b/ports/gonk/src/input.rs
@@ -6,7 +6,7 @@ use compositing::windowing::{WindowEvent, MouseWindowEvent};
use errno::errno;
use euclid::point::Point2D;
use libc::{c_int, c_long, time_t};
-use msg::constellation_msg::MouseButton;
+use script_traits::MouseButton;
use std::fs::File;
use std::io::Read;
use std::mem::{size_of, transmute, zeroed};
diff --git a/ports/gonk/src/main.rs b/ports/gonk/src/main.rs
index 57728f92f81..75b31dfa71a 100644
--- a/ports/gonk/src/main.rs
+++ b/ports/gonk/src/main.rs
@@ -33,6 +33,7 @@ extern crate layers;
extern crate libc;
extern crate msg;
extern crate net_traits;
+extern crate script_traits;
extern crate servo;
extern crate time;
extern crate url;