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
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
Simon Hausmann
9df888578f
Expose a ComponentWindow type in Rust
...
This comes with a factory function that re-directs to the backend and a
run member function to replace
sixtyfps_runtime_run_component_with_gl_renderer. For now it's all still
hidden in the generated run() method.
2020-06-17 19:15:18 +02:00
Olivier Goffart
300cb26208
Rename the interpreter crate to sixtyfps_interpreter
2020-06-10 08:41:49 +02:00
Simon Hausmann
a2c5e66bee
Rename gl renderer backend package
...
Use a full prefixed name (sixtyfps_rendering_backend_gl) to ensure that
the created static lib can be installed without file conflicts (libgl is
not a unique name).
2020-06-04 15:30:41 +02:00
Olivier Goffart
7b8df5ca9d
Use interior mutability for the cache
...
So we do not need a mutable reference to the Component
2020-06-04 14:03:30 +02:00
Olivier Goffart
e4366efb67
Do not require the component to be static to show a window
2020-06-04 13:44:40 +02:00
Olivier Goffart
30d61452ba
Interpreter and node API: some refactoring towards being able to set properties from JS
2020-06-03 17:33:43 +02:00
Olivier Goffart
0a48252702
Interpreter: implement the ComponentVTable properly
...
with the drop and construct function
2020-06-03 17:33:26 +02:00
Olivier Goffart
a8f02df642
Refactor the viewer into a binary, and an interpreter crate
...
The interpreter can be used from other crates such as the test or the JS for example
2020-06-02 17:05:48 +02:00
Olivier Goffart
88b7f7c0bf
Signal support in the viewer
2020-05-31 02:03:02 +02:00
Olivier Goffart
2debdb43ed
Viewer: Use corelib::rtti::PropertyInfo for declared property
2020-05-30 18:16:51 +02:00
Olivier Goffart
c024f97890
Viewer: use binding when needed
2020-05-30 17:42:17 +02:00
Olivier Goffart
5f01ec30ee
Fix the viewer using generated rtti from a macro
...
One thing that needed to change is that we needed the vtable to be unique
2020-05-30 15:08:51 +02:00
Olivier Goffart
a883da3281
WIP: Use a macro to generate the RTTI
2020-05-30 15:01:50 +02:00
Simon Hausmann
c5cdb86b25
Get rid of the life time specifier for ComponentImpl
...
This was done by simply reference-counting the RTTI structure that's shared.
2020-05-28 20:38:42 +02:00
Simon Hausmann
f9fe2d8fea
Don't crash on hello.60
...
There's a signal binding in there that's not handled yet.
2020-05-28 20:37:36 +02:00
Simon Hausmann
d0b9505b28
Don't crash when loading hello.60 in the viewer
...
Ignore signals for now.
2020-05-28 15:44:00 +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
f1adf323c2
Introduce the use of EvaluationContext in the viewer
2020-05-28 09:20:11 +02:00
Simon Hausmann
c4dd857e0d
Add an evaluation context to property evaluations
...
The context is not used yet or passed on to the binding closure.
2020-05-28 09:20:11 +02:00
Simon Hausmann
c8b64f5c4b
Remove the lowering
...
The LoweredItem and LoweredComponent contained, in essence, the same
information as the Element and Component in object_tree. Since the
moving declarations pass moved everything to the root element and the
LoweredPropertyDeclarations have been removed as well, this is the last
step.
2020-05-27 14:45:35 +02:00
Olivier Goffart
1389afda0d
viewer: handle property references
...
Note: Currently, the bindings are set as constant value, not as bindings
Since the setting of property happen in a indeterminate order, the value depending on other are currently undeterminate
2020-05-27 11:35:58 +02:00
Olivier Goffart
b084491878
Start working on trying to get custom properties working for the viewer
2020-05-27 11:33:20 +02:00
Olivier Goffart
36fb526811
Do inlining in a pass before the lowering
2020-05-26 15:10:27 +02:00
Olivier Goffart
4ea78134d8
Recactor the compiler so there are passes
2020-05-26 09:40:36 +02:00
Olivier Goffart
c0a4902240
Rename expressions -> expression_tree
...
there is already an expressions module in the parser
2020-05-25 15:28:37 +02:00
Olivier Goffart
93158e63e8
Fix crash in the viewer when there is a Text{}
...
Wrong vtable was used.
2020-05-25 13:15:10 +02:00
Olivier Goffart
3629e5f158
Refactor the Expression
...
So we will resolve the expression in a different step
2020-05-25 13:15:10 +02:00
Olivier Goffart
4f22e2c341
Add a bool property type
2020-05-20 13:36:47 +02:00
Olivier Goffart
bf64e40476
Format
2020-05-20 09:34:14 +02:00
Olivier Goffart
6b3765857a
Add a TouchArea builtin item (currently does nothing)
2020-05-20 09:32:01 +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
f4bfc3a5b4
Use the property system for our components
2020-05-19 15:15:23 +02:00
Olivier Goffart
25bf149e13
Add a shared string that can be used in properties
2020-05-18 17:09:40 +02:00
Olivier Goffart
751a3fbe59
Work on const field offset crate to give type safe offsets
2020-05-18 11:06:44 +02:00
Olivier Goffart
4ca45ca4da
vtable crate: Some refactoring and simplifications
2020-05-18 11:06:44 +02:00
Olivier Goffart
0a973f65d5
vtable: Some more safety fix
2020-05-18 11:06:44 +02:00
Olivier Goffart
f74cfe73cd
Use the vtable crate for the ItemVTable
2020-05-18 11:06:44 +02:00
Olivier Goffart
4988fcb543
More fix to use vtable for component. All rust code compiles
2020-05-18 11:06:31 +02:00
Olivier Goffart
fb691e0808
Implement Component using vtable
...
(the C++ part not yet ported)
2020-05-18 11:04:54 +02:00
Olivier Goffart
4b19818f6c
WIP: port Component to vtable
2020-05-18 11:04:54 +02:00
Olivier Goffart
7d1394e349
Add a viewer tool
2020-05-12 19:19:25 +02:00