mirror of
https://github.com/servo/servo.git
synced 2025-06-29 03:23:41 +01:00
Re-export crates needed to use the Servo Rust API
This commit is contained in:
parent
ccb8e46557
commit
bfcaf7ef1a
4 changed files with 98 additions and 27 deletions
7
components/servo/Cargo.lock
generated
7
components/servo/Cargo.lock
generated
|
@ -4,13 +4,18 @@ version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"android_glue 0.0.2",
|
"android_glue 0.0.2",
|
||||||
"bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"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",
|
"compositing 0.0.1",
|
||||||
"devtools 0.0.1",
|
"devtools 0.0.1",
|
||||||
"devtools_traits 0.0.1",
|
"devtools_traits 0.0.1",
|
||||||
"env_logger 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"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 0.0.1",
|
||||||
"gfx_tests 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",
|
"glutin_app 0.0.1",
|
||||||
|
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
|
||||||
"layout 0.0.1",
|
"layout 0.0.1",
|
||||||
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"msg 0.0.1",
|
"msg 0.0.1",
|
||||||
|
@ -22,6 +27,8 @@ dependencies = [
|
||||||
"profile_traits 0.0.1",
|
"profile_traits 0.0.1",
|
||||||
"script 0.0.1",
|
"script 0.0.1",
|
||||||
"script_tests 0.0.1",
|
"script_tests 0.0.1",
|
||||||
|
"script_traits 0.0.1",
|
||||||
|
"style 0.0.1",
|
||||||
"style_tests 0.0.1",
|
"style_tests 0.0.1",
|
||||||
"time 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
|
"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)",
|
"url 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
|
@ -41,9 +41,10 @@ git = "https://github.com/servo/rust-png"
|
||||||
features = [ "serde-serialization" ]
|
features = [ "serde-serialization" ]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["glutin_app", "window"]
|
default = ["glutin_app", "window", "webdriver"]
|
||||||
window = ["glutin_app/window"]
|
window = ["glutin_app/window"]
|
||||||
headless = ["glutin_app/headless"]
|
headless = ["glutin_app/headless"]
|
||||||
|
webdriver = ["webdriver_server"]
|
||||||
|
|
||||||
# Uncomment to profile on Linux:
|
# Uncomment to profile on Linux:
|
||||||
#
|
#
|
||||||
|
@ -77,17 +78,30 @@ path = "../util"
|
||||||
[dependencies.script]
|
[dependencies.script]
|
||||||
path = "../script"
|
path = "../script"
|
||||||
|
|
||||||
|
[dependencies.script_traits]
|
||||||
|
path = "../script_traits"
|
||||||
|
|
||||||
[dependencies.layout]
|
[dependencies.layout]
|
||||||
path = "../layout"
|
path = "../layout"
|
||||||
|
|
||||||
[dependencies.gfx]
|
[dependencies.gfx]
|
||||||
path = "../gfx"
|
path = "../gfx"
|
||||||
|
|
||||||
|
[dependencies.style]
|
||||||
|
path = "../style"
|
||||||
|
|
||||||
|
[dependencies.canvas]
|
||||||
|
path = "../canvas"
|
||||||
|
|
||||||
|
[dependencies.canvas_traits]
|
||||||
|
path = "../canvas_traits"
|
||||||
|
|
||||||
[dependencies.devtools]
|
[dependencies.devtools]
|
||||||
path = "../devtools"
|
path = "../devtools"
|
||||||
|
|
||||||
[dependencies.webdriver_server]
|
[dependencies.webdriver_server]
|
||||||
path = "../webdriver_server"
|
path = "../webdriver_server"
|
||||||
|
optional = true
|
||||||
|
|
||||||
[dependencies.devtools_traits]
|
[dependencies.devtools_traits]
|
||||||
path = "../devtools_traits"
|
path = "../devtools_traits"
|
||||||
|
@ -104,6 +118,15 @@ optional = true
|
||||||
version = "0.2"
|
version = "0.2"
|
||||||
features = [ "serde_serialization" ]
|
features = [ "serde_serialization" ]
|
||||||
|
|
||||||
|
[dependencies.euclid]
|
||||||
|
version = "0.1"
|
||||||
|
|
||||||
|
[dependencies.layers]
|
||||||
|
git = "https://github.com/servo/rust-layers"
|
||||||
|
|
||||||
|
[dependencies.gleam]
|
||||||
|
version = "0.1"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
env_logger = "0.3"
|
env_logger = "0.3"
|
||||||
time = "0.1.12"
|
time = "0.1.12"
|
||||||
|
|
|
@ -17,6 +17,10 @@
|
||||||
// The `Browser` is fed events from a generic type that implements the
|
// The `Browser` is fed events from a generic type that implements the
|
||||||
// `WindowMethods` trait.
|
// `WindowMethods` trait.
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
extern crate util as _util;
|
||||||
|
|
||||||
|
mod export {
|
||||||
extern crate compositing;
|
extern crate compositing;
|
||||||
extern crate devtools;
|
extern crate devtools;
|
||||||
extern crate devtools_traits;
|
extern crate devtools_traits;
|
||||||
|
@ -25,14 +29,55 @@ extern crate net_traits;
|
||||||
extern crate msg;
|
extern crate msg;
|
||||||
extern crate profile;
|
extern crate profile;
|
||||||
extern crate profile_traits;
|
extern crate profile_traits;
|
||||||
#[macro_use]
|
|
||||||
extern crate util;
|
|
||||||
extern crate script;
|
extern crate script;
|
||||||
|
extern crate script_traits;
|
||||||
extern crate layout;
|
extern crate layout;
|
||||||
extern crate gfx;
|
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;
|
extern crate libc;
|
||||||
|
|
||||||
|
#[cfg(feature = "webdriver")]
|
||||||
extern crate webdriver_server;
|
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::CompositorEventListener;
|
||||||
use compositing::windowing::WindowEvent;
|
use compositing::windowing::WindowEvent;
|
||||||
|
|
||||||
|
@ -110,9 +155,11 @@ impl Browser {
|
||||||
devtools_chan,
|
devtools_chan,
|
||||||
supports_clipboard);
|
supports_clipboard);
|
||||||
|
|
||||||
|
if cfg!(feature = "webdriver") {
|
||||||
if let Some(port) = opts.webdriver_port {
|
if let Some(port) = opts.webdriver_port {
|
||||||
webdriver_server::start_server(port, constellation_chan.clone());
|
webdriver(port, constellation_chan.clone());
|
||||||
};
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// The compositor coordinates with the client window to create the final
|
// The compositor coordinates with the client window to create the final
|
||||||
// rendered page and display it somewhere.
|
// rendered page and display it somewhere.
|
||||||
|
|
|
@ -19,13 +19,7 @@
|
||||||
|
|
||||||
// The Servo engine
|
// The Servo engine
|
||||||
extern crate servo;
|
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
|
// The window backed by glutin
|
||||||
extern crate glutin_app as app;
|
extern crate glutin_app as app;
|
||||||
extern crate time;
|
extern crate time;
|
||||||
|
@ -35,11 +29,11 @@ extern crate env_logger;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate android_glue;
|
extern crate android_glue;
|
||||||
|
|
||||||
use compositing::windowing::WindowEvent;
|
|
||||||
use net_traits::hosts;
|
|
||||||
use servo::Browser;
|
use servo::Browser;
|
||||||
|
use servo::compositing::windowing::WindowEvent;
|
||||||
|
use servo::net_traits::hosts;
|
||||||
|
use servo::util::opts;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use util::opts;
|
|
||||||
|
|
||||||
#[cfg(target_os="android")]
|
#[cfg(target_os="android")]
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue