Ryan Hunt
3383a565f9
Handle type aliases better
...
This commit expands the support for type aliases. Now a type alias will
handle structs by generating a renamed specialization with template parameters
removed, and will handle every other type by generating a typedef.
This commit also adds an example for testing aliases.
2017-04-10 11:11:50 -04:00
Kartikaya Gupta
b71230d5ae
Make sure things are printed in dependency order
2017-04-06 13:09:57 -04:00
Kartikaya Gupta
163ff0911b
Update readme
2017-04-05 18:28:30 -04:00
Kartikaya Gupta
c2362a02e2
Add a basic README
2017-04-05 18:14:21 -04:00
Kartikaya Gupta
841f83bbb5
Put function parameters one per line for readability
2017-04-05 18:10:52 -04:00
Kartikaya Gupta
a599c1c12e
Add support for type aliasing to deal with the pesky Wr prefix
2017-04-05 18:09:44 -04:00
Kartikaya Gupta
8ff2b86fe3
Add some docs
2017-04-05 15:39:00 -04:00
Kartikaya Gupta
0bc8599c7b
Actually use the dep tree to only spit out structs and enums we care about
2017-04-05 15:32:50 -04:00
Kartikaya Gupta
52aff39710
Add dependency lists for each hunk of generated C code. Sorry for messy patch
2017-04-05 15:17:14 -04:00
Kartikaya Gupta
e25edb5303
Avoid lossy conversions from ConvertedType to ConvertedType through String
2017-04-05 14:04:59 -04:00
Kartikaya Gupta
dfcbadc0b8
Use BTreeMap for more deterministic output, since it keeps stuff sorted
2017-04-05 14:02:52 -04:00
Kartikaya Gupta
a8e018e993
Make map_path return a ConvertedType
2017-04-05 13:30:07 -04:00
Kartikaya Gupta
40cc816908
Make map_return_type return a ConvertedType
2017-04-05 13:28:05 -04:00
Kartikaya Gupta
0003a66759
Add a format_with_ident helper
2017-04-05 13:27:52 -04:00
Kartikaya Gupta
80f773d4fd
Clean up formatting a little bit. rustfmt generates gross results so this is done by hand
2017-04-05 12:13:08 -04:00
Kartikaya Gupta
d364fcb658
Instead of printing conversions directly to stdout, stash them in a result struct. This is needed for selectively printing just the things we need
2017-04-05 12:09:06 -04:00
Kartikaya Gupta
adbdfb5fc9
Add conversion of enums
2017-04-05 11:08:46 -04:00
Kartikaya Gupta
ff0cd42c9a
More primitive type support
2017-04-05 09:45:24 -04:00
Kartikaya Gupta
af82991c7b
Implement array types with int literal sizes
2017-04-04 16:04:20 -04:00
Kartikaya Gupta
362835251d
Move warning dumps to stderr
2017-04-04 15:01:36 -04:00
Kartikaya Gupta
c66c326601
Remove the sample input as it no longer works with the binding generator. Use gfx/webrender_bindings from https://github.com/staktrace/gecko-dev/tree/bindgen
2017-04-04 14:52:28 -04:00
Kartikaya Gupta
3c50348e92
Generate template parameters for generic types
2017-04-04 14:22:54 -04:00
Kartikaya Gupta
2eb02370a8
Convert generic structs to templates
2017-04-04 14:22:54 -04:00
Ryan Hunt
6787a93fa2
Add a comment explaing rust_lib
2017-04-04 14:10:59 -04:00
Ryan Hunt
93b3a257d1
Use rust_lib for parsing
2017-04-04 14:10:59 -04:00
Ryan Hunt
674fa3ece2
Add a rust lib parser for handling whole library parsing
2017-04-04 14:10:59 -04:00
Kartikaya Gupta
dad4ecbad8
Add struct conversion
2017-04-04 13:05:25 -04:00
Kartikaya Gupta
fa1a2d911e
Typedef ImageKey to WrImageKey
2017-04-04 12:37:42 -04:00
Kartikaya Gupta
dcc308c6a6
Typedef RenderApi to WrAPI
2017-04-04 12:08:38 -04:00
Kartikaya Gupta
875e881221
Support c_void*
2017-04-04 12:04:56 -04:00
Kartikaya Gupta
39ca640b03
Add WR_DESTRUCTOR_SAFE_FUNC stuff
2017-04-04 11:53:55 -04:00
Kartikaya Gupta
b162d488b3
More typedefs to bring the generated code closer to what we already have in webrender_ffi.h
2017-04-04 11:42:59 -04:00
Kartikaya Gupta
8bf330163a
Add a typedef so as to simplify binding generation
2017-04-04 11:02:14 -04:00
Kartikaya Gupta
d7f7af4807
Fix missing C-ABI declaration in sample input
2017-04-04 11:01:59 -04:00
Kartikaya Gupta
3d00490585
Ensure the function uses a C ABI
2017-04-04 10:50:28 -04:00
Kartikaya Gupta
3c0616d87b
Remove src/bindings.rs, put an updated copy in a sample-input folder
2017-04-04 10:47:17 -04:00
Kartikaya Gupta
ccea723a9a
Run rustfmt
2017-04-04 10:31:45 -04:00
Kartikaya Gupta
5b688b1623
Add WR_INLINE and WR_FUNC decorations
2017-04-04 10:27:50 -04:00
Kartikaya Gupta
af1bc992d6
Refactor has_no_mangle to make it easier to match repr(C) which we'll need later
2017-04-04 10:24:05 -04:00
Jeff Muizelaar
4c559a4e47
Map f32
2017-04-04 10:15:46 -04:00
Jeff Muizelaar
703bc18491
Remove old output
2017-03-07 10:47:30 -05:00
Jeff Muizelaar
215d3a987b
Initial commit
2017-03-02 16:22:44 -05:00