Commit graph

16 commits

Author SHA1 Message Date
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