Commit graph

3667 commits

Author SHA1 Message Date
Patrick Walton
c52f550367 Update to get the reference counting correct 2014-11-27 10:31:32 -06:00
Patrick Walton
1ac5bfe830 Add mostly-correct (albeit leaky) string marshaling 2014-11-27 10:31:32 -06:00
Patrick Walton
14ef53cf57 Add back API hashes 2014-11-27 10:31:32 -06:00
Jack Moffitt
e4362dad73 Fixes for Linux. 2014-11-27 10:31:32 -06:00
Patrick Walton
3bf779cd21 ports/cef: Use the CEF translator tool to generate the full set of CEF
bindings.

This replaces hand-implemented CEF bindings with proper Rust wrappers
automatically generated from the C++ headers. This means that, whenever
CEF's C++ headers change, we can easily generate both the appropriate C
API and the appropriate Rust API. It eliminates much of the hand-written
unsafe code within the CEF port, because the CEF translator tool now
knows how to generate Rust smart pointer wrappers for each class that
corrently perform reference counting.

Additionally, this commit adds utility macros (located in `macros.rs`)
that make it easier to correctly expose Rust objects as CEF objects.
They handle the marshaling of objects between Rust and CEF properly.
The net result of this is that you can write mostly-natural-looking Rust
in the CEF port and interact with it with a natural-looking C++ API on
the embedding side.

This setup relies on the branch of CEF located here:

    https://github.com/pcwalton/chromium-embedded-framework

To regenerate, follow the instructions in `ports/cef/README.md`. For
convenience, and because I don't anticipate the API to change much, I
have vendored in all of the appropriate interfaces.
2014-11-27 10:31:32 -06:00
Simon Sapin
99e8358305 Add .cargo/config to .gitignore, move content to ports/android
This allows using .cargo/config at the root of the repository
for local path override, without risk of accidentally committing it.
2014-11-25 15:04:01 +00:00
Martin Robinson
737a14663d Update rust-layers to fix empty BufferRequest failures
rust-layers will now avoid sending empty buffer requests which can
cause failures when Servo tries to create empty platform surfaces.

Fixes #4060.
2014-11-22 23:36:21 -06:00
Mike Blumenkrantz
d4ddfaa623 embedding: redo browser creation, split after_created COM to separate function
this causes the callback to run at the expected time for applications that may depend on the browser loop having started or somesuch
2014-11-21 21:54:09 -05:00
Mike Blumenkrantz
8aceb59824 embedding: redo browser creation and message loop code to be more CEF-like
big thanks to @alexcrichton for his help with this
2014-11-21 21:54:09 -05:00
Mike Blumenkrantz
0ddbd430a3 embedding: add cef_window_info_t decl 2014-11-21 21:52:56 -05:00
Mike Blumenkrantz
cd0bcbd777 embedding: add cef_client_t decl 2014-11-21 21:52:56 -05:00
Mike Blumenkrantz
8f34fcb530 embedding: add cef_life_span_handler_t decl 2014-11-21 21:52:56 -05:00
Mike Blumenkrantz
1704838d7d embedding: add cef_display_handler_t decl 2014-11-21 21:52:56 -05:00
Mike Blumenkrantz
cb77e79522 embedding: fix type decls 2014-11-21 21:52:56 -05:00
Glenn Watson
898c1ecc8f Remove unused exit after load option.
This simplifies some upcoming changes to how event handling works.
2014-11-21 09:15:02 +10:00
Mike Blumenkrantz
c8da9e1a54 embedding: cef_string_ascii_to_wide() 2014-11-20 11:53:47 -05:00
Mike Blumenkrantz
0d21a68ee7 embedding: cef_string_ascii_to_utf16() 2014-11-20 11:53:47 -05:00
Mike Blumenkrantz
bd5419418e embedding: cef_string_wide_to_utf8() 2014-11-20 11:53:47 -05:00
Mike Blumenkrantz
8b5f4cff3d embedding: cef_string_utf8_to_wide() 2014-11-20 11:53:47 -05:00
Mike Blumenkrantz
031963c91e embedding: cef_string_wide_cmp() 2014-11-20 11:53:44 -05:00
Mike Blumenkrantz
b0a65f4918 embedding: implement cef_execute_process() stub
this is missing signal handler functionality in rust and we currently have no use case for actual execution of secondary processes
2014-11-20 11:53:41 -05:00
Mike Blumenkrantz
37583ea8f5 embedding: add some commonly used string constants from chromium 2014-11-20 11:53:37 -05:00
Patrick Walton
10cc07e137 cef: Don't link against librustc in the final build artifact 2014-11-19 12:12:04 -08:00
Glenn Watson
c39852a3f4 Remove rust-alert as it's broken on mac, and unimplemented on other platforms. 2014-11-19 14:19:40 +10:00
bors-servo
f5c6146de0 auto merge of #4028 : glennw/servo/glutin, r=larsbergstrom
Default build uses glfw, but glutin can be enabled via:

