diff options
Diffstat (limited to 'src/components/msg')
-rw-r--r-- | src/components/msg/compositor_msg.rs | 9 | ||||
-rw-r--r-- | src/components/msg/constellation_msg.rs | 14 | ||||
-rw-r--r-- | src/components/msg/msg.rs | 15 |
3 files changed, 20 insertions, 18 deletions
diff --git a/src/components/msg/compositor_msg.rs b/src/components/msg/compositor_msg.rs index 7c18df9f8f2..847a13d1ab7 100644 --- a/src/components/msg/compositor_msg.rs +++ b/src/components/msg/compositor_msg.rs @@ -11,7 +11,7 @@ use layers::platform::surface::{NativeSurface, NativeSurfaceMethods}; use constellation_msg::PipelineId; -use extra::serialize::{Encoder, Encodable}; +use serialize::{Encoder, Encodable}; pub struct LayerBuffer { /// The native surface which can be shared between threads or processes. On Mac this is an @@ -71,7 +71,8 @@ pub struct Epoch(uint); impl Epoch { pub fn next(&mut self) { - **self += 1; + let Epoch(ref mut u) = *self; + *u += 1; } } @@ -97,7 +98,7 @@ pub trait ScriptListener : Clone { fn dup(&self) -> ~ScriptListener; } -impl<S: Encoder> Encodable<S> for @ScriptListener { +impl<S: Encoder> Encodable<S> for ~ScriptListener { fn encode(&self, _s: &mut S) { } } @@ -125,7 +126,7 @@ impl Tile for ~LayerBuffer { self.screen_pos.size.width * self.screen_pos.size.height } fn is_valid(&self, scale: f32) -> bool { - self.resolution.approx_eq(&scale) + (self.resolution - scale).abs() < 1.0e-6 } fn get_size_2d(&self) -> Size2D<uint> { self.screen_pos.size diff --git a/src/components/msg/constellation_msg.rs b/src/components/msg/constellation_msg.rs index a2197c26baa..825ef0c7f6f 100644 --- a/src/components/msg/constellation_msg.rs +++ b/src/components/msg/constellation_msg.rs @@ -8,14 +8,14 @@ use extra::url::Url; use geom::rect::Rect; use geom::size::Size2D; -use std::comm::SharedChan; +use std::comm::Chan; #[deriving(Clone)] -pub struct ConstellationChan(SharedChan<Msg>); +pub struct ConstellationChan(Chan<Msg>); impl ConstellationChan { pub fn new() -> (Port<Msg>, ConstellationChan) { - let (port, chan) = SharedChan::new(); + let (port, chan) = Chan::new(); (port, ConstellationChan(chan)) } } @@ -48,20 +48,20 @@ pub enum Msg { } /// Represents the two different ways to which a page can be navigated -#[deriving(Clone, Eq, IterBytes)] +#[deriving(Clone, Eq, Hash)] pub enum NavigationType { Load, // entered or clicked on a url Navigate, // browser forward/back buttons } -#[deriving(Clone, Eq, IterBytes)] +#[deriving(Clone, Eq, Hash)] pub enum NavigationDirection { Forward, Back, } -#[deriving(Clone, Eq, IterBytes, Encodable)] +#[deriving(Clone, Eq, Hash, Encodable)] pub struct PipelineId(uint); -#[deriving(Clone, Eq, IterBytes, Encodable)] +#[deriving(Clone, Eq, Hash, Encodable)] pub struct SubpageId(uint); diff --git a/src/components/msg/msg.rs b/src/components/msg/msg.rs index 1315979ac18..cd874a69514 100644 --- a/src/components/msg/msg.rs +++ b/src/components/msg/msg.rs @@ -7,16 +7,17 @@ #[feature(managed_boxes)]; -extern mod azure; -extern mod extra; -extern mod geom; -extern mod layers; -extern mod std; +extern crate azure; +extern crate extra; +extern crate geom; +extern crate layers; +extern crate serialize; +extern crate std; #[cfg(target_os="macos")] -extern mod core_foundation; +extern crate core_foundation; #[cfg(target_os="macos")] -extern mod io_surface; +extern crate io_surface; pub mod compositor_msg; pub mod constellation_msg; |