Cleanup ports/servo to only rely on libservo

This commit is contained in:
Fabrice Desré 2018-03-30 17:44:47 -07:00
parent d232705106
commit bab1394146
7 changed files with 21 additions and 42 deletions

7
Cargo.lock generated
View file

@ -2717,25 +2717,18 @@ dependencies = [
"android_injected_glue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "android_injected_glue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"compositing 0.0.1",
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.29 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.4.29 (registry+https://github.com/rust-lang/crates.io-index)",
"glutin 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", "glutin 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libservo 0.0.1", "libservo 0.0.1",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"osmesa-src 17.3.1-devel (git+https://github.com/servo/osmesa-src)", "osmesa-src 17.3.1-devel (git+https://github.com/servo/osmesa-src)",
"osmesa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "osmesa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1",
"servo-egl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "servo-egl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"servo_config 0.0.1",
"servo_geometry 0.0.1",
"sig 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "sig 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"style_traits 0.0.1",
"tinyfiledialogs 3.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "tinyfiledialogs 3.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_api 0.57.0 (git+https://github.com/servo/webrender)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"winit 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", "winit 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
"winres 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "winres 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",

View file

@ -36,19 +36,12 @@ unstable = ["libservo/unstable"]
[dependencies] [dependencies]
backtrace = "0.3" backtrace = "0.3"
bitflags = "1.0" bitflags = "1.0"
compositing = {path = "../../components/compositing"}
euclid = "0.17" euclid = "0.17"
gleam = "0.4.29" gleam = "0.4.29"
glutin = "0.13" glutin = "0.13"
libservo = {path = "../../components/servo"} libservo = {path = "../../components/servo"}
log = "0.4" log = "0.4"
msg = {path = "../../components/msg"}
script_traits = {path = "../../components/script_traits"}
servo_geometry = {path = "../../components/geometry"}
servo_config = {path = "../../components/config"}
style_traits = {path = "../../components/style_traits"}
tinyfiledialogs = "3.0" tinyfiledialogs = "3.0"
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
winit = "0.11.2" winit = "0.11.2"
[target.'cfg(not(target_os = "android"))'.dependencies] [target.'cfg(not(target_os = "android"))'.dependencies]

View file

@ -2,21 +2,21 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use compositing::compositor_thread::EmbedderMsg;
use compositing::windowing::{WebRenderDebugOption, WindowEvent};
use euclid::{TypedPoint2D, TypedVector2D}; use euclid::{TypedPoint2D, TypedVector2D};
use glutin_app::keyutils::{CMD_OR_CONTROL, CMD_OR_ALT}; use glutin_app::keyutils::{CMD_OR_CONTROL, CMD_OR_ALT};
use glutin_app::window::{Window, LINE_HEIGHT}; use glutin_app::window::{Window, LINE_HEIGHT};
use msg::constellation_msg::{Key, TopLevelBrowsingContextId as BrowserId}; use servo::compositing::compositor_thread::EmbedderMsg;
use msg::constellation_msg::{KeyModifiers, KeyState, TraversalDirection}; use servo::compositing::windowing::{WebRenderDebugOption, WindowEvent};
use script_traits::TouchEventType; use servo::msg::constellation_msg::{Key, TopLevelBrowsingContextId as BrowserId};
use servo::msg::constellation_msg::{KeyModifiers, KeyState, TraversalDirection};
use servo::net_traits::pub_domains::is_reg_domain; use servo::net_traits::pub_domains::is_reg_domain;
use servo::script_traits::TouchEventType;
use servo::servo_config::prefs::PREFS;
use servo::servo_url::ServoUrl; use servo::servo_url::ServoUrl;
use servo_config::prefs::PREFS; use servo::webrender_api::ScrollLocation;
use std::mem; use std::mem;
use std::rc::Rc; use std::rc::Rc;
use tinyfiledialogs; use tinyfiledialogs;
use webrender_api::ScrollLocation;
pub struct Browser { pub struct Browser {
current_url: Option<ServoUrl>, current_url: Option<ServoUrl>,

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use msg::constellation_msg::{self, Key, KeyModifiers}; use servo::msg::constellation_msg::{self, Key, KeyModifiers};
use winit::{self, VirtualKeyCode}; use winit::{self, VirtualKeyCode};
bitflags! { bitflags! {

View file

@ -7,7 +7,7 @@
pub mod keyutils; pub mod keyutils;
pub mod window; pub mod window;
use servo_config::opts; use servo::servo_config::opts;
use std::rc::Rc; use std::rc::Rc;
pub fn create_window() -> Rc<window::Window> { pub fn create_window() -> Rc<window::Window> {

View file

@ -4,20 +4,23 @@
//! A windowing implementation using glutin. //! A windowing implementation using glutin.
use compositing::compositor_thread::EventLoopWaker;
use compositing::windowing::{AnimationState, MouseWindowEvent, WindowEvent};
use compositing::windowing::{EmbedderCoordinates, WindowMethods};
use euclid::{Length, TypedPoint2D, TypedVector2D, TypedScale, TypedSize2D}; use euclid::{Length, TypedPoint2D, TypedVector2D, TypedScale, TypedSize2D};
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
use gdi32; use gdi32;
use gleam::gl; use gleam::gl;
use glutin::{self, Api, GlContext, GlRequest}; use glutin::{self, Api, GlContext, GlRequest};
use msg::constellation_msg::{Key, KeyState};
#[cfg(any(target_os = "linux", target_os = "macos"))] #[cfg(any(target_os = "linux", target_os = "macos"))]
use osmesa_sys; use osmesa_sys;
use script_traits::TouchEventType; use servo::compositing::compositor_thread::EventLoopWaker;
use servo_config::opts; use servo::compositing::windowing::{AnimationState, MouseWindowEvent, WindowEvent};
use servo_geometry::DeviceIndependentPixel; use servo::compositing::windowing::{EmbedderCoordinates, WindowMethods};
use servo::msg::constellation_msg::{Key, KeyState};
use servo::script_traits::TouchEventType;
use servo::servo_config::opts;
use servo::servo_geometry::DeviceIndependentPixel;
use servo::style_traits::DevicePixel;
use servo::style_traits::cursor::CursorKind;
use servo::webrender_api::{DeviceIntPoint, DeviceUintRect, DeviceUintSize, ScrollLocation};
use std::cell::{Cell, RefCell}; use std::cell::{Cell, RefCell};
#[cfg(any(target_os = "linux", target_os = "macos"))] #[cfg(any(target_os = "linux", target_os = "macos"))]
use std::ffi::CString; use std::ffi::CString;
@ -28,12 +31,9 @@ use std::rc::Rc;
use std::sync::Arc; use std::sync::Arc;
use std::thread; use std::thread;
use std::time; use std::time;
use style_traits::DevicePixel;
use style_traits::cursor::CursorKind;
use super::keyutils::{self, GlutinKeyModifiers}; use super::keyutils::{self, GlutinKeyModifiers};
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
use user32; use user32;
use webrender_api::{DeviceIntPoint, DeviceUintRect, DeviceUintSize, ScrollLocation};
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
use winapi; use winapi;
use winit; use winit;
@ -513,7 +513,7 @@ impl Window {
event: winit::WindowEvent::Touch(touch), event: winit::WindowEvent::Touch(touch),
.. ..
} => { } => {
use script_traits::TouchId; use servo::script_traits::TouchId;
let phase = glutin_phase_to_touch_event_type(touch.phase); let phase = glutin_phase_to_touch_event_type(touch.phase);
let id = TouchId(touch.id as i32); let id = TouchId(touch.id as i32);
@ -570,7 +570,7 @@ impl Window {
fn handle_mouse(&self, button: winit::MouseButton, fn handle_mouse(&self, button: winit::MouseButton,
action: winit::ElementState, action: winit::ElementState,
coords: TypedPoint2D<i32, DevicePixel>) { coords: TypedPoint2D<i32, DevicePixel>) {
use script_traits::MouseButton; use servo::script_traits::MouseButton;
let max_pixel_dist = 10.0 * self.hidpi_factor().get(); let max_pixel_dist = 10.0 * self.hidpi_factor().get();
let event = match action { let event = match action {

View file

@ -21,25 +21,18 @@
extern crate android_injected_glue; extern crate android_injected_glue;
extern crate backtrace; extern crate backtrace;
#[macro_use] extern crate bitflags; #[macro_use] extern crate bitflags;
extern crate compositing;
extern crate euclid; extern crate euclid;
#[cfg(target_os = "windows")] extern crate gdi32; #[cfg(target_os = "windows")] extern crate gdi32;
extern crate gleam; extern crate gleam;
extern crate glutin; extern crate glutin;
// The window backed by glutin // The window backed by glutin
#[macro_use] extern crate log; #[macro_use] extern crate log;
extern crate msg;
#[cfg(any(target_os = "linux", target_os = "macos"))] extern crate osmesa_sys; #[cfg(any(target_os = "linux", target_os = "macos"))] extern crate osmesa_sys;
extern crate script_traits;
extern crate servo; extern crate servo;
extern crate servo_config;
extern crate servo_geometry;
#[cfg(all(feature = "unstable", not(target_os = "android")))] #[cfg(all(feature = "unstable", not(target_os = "android")))]
#[macro_use] #[macro_use]
extern crate sig; extern crate sig;
extern crate style_traits;
extern crate tinyfiledialogs; extern crate tinyfiledialogs;
extern crate webrender_api;
extern crate winit; extern crate winit;
#[cfg(target_os = "windows")] extern crate winapi; #[cfg(target_os = "windows")] extern crate winapi;
#[cfg(target_os = "windows")] extern crate user32; #[cfg(target_os = "windows")] extern crate user32;