./mach cargo build --no-default-features --features=glutin

Remaining work:
 * Mac
 * Android
 * hi-dpi
 * nested event loop

This PR also enables true headless (without X) rendering on Linux by specifying the rendering API as Mesa.
2014-11-18 15:48:29 -07:00
Glenn Watson
0278920343 Add glutin port (supported on Linux only currently).
Default build uses glfw, but glutin can be enabled via:

./mach cargo build --no-default-features --features=glutin
2014-11-19 08:31:34 +10:00
Mike Blumenkrantz
4ae5c88acc address review comments 2014-11-18 14:43:59 -05:00
Mike Blumenkrantz
8a4d2949e8 embedding: replace usage of deprecated find*() with get*() 2014-11-17 14:41:23 -05:00
Mike Blumenkrantz
8b231a26e4 embedding: cef_string_multimap_free() 2014-11-17 14:41:23 -05:00
Mike Blumenkrantz
32d6cff440 embedding: cef_string_multimap_clear() 2014-11-17 14:41:23 -05:00
Mike Blumenkrantz
ef288f1195 embedding: cef_string_multimap_value() 2014-11-17 14:41:22 -05:00
Mike Blumenkrantz
ce3e9fb511 embedding: cef_string_multimap_key() 2014-11-17 14:41:22 -05:00
Mike Blumenkrantz
85a099719e embedding: cef_string_multimap_enumerate() 2014-11-17 14:41:22 -05:00
Mike Blumenkrantz
7758a4427d embedding: cef_string_multimap_append() 2014-11-17 14:41:22 -05:00
Mike Blumenkrantz
f1f8c65de7 embedding: cef_string_multimap_find_count() 2014-11-17 14:41:22 -05:00
Mike Blumenkrantz
cc55f88496 embedding: cef_string_multimap_size() 2014-11-17 14:41:22 -05:00
Mike Blumenkrantz
89fa3bb99a embedding: begin cef string_multimap api
cef_string_multimap_alloc()
2014-11-17 14:41:22 -05:00
bors-servo
2bda68f038 auto merge of #3987 : mbrubeck/servo/rust-root, r=larsbergstrom
r? @larsbergstrom
2014-11-17 09:21:28 -07:00
Glenn Watson
e9ff6d9ce7 Update green-rs submodule to get android tls fix. 2014-11-17 09:45:56 +10:00
Glenn Watson
8addf6f633 Update gleam submodule, and use glfw to load OpenGL function pointers. 2014-11-17 07:41:54 +10:00
bors-servo
443b1b98e1 auto merge of #3984 : zmike/servo/embedding-option_callbacks, r=jdm
@jdm,  @larsbergstrom

#legday
2014-11-14 18:45:35 -07:00
bors-servo
0ab70dd539 auto merge of #3977 : wenderen/servo/cef-empty-enums, r=jdm
fix for #3968
2014-11-14 17:15:33 -07:00
Mike Blumenkrantz
5f10092995 embedding: convert callback Option<> matching to map() 2014-11-14 17:18:50 -05:00
Mike Blumenkrantz
11e30731ef embedding: change Option<> unwrapping for fptrs to use match 2014-11-14 17:08:36 -05:00
Matt Brubeck
3cacb029cc Use the correct Rust path in Android packaging 2014-11-14 13:01:46 -08:00
Matt Brubeck
18dad40dfb Update GLUT for rustup fixes
Pulls in servo/rust-glut#49
2014-11-14 12:14:03 -08:00
Matt Brubeck
6323c230a2 Update Cargo.lock files for Android rustup fixes
r? @glennw
2014-11-14 11:56:29 -08:00
Mike Blumenkrantz
d33f74f499 embedding: remove eutil::fptr_is_null, fix #3967, add Option<> to fptrs 2014-11-14 14:30:59 -05:00
Rohan Prinja
ab6a230839 empty enum replaces c_void
fix incorrect type aliasing logic

remove trailing semicolons

remove trailing semicolons

embedding: empty enum replaces c_void
2014-11-14 20:27:54 +05:30
bors-servo
99fc4ab634 auto merge of #3947 : zmike/servo/embedding-string_map, r=jdm
implements a string map which is 100% identical to CEF

r+ @larsbergstrom  @jdm
2014-11-13 17:06:30 -07:00