Commit graph

158 commits

Author SHA1 Message Date
Olivier Goffart
1425ef63de Change the Url from sixtyfps.io to slint-ui.com
Also, change the URL of the logo in the docs
2022-02-08 08:52:46 +01:00
Olivier Goffart
00ff5e21a7 Update git repository URL 2022-02-08 08:26:21 +01:00
Tobias Hunger
1534f87e30
Change authors to Slint Developers 2022-02-02 16:21:34 +01:00
Olivier Goffart
a45dcc1f9a Update to edition 2021
The ffi function wrapper need to be changed because in the 2021 edition, when
the capture is moved into the closure, it moves the individual field instead
of the whole wrapper. But we need to move the whole wrapper because the Drop
of the wrapper will delete the C++ closure, and we don't want to call the
closure after it is deleted.
2022-01-25 11:40:11 +01:00
Olivier Goffart
c3f0402966 Put the date in the vtable ChangeLog 2022-01-21 09:25:56 +01:00
Tobias Hunger
0063476aff Update license information
Use the reuse tool to get a better grip on licenses used in sixtyfps.
Fix a couple of licenses along the way.

* Uses creative commons for our own logo (commercial use!)
* Fixes some license information found in README files and documents
  them with proper .license files.
* Document Apache/MIT for helper_crates/const-field-offset which matches
  what its documentaion site says it uses.
* Add a list of licenses that apply to crates we publish and the tooling
  we have.

