aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_traits
diff options
context:
space:
mode:
authorJack Moffitt <jack@metajack.im>2014-08-28 09:34:23 -0600
committerJack Moffitt <jack@metajack.im>2014-09-08 20:21:42 -0600
commitc6ab60dbfc6da7b4f800c9e40893c8b58413960c (patch)
treed1d74076cf7fa20e4f77ec7cb82cae98b67362cb /components/layout_traits
parentdb2f642c32fc5bed445bb6f2e45b0f6f0b4342cf (diff)
downloadservo-c6ab60dbfc6da7b4f800c9e40893c8b58413960c.tar.gz
servo-c6ab60dbfc6da7b4f800c9e40893c8b58413960c.zip
Cargoify servo
Diffstat (limited to 'components/layout_traits')
-rw-r--r--components/layout_traits/Cargo.toml23
-rw-r--r--components/layout_traits/lib.rs54
2 files changed, 77 insertions, 0 deletions
diff --git a/components/layout_traits/Cargo.toml b/components/layout_traits/Cargo.toml
new file mode 100644
index 00000000000..29556f9b975
--- /dev/null
+++ b/components/layout_traits/Cargo.toml
@@ -0,0 +1,23 @@
+[package]
+name = "layout_traits"
+version = "0.0.1"
+authors = ["The Servo Project Developers"]
+
+[lib]
+name = "layout_traits"
+path = "lib.rs"
+
+[dependencies.gfx]
+path = "../gfx"
+
+[dependencies.script_traits]
+path = "../script_traits"
+
+[dependencies.msg]
+path = "../msg"
+
+[dependencies.net]
+path = "../net"
+
+[dependencies.util]
+path = "../util"
diff --git a/components/layout_traits/lib.rs b/components/layout_traits/lib.rs
new file mode 100644
index 00000000000..612ba246e76
--- /dev/null
+++ b/components/layout_traits/lib.rs
@@ -0,0 +1,54 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * 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/. */
+
+#![comment = "The Servo Parallel Browser Project"]
+#![license = "MPL"]
+
+extern crate gfx;
+extern crate script_traits;
+extern crate servo_msg = "msg";
+extern crate servo_net = "net";
+extern crate servo_util = "util";
+
+// This module contains traits in layout used generically
+// in the rest of Servo.
+// The traits are here instead of in layout so
+// that these modules won't have to depend on layout.
+
+use gfx::font_cache_task::FontCacheTask;
+use gfx::render_task::RenderChan;
+use servo_msg::constellation_msg::{ConstellationChan, PipelineId};
+use servo_msg::constellation_msg::Failure;
+use servo_net::image_cache_task::ImageCacheTask;
+use servo_util::opts::Opts;
+use servo_util::time::TimeProfilerChan;
+use script_traits::{ScriptControlChan, OpaqueScriptLayoutChannel};
+use std::comm::Sender;
+
+/// Messages sent to the layout task from the constellation
+pub enum LayoutControlMsg {
+ ExitNowMsg,
+}
+
+/// A channel wrapper for constellation messages
+pub struct LayoutControlChan(pub Sender<LayoutControlMsg>);
+
+// A static method creating a layout task
+// Here to remove the compositor -> layout dependency
+pub trait LayoutTaskFactory {
+ // FIXME: use a proper static method
+ fn create(_phantom: Option<&mut Self>,
+ id: PipelineId,
+ chan: OpaqueScriptLayoutChannel,
+ pipeline_port: Receiver<LayoutControlMsg>,
+ constellation_chan: ConstellationChan,
+ failure_msg: Failure,
+ script_chan: ScriptControlChan,
+ render_chan: RenderChan,
+ img_cache_task: ImageCacheTask,
+ font_cache_task: FontCacheTask,
+ opts: Opts,
+ time_profiler_chan: TimeProfilerChan,
+ shutdown_chan: Sender<()>);
+}