Commit graph

218 commits

Author SHA1 Message Date
Olivier Goffart
32cb50677a vtable: bump version 2021-08-16 11:24:40 +02:00
Olivier Goffart
8aac74d81d const-field-offset: Bump version and add ChangeLog 2021-08-16 11:20:39 +02:00
Olivier Goffart
4af34a8de1 const-field-offset: fix a bunch of clippy warnings in tests 2021-08-16 11:12:17 +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
ad98137c17 Janitor: Mark up float comparisons where we want bitwise identity
Mark up test cases where we want bitwise identity of float values and
use `assert_eq!` since that produces better output in the error case.
2021-07-09 17:00:46 +02:00
Tobias Hunger
2fdfbae33e Janitor: Remove unnecessary lifetimes 2021-07-08 20:43:38 +02:00
Tobias Hunger
b6ff90ed42 Janitor: No clippy::eval_order_dependence in FieldOffsets macro
The entire point of this code is that it is order dependent, so it
makes little sense to warn about that!
2021-07-08 06:47:05 +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
a5b61aa52b Janitor: Fix spelling in error messages 2021-07-03 18:22:01 +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
4c13221572 Add a readme dor the const-field-offset crate 2020-12-07 15:27:50 +01:00
Olivier Goffart
ecd814fed4 README for the vtable crate 2020-12-07 15:23:55 +01:00
Olivier Goffart
ca73c73725 Update memoffset version
This is just a dev dependency so no new release is needed because of that
2020-12-07 11:33:11 +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
Olivier Goffart
3194dd21ca Expose VRc to the C++ API
(Not yet in use in the code gen)
2020-11-10 12:43:19 +01:00
Olivier Goffart
a1f1fcb3a6 Use VRc<ComponentVTable> in the rust generated code 2020-11-09 14:58:37 +01:00
Olivier Goffart
7fbcb78606 vtable: change VRc and VWeak to add the concrete type as a parameter
... or `Dyn` if unkown.

So we can implement Deref for the concreate type.

Sicne Deref is implemented for VRc, all the method of VRc are now
associated function.
2020-11-06 11:50:31 +01:00
Olivier Goffart
270408d485 vtable::VRc: Add few comments and missing function found in review 2020-11-06 10:11:44 +01:00
Olivier Goffart
2c10daa6b2 Update helper_crates/vtable/macro/macro.rs
Co-authored-by: Simon Hausmann <simon.hausmann@sixtyfps.io>
2020-11-06 10:11:44 +01:00
Olivier Goffart
f852b0bb6a vtable: new VRc and VWeak pointer 2020-11-06 10:11:44 +01:00
Olivier Goffart
1138c9dbed Normalize the spelling of SixtyFPS 2020-10-13 07:48:55 +02:00
Simon Hausmann
e5dfb3a4c0 Implement basic focus handling
Similar to the mouse_grabber, we use a VisitChildrenResult field to
track the focus item within a component. Unlike the mouse grabber
however, it is set/cleared using dedicated focus events.

The key event now routes the key event directly to the focus item.

The focus can be requested via set_focus_item on a window, which the
TextItem does.
2020-09-25 10:43:47 +02:00
Olivier Goffart
58cdaeb8dd Update license header to mention that commertial option are available 2020-08-26 13:23:42 +02:00
Olivier Goffart
2a0c496e41 minor doc changes 2020-08-26 08:32:13 +02:00
Simon Hausmann
46911f60ee Minor doc fixes to the vtable crate 2020-08-25 16:22:07 +02:00
Simon Hausmann
b80182ce00 Minor doc fix for FieldOffsets.
Split the sentence into two pieces to make it easier to read.
2020-08-25 16:00:48 +02:00
Olivier Goffart
697aa61a0c Some doc polish 2020-08-25 15:33:15 +02:00
Olivier Goffart
c299bd5483 We are not using the ConstFieldOffset trait, so put it in a feature gate 2020-08-25 14:42:18 +02:00
Olivier Goffart
2c0fc29c5c Some fixup for the documentation 2020-08-25 14:42:18 +02:00
Olivier Goffart
304b0e7b0e Make sure the langref doc can be opened if the package is on crates.io
One need to make a symlink because the files need to be in the package
2020-08-25 14:42:18 +02:00
Olivier Goffart
6a77142dec Add the version field for the vtable crate 2020-08-25 12:33:17 +02:00