Commit graph

50 commits

Author SHA1 Message Date
Simon Hausmann
3ad41a551b Minor cleanup
When getting the include paths, avoid one intermediate String allocation
and go straight from str to SharedString
2021-03-19 18:08:53 +01:00
Simon Hausmann
9eecdefb35 Add ComponentCompiler::build_from_path 2021-03-19 17:26:19 +01:00
Simon Hausmann
fd9d154b27 Add getter/setter for the style 2021-03-19 17:17:57 +01:00
Simon Hausmann
4705c455b9 Remove CompilerConfiguration from the interpreter API
It's not needed anymore with `ComponentCompiler` (I forgot to remove it)
2021-03-19 17:02:19 +01:00
Simon Hausmann
2d790c202f Revert accidental publishing of internal ffi functions
Not needed as long as everything is within ffi
2021-03-19 16:53:27 +01:00
Simon Hausmann
3588d6ffbe Start exposing ComponentDefinition to C++ 2021-03-19 16:50:12 +01:00
Simon Hausmann
591ae8557b Add include_paths setter/getter to ComponentCompiler 2021-03-19 09:56:46 +01:00
Simon Hausmann
14cda0a9b4 Use Self::foo instead of LongerTypeName::foo in the Rust API docs 2021-03-19 09:28:44 +01:00
Simon Hausmann
7af77839ad Add the skeleton for CompilerCompiler in C++ 2021-03-19 09:26:42 +01:00
Simon Hausmann
de8ad46633 Fix doc warnings 2021-03-18 18:31:42 +01:00
Simon Hausmann
4a9cd954b8 Rework the Rust entry point API for the interpreter
Switch to the stateful `ComponentCompiler` concept that we discussed for the C++ API.
2021-03-18 18:20:50 +01:00
Olivier Goffart
63460c1a24 ComponentInstance show/hide/run 2021-03-18 16:37:01 +01:00
Olivier Goffart
09b7b92dbe Value comparison in C++ 2021-03-18 15:26:53 +01:00
Olivier Goffart
3335ff8da5 C++ API to put a model in the interpreter::Value 2021-03-18 12:17:01 +01:00
Simon Hausmann
02c1150fa7 Add the boilerplate for Struct in C++ 2021-03-18 12:12:48 +01:00
Simon Hausmann
e539d03007 Add C++ Value Brush support 2021-03-17 17:22:57 +01:00
Olivier Goffart
a4837207e6 Expose the ComponentInstance 2021-03-17 17:11:23 +01:00
Simon Hausmann
f09ea8bf6f Fix size assertion between OpaqueValue and Value
Make it an equals check, to match the comments further down
when using transmute.
2021-03-17 16:58:15 +01:00
Simon Hausmann
79612d7354 Add C++ Value Array construction/extraction 2021-03-17 16:52:30 +01:00
Olivier Goffart
e20dd384f5 Expose an iterator to interpreter::Struct 2021-03-17 15:29:03 +01:00
Simon Hausmann
e16e2d8d4f Fix doc test 2021-03-17 15:27:05 +01:00
Simon Hausmann
d6edb8016a Fix compilation 2021-03-17 15:03:48 +01:00
Olivier Goffart
8866d116fe Expose the sixtyfps_interpreter::Struct 2021-03-17 14:51:55 +01:00
Simon Hausmann
831bf58baa Add Value bool conversion to C++ 2021-03-17 14:15:48 +01:00
Simon Hausmann
0877f0c82a Add C++ Value number construction & conversion 2021-03-17 14:07:49 +01:00
Simon Hausmann
8e72d29669 Expose Value::to_string() conversion and construction in C++ 2021-03-17 13:28:53 +01:00
Olivier Goffart
6e9d4f9e8d Fix linking of the interpreter
I don't know why, byt the 'crate-type = "lib"' seem to fix the problem
2021-03-17 12:38:05 +01:00
Olivier Goffart
9e66ec71ce Expose conversion functions 2021-03-17 12:19:59 +01:00
Olivier Goffart
6c6efbdab0 expose the value type to C++ 2021-03-17 12:06:24 +01:00
Olivier Goffart
dbf06f73cc Link the C++ lib against the interpreter 2021-03-17 11:44:45 +01:00
Olivier Goffart
e7cbc716ed Generate a header file for the interpreter API 2021-03-17 11:26:44 +01:00
Simon Hausmann
3391aa0312 Remove the import resolve callback from the compiler configuration
Re-apply commit 2dcbc45cd6 but now do the
resolution from a relative import path to either an absolute path or url
in the compiler itself.
2021-03-16 14:21:33 +01:00
Olivier Goffart
ad75d41e20 Rename struct priperties to fields 2021-03-16 12:50:33 +01:00
Simon Hausmann
e3a33dffe0 Revert "Remove the import resolve callback from the compiler configuration"
This reverts commit 2dcbc45cd6.

It breaks loading of the printer demo in the editor because in
import_file we fail to return the absolute path and thus end up
importing common.60 too many times.
2021-03-16 11:43:33 +01:00
Olivier Goffart
455693dbc0 Documentation for the interpreter crate 2021-03-16 11:24:02 +01:00
Simon Hausmann
2dcbc45cd6 Remove the import resolve callback from the compiler configuration
It turns out that this isn't really needed with the current
implementation.
2021-03-15 20:02:46 +01:00
Simon Hausmann
79aefcb303 Fix compilation of tests 2021-03-15 20:02:31 +01:00
Olivier Goffart
fef4a10ebd Use the new API for the interpreter in wasm
Improve the ComponenetDefinition::from_source
2021-03-15 17:57:46 +01:00
Olivier Goffart
48333370a6 Use the new interpreter API in things that depends on it 2021-03-15 17:29:27 +01:00
Simon Hausmann
8372d3f6d8 Rename call_* to invoke_* for callbacks
Fixes #187
2021-03-15 17:01:05 +01:00
Olivier Goffart
7236e0dee6 Get rid of VoidValue and other small changes 2021-03-15 15:19:24 +01:00
Olivier Goffart
9676ed398d Fix wasm build 2021-03-15 15:14:15 +01:00
Simon Hausmann
9034bd3d1a Move the refined eval::Value API to api::Value
This is the new public value representation for the interpreter
2021-03-15 15:12:34 +01:00
Olivier Goffart
d7b86cd0c4 Polishing of the interpreter API after review 2021-03-15 14:43:55 +01:00
Simon Hausmann
a4c196df60 Use api::Struct in Value::Struct, replacing Value::Object 2021-03-15 12:55:39 +01:00
Olivier Goffart
34632206e6 Add some comments in the interpreter API 2021-03-15 12:13:41 +01:00
Olivier Goffart
5c79f2dbe1 Expose the Diagnostic as the return type in the interpreter API 2021-03-15 11:56:30 +01:00
Simon Hausmann
fdeca052cb Provide the same CompilerConfiguration wrapper in the interpreter API as in the Rust build API 2021-03-15 10:05:56 +01:00
Olivier Goffart
03d9938f8b More WIP work into the interpreter API 2021-03-10 11:46:20 +01:00
Olivier Goffart
6154736910 Some work toward a public interpreter API 2021-03-09 19:31:29 +01:00