diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2014-11-28 08:16:02 +0000 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2014-12-02 18:03:39 -0800 |
commit | 2f413c89374493184768e2ee6fe0b35f0ef52994 (patch) | |
tree | 745e727f761fd30d792cca9d61364b93bffd8a1b /components | |
parent | b2b6d4d0d1e381d038dc5e45cbe74304704934e7 (diff) | |
download | servo-2f413c89374493184768e2ee6fe0b35f0ef52994.tar.gz servo-2f413c89374493184768e2ee6fe0b35f0ef52994.zip |
Move the servo crate from root to components/servo
Diffstat (limited to 'components')
-rw-r--r-- | components/servo/Cargo.lock | 656 | ||||
-rw-r--r-- | components/servo/Cargo.toml | 71 | ||||
-rw-r--r-- | components/servo/lib.rs | 172 | ||||
-rw-r--r-- | components/servo/main.rs | 116 | ||||
-rw-r--r-- | components/util/resource_files.rs | 8 |
5 files changed, 1021 insertions, 2 deletions
diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock new file mode 100644 index 00000000000..698779f792e --- /dev/null +++ b/components/servo/Cargo.lock @@ -0,0 +1,656 @@ +[root] +name = "servo" +version = "0.0.1" +dependencies = [ + "compositing 0.0.1", + "gfx 0.0.1", + "glfw_app 0.0.1", + "glutin_app 0.0.1", + "green 0.0.1 (git+https://github.com/servo/green-rs?ref=servo)", + "layout 0.0.1", + "msg 0.0.1", + "net 0.0.1", + "rustuv 0.0.1 (git+https://github.com/servo/green-rs?ref=servo)", + "script 0.0.1", + "url 0.1.0 (git+https://github.com/servo/rust-url)", + "util 0.0.1", +] + +[[package]] +name = "android_glue" +version = "0.0.1" +source = "git+https://github.com/tomaka/android-rs-glue#fe9acb5bd465da1df4561e2bd4ebcc6d305134a4" +dependencies = [ + "compile_msg 0.1.1 (git+https://github.com/huonw/compile_msg)", +] + +[[package]] +name = "azure" +version = "0.1.0" +source = "git+https://github.com/servo/rust-azure#64853170e435d9320f3fd828b9e7d16bc4c260a3" +dependencies = [ + "core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)", + "core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)", + "core_text 0.1.0 (git+https://github.com/servo/rust-core-text)", + "egl 0.1.0 (git+https://github.com/servo/rust-egl)", + "freetype 0.1.0 (git+https://github.com/servo/rust-freetype)", + "geom 0.1.0 (git+https://github.com/servo/rust-geom)", + "layers 0.1.0 (git+https://github.com/servo/rust-layers)", + "skia-sys 0.0.20130412 (git+https://github.com/servo/skia)", + "xlib 0.1.0 (git+https://github.com/servo/rust-xlib)", +] + +[[package]] +name = "canvas" +version = "0.0.1" +dependencies = [ + "azure 0.1.0 (git+https://github.com/servo/rust-azure)", + "geom 0.1.0 (git+https://github.com/servo/rust-geom)", + "util 0.0.1", +] + +[[package]] +name = "cgl" +version = "0.0.1" +source = "git+https://github.com/servo/rust-cgl#7b7090729f65e2287c3d80651df02e547911b119" +dependencies = [ + "gleam 0.0.1 (git+https://github.com/servo/gleam)", +] + +[[package]] +name = "cocoa" +version = "0.1.1" +source = "git+https://github.com/servo/rust-cocoa#78b823bec1affcab20b6977e1057125088a6034c" + +[[package]] +name = "compile_msg" +version = "0.1.1" +source = "git+https://github.com/huonw/compile_msg#f526abe54b49642bc1e969e6c2af1411798b6776" + +[[package]] +name = "compositing" +version = "0.0.1" +dependencies = [ + "azure 0.1.0 (git+https://github.com/servo/rust-azure)", + "core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)", + "core_text 0.1.0 (git+https://github.com/servo/rust-core-text)", + "devtools 0.0.1", + "devtools_traits 0.0.1", + "geom 0.1.0 (git+https://github.com/servo/rust-geom)", + "gfx 0.0.1", + "gleam 0.0.1 (git+https://github.com/servo/gleam)", + "layers 0.1.0 (git+https://github.com/servo/rust-layers)", + "layout_traits 0.0.1", + "msg 0.0.1", + "net 0.0.1", + "png 0.1.0 (git+https://github.com/servo/rust-png)", + "script_traits 0.0.1", + "url 0.1.0 (git+https://github.com/servo/rust-url)", + "util 0.0.1", +] + +[[package]] +name = "core_foundation" +version = "0.1.0" +source = "git+https://github.com/servo/rust-core-foundation#6fa0b908f3912e20d081193e83bf5a9aa958fb83" + +[[package]] +name = "core_graphics" +version = "0.1.0" +source = "git+https://github.com/servo/rust-core-graphics#9434e2bda65d259f825104170b5fa6cc6dbaf5a9" +dependencies = [ + "core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)", +] + +[[package]] +name = "core_text" +version = "0.1.0" +source = "git+https://github.com/servo/rust-core-text#85784007b6fa1b8f9614059edcd0429b2bd69a11" +dependencies = [ + "core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)", + "core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)", +] + +[[package]] +name = "cssparser" +version = "0.1.0" +source = "git+https://github.com/servo/rust-cssparser#cbbfd66f794bd019bbdeaefc88b29eff455b62e5" +dependencies = [ + "encoding 0.2.0 (git+https://github.com/lifthrasiir/rust-encoding)", +] + +[[package]] +name = "devtools" +version = "0.0.1" +dependencies = [ + "devtools_traits 0.0.1", + "msg 0.0.1", + "util 0.0.1", +] + +[[package]] +name = "devtools_traits" +version = "0.0.1" +dependencies = [ + "msg 0.0.1", +] + +[[package]] +name = "egl" +version = "0.1.0" +source = "git+https://github.com/servo/rust-egl#88f2a13812ddbce2bf2317221663a61c31b3e220" + +[[package]] +name = "encoding" +version = "0.2.0" +source = "git+https://github.com/lifthrasiir/rust-encoding#a06637cc6d0da37c12c68661e2ee9ca1999764a4" +dependencies = [ + "encoding-index-japanese 1.0.20140915 (git+https://github.com/lifthrasiir/rust-encoding)", + "encoding-index-korean 1.0.20140915 (git+https://github.com/lifthrasiir/rust-encoding)", + "encoding-index-simpchinese 1.0.20140915 (git+https://github.com/lifthrasiir/rust-encoding)", + "encoding-index-singlebyte 1.0.20140915 (git+https://github.com/lifthrasiir/rust-encoding)", + "encoding-index-tradchinese 1.0.20140915 (git+https://github.com/lifthrasiir/rust-encoding)", +] + +[[package]] +name = "encoding-index-japanese" +version = "1.0.20140915" +source = "git+https://github.com/lifthrasiir/rust-encoding#a06637cc6d0da37c12c68661e2ee9ca1999764a4" + +[[package]] +name = "encoding-index-korean" +version = "1.0.20140915" +source = "git+https://github.com/lifthrasiir/rust-encoding#a06637cc6d0da37c12c68661e2ee9ca1999764a4" + +[[package]] +name = "encoding-index-simpchinese" +version = "1.0.20140915" +source = "git+https://github.com/lifthrasiir/rust-encoding#a06637cc6d0da37c12c68661e2ee9ca1999764a4" + +[[package]] +name = "encoding-index-singlebyte" +version = "1.0.20140915" +source = "git+https://github.com/lifthrasiir/rust-encoding#a06637cc6d0da37c12c68661e2ee9ca1999764a4" + +[[package]] +name = "encoding-index-tradchinese" +version = "1.0.20140915" +source = "git+https://github.com/lifthrasiir/rust-encoding#a06637cc6d0da37c12c68661e2ee9ca1999764a4" + +[[package]] +name = "expat-sys" +version = "2.1.0" +source = "git+https://github.com/servo/libexpat#da2ddaf78cbef836b8790807bb76b357c58df3a1" + +[[package]] +name = "fontconfig" +version = "0.1.0" +source = "git+https://github.com/servo/rust-fontconfig#f42ff5cbd0404fe4d2cd64e8d9bb6307bad8fd7c" +dependencies = [ + "fontconfig-sys 2.11.1 (git+https://github.com/servo/libfontconfig)", +] + +[[package]] +name = "fontconfig-sys" +version = "2.11.1" +source = "git+https://github.com/servo/libfontconfig#fcc324d2c8175d2e8e8c0aab032c03a404809f6d" +dependencies = [ + "expat-sys 2.1.0 (git+https://github.com/servo/libexpat)", + "freetype-sys 2.4.11 (git+https://github.com/servo/libfreetype2)", +] + +[[package]] +name = "freetype" +version = "0.1.0" +source = "git+https://github.com/servo/rust-freetype#e55b06110fb2d74a2db68ead740db7e98fb98060" + +[[package]] +name = "freetype-sys" +version = "2.4.11" +source = "git+https://github.com/servo/libfreetype2#f5c49c0da1d5bc6b206c4176344012ac37524243" + +[[package]] +name = "geom" +version = "0.1.0" +source = "git+https://github.com/servo/rust-geom#e5e74911ac6d3201009879b72499d6c681302611" + +[[package]] +name = "gfx" +version = "0.0.1" +dependencies = [ + "azure 0.1.0 (git+https://github.com/servo/rust-azure)", + "core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)", + "core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)", + "core_text 0.1.0 (git+https://github.com/servo/rust-core-text)", + "fontconfig 0.1.0 (git+https://github.com/servo/rust-fontconfig)", + "freetype 0.1.0 (git+https://github.com/servo/rust-freetype)", + "geom 0.1.0 (git+https://github.com/servo/rust-geom)", + "harfbuzz 0.1.0 (git+https://github.com/servo/rust-harfbuzz)", + "layers 0.1.0 (git+https://github.com/servo/rust-layers)", + "msg 0.0.1", + "net 0.0.1", + "plugins 0.0.1", + "png 0.1.0 (git+https://github.com/servo/rust-png)", + "script_traits 0.0.1", + "stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)", + "style 0.0.1", + "url 0.1.0 (git+https://github.com/servo/rust-url)", + "util 0.0.1", +] + +[[package]] +name = "gl_common" +version = "0.0.1" +source = "git+https://github.com/bjz/gl-rs.git#79cd3b3f9f19aa0e39f6af572fc8673a6d9760bc" + +[[package]] +name = "gl_generator" +version = "0.0.1" +source = "git+https://github.com/bjz/gl-rs.git#79cd3b3f9f19aa0e39f6af572fc8673a6d9760bc" +dependencies = [ + "gl_common 0.0.1 (git+https://github.com/bjz/gl-rs.git)", + "khronos_api 0.0.1 (git+https://github.com/bjz/gl-rs.git)", + "rust-xml 0.1.0 (git+https://github.com/netvl/rust-xml)", +] + +[[package]] +name = "gleam" +version = "0.0.1" +source = "git+https://github.com/servo/gleam#aaea38be25ce9de6e1e8620fa5b554669ac6475c" +dependencies = [ + "gl_generator 0.0.1 (git+https://github.com/bjz/gl-rs.git)", +] + +[[package]] +name = "glfw" +version = "0.0.1" +source = "git+https://github.com/servo/glfw-rs?ref=servo#46f82b46589720f202ab2d4a99e4f4fd48df6469" +dependencies = [ + "glfw-sys 3.0.4 (git+https://github.com/servo/glfw?ref=cargo-3.0.4)", + "semver 0.1.0 (git+https://github.com/rust-lang/semver)", +] + +[[package]] +name = "glfw-sys" +version = "3.0.4" +source = "git+https://github.com/servo/glfw?ref=cargo-3.0.4#765dace7e4125b87c764f5ac0e7a80eae5c550b2" + +[[package]] +name = "glfw_app" +version = "0.0.1" +dependencies = [ + "cgl 0.0.1 (git+https://github.com/servo/rust-cgl)", + "compositing 0.0.1", + "geom 0.1.0 (git+https://github.com/servo/rust-geom)", + "gleam 0.0.1 (git+https://github.com/servo/gleam)", + "glfw 0.0.1 (git+https://github.com/servo/glfw-rs?ref=servo)", + "layers 0.1.0 (git+https://github.com/servo/rust-layers)", + "msg 0.0.1", + "util 0.0.1", +] + +[[package]] +name = "glutin" +version = "0.0.2" +source = "git+https://github.com/tomaka/glutin#c95b778e2c077c0b410f366ad3c85a93c40c6095" +dependencies = [ + "android_glue 0.0.1 (git+https://github.com/tomaka/android-rs-glue)", + "cocoa 0.1.1 (git+https://github.com/servo/rust-cocoa)", + "compile_msg 0.1.1 (git+https://github.com/huonw/compile_msg)", + "core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)", + "gl_common 0.0.1 (git+https://github.com/bjz/gl-rs.git)", + "gl_generator 0.0.1 (git+https://github.com/bjz/gl-rs.git)", +] + +[[package]] +name = "glutin_app" +version = "0.0.1" +dependencies = [ + "cgl 0.0.1 (git+https://github.com/servo/rust-cgl)", + "compositing 0.0.1", + "geom 0.1.0 (git+https://github.com/servo/rust-geom)", + "gleam 0.0.1 (git+https://github.com/servo/gleam)", + "glutin 0.0.2 (git+https://github.com/tomaka/glutin)", + "layers 0.1.0 (git+https://github.com/servo/rust-layers)", + "msg 0.0.1", + "util 0.0.1", +] + +[[package]] +name = "glx" +version = "0.0.1" +source = "git+https://github.com/servo/rust-glx#7126ffa09fcfcc9f85f1406f3b5db729f5fdb7c3" +dependencies = [ + "gl_generator 0.0.1 (git+https://github.com/bjz/gl-rs.git)", +] + +[[package]] +name = "green" +version = "0.0.1" +source = "git+https://github.com/servo/green-rs?ref=servo#9300d7e7dc73680c7446d78b10a309095636e64d" + +[[package]] +name = "harfbuzz" +version = "0.1.0" +source = "git+https://github.com/servo/rust-harfbuzz#8aab215463214647b7a81f66011da552bbb1121c" + +[[package]] +name = "html5ever" +version = "0.0.0" +source = "git+https://github.com/servo/html5ever?ref=servo#87c7e8b710391338b2463652be835f498923653c" +dependencies = [ + "html5ever_macros 0.0.0 (git+https://github.com/servo/html5ever?ref=servo)", + "phf 0.0.0 (git+https://github.com/sfackler/rust-phf)", + "phf_mac 0.0.0 (git+https://github.com/sfackler/rust-phf)", + "string_cache 0.0.0 (git+https://github.com/servo/string-cache)", + "string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)", +] + +[[package]] +name = "html5ever_macros" +version = "0.0.0" +source = "git+https://github.com/servo/html5ever?ref=servo#87c7e8b710391338b2463652be835f498923653c" + +[[package]] +name = "http" +version = "0.1.0-pre" +source = "git+https://github.com/servo/rust-http?ref=servo#f957b94deb2c939c8e3d73d51823b65f8a1f8256" +dependencies = [ + "openssl 0.0.0 (git+https://github.com/sfackler/rust-openssl.git)", + "url 0.1.0 (git+https://github.com/servo/rust-url)", +] + +[[package]] +name = "io_surface" +version = "0.1.0" +source = "git+https://github.com/servo/rust-io-surface#691cbccc320c4fb9b75e215da9b0b82539d729bd" +dependencies = [ + "cgl 0.0.1 (git+https://github.com/servo/rust-cgl)", + "core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)", + "geom 0.1.0 (git+https://github.com/servo/rust-geom)", + "gleam 0.0.1 (git+https://github.com/servo/gleam)", +] + +[[package]] +name = "js" +version = "0.1.0" +source = "git+https://github.com/servo/rust-mozjs#2a7acd8c04949796c71145db61b7868128e497f2" +dependencies = [ + "green 0.0.1 (git+https://github.com/servo/green-rs?ref=servo)", + "mozjs-sys 0.0.0 (git+https://github.com/servo/mozjs)", + "rustuv 0.0.1 (git+https://github.com/servo/green-rs?ref=servo)", +] + +[[package]] +name = "khronos_api" +version = "0.0.1" +source = "git+https://github.com/bjz/gl-rs.git#79cd3b3f9f19aa0e39f6af572fc8673a6d9760bc" + +[[package]] +name = "layers" +version = "0.1.0" +source = "git+https://github.com/servo/rust-layers#b068d2a96d54bf173b548aece36f5ea4ef9353cf" +dependencies = [ + "cgl 0.0.1 (git+https://github.com/servo/rust-cgl)", + "core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)", + "egl 0.1.0 (git+https://github.com/servo/rust-egl)", + "geom 0.1.0 (git+https://github.com/servo/rust-geom)", + "gleam 0.0.1 (git+https://github.com/servo/gleam)", + "glx 0.0.1 (git+https://github.com/servo/rust-glx)", + "io_surface 0.1.0 (git+https://github.com/servo/rust-io-surface)", + "xlib 0.1.0 (git+https://github.com/servo/rust-xlib)", +] + +[[package]] +name = "layout" +version = "0.0.1" +dependencies = [ + "encoding 0.2.0 (git+https://github.com/lifthrasiir/rust-encoding)", + "geom 0.1.0 (git+https://github.com/servo/rust-geom)", + "gfx 0.0.1", + "layout_traits 0.0.1", + "net 0.0.1", + "plugins 0.0.1", + "script 0.0.1", + "script_traits 0.0.1", + "string_cache 0.0.0 (git+https://github.com/servo/string-cache)", + "string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)", + "style 0.0.1", + "url 0.1.0 (git+https://github.com/servo/rust-url)", + "util 0.0.1", +] + +[[package]] +name = "layout_traits" +version = "0.0.1" +dependencies = [ + "gfx 0.0.1", + "msg 0.0.1", + "net 0.0.1", + "script_traits 0.0.1", + "util 0.0.1", +] + +[[package]] +name = "lazy_static" +version = "0.1.0" +source = "git+https://github.com/Kimundi/lazy-static.rs#62976cb611c5396e11315ae64c9c389576240eb7" + +[[package]] +name = "mozjs-sys" +version = "0.0.0" +source = "git+https://github.com/servo/mozjs#0dd618fcc78fe7aa64e4e2a3b0f7f0d8a2f0f08a" + +[[package]] +name = "msg" +version = "0.0.1" +dependencies = [ + "azure 0.1.0 (git+https://github.com/servo/rust-azure)", + "core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)", + "geom 0.1.0 (git+https://github.com/servo/rust-geom)", + "http 0.1.0-pre (git+https://github.com/servo/rust-http?ref=servo)", + "io_surface 0.1.0 (git+https://github.com/servo/rust-io-surface)", + "layers 0.1.0 (git+https://github.com/servo/rust-layers)", + "url 0.1.0 (git+https://github.com/servo/rust-url)", + "util 0.0.1", +] + +[[package]] +name = "net" +version = "0.0.1" +dependencies = [ + "geom 0.1.0 (git+https://github.com/servo/rust-geom)", + "http 0.1.0-pre (git+https://github.com/servo/rust-http?ref=servo)", + "png 0.1.0 (git+https://github.com/servo/rust-png)", + "stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)", + "url 0.1.0 (git+https://github.com/servo/rust-url)", + "util 0.0.1", +] + +[[package]] +name = "openssl" +version = "0.0.0" +source = "git+https://github.com/sfackler/rust-openssl.git#766ce4b7785c0b038bee95b74564e5b9bf7e9a4b" + +[[package]] +name = "phf" +version = "0.0.0" +source = "git+https://github.com/sfackler/rust-phf#18a5ecc028055c3dbd650cc5a064b6fb033d82ef" +dependencies = [ + "xxhash 0.0.1 (git+https://github.com/Jurily/rust-xxhash)", +] + +[[package]] +name = "phf_mac" +version = "0.0.0" +source = "git+https://github.com/sfackler/rust-phf#18a5ecc028055c3dbd650cc5a064b6fb033d82ef" +dependencies = [ + "xxhash 0.0.1 (git+https://github.com/Jurily/rust-xxhash)", +] + +[[package]] +name = "plugins" +version = "0.0.1" + +[[package]] +name = "png" +version = "0.1.0" +source = "git+https://github.com/servo/rust-png#b0b4acde0080dd475dee93615276bfc19207a21e" +dependencies = [ + "png-sys 1.6.3 (git+https://github.com/servo/libpng?ref=servo)", +] + +[[package]] +name = "png-sys" +version = "1.6.3" +source = "git+https://github.com/servo/libpng?ref=servo#d01f32b4eb86904695efe7fc02b574f902e21a98" + +[[package]] +name = "rust-xml" +version = "0.1.0" +source = "git+https://github.com/netvl/rust-xml#d6c57380a300b94f7e7881979dbe5459dbe4ca06" + +[[package]] +name = "rustuv" +version = "0.0.1" +source = "git+https://github.com/servo/green-rs?ref=servo#9300d7e7dc73680c7446d78b10a309095636e64d" +dependencies = [ + "green 0.0.1 (git+https://github.com/servo/green-rs?ref=servo)", + "tls 0.0.1 (git+https://github.com/alexcrichton/tls-rs)", +] + +[[package]] +name = "script" +version = "0.0.1" +dependencies = [ + "canvas 0.0.1", + "cssparser 0.1.0 (git+https://github.com/servo/rust-cssparser)", + "devtools_traits 0.0.1", + "encoding 0.2.0 (git+https://github.com/lifthrasiir/rust-encoding)", + "geom 0.1.0 (git+https://github.com/servo/rust-geom)", + "gfx 0.0.1", + "html5ever 0.0.0 (git+https://github.com/servo/html5ever?ref=servo)", + "http 0.1.0-pre (git+https://github.com/servo/rust-http?ref=servo)", + "js 0.1.0 (git+https://github.com/servo/rust-mozjs)", + "msg 0.0.1", + "net 0.0.1", + "plugins 0.0.1", + "script_traits 0.0.1", + "string_cache 0.0.0 (git+https://github.com/servo/string-cache)", + "string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)", + "style 0.0.1", + "url 0.1.0 (git+https://github.com/servo/rust-url)", + "util 0.0.1", + "uuid 0.0.1 (git+https://github.com/rust-lang/uuid)", +] + +[[package]] +name = "script_traits" +version = "0.0.1" +dependencies = [ + "devtools_traits 0.0.1", + "geom 0.1.0 (git+https://github.com/servo/rust-geom)", + "msg 0.0.1", + "net 0.0.1", + "url 0.1.0 (git+https://github.com/servo/rust-url)", + "util 0.0.1", +] + +[[package]] +name = "semver" +version = "0.1.0" +source = "git+https://github.com/rust-lang/semver#7dca047a9cd40e929a4545b37a1917daff82f156" + +[[package]] +name = "skia-sys" +version = "0.0.20130412" +source = "git+https://github.com/servo/skia#63e40419e2570646a8d83fefb8914d6e1b786cfb" +dependencies = [ + "expat-sys 2.1.0 (git+https://github.com/servo/libexpat)", + "freetype-sys 2.4.11 (git+https://github.com/servo/libfreetype2)", +] + +[[package]] +name = "stb_image" +version = "0.1.0" +source = "git+https://github.com/servo/rust-stb-image#74488fef4740acf287ff5dc248d65cc74033467a" + +[[package]] +name = "string_cache" +version = "0.0.0" +source = "git+https://github.com/servo/string-cache#ae950525434b642eff5f4904f5e0c76cd6ea99b9" +dependencies = [ + "lazy_static 0.1.0 (git+https://github.com/Kimundi/lazy-static.rs)", + "phf 0.0.0 (git+https://github.com/sfackler/rust-phf)", + "phf_mac 0.0.0 (git+https://github.com/sfackler/rust-phf)", + "string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)", + "xxhash 0.0.1 (git+https://github.com/Jurily/rust-xxhash)", +] + +[[package]] +name = "string_cache_macros" +version = "0.0.0" +source = "git+https://github.com/servo/string-cache#ae950525434b642eff5f4904f5e0c76cd6ea99b9" +dependencies = [ + "lazy_static 0.1.0 (git+https://github.com/Kimundi/lazy-static.rs)", +] + +[[package]] +name = "style" +version = "0.0.1" +dependencies = [ + "cssparser 0.1.0 (git+https://github.com/servo/rust-cssparser)", + "encoding 0.2.0 (git+https://github.com/lifthrasiir/rust-encoding)", + "geom 0.1.0 (git+https://github.com/servo/rust-geom)", + "lazy_static 0.1.0 (git+https://github.com/Kimundi/lazy-static.rs)", + "plugins 0.0.1", + "string_cache 0.0.0 (git+https://github.com/servo/string-cache)", + "string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)", + "url 0.1.0 (git+https://github.com/servo/rust-url)", + "util 0.0.1", +] + +[[package]] +name = "task_info" +version = "0.0.1" + +[[package]] +name = "tls" +version = "0.0.1" +source = "git+https://github.com/alexcrichton/tls-rs#2abeb8996f3795f1e870523b7684dcc2ce64fa85" + +[[package]] +name = "url" +version = "0.1.0" +source = "git+https://github.com/servo/rust-url#8a61b7654ab5378b488225a1d8a9cbbbcbd38894" +dependencies = [ + "encoding 0.2.0 (git+https://github.com/lifthrasiir/rust-encoding)", +] + +[[package]] +name = "util" +version = "0.0.1" +dependencies = [ + "geom 0.1.0 (git+https://github.com/servo/rust-geom)", + "layers 0.1.0 (git+https://github.com/servo/rust-layers)", + "string_cache 0.0.0 (git+https://github.com/servo/string-cache)", + "string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)", + "task_info 0.0.1", + "url 0.1.0 (git+https://github.com/servo/rust-url)", +] + +[[package]] +name = "uuid" +version = "0.0.1" +source = "git+https://github.com/rust-lang/uuid#7c5af48d4f9074717199e05a1895f42b9fb1c1f0" + +[[package]] +name = "xlib" +version = "0.1.0" +source = "git+https://github.com/servo/rust-xlib#58ec3847b592aeabdcfeb6a2d02033d3a2c7f427" + +[[package]] +name = "xxhash" +version = "0.0.1" +source = "git+https://github.com/Jurily/rust-xxhash#7e4174e780af0cfb29a5e53ede0b987adca16396" + diff --git a/components/servo/Cargo.toml b/components/servo/Cargo.toml new file mode 100644 index 00000000000..8735b56686f --- /dev/null +++ b/components/servo/Cargo.toml @@ -0,0 +1,71 @@ +[package] + +name = "servo" +version = "0.0.1" +authors = ["The Servo Project Developers"] + +[lib] +name = "servo" +path = "lib.rs" +crate-type = ["rlib"] + +[[bin]] +name = "servo" +path = "main.rs" +test = false +doc = false +bench = false + +[[test]] +name = "reftest" +path = "../../tests/reftest.rs" +harness = false + +[[test]] +name = "contenttest" +path = "../../tests/contenttest.rs" +harness = false + +[features] +default = ["glfw_app"] +glutin = ["glutin_app"] + +[dependencies.compositing] +path = "../compositing" + +[dependencies.net] +path = "../net" + +[dependencies.msg] +path = "../msg" + +[dependencies.util] +path = "../util" + +[dependencies.script] +path = "../script" + +[dependencies.layout] +path = "../layout" + +[dependencies.gfx] +path = "../gfx" + +[dependencies.glfw_app] +path = "../../ports/glfw" +optional = true + +[dependencies.glutin_app] +path = "../../ports/glutin" +optional = true + +[dependencies.url] +git = "https://github.com/servo/rust-url" + +[dependencies.green] +git = "https://github.com/servo/green-rs" +branch = "servo" + +[dependencies.rustuv] +git = "https://github.com/servo/green-rs" +branch = "servo" diff --git a/components/servo/lib.rs b/components/servo/lib.rs new file mode 100644 index 00000000000..51297269a9b --- /dev/null +++ b/components/servo/lib.rs @@ -0,0 +1,172 @@ +/* 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"] + +#![feature(globs, macro_rules, phase, thread_local)] + +#![deny(unused_imports)] +#![deny(unused_variables)] + +#[phase(plugin, link)] +extern crate log; + +extern crate compositing; +extern crate devtools; +extern crate rustuv; +extern crate "net" as servo_net; +extern crate "msg" as servo_msg; +#[phase(plugin, link)] +extern crate "util" as servo_util; +extern crate script; +extern crate layout; +extern crate green; +extern crate gfx; +extern crate libc; +extern crate native; +extern crate rustrt; +extern crate url; + +use compositing::CompositorEventListener; +use compositing::windowing::{WindowEvent, WindowMethods}; + +#[cfg(not(test))] +use compositing::{CompositorProxy, CompositorTask, Constellation}; +#[cfg(not(test))] +use servo_msg::constellation_msg::{ConstellationChan, InitLoadUrlMsg}; +#[cfg(not(test))] +use script::dom::bindings::codegen::RegisterBindings; + +#[cfg(not(test))] +use servo_net::image_cache_task::ImageCacheTask; +#[cfg(not(test))] +use servo_net::resource_task::new_resource_task; +#[cfg(not(test))] +use gfx::font_cache_task::FontCacheTask; +#[cfg(not(test))] +use servo_util::time::TimeProfiler; +#[cfg(not(test))] +use servo_util::memory::MemoryProfiler; +#[cfg(not(test))] +use servo_util::opts; +#[cfg(not(test))] +use servo_util::taskpool::TaskPool; + +#[cfg(not(test))] +use green::GreenTaskBuilder; +#[cfg(not(test))] +use std::os; +#[cfg(not(test))] +use std::rc::Rc; +#[cfg(not(test))] +use std::task::TaskBuilder; + +pub struct Browser<Window> { + pool: green::SchedPool, + compositor: Box<CompositorEventListener + 'static>, +} + +impl<Window> Browser<Window> where Window: WindowMethods + 'static { + #[cfg(not(test))] + pub fn new(window: Option<Rc<Window>>) -> Browser<Window> { + use rustuv::EventLoop; + fn event_loop() -> Box<green::EventLoop + Send> { + box EventLoop::new().unwrap() as Box<green::EventLoop + Send> + } + + ::servo_util::opts::set_experimental_enabled(opts::get().enable_experimental); + let opts = opts::get(); + RegisterBindings::RegisterProxyHandlers(); + + let mut pool_config = green::PoolConfig::new(); + pool_config.event_loop_factory = event_loop; + let mut pool = green::SchedPool::new(pool_config); + let shared_task_pool = TaskPool::new(8); + + let (compositor_proxy, compositor_receiver) = + WindowMethods::create_compositor_channel(&window); + let time_profiler_chan = TimeProfiler::create(opts.time_profiler_period); + let memory_profiler_chan = MemoryProfiler::create(opts.memory_profiler_period); + let devtools_chan = opts.devtools_port.map(|port| { + devtools::start_server(port) + }); + + let opts_clone = opts.clone(); + let time_profiler_chan_clone = time_profiler_chan.clone(); + + let (result_chan, result_port) = channel(); + let compositor_proxy_for_constellation = compositor_proxy.clone_compositor_proxy(); + TaskBuilder::new() + .green(&mut pool) + .spawn(proc() { + let opts = &opts_clone; + // Create a Servo instance. + let resource_task = new_resource_task(opts.user_agent.clone()); + // If we are emitting an output file, then we need to block on + // image load or we risk emitting an output file missing the + // image. + let image_cache_task = if opts.output_file.is_some() { + ImageCacheTask::new_sync(resource_task.clone(), shared_task_pool) + } else { + ImageCacheTask::new(resource_task.clone(), shared_task_pool) + }; + let font_cache_task = FontCacheTask::new(resource_task.clone()); + let constellation_chan = Constellation::<layout::layout_task::LayoutTask, + script::script_task::ScriptTask>::start( + compositor_proxy_for_constellation, + resource_task, + image_cache_task, + font_cache_task, + time_profiler_chan_clone, + devtools_chan); + + // Send the URL command to the constellation. + let cwd = os::getcwd(); + for url in opts.urls.iter() { + let url = match url::Url::parse(url.as_slice()) { + Ok(url) => url, + Err(url::RelativeUrlWithoutBase) + => url::Url::from_file_path(&cwd.join(url.as_slice())).unwrap(), + Err(_) => panic!("URL parsing failed"), + }; + + let ConstellationChan(ref chan) = constellation_chan; + chan.send(InitLoadUrlMsg(url)); + } + + // Send the constallation Chan as the result + result_chan.send(constellation_chan); + }); + + let constellation_chan = result_port.recv(); + + debug!("preparing to enter main loop"); + let compositor = CompositorTask::create(window, + compositor_proxy, + compositor_receiver, + constellation_chan, + time_profiler_chan, + memory_profiler_chan); + + Browser { + pool: pool, + compositor: compositor, + } + } + + pub fn handle_event(&mut self, event: WindowEvent) -> bool { + self.compositor.handle_event(event) + } + + pub fn repaint_synchronously(&mut self) { + self.compositor.repaint_synchronously() + } + + pub fn shutdown(mut self) { + self.compositor.shutdown(); + self.pool.shutdown(); + } +} + diff --git a/components/servo/main.rs b/components/servo/main.rs new file mode 100644 index 00000000000..16ef1980668 --- /dev/null +++ b/components/servo/main.rs @@ -0,0 +1,116 @@ +/* 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"] + +#![deny(unused_imports)] +#![deny(unused_variables)] + +extern crate servo; +extern crate native; +extern crate time; +extern crate "util" as servo_util; + +#[cfg(all(feature = "glutin",not(any(test,target_os="android"))))] +extern crate "glutin_app" as app; +#[cfg(all(feature = "glfw_app",not(any(test,target_os="android"))))] +extern crate "glfw_app" as app; + +#[cfg(not(any(test,target_os="android")))] +extern crate compositing; + +#[cfg(not(any(test,target_os="android")))] +use servo_util::opts; + +#[cfg(not(any(test,target_os="android")))] +use servo_util::rtinstrument; + +#[cfg(not(any(test,target_os="android")))] +use servo::Browser; +#[cfg(not(any(test,target_os="android")))] +use compositing::windowing::{IdleWindowEvent, ResizeWindowEvent, WindowEvent}; + +#[cfg(not(any(test,target_os="android")))] +use std::os; + +#[cfg(not(any(test,target_os="android")))] +struct BrowserWrapper { + browser: Browser<app::window::Window>, +} + +#[cfg(not(any(test,target_os="android")))] +#[start] +#[allow(dead_code)] +fn start(argc: int, argv: *const *const u8) -> int { + native::start(argc, argv, proc() { + if opts::from_cmdline_args(os::args().as_slice()) { + let window = if opts::get().headless { + None + } else { + Some(app::create_window()) + }; + + let mut browser = BrowserWrapper { + browser: Browser::new(window.clone()), + }; + + match window { + None => {} + Some(ref window) => { + unsafe { + window.set_nested_event_loop_listener(&mut browser); + } + } + } + + loop { + let should_continue = match window { + None => browser.browser.handle_event(IdleWindowEvent), + Some(ref window) => { + let event = window.wait_events(); + browser.browser.handle_event(event) + } + }; + if !should_continue { + break + } + } + + match window { + None => {} + Some(ref window) => { + unsafe { + window.remove_nested_event_loop_listener(); + } + } + } + + let BrowserWrapper { + browser + } = browser; + browser.shutdown(); + + rtinstrument::teardown(); + } + }) +} + +#[cfg(not(any(test,target_os="android")))] +impl app::NestedEventLoopListener for BrowserWrapper { + fn handle_event_from_nested_event_loop(&mut self, event: WindowEvent) -> bool { + let is_resize = match event { + ResizeWindowEvent(..) => true, + _ => false, + }; + if !self.browser.handle_event(event) { + return false + } + if is_resize { + self.browser.repaint_synchronously() + } + true + } +} + diff --git a/components/util/resource_files.rs b/components/util/resource_files.rs index 73e1148cc9a..b40c93f2651 100644 --- a/components/util/resource_files.rs +++ b/components/util/resource_files.rs @@ -17,11 +17,15 @@ pub fn resources_dir_path() -> Path { #[cfg(not(target_os = "android"))] pub fn resources_dir_path() -> Path { - // FIXME: Find a way to not rely on the executable being under `<servo source>/target`. + // FIXME: Find a way to not rely on the executable being + // under `<servo source>/components/servo/target` + // or `<servo source>/components/servo/target/release`. let mut path = os::self_exe_path().expect("can't get exe path"); path.pop(); + path.pop(); + path.pop(); path.push("resources"); - if !path.is_dir() { + if !path.is_dir() { // self_exe_path() is probably in .../target/release path.pop(); path.pop(); path.push("resources"); |