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
4e3473d40c
clang_format
2020-06-19 14:30:50 +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
Simon Hausmann
8f613685ba
Expose a ComponentWindow in C++
...
This paves a way for a more modular API.
2020-06-17 19:15:18 +02:00
Olivier Goffart
096fd7bbb4
Repeater in C++
2020-06-17 14:39:33 +02:00
Olivier Goffart
e8c825b434
Add a test for embedded conditionals
...
Also fix the initialization of properties in C++, make them zero-initialized like in rust
2020-06-16 17:47:10 +02:00
Olivier Goffart
30b201d946
Reduce the use of unsafe in corelib and in the rust backend
2020-06-12 19:03:15 +02:00
Olivier Goffart
e7644eba94
Fix C++ compilation with the new item visitor
2020-06-12 17:09:51 +02:00
Olivier Goffart
ef9d3963e4
Fix casting of conditional operator
2020-06-12 10:32:56 +02:00
Olivier Goffart
9c23326c60
Layout for the C++ as well
2020-06-10 19:41:24 +02:00
Olivier Goffart
bd4bcdfeb3
Even better way to use enums from C++
2020-06-10 10:18:27 +02:00
Olivier Goffart
4c6205d09b
Use the generated internal::types::Resource
from the C++ resource header
2020-06-10 10:06:41 +02:00
Simon Hausmann
1404cb73ae
Add support for embedding resources in the rust generator
...
This is relatively straight-forward via a pass in the compiler to
collect the resources to embed and then use include_bytes! (once per
resource).
What's really annoying is that the rust resource enum can't store a
&'static [u8] because cbindgen doesn't represent that, probably because
the slice representation isn't guaranteed to stay as it is. So instead
this, for now, uses raw pointers.
2020-06-09 22:54:29 +02:00
Simon Hausmann
5bae6e01a5
Prepare for the ability to embed image data
...
The Image's source property used to be a string. Now it is a Resource
enum, which can either be None or an absolute file path to the image on
disk. This also replaces the internal Image type.
The compiler internally resolves the img bang expression to a resource
reference, which shall remain just an absolute path. For now the target
generator passes that through, but in the future the target generator
may choose a target specific way of embedding the data and thus
generating a different Resource type in the final code (through
compile_expression in the cpp and rust generator).
The C++ binding is a bit messy as cbindgen doesn't really support
exporting enums that can be constructed on the C++ side. So instead we
use cbindgen to merely export the type internally and only use the tag
from it then. The public API is then a custom Resource type that is
meant to be binary compatible.
2020-06-09 22:54:29 +02:00
Olivier Goffart
ec8baa81f2
formating
2020-06-04 14:05:17 +02:00
Simon Hausmann
12457ed7f3
Fix crash when using optimized gcc builds
...
Don't return void in non-void functions.
2020-06-04 08:44:24 +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
619e21295d
reformat
2020-05-28 17:15:11 +02:00
Olivier Goffart
9891779022
Fix the C++ property
2020-05-28 15:25:56 +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
f6d1151832
Use the EvaluationContext in the signal handler
2020-05-28 14:26:35 +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
Olivier Goffart
5580b5112f
Fix number to string conversion in C++
2020-05-27 16:18:08 +02:00
Olivier Goffart
4575011293
More work on signal: the C++ part is working
2020-05-20 19:28:58 +02:00
Olivier Goffart
83d206ea39
runtime: Add a Signal class
...
Not very functional yet
2020-05-20 16:13:04 +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
f4bfc3a5b4
Use the property system for our components
2020-05-19 15:15:23 +02:00
Olivier Goffart
8ec6fd5237
Change the representation of the Property to be more FFI friendly
2020-05-19 15:09:45 +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
544cb1a198
Fix C++ compilation using the vtable crate
2020-05-18 11:06:42 +02:00
Olivier Goffart
1ced4224b5
More work on the vtable crate
2020-05-18 11:04:54 +02:00
Olivier Goffart
638c445cf9
Support for rendering sub-elements with proper offset
2020-05-12 15:38:50 +02:00
Simon Hausmann
802c8d1add
Reformat public header with Qt's clang-format
2020-05-11 15:20:17 +02:00
Simon Hausmann
83eb00b080
Run the C++ generated component through the GL backend
...
... which in turn forward to the corelib, but with the GL renderer attached.
2020-05-11 15:05:33 +02:00
Simon Hausmann
5b4966f652
Re-format public C++ header with clang-format
2020-05-11 14:53:25 +02:00
Olivier Goffart
bd039be10c
Introduce the datastructure to allow models and repeater
2020-05-11 10:10:25 +02:00
Olivier Goffart
0398a221d2
Add a visitor to visit the items of a component
2020-05-07 12:11:01 +02:00
Olivier Goffart
2f16517291
Put the CompoentType inside the class in the generated code
...
and start working on safe wrapper
2020-05-07 10:36:23 +02:00
Olivier Goffart
bdaf14ae23
Parse numbers
2020-05-07 09:06:58 +02:00
Olivier Goffart
b2b57887e2
add sixtyfps-cpp draft
2020-05-06 12:52:31 +02:00