Source-Repo: https://github.com/servo/servo
Source-Revision: a52818978d9e6aefa1189b9c481ac121e2c8ec79
This commit is contained in:
Brian Anderson 2012-08-16 15:24:19 -07:00
Родитель 1983508f2e
Коммит 72750435c7
12 изменённых файлов: 36 добавлений и 36 удалений

Просмотреть файл

@ -29,7 +29,7 @@ import jsrt = js::rust::rt;
import js::rust::methods;
import js::global::{global_class, debug_fns};
import either::{either, left, right};
import either::{Either, Left, Right};
import dom::bindings::utils::rust_box;
import js::rust::compartment;
@ -77,8 +77,8 @@ class Document {
class Content<S:Sink send copy> {
let sink: S;
let layout: Layout;
let from_master: comm::port<ControlMsg>;
let event_port: comm::port<Event>;
let from_master: comm::Port<ControlMsg>;
let event_port: comm::Port<Event>;
let scope: NodeScope;
let jsrt: jsrt;
@ -111,10 +111,10 @@ class Content<S:Sink send copy> {
}
}
fn handle_msg(msg: either<ControlMsg,Event>) -> bool {
fn handle_msg(msg: Either<ControlMsg,Event>) -> bool {
match msg {
left(control_msg) => self.handle_control_msg(control_msg),
right(event) => self.handle_event(event)
Left(control_msg) => self.handle_control_msg(control_msg),
Right(event) => self.handle_event(event)
}
}

Просмотреть файл

@ -9,7 +9,7 @@ import js::jsapi::{JSClass, JSObject, JSPropertySpec, JSContext, jsid, jsval, JS
import js::{JSPROP_ENUMERATE, JSPROP_SHARED};
import js::crust::*;
import js::glue::bindgen::RUST_OBJECT_TO_JSVAL;
import dvec::dvec;
import dvec::{DVec, dvec};
import ptr::null;
import content::Document;
import bindings;
@ -27,7 +27,7 @@ enum NodeKind {
class ElementData {
let tag_name: ~str;
let kind: ~ElementKind;
let attrs: dvec<~Attr>;
let attrs: DVec<~Attr>;
new(-tag_name: ~str, -kind: ~ElementKind) {
self.tag_name = tag_name;

Просмотреть файл

@ -50,7 +50,7 @@ of the RCU nodes themselves.
")];
import core::libc::types::os::arch::c95::size_t;
import ptr::ptr;
import ptr::Ptr;
import vec::push;
export Handle;

Просмотреть файл

@ -19,7 +19,7 @@ class Engine<S:Sink send copy> {
let resource_task: ResourceTask;
let image_cache_task: ImageCacheTask;
let layout: Layout;
let content: comm::chan<content::ControlMsg>;
let content: comm::Chan<content::ControlMsg>;
new(+sink: S) {
self.sink = sink;
@ -37,7 +37,7 @@ class Engine<S:Sink send copy> {
self.content = content;
}
fn start() -> comm::chan<Msg> {
fn start() -> comm::Chan<Msg> {
do spawn_listener::<Msg> |request| {
while self.handle_request(request.recv()) {
// Go on...

Просмотреть файл

@ -19,7 +19,7 @@ import azure::cairo::{cairo_font_face_t, cairo_scaled_font_t};
import pipes::{port, chan};
type Renderer = comm::chan<Msg>;
type Renderer = comm::Chan<Msg>;
enum Msg {
RenderMsg(dl::display_list),
@ -35,11 +35,11 @@ FIXME: Change this name to Compositor.
trait Sink {
fn begin_drawing(+next_dt: pipes::chan<AzDrawTargetRef>);
fn draw(+next_dt: pipes::chan<AzDrawTargetRef>, draw_me: AzDrawTargetRef);
fn add_event_listener(listener: comm::chan<Event>);
fn add_event_listener(listener: comm::Chan<Event>);
}
fn Renderer<S: Sink send copy>(sink: S) -> comm::chan<Msg> {
do task::spawn_listener |po: comm::port<Msg>| {
fn Renderer<S: Sink send copy>(sink: S) -> comm::Chan<Msg> {
do task::spawn_listener |po: comm::Port<Msg>| {
let (draw_target_ch, draw_target_po) = pipes::stream();
let mut draw_target_ch = draw_target_ch;
let mut draw_target_po = draw_target_po;

Просмотреть файл

@ -1,7 +1,7 @@
import gfx::surface;
import io::writer_util;
import io::WriterUtil;
fn encode(writer: io::writer, surface: surface::image_surface) {
fn encode(writer: io::Writer, surface: surface::image_surface) {
assert surface.format == gfx::surface::fo_rgba_8888;
writer.write_u8(0u8); // identsize

Просмотреть файл

@ -4,7 +4,7 @@ import image::base::Image;
import servo_text::text_run::TextRun;
import std::arc::arc;
import dvec::dvec;
import dvec::DVec;
enum item_type {
display_item_solid_color(u8, u8, u8),
@ -19,4 +19,4 @@ enum display_item = {
bounds: Rect<au>
};
type display_list = dvec<display_item>;
type display_list = DVec<display_item>;

Просмотреть файл

@ -4,7 +4,7 @@ import base::{Box, BTree, ImageHolder, TextBoxKind};
import dl = display_list;
import dom::base::{Text, NodeScope};
import dom::rcu::Scope;
import either::{left, right};
import either::{Left, Right};
import geom::point::Point2D;
import geom::rect::Rect;
import geom::size::Size2D;

Просмотреть файл

@ -227,7 +227,7 @@ impl CssLexer : CssLexerMethods {
}
}
fn parser(input_port: comm::port<ProgressMsg>, state : ParserState) -> CssLexer {
fn parser(input_port: comm::Port<ProgressMsg>, state : ParserState) -> CssLexer {
return {
input_state: {
mut lookahead: none,
@ -239,7 +239,7 @@ fn parser(input_port: comm::port<ProgressMsg>, state : ParserState) -> CssLexer
};
}
fn lex_css_from_bytes(+input_port: comm::port<ProgressMsg>, result_chan : chan<Token>) {
fn lex_css_from_bytes(+input_port: comm::Port<ProgressMsg>, result_chan : chan<Token>) {
let lexer = parser(input_port, CssElement);
loop {

Просмотреть файл

@ -93,7 +93,7 @@ spawned, collates them, and sends them to the given result channel.
* `from_parent` - A port on which to receive new links.
"]
fn css_link_listener(to_parent : comm::chan<Stylesheet>, from_parent : comm::port<CSSMessage>,
fn css_link_listener(to_parent : comm::Chan<Stylesheet>, from_parent : comm::Port<CSSMessage>,
resource_task: ResourceTask) {
let mut result_vec = ~[];
@ -124,7 +124,7 @@ fn css_link_listener(to_parent : comm::chan<Stylesheet>, from_parent : comm::por
to_parent.send(css_rules);
}
fn js_script_listener(to_parent : comm::chan<~[~[u8]]>, from_parent : comm::port<js_message>,
fn js_script_listener(to_parent : comm::Chan<~[~[u8]]>, from_parent : comm::Port<js_message>,
resource_task: ResourceTask) {
let mut result_vec = ~[];
@ -169,8 +169,8 @@ fn js_script_listener(to_parent : comm::chan<~[~[u8]]>, from_parent : comm::port
}
#[allow(non_implicitly_copyable_typarams)]
fn build_dom(scope: NodeScope, stream: comm::port<Token>, url: url,
resource_task: ResourceTask) -> (Node, comm::port<Stylesheet>, comm::port<~[~[u8]]>) {
fn build_dom(scope: NodeScope, stream: comm::Port<Token>, url: url,
resource_task: ResourceTask) -> (Node, comm::Port<Stylesheet>, comm::Port<~[~[u8]]>) {
// The current reference node.
let mut cur_node = scope.new_node(Element(ElementData(~"html", ~HTMLDivElement)));
// We will spawn a separate task to parse any css that is

Просмотреть файл

@ -8,25 +8,25 @@ import azure::cairo;
import azure::cairo::bindgen::*;
import azure::cairo_hl::ImageSurface;
import comm::*;
import dvec::dvec;
import dvec::{DVec, dvec};
import azure::cairo::cairo_surface_t;
import gfx::renderer::Sink;
import dom::event::{Event, ResizeEvent};
import layers::ImageLayer;
import geom::size::Size2D;
import std::cmp::fuzzy_eq;
import task::task_builder;
import task::TaskBuilder;
import vec::push;
import pipes::chan;
type OSMain = comm::chan<Msg>;
type OSMain = comm::Chan<Msg>;
enum Msg {
BeginDrawing(pipes::chan<AzDrawTargetRef>),
Draw(pipes::chan<AzDrawTargetRef>, AzDrawTargetRef),
AddKeyHandler(pipes::chan<()>),
AddEventListener(comm::chan<Event>),
AddEventListener(comm::Chan<Event>),
Exit
}
@ -40,8 +40,8 @@ fn OSMain() -> OSMain {
}
fn mainloop(po: port<Msg>) {
let key_handlers: @dvec<pipes::chan<()>> = @dvec();
let event_listeners: @dvec<comm::chan<Event>> = @dvec();
let key_handlers: @DVec<pipes::chan<()>> = @dvec();
let event_listeners: @DVec<comm::Chan<Event>> = @dvec();
glut::init();
glut::init_display_mode(glut::DOUBLE);
@ -131,7 +131,7 @@ impl OSMain : Sink {
fn draw(+next_dt: pipes::chan<AzDrawTargetRef>, draw_me: AzDrawTargetRef) {
self.send(Draw(next_dt, draw_me))
}
fn add_event_listener(listener: comm::chan<Event>) {
fn add_event_listener(listener: comm::Chan<Event>) {
self.send(AddEventListener(listener));
}
}
@ -186,8 +186,8 @@ fn Surface() -> Surface {
}
#[doc = "A function for spawning into the platform's main thread"]
fn on_osmain<T: send>(+f: fn~(comm::port<T>)) -> comm::chan<T> {
task::task().sched_mode(task::platform_thread).spawn_listener(f)
fn on_osmain<T: send>(+f: fn~(comm::Port<T>)) -> comm::Chan<T> {
task::task().sched_mode(task::PlatformThread).spawn_listener(f)
}
// #[cfg(target_os = "linux")]

Просмотреть файл

@ -68,7 +68,7 @@ fn run_pipeline_png(-url: ~str, outfile: ~str) {
import gfx::pngsink;
import pngsink::PngSink;
import result::{ok, err};
import io::{writer, buffered_file_writer};
import io::{Writer, buffered_file_writer};
listen(|pngdata_from_sink| {
let sink = PngSink(pngdata_from_sink);