Olivier Goffart
81688906f7
C++ Interpreter: add API to get/set global value
2021-08-27 13:36:48 +02:00
Simon Hausmann
5e833e5d23
Add support for accessing globals from C++
2021-08-27 13:36:48 +02:00
Olivier Goffart
b07d52cd23
Support aliases to callbacks in globals
2021-08-24 12:36:16 +02:00
Olivier Goffart
b42c187ed1
Refactor the way the two-ways biding are represented internaly
...
Don't put them in a fake expression.
This simplifies a bit the expression handling, and will make
possible to fix analysis that needs a vew into the aliases
2021-08-20 18:26:36 +02:00
Simon Hausmann
2458ac5d02
Fix panic when calling focus() on a repeated element
...
When trying to reference an instance of a repeated item, for use with
ItemRc or VRef<Item>, the item_index (or id) of the ElementRc is not
directly what we want.
Adjust any element references to the repeater to to the inner instance
after creating them. Also make sure that the enclosing component is
respected in the C++ and Rust generators.
Fixes #422
2021-08-20 15:39:54 +02:00
Tobias Hunger
a387c0f60f
Janitor: Fix clippy::needless_borrow
2021-08-18 00:24:51 +02:00
Olivier Goffart
c25538c982
Normalize identifiers to -
instead of _
...
As a result
- The error messages will now show the error with `-` instead of `_`
- The LSP will auto-complete with -
- The interpreter's list of properties will list the property with '-'
(but we made the change so that set_property, get_property, and so on
work also if passed a '-')
2021-08-10 22:21:01 +02:00
Tobias Hunger
c3ce321429
Janitor: Fix clippy::ptr_arg
2021-08-09 13:19:34 +02:00
Tobias Hunger
61af35afe1
Janitor: Fix clippy::needless_update
...
This leaves some of these issues in, which may be triggered depending on
selected features. `#[allow(needless_update)]` is used to silence those.
2021-08-05 23:41:56 +02:00
Tobias Hunger
24a2021226
Janitor: Fix clippy::needless_borrow
2021-08-04 22:50:35 +02:00
Olivier Goffart
1dab4c35d9
For embedded data, store the extension in the binary
...
This is usefull for the detection of SVG
2021-08-03 16:15:31 +02:00
Simon Hausmann
b55931e601
Make the new window() accessor in generated C++ code const
2021-08-03 10:32:04 +02:00
Simon Hausmann
e97ecea480
Fix constness in generated C++ API
...
run(), show() and hide() should not be const, as well as the window() accessor.
2021-08-03 10:32:04 +02:00
Simon Hausmann
341387c8d0
Provide sixtyfps::Window
by reference in the generated C++ API
2021-08-03 10:32:04 +02:00
Simon Hausmann
23da97bc75
minor cleanup
...
Rename window_ to window_rc for the private window member in the generated C++ struct.
2021-08-03 10:32:04 +02:00
Simon Hausmann
66891a299c
Start a new sixtyfps::Window API for Rust, C++, the interpreters and JS
...
The generated component now provides access to a Window type
via the window() accessor function.
This is part of #333
2021-08-03 10:32:04 +02:00
Tobias Hunger
ec7b7f751b
Janitor: Fix clippy::or_fun_call
2021-07-30 09:27:48 +02:00
Tobias Hunger
f7f5a33c67
Janitor: Fix clippy::useless_format
2021-07-30 09:27:48 +02:00
Tobias Hunger
f9f05c3c58
Janitor: Fix clippy::map_clone
2021-07-30 09:27:48 +02:00
Olivier Goffart
807377ed40
fix warnings
2021-07-23 15:40:11 +02:00
Olivier Goffart
01f11695a7
Properly merge the animation when inlining and removing aliases
...
Fix #193
Fix #345
2021-07-23 15:25:53 +02:00
Olivier Goffart
ba32777cab
Refactoring: move the animation in the PropertyBinding struct
...
Since they always belong together.
This will help for issue #193
2021-07-23 15:25:53 +02:00
Tobias Hunger
9e224f579c
Janitor: Fix clippy::comparison_to_empty
2021-07-23 13:48:52 +02:00
Olivier Goffart
19ad14b6f2
C++: Fix assigning a @linear-gradient to a color property
2021-07-22 14:38:58 +02:00
Simon Hausmann
eaddbe664e
internal cleanup: Rename ComponentWindow to WindowRc
...
That's all it is nowadays, it's a wrapper around Rc<Window>. It's not an
alias because we need to also "wrap" it to C++ via cbindgen, but that's
about it.
2021-07-21 20:33:02 +02:00
Tobias Hunger
ca53abdbc7
Janitor: calls to push
immediately after creation
...
This is clippy::vec_init_then_push.
2021-07-15 07:55:06 +02:00
Olivier Goffart
cc8249212d
Fix name conflict when having two global with the same name in different files
...
Give globals an unique id so two global with the same name imported
from different file don't clash
Fixes #159
2021-07-13 14:36:38 +02:00
Olivier Goffart
7193cbeec1
Revert "C++ Fix struct with a field that has the same name as the struct itself"
...
This reverts commit 9e70e009a2
.
This turns out to break CI
Changed the test not to use the same name for a field and the struct
2021-07-09 15:52:28 +02:00
Olivier Goffart
9e70e009a2
C++ Fix struct with a field that has the same name as the struct itself
2021-07-09 14:37:42 +02:00
Olivier Goffart
a987b225b5
Collect all used components before inlining
...
And do some passes before inlining
We will need the list of components before inlining in order to generate
them if we disable inlining
So we can do some passes on each component before they are inlining
I tried to put the flickable pass in that list, but it did not work
if the Flickable itself is the root of a component
2021-07-07 17:58:43 +02:00
Tobias Hunger
ac207428dc
Janitor: CSpell fixes
...
Mark up some special words in documents (like C++ lingo in rust files).
2021-07-06 22:44:09 +02:00
Tobias Hunger
39984b27db
Janitor: Fix spelling in comments
2021-07-03 15:49:43 +02:00
Olivier Goffart
13bd828b96
Update license date
2021-07-02 15:55:54 +02:00
Simon Hausmann
adeb192f6e
C++ API: Make LinearGradientBrush and GradientStop private API
2021-07-02 15:34:16 +02:00
Olivier Goffart
894a369737
C++: Fix warnings on windows
...
Unproperly escaped path with slashes
2021-07-01 13:50:27 +02:00
Olivier Goffart
35e20763a7
More replacement of &*std::begin
with std::data
...
Complement the previous commit.
It is not ok to call *std::begin for an empty vector.
Also added a test for it.
2021-06-30 17:10:58 +02:00
Simon Hausmann
2662858a71
Fix assert with MSVC when deleting last item in C++ built printer demo
...
The generated code tries to compute the box layout info for an empty
repeater, where we end up calling `&*std::begin(cells)` and MSVC
asserts that this is dereferencing an invalid iterator. As Olivier spotted,
`std::data` comes to the assert-free rescue :-)
2021-06-30 17:03:28 +02:00
Olivier Goffart
ae114cf79d
C++: don't re-export private symbol in the public API
...
Use the cbindgen_private namespace dirrectly from the generated code
2021-06-28 12:03:49 +02:00
Olivier Goffart
daff9e8e65
Move Callback and internal Models to the private_api namespace
2021-06-28 11:23:44 +02:00
Tobias Hunger
13d7f5e7bd
Janitor: Fix typos in comments and user-facing strings
...
Also adapt tests for error messages containing the fixed strings.
No behavior change is intended!
2021-06-28 08:32:25 +02:00
Tobias Hunger
1e30bea812
Janitor: Fix typo in thread-local variable name
...
No behavior change is intended here!
2021-06-28 08:32:00 +02:00
Simon Hausmann
66299437f0
Fix C++ build
...
The path types are now all in the private_api namespace
2021-06-21 15:50:58 +02:00
Simon Hausmann
fe59fb3ec3
C++: Hide sixtyfps::PathData from the public API
2021-06-21 15:50:58 +02:00
Simon Hausmann
51bc21c9a5
C++: Hide AbstractRepeaterView, Repeater and ModelPeer
...
These are not public API.
2021-06-21 15:50:58 +02:00
Simon Hausmann
7f8f1b3105
Hide Property<T> and PropertyTracker<T> from the public C++ API
...
Move those two classes into the private_api namespace, which is excluded
from the API reference documentation.
For generate code the explicit qualification of Property<T> is changed,
for the cbindgen generated item types the private_api namespace is
pulled into the cbindgen_private namespace.
2021-06-21 15:50:58 +02:00
Olivier Goffart
99c140ae08
Allow accessing the width and height of the image in .60
...
Closes #208
2021-06-21 11:22:50 +02:00
Olivier Goffart
a97bcd5ae1
Use BTreeMap unstead of HashMap to store the bindings
...
Because the order is important to keep deterministic error and output
2021-06-18 21:47:00 +02:00
Olivier Goffart
d758102f26
Make the orientation a static parameter to BuiltinFunction::ImplicitLayoutInfo
2021-06-16 15:14:07 +02:00
Olivier Goffart
cfc04bb4ab
C++: adapt to the layout horizontal/vertical split
2021-06-16 15:14:07 +02:00
Olivier Goffart
2483425d57
Add abs()
2021-06-11 14:17:47 +02:00