Minor refactoring of mouse event types

* Move some types into the `msg` crate so they can be shared more.
* Use MouseEventType instead of duplicating it in other enums.
This commit is contained in:
Matt Brubeck 2015-12-02 11:49:37 -08:00
parent 2be60be062
commit 8c4fed42b0
13 changed files with 43 additions and 64 deletions

View file

@ -14,8 +14,7 @@ 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};
use script_traits::MouseButton;
use msg::constellation_msg::{self, KeyModifiers, KeyState, MouseButton};
use std::cell::{Cell, RefCell};
pub struct ServoCefBrowserHost {

View file

@ -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 script_traits::MouseButton;
use msg::constellation_msg::MouseButton;
// FIXME(tkuehn): max pixel dist should be based on pixel density
let max_pixel_dist = 10f64;

1
ports/gonk/Cargo.lock generated
View file

@ -17,7 +17,6 @@ dependencies = [
"net_traits 0.0.1",
"profile 0.0.1",
"script 0.0.1",
"script_traits 0.0.1",
"servo 0.0.1",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",

View file

@ -18,9 +18,6 @@ path = "../../components/msg"
[dependencies.script]
path = "../../components/script"
[dependencies.script_traits]
path = "../../components/script_traits"
[dependencies.net_traits]
path = "../../components/net_traits"

View file

@ -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 script_traits::MouseButton;
use msg::constellation_msg::MouseButton;
use std::fs::File;
use std::io::Read;
use std::mem::{size_of, transmute, zeroed};

View file

@ -33,7 +33,6 @@ 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;