Simon Hausmann
1ab71b8ca3
Prepare the path element setup in the run-time for extensibility
...
Make the anonymous struct for the LineTo variant in the PathElement enum
as separate structure, which can be introspected using rtto::FieldInfo.
2020-07-07 14:14:17 +02:00
Simon Hausmann
9d9779ecde
Fix linter warning
...
When docs are required, don't require them for the generated field offset module.
2020-07-07 14:14:17 +02:00
Simon Hausmann
9a73443e14
Allow for path elements to contain bindings
2020-07-07 14:14:17 +02:00
Simon Hausmann
9cf2d618d2
Use Lyon's path builder
...
Instead of trying to convert the individual (future) elements, let's use a builder.
This way the markup remains simple and due to
future support for bindings we can't really
pre-compute the path events anyway.
2020-07-07 14:14:17 +02:00
Simon Hausmann
fdf7169459
Fix is_constant for Expression::PathElements
...
Respect the constant'ness of the contained expressions.
2020-07-07 14:14:17 +02:00
Simon Hausmann
a71c67152e
Revert "Prepare for additional path elements"
...
This reverts commit d143addb07
.
We're going to need to support binding expressions in path elements.
2020-07-07 14:14:17 +02:00
Olivier Goffart
d0b44a125d
Support for if expression in the interpreter
...
Dynamic model or expression not yet supported
2020-07-03 17:56:48 +02:00
Olivier Goffart
90532e80d2
C++: Support of dynamic model and if expression
2020-07-03 17:37:07 +02:00
Olivier Goffart
20369c7fc7
Fix nested components
2020-07-03 14:04:51 +02:00
Olivier Goffart
1cbd522a03
Rust: make non-constant model and if expression work
2020-07-03 14:04:23 +02:00
Olivier Goffart
769474a478
Introduce a property listener
2020-07-03 13:02:50 +02:00
Olivier Goffart
b529a021a2
Fix bug in the property linked list
...
Not having a prev can happen if the property itsalf was destroyed.
2020-07-02 18:08:46 +02:00
Olivier Goffart
90ed79e39f
Remove unused code in the animation driver
2020-07-02 17:36:34 +02:00
Olivier Goffart
055a3baf90
Remove the binding when the animation on value is finished.
2020-07-02 17:28:04 +02:00
Olivier Goffart
9d852f802e
Property refactoring
...
The tests are working and everything seems to be back normal.
But there is still some cleanup required
2020-07-02 14:14:49 +02:00
Simon Hausmann
facc18d0eb
Fix formatting
...
RA stopped working for some odd reason :-/
2020-07-02 11:25:29 +02:00
Simon Hausmann
d143addb07
Prepare for additional path elements
...
Require that the values to the path element properties are numerical literals.
The conversion happens in the path "compilation" pass, where we can do more
pre-calcuation in the future.
2020-07-02 10:40:31 +02:00
Simon Hausmann
196aef5fbe
Fix C++ linkage on Linux
...
Apply the same workaround for missing symbol exports as in commit
54f81d4d29
2020-07-02 09:10:06 +02:00
Simon Hausmann
9bf3533c9b
Fix C++ build
...
Accidentally remove the .h extension from the color generated header file :)
2020-07-02 08:56:34 +02:00
Simon Hausmann
e54931ea9b
Remove stray debug output
2020-07-02 08:50:16 +02:00
Simon Hausmann
5e61ed4ad2
Implement Path and LineTo in the markup
2020-07-01 15:13:23 +02:00
Simon Hausmann
4e22c2839e
Add the rendering primitives for rendering a path
...
Right now the path is limited to polygons (only LineTo elements) and only the fill color can be specified.
2020-07-01 14:58:09 +02:00
Simon Hausmann
e4ab64f858
Add a SharedArray type
...
This is based on the SharedString code and will allow sharing ownership
of arrays between Rust and C++.
2020-07-01 14:58:09 +02:00
Olivier Goffart
6863c3f631
Use scoped_thread_local for the CURRENT_BINDING
2020-06-30 10:11:34 +02:00
Olivier Goffart
009addf9b4
Logical operations and comparisons and unary operators
2020-06-29 18:40:37 +02:00
Olivier Goffart
c4b1feeea0
Parse Equality opreration
...
(Code generation still missing)
2020-06-29 18:40:37 +02:00
Simon Hausmann
c653f555ea
Begin parsing Path elements
...
As types they follow the regular syntax convention of elements and
properties, but they are contextually restricted.
2020-06-29 16:48:20 +02:00
Simon Hausmann
38b605998c
Fix build
2020-06-29 16:44:54 +02:00
Simon Hausmann
85ac4ad824
Generalize the handling of contextual elements
...
Certainly elements are only allowed as children of certain others, such
as Row only within GridLayout, for example. This patch implements this
constraint at type lookup type and allows removing "Row" from the
general list of types that can be instantiated anywhere.
This mechanism will also be used for path elements, in the future.
2020-06-29 15:43:55 +02:00
Olivier Goffart
19a8559d3f
WIP: Conditional elements
...
The parsing part is implemented, but not the backend as it requires
non-const "models"
2020-06-29 15:03:09 +02:00
Olivier Goffart
8851ad0f3d
Interpreter: Don't copy the property_animations from the object_tree::Component to the ComponentDescription
...
They can be easily accessed from the original object_tree::Component
2020-06-29 11:01:20 +02:00
Olivier Goffart
89ad110fc2
Test nodejs driver: print compile error on the console if there are some
2020-06-29 10:52:48 +02:00
Olivier Goffart
967a2b94eb
C++: put a pointer to the parent in the component
2020-06-29 10:35:18 +02:00
Olivier Goffart
f35c12aef1
Fix building of the nodejs frontend for the tests
2020-06-29 10:35:18 +02:00
Simon Hausmann
ba15a768d6
Add the ability to output rust code to the compiler cli
2020-06-29 09:00:35 +02:00
Simon Hausmann
df20072970
Fix comment
2020-06-29 09:00:35 +02:00
Simon Hausmann
b8ca0fe3c9
Add support for animating color properties
2020-06-27 16:51:48 +02:00
Simon Hausmann
be75cb2b21
Fix failing C++ build tests
...
Making color a real property type broke the build of tests that compare
color properties. Fix this and the incorrect decoding of
strings in the cast to colors, by providing a proper public C++ color
wrapper type.
2020-06-27 16:09:59 +02:00
Simon Hausmann
f7517f403c
Make the color a valid property type
...
This replaces Property<u32> with Property<Color>
2020-06-26 21:46:37 +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
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
Simon Hausmann
45de3d832e
Minor cleanup in the interpreter animation handling
...
Expose the fields of the PropertyAnimation through the rtti module
instead of hard-coding them in the interpreter.
2020-06-26 20:33:55 +02:00
Olivier Goffart
d267039fa8
Put a pointer to the parent component in the component
...
This means we must use Rc for the component so we can use Weak for the parent pointer.
The idea is to get rid later of the context
2020-06-26 19:26:55 +02:00
Olivier Goffart
f8a63b1b76
Add a weak-pin crate that can be used to create Weak pointr from Pin<Rc>
2020-06-26 17:30:40 +02:00
Simon Hausmann
fe64712582
Fix rectangle rendering
...
Use the width for the width instead of x :-)
2020-06-26 17:19:02 +02:00
Olivier Goffart
2d22bac451
Use Pin<&Self> for Property::get
2020-06-26 13:18:04 +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
1b748792ad
Visit the item as Pin
...
A preparation to have Property::get to take Pin<Self>
2020-06-25 18:50:20 +02:00