This patch only adds static information and does not contain any tooling
support.
2022-01-20 14:45:02 +01:00
Tobias Hunger
2f6be7b31f Mass-add copyright headers into Cargo.toml files 2022-01-19 11:25:21 +01:00
Tobias Hunger
43e4b262c2
janitor: Remove some more unnecessary clone() calls 2022-01-09 14:34:03 +01:00
Tobias Hunger
500dab771f
janitor: Use separate section for Safety information
That makes clippy happy:-)
2022-01-09 14:26:15 +01:00
Olivier Goffart
81602353e2 Implement Default for VWeakMapped 2022-01-05 15:57:16 +01:00
Tobias Hunger
bfca0e3573 Mass update copyright messages to be more REUSE compliant 2021-12-22 10:06:12 +01:00
Frederick Vollbrecht
12c0ef38fb
Typos: repeating words in documentation, across the repository (#753)
* fixed typo in image.rs

* unnecessary repeated words in sixtyfps_runtime

* unnecessary repeated words in sixtyfps_compiler

* unnecessary repeated word in docs

* unnecessary repeated words in helper_crates
2021-12-19 17:40:45 +01:00
Olivier Goffart
dc7942fa86 Fix warnings when generting documentation 2021-12-12 14:33:37 +01:00
Simon Hausmann
8f4d5585ae Fix vrc build to target architecures that need polyfills for atomic ops 2021-11-29 17:28:16 +01:00
Simon Hausmann
dc2f4c0bb4 Add support for no_std to VRcMapped and VWeakMapped
Port away from owning_ref, which doesn't support no_std, use a raw pointer instead.
2021-11-29 17:28:16 +01:00
Olivier Goffart
41e180f184 Make vtable no_std 2021-11-25 12:02:16 +01:00
Olivier Goffart
06f37b40cf Update ChangeLog of helper crates 2021-11-24 16:21:04 +01:00
Olivier Goffart
390b838c21 Use intra doc links in the documentation of vtable and const-field-offset macro 2021-11-09 17:37:31 +01:00
Simon Hausmann
94b19d3df9 Add VRcMapped::origin() 2021-11-08 13:41:52 +01:00
Simon Hausmann
5af91a133e Fix compilation when trying to clone VRcMappend and VWeakMapped
A #[derive(Clone)] imposes Clone on the VTable type, which
doesn't make sense here.
2021-11-05 11:17:55 +01:00
Olivier Goffart
c506e87484 Add VRcMapped::map 2021-11-05 09:50:58 +01:00
Simon Hausmann
2b70e28d54 Move VRcMapped::map to VRc::map
This makes the functionality easier to discover and seems more consistent.
2021-11-04 19:59:04 +01:00
Olivier Goffart
3cdd830417 Bump vtable version 2021-11-04 19:57:52 +01:00
Simon Hausmann
183ff6586b Add VrcMapped and VWeakMapped to allow for references to objects that are reachable via VRc
For now this requires pinning on the type contained in VRc as well as
the fields mapped to. This could be lifted using additional flags, but
for now this is what we need anyway.
2021-11-04 19:57:36 +01:00
Tobias Hunger
aea4ecca99 Apply pre-commit hooks to all files 2021-08-17 22:38:16 +02:00
Olivier Goffart
32cb50677a vtable: bump version 2021-08-16 11:24:40 +02:00
Olivier Goffart
73ec3e6701 vtable: fix clippy warnings in tests
(ran with cargo clippy --tests)
2021-08-16 11:04:33 +02:00
Olivier Goffart
b40b1291e3 vtable: fix clippy warning about unneeded mut in a macro 2021-08-16 10:56:54 +02:00
Tobias Hunger
3e0534afea Janitor: Fix clippy::needless_lifetimes 2021-07-23 13:48:52 +02:00
Tobias Hunger
2fdfbae33e Janitor: Remove unnecessary lifetimes 2021-07-08 20:43:38 +02:00
Olivier Goffart
13bd828b96 Update license date 2021-07-02 15:55:54 +02:00
Olivier Goffart
742fd74a09 vtable release 2021-06-28 14:37:23 +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
c33a897bb3 Janitor: Fix type in struct field name
No behavior change is intended here!
2021-06-28 08:32:00 +02:00
Olivier Goffart
f7c8f40dec VRc: use atomic for the strong and weak count 2021-05-25 15:53:49 +02:00
Olivier Goffart
a41f56ff8e Don't use deprecated symbol
The new alternative is new in Rust 1.52, so this raise the minimum
supported rust version
2021-05-20 11:19:56 +02:00
Olivier Goffart
3335ff8da5 C++ API to put a model in the interpreter::Value 2021-03-18 12:17:01 +01:00
Olivier Goffart
b7a6c067b5 Fix typo 2021-01-04 12:20:55 +01:00
Olivier Goffart
f8add9f23e The release will not happen today 2020-12-08 17:21:38 +01:00
Olivier Goffart
578918b520 The plan is to release tomorrow 2020-12-07 16:45:48 +01:00
Olivier Goffart
e6d4fc3b5a Changelog for the vtable crate 2020-12-07 16:05:33 +01:00
Olivier Goffart
ecd814fed4 README for the vtable crate 2020-12-07 15:23:55 +01:00
Olivier Goffart
8d47b298b3 Make sure everything in the vtable crate is documented 2020-12-04 13:06:50 +01:00
Olivier Goffart
d85df00126 Fix cargo clippy warning on the vtable crate 2020-12-04 13:04:14 +01:00
Simon Hausmann
52aae34f94 Fix Deref for VRc<VTable, Dyn>
As outlined in commit 753ec83a05,
converting from a VRc<VT, X> to VRc<VT, Dyn> requires subsequent use of
the data_offset in order to determine the correct instance pointer.

This applies also to VRc's Deref implementation, which isn't used with
Dyn right now, but will be soon in order to determine the bare instance
address for item tree traversal.
2020-11-19 16:24:12 +01:00
Simon Hausmann
b94054855f Remove as_ptr member function from VRef
This reverts that part of commit
e5dfb3a4c0 since:

    * it's apparently not needed anymore
    * bad API for a type that also implements deref
2020-11-19 15:57:13 +01:00
Olivier Goffart
8dbd0828a4 Make the vtable test pass with cargo miri 2020-11-16 14:33:19 +01:00
Simon Hausmann
79bfa080c6 Fix crash of the online editor
Component's get_item_ref has a life time attached to it, and in the
interpreter we're having two vtable implementations, one for
ErasedComponentBox and another generated one. The approach with
as_pin_ref to transfer the lifetime to a reference to the trait object
for the other vtable isn't working because as_pin_ref consumes the VRef
and then takes the address of a temporary on the stack.

Short of a cleaner solution, this patch circumvents the second vtable
indirection and calls our extern "C" function directly.
2020-11-12 14:35:01 +01:00
Simon Hausmann
753ec83a05 Fix crash with VRc::borrow() on wasm32
When converting a Weak<VT, T> into Weak<VT, Dyn>, we were ignoring that
while T inside VRcInner may be at a certain offset to satisfy alignment,
the empty Dyn field may not and thus be at a different offset.

On wasm32 for example the compiler generated component struct has a
16-byte alignment, while the Dyn has none. So converting the Weak<VT,
Dyn> to a VRc<VT, Dyn> and then calling borrow() would use the wrong
instance pointer.

To fix this, this patch introduces an extra offset field that's
preserved during the casting and that's used for borrow() as well as
drop().
2020-11-12 11:04:56 +01:00
Olivier Goffart
7f66ca9584 Add a function in the ComponentVTable to get an ItemRef from an index
Needed to adjust vtable so it can work if the return type has a reference
2020-11-11 14:29:44 +01:00