servo: Merge #9263 - Moved MouseButton from msg to script_traits (from DarinM223:move_mousebutton); r=KiChjang

Fixes #9250

Source-Repo: https://github.com/servo/servo
Source-Revision: 9118b64b4b610a95f48a88a198baac4eb31a04a0
This commit is contained in:
Darin Minamoto 2016-01-16 19:05:51 +05:01
Родитель 9a7c1d808c
Коммит 7af6d9dbee
13 изменённых файлов: 31 добавлений и 25 удалений

Просмотреть файл

@ -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};

Просмотреть файл

@ -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;

Просмотреть файл

@ -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>),

Просмотреть файл

@ -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;

Просмотреть файл

@ -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};

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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;

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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;

1
servo/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)",

Просмотреть файл

@ -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"

Просмотреть файл

@ -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};

Просмотреть файл

@ -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;