aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Kuehn <tkuehn@cmu.edu>2013-06-19 21:02:23 -0700
committerTim Kuehn <tkuehn@cmu.edu>2013-06-19 21:31:12 -0700
commit2253365735fa93768d83f06b4a799b9f3d61f780 (patch)
tree984e2454f3bbedd6839abcb164a519cc5f307a96
parent68aee00ec4702904ca6b4c7eba163148b4cccf45 (diff)
downloadservo-2253365735fa93768d83f06b4a799b9f3d61f780.tar.gz
servo-2253365735fa93768d83f06b4a799b9f3d61f780.zip
libmsg crate for message interfaces to compositor and engine
-rw-r--r--Makefile.in22
-rwxr-xr-xconfigure1
-rw-r--r--mk/clean.mk3
-rw-r--r--src/components/gfx/gfx.rc2
-rw-r--r--src/components/gfx/render_context.rs2
-rw-r--r--src/components/gfx/render_task.rs3
-rw-r--r--src/components/main/compositing/mod.rs5
-rw-r--r--src/components/main/engine.rs4
-rw-r--r--src/components/main/platform/common/glut_windowing.rs4
-rwxr-xr-xsrc/components/main/servo.rc3
-rw-r--r--src/components/main/windowing.rs3
-rw-r--r--src/components/msg/compositor.rs (renamed from src/components/gfx/compositor.rs)14
-rw-r--r--src/components/msg/engine.rs (renamed from src/components/script/engine_interface.rs)0
-rw-r--r--src/components/msg/msg.rc18
-rw-r--r--src/components/script/compositor_interface.rs21
-rw-r--r--src/components/script/script.rc3
-rw-r--r--src/components/script/script_task.rs4
m---------src/support/azure/rust-azure0
m---------src/support/skia/skia0
19 files changed, 69 insertions, 43 deletions
diff --git a/Makefile.in b/Makefile.in
index 90adb878799..b2ad90cb475 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -186,28 +186,35 @@ DONE_net = $(B)src/components/net/libnet.dummy
DEPS_net = $(CRATE_net) $(SRC_net) $(DONE_SUBMODULES) $(DONE_util)
-RFLAGS_gfx = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/util -L $(B)src/components/net
+RFLAGS_msg = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES))
+SRC_msg = $(call rwildcard,$(S)src/components/msg/,*.rs)
+CRATE_msg = $(S)src/components/msg/msg.rc
+DONE_msg = $(B)src/components/msg/libmsg.dummy
+
+DEPS_msg = $(CRATE_msg) $(SRC_msg) $(DONE_SUBMODULES)
+
+RFLAGS_gfx = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/util -L $(B)src/components/net -L $(B)src/components/msg
SRC_gfx = $(call rwildcard,$(S)src/components/gfx/,*.rs)
CRATE_gfx = $(S)src/components/gfx/gfx.rc
DONE_gfx = $(B)src/components/gfx/libgfx.dummy
-DEPS_gfx = $(CRATE_gfx) $(SRC_gfx) $(DONE_SUBMODULES) $(DONE_util) $(DONE_net)
+DEPS_gfx = $(CRATE_gfx) $(SRC_gfx) $(DONE_SUBMODULES) $(DONE_util) $(DONE_net) $(DONE_msg)
-RFLAGS_script = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/util -L $(B)src/components/net -L $(B)src/components/gfx
+RFLAGS_script = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/util -L $(B)src/components/net -L $(B)src/components/gfx -L $(B)src/components/msg
WEBIDL_script = $(call rwildcard,$(S)src/components/script/,*.webidl)
AUTOGEN_SRC_script = $(patsubst %.webidl, %Binding.rs, $(WEBIDL_script))
SRC_script = $(call rwildcard,$(S)src/components/script/,*.rs) $(AUTOGEN_SRC_script)
CRATE_script = $(S)src/components/script/script.rc
DONE_script = $(B)src/components/script/libscript.dummy
-DEPS_script = $(CRATE_script) $(SRC_script) $(DONE_SUBMODULES) $(DONE_util) $(DONE_net) $(DONE_gfx)
+DEPS_script = $(CRATE_script) $(SRC_script) $(DONE_SUBMODULES) $(DONE_util) $(DONE_net) $(DONE_gfx) $(DONE_msg)
-RFLAGS_servo = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/gfx -L $(B)src/components/util -L $(B)src/components/net -L $(B)src/components/script
+RFLAGS_servo = $(strip $(CFG_RUSTC_FLAGS)) $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/gfx -L $(B)src/components/util -L $(B)src/components/net -L $(B)src/components/script -L $(B)src/components/msg
SRC_servo = $(call rwildcard,$(S)src/components/main/,*.rs)
CRATE_servo = $(S)src/components/main/servo.rc
-DEPS_servo = $(CRATE_servo) $(SRC_servo) $(DONE_SUBMODULES) $(DONE_util) $(DONE_gfx) $(DONE_script) $(DONE_net)
+DEPS_servo = $(CRATE_servo) $(SRC_servo) $(DONE_SUBMODULES) $(DONE_util) $(DONE_gfx) $(DONE_script) $(DONE_net) $(DONE_msg)
# rules that depend on having correct meta-target vars (DEPS_CLEAN, DEPS_servo, etc)
include $(S)mk/check.mk
@@ -225,6 +232,9 @@ $(DONE_util): $(DEPS_util)
$(DONE_net): $(DEPS_net)
$(RUSTC) $(RFLAGS_net) -o $@ $< && touch $@
+$(DONE_msg): $(DEPS_msg)
+ $(RUSTC) $(RFLAGS_msg) -o $@ $< && touch $@
+
$(DONE_gfx): $(DEPS_gfx)
$(RUSTC) $(RFLAGS_gfx) -o $@ $< && touch $@
diff --git a/configure b/configure
index 8d39cb8788a..4fde268cc26 100755
--- a/configure
+++ b/configure
@@ -452,6 +452,7 @@ do
done
make_dir ${CFG_BUILD_DIR}src/components/util
+make_dir ${CFG_BUILD_DIR}src/components/msg
make_dir ${CFG_BUILD_DIR}src/components/net
make_dir ${CFG_BUILD_DIR}src/components/gfx
make_dir ${CFG_BUILD_DIR}src/components/script
diff --git a/mk/clean.mk b/mk/clean.mk
index c08d51e9709..db92a5df392 100644
--- a/mk/clean.mk
+++ b/mk/clean.mk
@@ -28,6 +28,9 @@ clean-fast: $(DEPS_CLEAN_TARGETS_FAST) clean-servo
clean-util:
cd $(B)/src/components/util/ && rm -rf libutil*.dylib $(DONE_util)
+clean-msg:
+ cd $(B)/src/components/msg/ && rm -rf libmsg*.dylib $(DONE_msg)
+
clean-net:
cd $(B)/src/components/net/ && rm -rf libnet*.dylib $(DONE_net)
diff --git a/src/components/gfx/gfx.rc b/src/components/gfx/gfx.rc
index c96e4e4b8da..9d3fd2a20d9 100644
--- a/src/components/gfx/gfx.rc
+++ b/src/components/gfx/gfx.rc
@@ -15,6 +15,7 @@ extern mod stb_image;
extern mod std;
extern mod servo_net (name = "net");
extern mod servo_util (name = "util");
+extern mod servo_msg (name = "msg");
// Eventually we would like the shaper to be pluggable, as many operating systems have their own
// shapers. For now, however, this is a hard dependency.
@@ -39,7 +40,6 @@ priv mod render_context;
// Rendering
pub mod color;
-pub mod compositor;
pub mod display_list;
pub mod geometry;
pub mod render_task;
diff --git a/src/components/gfx/render_context.rs b/src/components/gfx/render_context.rs
index aef6e85c9ec..8b3c9954f5e 100644
--- a/src/components/gfx/render_context.rs
+++ b/src/components/gfx/render_context.rs
@@ -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 compositor::LayerBuffer;
+use servo_msg::compositor::LayerBuffer;
use font_context::FontContext;
use geometry::Au;
use opts::Opts;
diff --git a/src/components/gfx/render_task.rs b/src/components/gfx/render_task.rs
index 07c530bf2e1..a0b54d8dd9e 100644
--- a/src/components/gfx/render_task.rs
+++ b/src/components/gfx/render_task.rs
@@ -6,8 +6,9 @@
use azure::{AzFloat, AzGLContext};
use azure::azure_hl::{B8G8R8A8, DrawTarget};
-use compositor::{RenderListener, IdleRenderState, RenderingRenderState, LayerBuffer, LayerBufferSet};
use display_list::DisplayList;
+use servo_msg::compositor::{RenderListener, IdleRenderState, RenderingRenderState, LayerBuffer};
+use servo_msg::compositor::LayerBufferSet;
use font_context::FontContext;
use geom::matrix2d::Matrix2D;
use geom::point::Point2D;
diff --git a/src/components/main/compositing/mod.rs b/src/components/main/compositing/mod.rs
index 7e6a83c373c..5eb82234e0b 100644
--- a/src/components/main/compositing/mod.rs
+++ b/src/components/main/compositing/mod.rs
@@ -6,9 +6,11 @@ use platform::{Application, Window};
use script::dom::event::{Event, ClickEvent, MouseDownEvent, MouseUpEvent, ResizeEvent};
use script::script_task::{LoadMsg, SendEventMsg};
use script::layout_interface::{LayoutChan, RouteScriptMsg};
-use script::compositor_interface::{ReadyState, ScriptListener};
use windowing::{ApplicationMethods, WindowMethods, WindowMouseEvent, WindowClickEvent};
use windowing::{WindowMouseDownEvent, WindowMouseUpEvent};
+use servo_msg::compositor::{RenderListener, LayerBufferSet, RenderState};
+use servo_msg::compositor::{ReadyState, ScriptListener};
+
use azure::azure_hl::{DataSourceSurface, DrawTarget, SourceSurfaceMethods, current_gl_context};
use azure::azure::AzGLContext;
use core::cell::Cell;
@@ -18,7 +20,6 @@ use core::util;
use geom::matrix::identity;
use geom::point::Point2D;
use geom::size::Size2D;
-use gfx::compositor::{RenderListener, LayerBufferSet, RenderState};
use layers::layers::{ARGB32Format, ContainerLayer, ContainerLayerKind, Format};
use layers::layers::{ImageData, WithDataFn};
use layers::layers::{TextureLayerKind, TextureLayer, TextureManager};
diff --git a/src/components/main/engine.rs b/src/components/main/engine.rs
index 1abc00537c4..3da355a08c7 100644
--- a/src/components/main/engine.rs
+++ b/src/components/main/engine.rs
@@ -10,8 +10,8 @@ use core::comm::Port;
use gfx::opts::Opts;
use gfx::render_task::RenderChan;
use gfx::render_task;
-use script::compositor_interface::{ScriptListener, ReadyState};
-use script::engine_interface::{EngineChan, ExitMsg, LoadUrlMsg, Msg};
+use servo_msg::compositor::{ScriptListener, ReadyState};
+use servo_msg::engine::{EngineChan, ExitMsg, LoadUrlMsg, Msg};
use script::layout_interface::LayoutChan;
use script::layout_interface;
use script::script_task::{ExecuteMsg, LoadMsg, ScriptMsg, ScriptContext, ScriptChan};
diff --git a/src/components/main/platform/common/glut_windowing.rs b/src/components/main/platform/common/glut_windowing.rs
index d633bb55056..72487539fb9 100644
--- a/src/components/main/platform/common/glut_windowing.rs
+++ b/src/components/main/platform/common/glut_windowing.rs
@@ -15,11 +15,11 @@ use alert::{Alert, AlertMethods};
use core::libc::c_int;
use geom::point::Point2D;
use geom::size::Size2D;
-use gfx::compositor::{IdleRenderState, RenderState, RenderingRenderState};
+use servo_msg::compositor::{IdleRenderState, RenderState, RenderingRenderState};
+use servo_msg::compositor::{FinishedLoading, Loading, PerformingLayout, ReadyState};
use glut::glut::{ACTIVE_CTRL, DOUBLE, HAVE_PRECISE_MOUSE_WHEEL, WindowHeight, WindowWidth};
use glut::glut;
use glut::machack;
-use script::compositor_interface::{FinishedLoading, Loading, PerformingLayout, ReadyState};
static THROBBER: [char, ..8] = [ '⣾', '⣽', '⣻', '⢿', '⡿', '⣟', '⣯', '⣷' ];
diff --git a/src/components/main/servo.rc b/src/components/main/servo.rc
index 8357d4136d1..99073d701a6 100755
--- a/src/components/main/servo.rc
+++ b/src/components/main/servo.rc
@@ -23,6 +23,7 @@ extern mod newcss (name = "css");
extern mod opengles;
extern mod script;
extern mod servo_net (name = "net");
+extern mod servo_msg (name = "msg");
extern mod servo_util (name = "util");
extern mod sharegl;
extern mod stb_image;
@@ -35,7 +36,7 @@ extern mod core_text;
use compositing::{CompositorChan, CompositorTask};
use engine::Engine;
-use script::engine_interface::{ExitMsg, LoadUrlMsg};
+use servo_msg::engine::{ExitMsg, LoadUrlMsg};
use gfx::opts;
use servo_net::image_cache_task::ImageCacheTask;
diff --git a/src/components/main/windowing.rs b/src/components/main/windowing.rs
index 888851cbbf1..56a6cbcb0ab 100644
--- a/src/components/main/windowing.rs
+++ b/src/components/main/windowing.rs
@@ -6,8 +6,7 @@
use geom::point::Point2D;
use geom::size::Size2D;
-use gfx::compositor::RenderState;
-use script::compositor_interface::ReadyState;
+use servo_msg::compositor::{ReadyState, RenderState};
pub enum WindowMouseEvent {
WindowClickEvent(uint, Point2D<f32>),
diff --git a/src/components/gfx/compositor.rs b/src/components/msg/compositor.rs
index 46e09800685..1cd50843449 100644
--- a/src/components/gfx/compositor.rs
+++ b/src/components/msg/compositor.rs
@@ -40,3 +40,17 @@ pub trait RenderListener {
fn set_render_state(&self, render_state: RenderState);
}
+pub enum ReadyState {
+ /// Informs the compositor that a page is loading. Used for setting status
+ Loading,
+ /// Informs the compositor that a page is performing layout. Used for setting status
+ PerformingLayout,
+ /// Informs the compositor that a page is finished loading. Used for setting status
+ FinishedLoading,
+}
+
+/// The interface used by the script task to tell the compositor to update its ready state,
+/// which is used in displaying the appropriate message in the window's title.
+pub trait ScriptListener : Clone {
+ fn set_ready_state(&self, ReadyState);
+}
diff --git a/src/components/script/engine_interface.rs b/src/components/msg/engine.rs
index c7a33334c97..c7a33334c97 100644
--- a/src/components/script/engine_interface.rs
+++ b/src/components/msg/engine.rs
diff --git a/src/components/msg/msg.rc b/src/components/msg/msg.rc
new file mode 100644
index 00000000000..12dac1c1d4c
--- /dev/null
+++ b/src/components/msg/msg.rc
@@ -0,0 +1,18 @@
+/* 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/. */
+
+#[link(name = "msg",
+ vers = "0.1",
+ uuid = "4c6054e4-2a7b-4fae-b0c8-6d04416b2bf2",
+ url = "http://servo.org/")];
+#[crate_type = "lib"];
+
+
+extern mod azure;
+extern mod core;
+extern mod geom;
+extern mod std;
+
+pub mod compositor;
+pub mod engine;
diff --git a/src/components/script/compositor_interface.rs b/src/components/script/compositor_interface.rs
deleted file mode 100644
index b0041e49298..00000000000
--- a/src/components/script/compositor_interface.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-/* 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/. */
-
-//! The high-level interface from script to compositor. Using this abstract interface helps reduce
-/// coupling between these two components
-
-pub enum ReadyState {
- /// Informs the compositor that a page is loading. Used for setting status
- Loading,
- /// Informs the compositor that a page is performing layout. Used for setting status
- PerformingLayout,
- /// Informs the compositor that a page is finished loading. Used for setting status
- FinishedLoading,
-}
-
-/// The interface used by the script task to tell the compositor to update its ready state,
-/// which is used in displaying the appropriate message in the window's title.
-pub trait ScriptListener : Clone {
- fn set_ready_state(&self, ReadyState);
-}
diff --git a/src/components/script/script.rc b/src/components/script/script.rc
index 2d608e4d25b..4b90ee1f0b2 100644
--- a/src/components/script/script.rc
+++ b/src/components/script/script.rc
@@ -19,6 +19,7 @@ extern mod netsurfcss;
extern mod newcss (name = "css");
extern mod servo_net (name = "net");
extern mod servo_util (name = "util");
+extern mod servo_msg (name = "msg");
extern mod std;
pub mod dom {
@@ -64,8 +65,6 @@ pub mod html {
pub mod hubbub_html_parser;
}
-pub mod compositor_interface;
-pub mod engine_interface;
pub mod layout_interface;
pub mod script_task;
diff --git a/src/components/script/script_task.rs b/src/components/script/script_task.rs
index 6eddd9d6335..ec655dc2984 100644
--- a/src/components/script/script_task.rs
+++ b/src/components/script/script_task.rs
@@ -5,7 +5,7 @@
/// The script task is the task that owns the DOM in memory, runs JavaScript, and spawns parsing
/// and layout tasks.
-use compositor_interface::{ReadyState, Loading, PerformingLayout, FinishedLoading};
+use servo_msg::compositor::{ReadyState, Loading, PerformingLayout, FinishedLoading};
use dom::bindings::utils::GlobalStaticData;
use dom::document::Document;
use dom::element::Element;
@@ -17,7 +17,7 @@ use layout_interface::{HitTestResponse, LayoutQuery, LayoutResponse, LayoutChan}
use layout_interface::{MatchSelectorsDocumentDamage, QueryMsg, Reflow, ReflowDocumentDamage};
use layout_interface::{ReflowForDisplay, ReflowForScriptQuery, ReflowGoal, ReflowMsg};
use layout_interface;
-use engine_interface::{EngineChan, LoadUrlMsg};
+use servo_msg::engine::{EngineChan, LoadUrlMsg};
use core::cast::transmute;
use core::cell::Cell;
diff --git a/src/support/azure/rust-azure b/src/support/azure/rust-azure
-Subproject b754fd3d16f6acc80ae2252a310f8c71070366c
+Subproject cf5641f5b0b7720e3841518ab7fbfafb4d2443a
diff --git a/src/support/skia/skia b/src/support/skia/skia
-Subproject 5c00e2b7f471e70a892aeae36b4c77b78227823
+Subproject 3f41e98925b9d4c0d4074046388e73f0e0032ab