To be compatible with the 2024 edition, we need to wrap the
`no_mangle` attribute in `unsafe()`.
The parsing for that in cbindgen was only added in the version 0.28,
but we couldn't upgrade cbindgen before because of a regression in
cbindgen 0.27 that prevented us from upgrading.
Now that cbindgen 0.29 is released with a fix, we can prepare for the
2024 edition
And call `extern crate std` when the feature is enabled.
I've read this is the good practice on how to do it.
So that the std prelude is no longer included automatically.
There is then less difference between std and and no-std build which
should avoid surprises in the CI when we use things from the prelude.
The downside is that there is a bit of churn in the tests
Destroy means we need to exit the event loop.
And android_main will be called again from another thread, so we need to
support reseting the proxy
There is also a bug in the timer when exiting the app that this worked
around
Fix#6626
- When stopping a running but not yet expired timer from within the activation callback of an expired timer, the stopping would fail to find the timer in the active_timers list because it was built on the fly. Similarly, restarting a future timer form within the same kind of callback would end up registering the active timer twice. Fix this by doing all the active_timer re-setup before activating any callbacks, so that by the time of activation the data structure is in a good state.
- When two timers expire at the same time and from the callback of the first, the second timer would be dropped/deleted, the timer's `being_activated` was overwritten and the timer was deleted too early, causing a panic. Fix this by preserving the removal state.
Fixes#6187Fixes#6505
Don't return an Option, just return 0 when the timer is not started.
As discussed in the API review, the rational is that the interval is
just like a field in a struct and when the struct is default
constructed, it is initialized to 0
When stopping a timer, the removal from the timer list requires a mutable borrow.
If during that borrow the timer's closure is dropped and a `Drop` impl starts another time, then the attempt of
acquiring a mutable borrow for the timers list to insert the new timer fails.
The Timer cannot be moved between threads because the id is only valid
as part of the thread local of timers.
This is a breaking change. But if one had move timer between thread
before, it would have caused a bug.
Updated the version from 1.1 to 1.2
Renamed the header to "Slint Royalty-free Desktop, Mobile, and Web Applications License"
Added definition of "Mobile Application" and grant of right
Moved "Limitations" to 3rd section and "License Conditions - Attributions" to 2nd section
Added flexibility to choose between showing "MadeWithSlint" as a dialog/splash screen or on a public webpage
Moved the para on copyright notices to section under "Limitations"
We have a nice FFI-compatible wrapper areound rust timers in C++, so
allow to use that in other types exported to C++.
This also makes sure the rust and C++ side agree on the size of the
type, with the nice side effect that the rust Timer now uses half as
much space now as it did before.
... after firing once. `running()` will now return `true` for such timers
till just before the callback is run and `false` after that point.
Add test a new test and update existing C++ tests to make them comply
with the changed behavior.
- in SetRenderingNotifierError using a rustdoc link breaks the C++ docs. Using a qualified backtick'ed slint::Window works perfect with both.
- In TimerMode, the same track unfortunately doesn't work with a function,
but we can use [`Foo::bar()`] to make the link work with rustdoc and myst-parser.
The look isn't perfect in C++, the square brackets are visible.
The nodejs tests don't use the testing backend, as a result, calling
`platform::update_timers_and_animations` would use the real time instead
of the fake time.
So call `maybe_activate_timers` with the fake time instead
It was reported an annoying visual bug when flicking over a listview
with item that has a special effect on pressed, that the items would
show "pressed" for a brief instant. This patch add a small delay before
sending the press event to the children.
The FIXME in the test is not a regression. (This happens because we send
Exited event to the children when flicking, despite the mouse is still in
the area)
Added a update_timers_and_animations from slint_mock_elapsed_time so we
don't have to call update_timers_and_animations ourselves in the test
anymore to fire the timers (it was previously only touching the
animation property)
Before the change:
- calling the_timer.start(...) in the_timer's callback resulted in the_timer
keeping the old callback;
- calling the_timer.stop() in the_timer's callback was ignored.
The README.md contains the warning that used to be in lib.rs.
Add README.md files to all internal crates
... pointing to the official public crate to use instead.
Rename internal crates
fixup: README files
fixup rename
Move "internal" crates into the `internal` directory. This first batch
includes most of sixtyfps_runtime but leaves the rendering backends
alone for now.
pre-commit applied some cleanups to the moved files:
- Consistent newline at end of file policy
- trimming trailing whitespace
- Formatting Cargo.toml files.
2022-01-31 16:00:50 +01:00
Renamed from sixtyfps_runtime/corelib/timers.rs (Browse further)