Skip to content

Commit

Permalink
Cleanup ports/servo to only rely on libservo
Browse files Browse the repository at this point in the history
  • Loading branch information
fabricedesre committed Mar 31, 2018
1 parent d232705 commit bab1394
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 42 deletions.
7 changes: 0 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions ports/servo/Cargo.toml
Expand Up @@ -36,19 +36,12 @@ unstable = ["libservo/unstable"]
[dependencies]
backtrace = "0.3"
bitflags = "1.0"
compositing = {path = "../../components/compositing"}
euclid = "0.17"
gleam = "0.4.29"
glutin = "0.13"
libservo = {path = "../../components/servo"}
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"
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
winit = "0.11.2"

[target.'cfg(not(target_os = "android"))'.dependencies]
Expand Down
14 changes: 7 additions & 7 deletions ports/servo/browser.rs
Expand Up @@ -2,21 +2,21 @@
* 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/. */

use compositing::compositor_thread::EmbedderMsg;
use compositing::windowing::{WebRenderDebugOption, WindowEvent};
use euclid::{TypedPoint2D, TypedVector2D};
use glutin_app::keyutils::{CMD_OR_CONTROL, CMD_OR_ALT};
use glutin_app::window::{Window, LINE_HEIGHT};
use msg::constellation_msg::{Key, TopLevelBrowsingContextId as BrowserId};
use msg::constellation_msg::{KeyModifiers, KeyState, TraversalDirection};
use script_traits::TouchEventType;
use servo::compositing::compositor_thread::EmbedderMsg;
use servo::compositing::windowing::{WebRenderDebugOption, WindowEvent};
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::script_traits::TouchEventType;
use servo::servo_config::prefs::PREFS;
use servo::servo_url::ServoUrl;
use servo_config::prefs::PREFS;
use servo::webrender_api::ScrollLocation;
use std::mem;
use std::rc::Rc;
use tinyfiledialogs;
use webrender_api::ScrollLocation;

pub struct Browser {
current_url: Option<ServoUrl>,
Expand Down
2 changes: 1 addition & 1 deletion ports/servo/glutin_app/keyutils.rs
Expand Up @@ -2,7 +2,7 @@
* 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/. */

use msg::constellation_msg::{self, Key, KeyModifiers};
use servo::msg::constellation_msg::{self, Key, KeyModifiers};
use winit::{self, VirtualKeyCode};

bitflags! {
Expand Down
2 changes: 1 addition & 1 deletion ports/servo/glutin_app/mod.rs
Expand Up @@ -7,7 +7,7 @@
pub mod keyutils;
pub mod window;

use servo_config::opts;
use servo::servo_config::opts;
use std::rc::Rc;

pub fn create_window() -> Rc<window::Window> {
Expand Down
24 changes: 12 additions & 12 deletions ports/servo/glutin_app/window.rs
Expand Up @@ -4,20 +4,23 @@

//! 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};
#[cfg(target_os = "windows")]
use gdi32;
use gleam::gl;
use glutin::{self, Api, GlContext, GlRequest};
use msg::constellation_msg::{Key, KeyState};
#[cfg(any(target_os = "linux", target_os = "macos"))]
use osmesa_sys;
use script_traits::TouchEventType;
use servo_config::opts;
use servo_geometry::DeviceIndependentPixel;
use servo::compositing::compositor_thread::EventLoopWaker;
use servo::compositing::windowing::{AnimationState, MouseWindowEvent, WindowEvent};
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};
#[cfg(any(target_os = "linux", target_os = "macos"))]
use std::ffi::CString;
Expand All @@ -28,12 +31,9 @@ use std::rc::Rc;
use std::sync::Arc;
use std::thread;
use std::time;
use style_traits::DevicePixel;
use style_traits::cursor::CursorKind;
use super::keyutils::{self, GlutinKeyModifiers};
#[cfg(target_os = "windows")]
use user32;
use webrender_api::{DeviceIntPoint, DeviceUintRect, DeviceUintSize, ScrollLocation};
#[cfg(target_os = "windows")]
use winapi;
use winit;
Expand Down Expand Up @@ -513,7 +513,7 @@ impl Window {
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 id = TouchId(touch.id as i32);
Expand Down Expand Up @@ -570,7 +570,7 @@ impl Window {
fn handle_mouse(&self, button: winit::MouseButton,
action: winit::ElementState,
coords: TypedPoint2D<i32, DevicePixel>) {
use script_traits::MouseButton;
use servo::script_traits::MouseButton;

let max_pixel_dist = 10.0 * self.hidpi_factor().get();
let event = match action {
Expand Down
7 changes: 0 additions & 7 deletions ports/servo/main.rs
Expand Up @@ -21,25 +21,18 @@
extern crate android_injected_glue;
extern crate backtrace;
#[macro_use] extern crate bitflags;
extern crate compositing;
extern crate euclid;
#[cfg(target_os = "windows")] extern crate gdi32;
extern crate gleam;
extern crate glutin;
// The window backed by glutin
#[macro_use] extern crate log;
extern crate msg;
#[cfg(any(target_os = "linux", target_os = "macos"))] extern crate osmesa_sys;
extern crate script_traits;
extern crate servo;
extern crate servo_config;
extern crate servo_geometry;
#[cfg(all(feature = "unstable", not(target_os = "android")))]
#[macro_use]
extern crate sig;
extern crate style_traits;
extern crate tinyfiledialogs;
extern crate webrender_api;
extern crate winit;
#[cfg(target_os = "windows")] extern crate winapi;
#[cfg(target_os = "windows")] extern crate user32;
Expand Down

0 comments on commit bab1394

Please sign in to comment.