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
dfd4a35e35
Set the DPI property according to the window's screen
2020-07-15 18:46:55 +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
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
1845e495fe
Fix path layout positioning
...
The local parameter t on a path segment wasn't normalized to the length
of the segment itself.
2020-07-14 14:23:43 +02:00
Simon Hausmann
f8024e6658
Add support for looping in animations
2020-07-14 13:22:28 +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
Olivier Goffart
ab7ae9f3e2
Some refactoring of the rust generated code
...
Always use a Pin<Rc> for the component. (This is required to support repeater
within repeater as well anyway)
Do not use the context within the binding. We can get along by simply capturing
a weak pointer to the component
2020-07-13 16:37:54 +02:00
Simon Hausmann
1a0d053889
Align default path layout tolerance
...
Use the same tolerance as when rendering
2020-07-13 16:12:38 +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
Olivier Goffart
905dca7d19
Remove debug output
2020-07-13 11:50:39 +02:00
Simon Hausmann
6243df1702
Avoid unnecessary path building
...
When the path was constructed from events (SVG commands), then we don't really need to build an intermediate path,
neither for rendering nor for path layouting.
2020-07-10 13:59:40 +02:00
Simon Hausmann
535da41ae0
More naming cleanups
...
PathData::PathElements has one redundant "Path" in the name, so eliminate
for Events and Elements.
2020-07-10 13:06:28 +02:00
Simon Hausmann
7c4b12a0ce
Remove unused path event data structures
2020-07-10 13:02:12 +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
69325a1a5b
Get rid of PathElements::StaticElements
...
This functionality can be folded into SharedArray later, if needed.
2020-07-10 12:47:27 +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
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
8edb9bd7f8
Implement a layout function to position items on a path
...
This is very simple still, always starts at the beginning of the path
and uses equal distances.
2020-07-09 15:26:52 +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
be60079f21
Add support for pre-compiled paths
...
They are represented as lyon-style path events. We can use this to
compile SVG paths ahead of time and use them
without including lyon's SVG path builder.
2020-07-09 10:43:49 +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
f45ff6ce79
Add support for stroking paths
...
This will make it easier to visualize the path for layouts.
2020-07-09 09:36:16 +02:00
Simon Hausmann
5629683942
Remove PathElements::as_slice()
...
This function is not needed anymore
2020-07-09 08:54:19 +02:00
Simon Hausmann
afa23faa94
Move the path building function into corelib
...
We're going to need it not only in the GL renderer but also in the layout code.
2020-07-08 20:36:40 +02:00
Simon Hausmann
89a05245f9
Fix SharedArray length in bytes to be a multiple of pointer alignment
2020-07-07 18:15:26 +02:00
Simon Hausmann
f646809ff4
Added ArcTo element for paths
2020-07-07 16:02:46 +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
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
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
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
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
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
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