Commit graph

98 commits

Author SHA1 Message Date
Simon Hausmann
ada5f68908 Add aggregating BuildDiagnostics
This type aggregates different per-file diagnostics into a similar interface,
in preparation for reporting diagnostics from multiple source files.
2020-07-17 12:10:25 +02:00
Simon Hausmann
e914715d88 Rename Diagnostics to FileDiagnostics
As this structure holds the diagnostics just for one file.
2020-07-16 18:25:42 +02:00
Olivier Goffart
5e7d5369aa Few fixes to the layout and add a test that the items are well positioned 2020-07-16 17:22:29 +02:00
Olivier Goffart
96cfd8a620 Fix property named "value" in C++, and fix comparison of lenght in rust 2020-07-16 17:22:29 +02:00
Olivier Goffart
dfd4a35e35 Set the DPI property according to the window's screen 2020-07-15 18:46:55 +02:00
Olivier Goffart
1dec276002 Continue adapting the window size
Implement the Rust and C++ part
2020-07-15 17:52:14 +02:00
Olivier Goffart
96e5738785 Add a DPI variable in the interpreter and in the C++ backend 2020-07-15 17:13:23 +02:00
Olivier Goffart
24033ecdc3 Support for logical_lenght type 2020-07-15 11:53:19 +02:00
Olivier Goffart
8e7e3aaa7a Make the length its own unit 2020-07-14 17:45:03 +02:00
Olivier Goffart
952ddda7c4 Force duration to have an unit 2020-07-14 16:18:12 +02:00
Simon Hausmann
39359a4e26 Add support for an offset to PathLayout
This allows animating items on their position along the path.
2020-07-14 15:12:03 +02:00
Olivier Goffart
c30aa370f3 Parse units
They currently have no real meaning
2020-07-14 11:35:45 +02:00
Simon Hausmann
a3f365417c Center items on a path layout 2020-07-14 09:43:59 +02:00
Olivier Goffart
e00491811b Get rid of the context in properties/signal 2020-07-13 18:49:06 +02:00
Simon Hausmann
992f990fa8 Allow for fitting paths into a given bounding rectangle
... by applying a transformation. This allows designing a path in some
other path design tool and then make it fit using bindings.
2020-07-13 15:41:11 +02:00
Simon Hausmann
79ba943882 Allow for positioning grid layouts as well 2020-07-13 14:02:53 +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
1f7ae1b318 Rename PathElements to PathData
as it can now consists of elements or events.
2020-07-10 13:01:05 +02:00
Simon Hausmann
4b6e549b96 Simplify compiled path data structure
Use two arrays, one for events and one for coordinates. That simplifies
the code generator and the generated code, and it also provides for
a more compact memory representation.
2020-07-10 10:20:59 +02:00
Simon Hausmann
264b1f650f Use std::size instead of hand-written version
Less is more :-)
2020-07-09 15:40:01 +02:00
Simon Hausmann
1a70213c05 Fix path layout implementation to allow positioning
This is not exposed in the API yet though.
2020-07-09 15:38:26 +02:00
Simon Hausmann
4b75ec0ee8 Lay out items on a path
This works, but it's still missing support for positioning of the layout
itself.
2020-07-09 15:32:47 +02:00
Simon Hausmann
251ef7fc97 Add support for SVG commands in Path elements
Using the commands property we can just paste SVG paths. This makes it
much easier to write examples/demos. A good online path designer is
for example https://codepen.io/anthonydugois/pen/mewdyZ
2020-07-09 13:41:57 +02:00
Simon Hausmann
c17c06c6e7 Making closing of a path optional
By default paths are not closed and they can be closed using a Close {}
element.
2020-07-09 09:52:09 +02:00
Simon Hausmann
22d838ffae Add support for true and false boolean literals 2020-07-07 22:11:41 +02:00
Simon Hausmann
a83127ace8 Prepare the path element compilation for extensibility
Avoid any element specific code in the Rust and C++ generator and
minimize the involvement in the interpreter.
2020-07-07 14:14:17 +02:00
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
9a73443e14 Allow for path elements to contain bindings 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
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
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
5e61ed4ad2 Implement Path and LineTo in the markup 2020-07-01 15:13:23 +02:00
Olivier Goffart
009addf9b4 Logical operations and comparisons and unary operators 2020-06-29 18:40:37 +02:00
Olivier Goffart
967a2b94eb C++: put a pointer to the parent in the component 2020-06-29 10:35:18 +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
e6b386ab53 Implement property animations for C++ 2020-06-25 13:38:51 +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
Simon Hausmann
de74ae4534 Fix warrning warnings in C++ code when using array models with integer literals
For the generated

   std::make_shared<sixtyfps::ArrayModel<3,float>>(1, 3, 2);

gcc would complain

    non-constant-expression cannot be narrowed from type 'int' to 'float' in initializer list [-Wc++11-narrowing]

So this patch casts the individual elements to the target (float) type.
2020-06-24 10:47:00 +02:00
Olivier Goffart
c682d14e0b C++: Object literal and ObjectAccess 2020-06-22 18:30:40 +02:00
Olivier Goffart
f744fcccab Lookup within objects properties
Generated code not yet implemented
2020-06-22 17:35:01 +02:00
Olivier Goffart
f8b7989c0b Access the properties in the parent component of a repeated element
This required some refactoring of the EvaluationContext structure to include the parent context
2020-06-22 14:38: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
022cd64625 Support for array model in C++ 2020-06-19 14:29:54 +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
096fd7bbb4 Repeater in C++ 2020-06-17 14:39:33 +02:00
Olivier Goffart
8651acbef4 Small renaming in the cpp generator
Take the component by Rc as this will be usefull when generating repeated expression
2020-06-17 10:50:20 +02:00