aboutsummaryrefslogtreecommitdiffstats
path: root/components/servo
diff options
context:
space:
mode:
authormeh <meh@schizofreni.co>2015-08-29 23:50:56 +0200
committermeh <meh@schizofreni.co>2015-08-31 00:15:29 +0200
commitbfcaf7ef1ad1c834fee22d1f69b410e4dffbe2e3 (patch)
tree1b883a61fcf322be79de079a9c3a0a5651f2d232 /components/servo
parentccb8e4655759341e1b45139217cae7d8c2f7ec48 (diff)
downloadservo-bfcaf7ef1ad1c834fee22d1f69b410e4dffbe2e3.tar.gz
servo-bfcaf7ef1ad1c834fee22d1f69b410e4dffbe2e3.zip
Re-export crates needed to use the Servo Rust API
Diffstat (limited to 'components/servo')
-rw-r--r--components/servo/Cargo.lock7
-rw-r--r--components/servo/Cargo.toml27
-rw-r--r--components/servo/lib.rs77
-rw-r--r--components/servo/main.rs14
4 files changed, 98 insertions, 27 deletions
diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock
index 81063198cce..dd145b1675d 100644
--- a/components/servo/Cargo.lock
+++ b/components/servo/Cargo.lock
@@ -4,13 +4,18 @@ version = "0.0.1"
dependencies = [
"android_glue 0.0.2",
"bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "canvas 0.0.1",
+ "canvas_traits 0.0.1",
"compositing 0.0.1",
"devtools 0.0.1",
"devtools_traits 0.0.1",
"env_logger 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "euclid 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx 0.0.1",
"gfx_tests 0.0.1",
+ "gleam 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"glutin_app 0.0.1",
+ "layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"layout 0.0.1",
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
@@ -22,6 +27,8 @@ dependencies = [
"profile_traits 0.0.1",
"script 0.0.1",
"script_tests 0.0.1",
+ "script_traits 0.0.1",
+ "style 0.0.1",
"style_tests 0.0.1",
"time 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
diff --git a/components/servo/Cargo.toml b/components/servo/Cargo.toml
index 00a30da7962..8d454044d4e 100644
--- a/components/servo/Cargo.toml
+++ b/components/servo/Cargo.toml
@@ -41,9 +41,10 @@ git = "https://github.com/servo/rust-png"
features = [ "serde-serialization" ]
[features]
-default = ["glutin_app", "window"]
+default = ["glutin_app", "window", "webdriver"]
window = ["glutin_app/window"]
headless = ["glutin_app/headless"]
+webdriver = ["webdriver_server"]
# Uncomment to profile on Linux:
#
@@ -77,17 +78,30 @@ path = "../util"
[dependencies.script]
path = "../script"
+[dependencies.script_traits]
+path = "../script_traits"
+
[dependencies.layout]
path = "../layout"
[dependencies.gfx]
path = "../gfx"
+[dependencies.style]
+path = "../style"
+
+[dependencies.canvas]
+path = "../canvas"
+
+[dependencies.canvas_traits]
+path = "../canvas_traits"
+
[dependencies.devtools]
path = "../devtools"
[dependencies.webdriver_server]
-path = "../webdriver_server"
+path = "../webdriver_server"
+optional = true
[dependencies.devtools_traits]
path = "../devtools_traits"
@@ -104,6 +118,15 @@ optional = true
version = "0.2"
features = [ "serde_serialization" ]
+[dependencies.euclid]
+version = "0.1"
+
+[dependencies.layers]
+git = "https://github.com/servo/rust-layers"
+
+[dependencies.gleam]
+version = "0.1"
+
[dependencies]
env_logger = "0.3"
time = "0.1.12"
diff --git a/components/servo/lib.rs b/components/servo/lib.rs
index dbf127803d3..8dd05d6f6f4 100644
--- a/components/servo/lib.rs
+++ b/components/servo/lib.rs
@@ -17,22 +17,67 @@
// The `Browser` is fed events from a generic type that implements the
// `WindowMethods` trait.
-extern crate compositing;
-extern crate devtools;
-extern crate devtools_traits;
-extern crate net;
-extern crate net_traits;
-extern crate msg;
-extern crate profile;
-extern crate profile_traits;
#[macro_use]
-extern crate util;
-extern crate script;
-extern crate layout;
-extern crate gfx;
+extern crate util as _util;
+
+mod export {
+ extern crate compositing;
+ extern crate devtools;
+ extern crate devtools_traits;
+ extern crate net;
+ extern crate net_traits;
+ extern crate msg;
+ extern crate profile;
+ extern crate profile_traits;
+ extern crate script;
+ extern crate script_traits;
+ extern crate layout;
+ extern crate gfx;
+ extern crate style;
+ extern crate canvas;
+ extern crate canvas_traits;
+
+ extern crate euclid;
+ extern crate url;
+ extern crate layers;
+ extern crate gleam;
+}
+
extern crate libc;
+
+#[cfg(feature = "webdriver")]
extern crate webdriver_server;
+#[cfg(feature = "webdriver")]
+fn webdriver(port: u16, constellation: msg::constellation_msg::ConstellationChan) {
+ webdriver_server::start_server(port, constellation.clone());
+}
+
+#[cfg(not(feature = "webdriver"))]
+fn webdriver(_port: u16, _constellation: msg::constellation_msg::ConstellationChan) { }
+
+pub use _util as util;
+pub use export::compositing;
+pub use export::devtools;
+pub use export::devtools_traits;
+pub use export::net;
+pub use export::net_traits;
+pub use export::msg;
+pub use export::profile;
+pub use export::profile_traits;
+pub use export::script;
+pub use export::script_traits;
+pub use export::layout;
+pub use export::gfx;
+pub use export::style;
+pub use export::canvas;
+pub use export::canvas_traits;
+
+pub use export::euclid;
+pub use export::url;
+pub use export::layers;
+pub use export::gleam::gl;
+
use compositing::CompositorEventListener;
use compositing::windowing::WindowEvent;
@@ -110,9 +155,11 @@ impl Browser {
devtools_chan,
supports_clipboard);
- if let Some(port) = opts.webdriver_port {
- webdriver_server::start_server(port, constellation_chan.clone());
- };
+ if cfg!(feature = "webdriver") {
+ if let Some(port) = opts.webdriver_port {
+ webdriver(port, constellation_chan.clone());
+ }
+ }
// The compositor coordinates with the client window to create the final
// rendered page and display it somewhere.
diff --git a/components/servo/main.rs b/components/servo/main.rs
index e96703026fe..530bbf639ee 100644
--- a/components/servo/main.rs
+++ b/components/servo/main.rs
@@ -19,13 +19,7 @@
// The Servo engine
extern crate servo;
-// Window graphics compositing and message dispatch
-extern crate compositing;
-// Servo networking
-extern crate net;
-extern crate net_traits;
-// Servo common utilitiess
-extern crate util;
+
// The window backed by glutin
extern crate glutin_app as app;
extern crate time;
@@ -35,11 +29,11 @@ extern crate env_logger;
#[macro_use]
extern crate android_glue;
-use compositing::windowing::WindowEvent;
-use net_traits::hosts;
use servo::Browser;
+use servo::compositing::windowing::WindowEvent;
+use servo::net_traits::hosts;
+use servo::util::opts;
use std::rc::Rc;
-use util::opts;
#[cfg(target_os="android")]
use std::borrow::ToOwned;