Olivier Goffart
5f5e5b7420
Access global properties from rust
...
C++ and interpreter implementation is still missing so the new stest is failling
2020-10-29 11:01:04 +01:00
Olivier Goffart
c659c4369a
Refactor the Layout generation code
2020-10-26 10:07:31 +01:00
Olivier Goffart
27a6ff1227
Move Type and related concepts in a different module
...
Leaving only the TypeRegister in the typeregister module
2020-10-23 11:17:14 +02:00
Simon Hausmann
1b4317a93a
Minor cleanup in the layout code in the compiler
...
Free the term "Layout Constraints" for use later for the actual constraints
of layouts.
2020-10-13 18:00:54 +02:00
Simon Hausmann
2a9c962b8d
Exclude exposure of easing and duration typed properties
...
We decided that their type mapping is not ready for public API yet. For
example for duration we'd like to replace the opaque i64 with another
opaque type that however has convenient conversions to
std::time::Duration or std::chrono::milliseconds. We can't use either
directly because we need ffi compatibility, in order to create an
instance in C++ and pass it to the Rust run-time.
So this hides such properties and instead produces a warning.
2020-09-04 21:25:11 +02:00
Olivier Goffart
59dbb610be
Materialize fake properties such as layout width/height
2020-09-01 18:49:49 +02:00
Olivier Goffart
58cdaeb8dd
Update license header to mention that commertial option are available
2020-08-26 13:23:42 +02:00
Olivier Goffart
058a91ba75
Fix repeater access to properties within sub components
2020-08-24 08:27:22 +02:00
Simon Hausmann
2823f32692
Apply license headers to all non-binary/non-json sources
2020-08-17 17:55:20 +02:00
Simon Hausmann
30acb11362
Fix handling of properties of nested optimized layout elements
...
We need to traverse also into the expressions of nested layouts to ensure
any references inside are updated as the
"virtual" properties are moved.
2020-07-29 18:52:22 +02:00
Simon Hausmann
267f7caa90
Fix a bug with accessing declared and moved properties from within bindings
...
In commit 46ca98b159
the binding fixup was moved
to be applied later, but at that point the bindings have been
moved and aren't there (on the element) anymore, so they'd
never get fixed. This patch moves the fixup back up again.
2020-07-24 08:17:12 +02:00
Olivier Goffart
46ca98b159
Make sure to visit all the expressions in the different passes
...
Including the new expressions in the states
2020-07-21 13:30:04 +02:00
Simon Hausmann
f6761e2c4c
Allow for the positioning of PathLayouts via x/y properties
...
These are just "virtual" properties that will be transformed into
property members of the main struct through the optimized elements
sub-pass.
2020-07-13 13:34:04 +02:00
Simon Hausmann
e78dd1342a
Fix optimized elements pass
...
Apply the move of bindings and properties also to the optimized elements themselves.
2020-07-13 13:30:55 +02:00
Simon Hausmann
288ad0cba8
Add support for animations of declared properties
...
* Make sure to move the animation declarations when moving property
declarations to the root
* In the interpreter, we need to do a little extra dance to get the RTTI
right for custom properties and also apply the animations.
2020-06-26 20:33:55 +02:00
Olivier Goffart
53e61629ca
Fix access to property declared within the repeater.
...
The move_declaration pass should recurse into sub-components for repeater elements
2020-06-22 10:26:22 +02:00
Olivier Goffart
56aad7f474
Fix looking up of 'id' so that we can't access inaccessible id
2020-06-16 16:04: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
58ac9e964c
Visit the model expression in the passes that visit the expressions
2020-06-15 14:00:39 +02:00
Olivier Goffart
136a90907b
Refactor the element children to account for RepeatedElements
2020-06-12 22:24:50 +02:00
Simon Hausmann
be3d0ab369
Provide convenience accessors for public properties in C++
...
While properties declared in the root component are named as-is and
exposed as Property<T>, their get() function in particular is hard to
use because it requires an EvaluationContext as a parameter.
This patch adds get_foo() and set_foo() accessors for each public
property and hides the evaluation context business for the getter.
The added test uses this right away and adds missing test coverage for
the conditional expression.
2020-06-11 15:45:16 +02:00
Olivier Goffart
8b6bb47af8
Create a type alias for Rc<RefCell<Element>>
2020-06-11 15:28:51 +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
e86a7d3192
Merge signal and property declaration
...
A Signal is just a property of type Type::Signal
Simplifies the code a bit
2020-05-28 12:49:18 +02:00
Olivier Goffart
f27816a450
Recurse into the expressions in the passes
2020-05-28 08:01:33 +02:00
Simon Hausmann
01fc0df1a2
Revert "Fix C++ build"
...
This reverts commit 6818ea746f
.
The build was fine before this change. We don't call map_name() on the
root declarations, so this can't really happen.
2020-05-27 09:58:55 +02:00
Simon Hausmann
6818ea746f
Fix C++ build
...
Don't rename the declarations in the root element.
2020-05-27 09:56:24 +02:00
Olivier Goffart
c137b4dab5
Add a pass to move all declaration on the top level
2020-05-27 09:37:46 +02:00