Olivier Goffart
b57f3775c9
Refactor GridLayout
2020-07-28 10:31:05 +02:00
Simon Hausmann
09cae799d3
Fix return type of compile_syntax_node
...
All call sites are only interested in the root component, so might
as well return that.
2020-07-28 09:21:32 +02:00
Simon Hausmann
2425c366db
Fix build without Qt, part 2
...
A really clean build still brough up the issue that the C++ code was failing to build.
Instead, guard those places with #cfg just in the style crate and provide
"empty" items otherwise. That also simplifies the usage site again.
This time tested with git clean -fdx :-)
2020-07-28 08:58:13 +02:00
Simon Hausmann
b07f577aa4
Fix build without Qt
...
If we can't find qmake, don't use the qt_style crate
2020-07-27 15:26:13 +02:00
Olivier Goffart
d77d7cddc3
The viewer can use the Qt style with --style qt
2020-07-24 18:06:55 +02:00
Simon Hausmann
88fb491837
Add support for mapping elements to different native classes
...
The Rectangle element has properties for a border outline. If those are
used, then the generated code should use BorderRectangle. But if they are
not used, then we can fall back to just generating a Rectangle.
2020-07-24 17:48:19 +02:00
Simon Hausmann
6c27451761
Begin separating builtin elements from the underlying types
...
This uses a NativeClass type in the registry to represent the underlying
Rust/C++ types.
2020-07-24 16:11:46 +02:00
Simon Hausmann
a03e0dc5d6
Fix gallery.60 in the interpreter
...
Forgot to collect RTTI for BorderRectangle :-)
2020-07-24 10:34:27 +02:00
Olivier Goffart
05c5f7c53d
Test and fix animations on properties
...
The animation should not start when the property is initialized, only when the
property is set by the setter
2020-07-23 11:45:34 +02:00
Olivier Goffart
1a1d3dbec0
Store two consecutive read of the same variable in a temporary variable
...
Avoid to create too many dependencies when not required.
Especially the state transformation can create a lots of read to the same property
2020-07-22 17:24:26 +02:00
Simon Hausmann
2f0718bffa
Add include path options to the viewer and compiler
...
This allows specifying additional component locations. It works for
simple structs, but not yet for more complex types due to a bug yet to
be fixed :-)
2020-07-17 15:26:35 +02:00
Olivier Goffart
6c54dfb67d
Layout the item in a PathLayout if they are part of a repeater
2020-07-17 15:00:12 +02:00
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
5dc53f0f79
Remove unused diagnostics argument in the interpreter
2020-07-17 11:52:29 +02:00
Simon Hausmann
893b5132c8
Further encapsulate Diagnostics
...
Use has_error() and a new convenience function to get the diagnostics as a string vector.
2020-07-17 11:52:29 +02:00
Simon Hausmann
732a56259f
Simplify compilation call sites further
...
Move run_passes into the library compilation function. That way the
FileDiagnostics are created by the parser, can be passed on to the library
compilation function and after that we don't need them anymore and can
replace them with future BuildDiagnostics for example.
2020-07-16 18:53:59 +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
Simon Hausmann
c3aae7648a
Further simplify compilation call sites
...
Remove the need to construct the type registry at all the call sites by
offering a compile_syntax_node function in the compiler library.
2020-07-16 09:25:26 +02:00
Simon Hausmann
64a4e749b7
Simplify path setup in the Diagnostics
...
Pass the path to the parse function, as that's easier at most call sites.
Also offer a convenience parse_file function.
2020-07-15 19:21:25 +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
Simon Hausmann
ddc4fb6e1f
WIP: window size
...
Just playing around with propagating the width/height of the window.
2020-07-15 17:52:14 +02:00
Simon Hausmann
8e047d3761
Simplify compiler diagnostics API
...
Don't require the callers to hold on to the source code string until an
eventual diagnostics code path is hit. Instead it turns out it's
simpler to let the parser consume the source code as string, where
internally after tokenizing it can be moved into the diagnostics and
from there into the code map if needed.
There are a few places where we now clone the source code, but that's
only in cases where we also extract stuff separately (test code) or the
syntax updater.
2020-07-15 17:34:11 +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
Simon Hausmann
5b43962bb2
Split up TypeRegistry
...
For a .60 files the locally defined components are now stored in a separate
per-document TypeRegistry instance that falls back to the global registry
for lookups.
2020-07-15 13:09:43 +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
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
Olivier Goffart
868468b101
Interpreter: Do not use the parent component from the context
2020-07-13 13:13:23 +02:00
Olivier Goffart
d392e00c1c
Implement dynamic models in the interpreter
2020-07-13 11:50:57 +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
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
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
Simon Hausmann
5e61ed4ad2
Implement Path and LineTo in the markup
2020-07-01 15:13:23 +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
Simon Hausmann
b8ca0fe3c9
Add support for animating color properties
2020-06-27 16:51:48 +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
0029921f1a
Pin the items in the interpreter
2020-06-26 11:55:05 +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