Commit graph

76 commits

Author SHA1 Message Date
Simon Hausmann
4f2f27cbda Simplify property and binding setting code in the interpreter
Change the Property RTTI to take an optional animation, instead of
having to match on each call site.
2020-06-26 20:33:55 +02:00
Olivier Goffart
0029921f1a Pin the items in the interpreter 2020-06-26 11:55:05 +02:00
Olivier Goffart
f80addb6a3 Make the viewer's animation work 2020-06-26 11:07:18 +02:00
Simon Hausmann
36bd645e09 First stab at supporting animations in the interpreter.
The sub-optimal RTTI bits are replaced with a superior solution in the
follow-up commit :-)
2020-06-26 11:07:18 +02:00
Olivier Goffart
caca0d0ba4 Put the component in a Pin<>
Removed the drop and create from the ComponentVTable:
since we are not using VBox<ComponentVTable>, this simplifies a bit
the code of the interpreter and everything else.

But there is still a lot of changes everywhere to support that the Component
is pinned.
This is just for the component. Which would be required if later we want
to access the properties as Pin<Property<_>>. But we have not yet ability
to do projections
2020-06-24 14:13:27 +02:00
Olivier Goffart
85b06c3342 Interpreter: support for Object as Value 2020-06-22 19:03:54 +02:00
Olivier Goffart
f744fcccab Lookup within objects properties
Generated code not yet implemented
2020-06-22 17:35:01 +02:00
Olivier Goffart
fa0c393dca Interpreter: Fix property access from parent component in repeater element 2020-06-22 15:22:38 +02:00
Olivier Goffart
1bb8d94ab8 Support array for model in rust and in the interpreter 2020-06-19 19:46:59 +02:00
Olivier Goffart
6238d0d14f Prepare for the ability to access the model
Add an expression type for the access of the model variable from a repeater
2020-06-19 13:46:55 +02:00
Olivier Goffart
864e74601d Add a Model type for
I guess in the future we want to make model a type that knows its inside
2020-06-19 13:13:19 +02:00
Olivier Goffart
be8f127317 Object and array parsing 2020-06-18 15:22:30 +02:00
Olivier Goffart
8f0520f2be Repeater in the viewer 2020-06-17 15:43:57 +02:00
Olivier Goffart
5cd4ed7347 Arithmetic operations 2020-06-16 19:04:03 +02:00
Olivier Goffart
d7fe69ff74 Lookup the index from a repeater expression 2020-06-16 17:23:38 +02:00
Olivier Goffart
81ce11ee8b Add a reference to the enclosing component in the element itself 2020-06-15 16:40:55 +02:00
Olivier Goffart
96a372e45d Grid layout in the interpreter
current imploementation is just a prototype
2020-06-10 19:40:47 +02:00
Simon Hausmann
63f81e1991 Add basic support for conditional expressions
Todo are automated tests and cleaning up the C++ implementation.
2020-06-10 16:04:15 +02:00
Simon Hausmann
ea52c7c9c9 Fix typo 2020-06-10 12:03:46 +02:00
Olivier Goffart
58618c0683 Documentation for the interpreter 2020-06-10 09:26:11 +02:00
Simon Hausmann
5bae6e01a5 Prepare for the ability to embed image data
The Image's source property used to be a string. Now it is a Resource
enum, which can either be None or an absolute file path to the image on
disk. This also replaces the internal Image type.

The compiler internally resolves the img bang expression to a resource
reference, which shall remain just an absolute path. For now the target
generator passes that through, but in the future the target generator
may choose a target specific way of embedding the data and thus
generating a different Resource type in the final code (through
compile_expression in the cpp and rust generator).

The C++ binding is a bit messy as cbindgen doesn't really support
exporting enums that can be constructed on the C++ side. So instead we
use cbindgen to merely export the type internally and only use the tag
from it then. The public API is then a custom Resource type that is
meant to be binary compatible.
2020-06-09 22:54:29 +02:00
Simon Hausmann
afd7319ae5 Rename corelib to sixtyfps_corelib
This is consistent with the other packages and since corelib is now also
a cdylib, libsixtyfps_corelib.so looks much better than libcorelib.so
:-)
2020-06-09 13:27:18 +02:00
Olivier Goffart
c05da294a1 Add GridLayout and Row
The compiler currently lowers them to nothing
2020-06-09 12:46:16 +02:00
Olivier Goffart
3651885d87 Move the compiler binary in tools/
And rename sixtyfps_compiler to sixtyfps_compilerlib
2020-06-05 09:23:38 +02:00
Olivier Goffart
fd829fc89f Some more refactoring of the interpreter
Move the content of lib.rs to a module so we can have some
kind of public api in the lib.rs
2020-06-03 17:33:26 +02:00
Olivier Goffart
a8f02df642 Refactor the viewer into a binary, and an interpreter crate
The interpreter can be used from other crates such as the test or the JS for example
2020-06-02 17:05:48 +02:00
Renamed from tools/viewer/eval.rs (Browse further)