Olivier Goffart
ec8baa81f2
formating
2020-06-04 14:05:17 +02:00
Olivier Goffart
49d2aec7e2
Node: add possibility to add signal handler
...
Right now, this only works once and then panic the second time
2020-06-04 12:49:33 +02:00
Olivier Goffart
5ee09398e8
Node: Allow to init properties to value
2020-06-03 17:33:45 +02:00
Olivier Goffart
13c7e0dec8
Begin working on a Node API
...
Currently, the followinf command in the example/nodetest directory works:
npm install ../../api/sixtyfps-node && node main.js
2020-06-03 17:33:05 +02:00
Olivier Goffart
619e21295d
reformat
2020-05-28 17:15:11 +02:00
Olivier Goffart
dc276290e9
Add support for self assignment (+=, -=, ...)
2020-05-28 17:02:06 +02:00
Simon Hausmann
b8a8abcdf9
Make the plus minus use-case work with the Rust frontend
...
Initialize the counter label from a property that we modify in signals handlers
from Rust code.
2020-05-28 15:20:30 +02:00
Olivier Goffart
74898a1386
Make property conneciton binding in the C++
...
(somehow plus/minus is not working yet)
2020-05-28 14:52:43 +02:00
Olivier Goffart
95b671c97c
Support for code blocks and signal call
2020-05-28 12:30:08 +02:00
Simon Hausmann
f2df9293a9
Fix the C++ build
...
Remove the Optional from the evaluation context passing for property
evaluation. Unfortunately there are nullptr uses left on the C++ side,
that need to be replaced with passing through.
2020-05-28 12:07:11 +02:00
Simon Hausmann
4f9c53879b
Implement property references as bindings in the Rust frontend
2020-05-28 11:37:59 +02:00
Olivier Goffart
5580b5112f
Fix number to string conversion in C++
2020-05-27 16:18:08 +02:00
Olivier Goffart
41332a759f
Make property reference works in C++
2020-05-27 10:00:45 +02:00
Olivier Goffart
36fb526811
Do inlining in a pass before the lowering
2020-05-26 15:10:27 +02:00
Simon Hausmann
0932953ac8
Implement property declarations for the C++ backend
2020-05-25 19:13:52 +02:00
Olivier Goffart
e34ac8c3f4
Get signals and toucharea working on the rust example
2020-05-25 17:41:24 +02:00
Olivier Goffart
dd756ef112
Adapt the parser to parse := instead of =
2020-05-25 10:46:00 +02:00
Olivier Goffart
d8601621c0
Use the tool to replace = with :=
2020-05-25 10:44:22 +02:00
Simon Hausmann
bcc6c6a60a
Move Color and RenderingPrimitive into abi::datastructures
...
This paves the way to replace RenderingInfo.
2020-05-22 16:07:06 +02:00
Simon Hausmann
d48faf711f
Update cached rendering data only when there are changes
...
This introduces a separate rendering preparation step in the main
window. As a consequence, the component becomes a parameter and the
graphicstest example can't use the main window anymore.
The decision whether a new low-level primitive needs to be created or
not is made by comparing the last RenderingPrimitive against the new
one.
On the upside, this means that property changes are now reflected in the
graphics.
2020-05-22 16:07:06 +02:00
Simon Hausmann
21842bdd75
Remove the individual primitive factory functions from RenderingPrimitivesBuilder
...
Only use the new one that takes the new enum.
2020-05-22 16:07:06 +02:00
Simon Hausmann
f2662f0884
Simplify image primitives graphics API
...
Don't require a dest rect for now. Rendering is always at (0, 0) but
with the transformation applied. And the size shall for now not be a
parameter.
2020-05-22 16:07:06 +02:00
Olivier Goffart
c03c2e2e7e
Attempt to do Plus / Minus
2020-05-21 13:24:45 +02:00
Olivier Goffart
54eb0f831b
Fix the children allocation array
...
The offsets was not computed properly
2020-05-21 13:14:28 +02:00
Olivier Goffart
4575011293
More work on signal: the C++ part is working
2020-05-20 19:28:58 +02:00
Olivier Goffart
efe0ccfb3f
Add support for signal in the parser
...
(currently not doing anything else than parsing)
2020-05-20 12:53:08 +02:00
Olivier Goffart
94c58dc1c4
Add an mouse handler for the TouchArea
2020-05-20 12:03:36 +02:00
Olivier Goffart
6b3765857a
Add a TouchArea builtin item (currently does nothing)
2020-05-20 09:32:01 +02:00
Simon Hausmann
cbd28bf745
Simplify image primitives API
...
Removed the source rectangle as that can also be done on the source image side,
if necessary.
2020-05-19 20:37:36 +02:00
Olivier Goffart
260f17a3e0
Support for inline components within a .60 file
2020-05-19 17:43:56 +02:00
Olivier Goffart
ab28828351
Support for img!("foo.png") to make string absolute
...
This is a temporary solution until we get better ressource handling
2020-05-19 16:30:48 +02:00
Olivier Goffart
a4569ddca3
BangExpression allow for finding relative paths
2020-05-19 15:36:56 +02:00
Simon Hausmann
23d3964a0d
Add boilerplate for text items
...
Forward the text and color properties to the rendering backend, where
right now we just rendering all the glyphs into a dedicated texture.
Next steps are a glyph atlas texture, blending the specified color with
the alpha of the glyphs, configurable size and family, shaping with
Harfbuzz and may more things.
2020-05-18 19:04:12 +02:00
Olivier Goffart
25bf149e13
Add a shared string that can be used in properties
2020-05-18 17:09:40 +02:00
Simon Hausmann
a7d5bd9f59
Minor rendering cleanup
...
Remove the x/y parameters from the rectangle primitive. They're always zero
since we always render with a transformation
matrix.
2020-05-18 16:01:53 +02:00
Simon Hausmann
25fd60c820
Fix runtime panic in cpp example
...
Correct the path to the image.
2020-05-14 08:43:00 +02:00
Simon Hausmann
18a2b7748f
Silence VS code warning
...
... when not targeting wasm.
2020-05-13 13:27:15 +02:00
Simon Hausmann
6f98e2ea56
Fix cargo warning
...
For now, always depend on console_error_panic_hook. It's useful :-)
2020-05-13 12:08:00 +02:00
Simon Hausmann
3d604b1a0c
Ignore the dist directory
2020-05-13 12:07:38 +02:00
Simon Hausmann
e313f39490
Add simple rust wasm test
...
Needs an initial "npm install" and then "npm start" will build and launch it in the browser.
2020-05-13 11:24:51 +02:00
Simon Hausmann
3142883ca8
Render the contents of image elements
...
The source property is a path relative to the path of the executable.
That is still rather inconvenient. It would be more convenient to make
it relative to the source file, but the corresponding proc-macro span
source_file() accessor is not public/stable.
Perhaps there's a way of doing this also through the generated code and
std::file!().
2020-05-13 10:27:09 +02:00
Simon Hausmann
3aac8282a8
Allow passing string literals to string properties in Rust
...
In the Rust code generator, convert to a null terminated byte literal.
2020-05-13 10:01:19 +02:00
Simon Hausmann
6ba90975b8
Further cleanup of the internal run_event_loop
...
Let the callback take a frame and that's it. Then the caller can take
care of presenting it, etc.
2020-05-12 22:16:04 +02:00
Simon Hausmann
c26a2a1562
Fix GL context state handling
...
Make our GL context not current when done with the initialization
and make it current for the duration fo primitive creation and frame
rendering.
Fixes #4
2020-05-12 21:42:34 +02:00
Simon Hausmann
ea03e08306
Clean up rectangle creation
...
Use a simple shared convenience method in the GraphicsBackend trait
2020-05-12 19:22:01 +02:00
Simon Hausmann
c5bcba2c3c
Added basic rendering of cache primitives to the Items
2020-05-12 16:00:41 +02:00
Simon Hausmann
85e2ac36ef
Prepare for caching rendering info for Items
...
Replace the RenderTree with a RenderingCache that is just the free-list vector
of rendering primitives.
2020-05-12 15:44:08 +02:00
Olivier Goffart
638c445cf9
Support for rendering sub-elements with proper offset
2020-05-12 15:38:50 +02:00
Olivier Goffart
7c2f40da90
Generator for the rust API
2020-05-12 11:43:29 +02:00
Olivier Goffart
89f6e3529c
Revert one of the previous change
...
The goal was to ensure that the libraries are up-to-date
2020-05-12 08:29:53 +02:00