mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-01 20:31:27 +00:00
C++ platform: duration_until_next_timer_update and change return type of duration_since_start
This commit is contained in:
parent
de532d372a
commit
81bb6e2c70
3 changed files with 158 additions and 4 deletions
|
|
@ -240,6 +240,13 @@ pub extern "C" fn slint_platform_update_timers_and_animations() {
|
|||
i_slint_core::platform::update_timers_and_animations()
|
||||
}
|
||||
|
||||
/// Returns the duration in millisecond until the next timer or `u64::MAX` if there is no pending timers
|
||||
#[no_mangle]
|
||||
pub extern "C" fn slint_platform_duration_until_next_timer_update() -> u64 {
|
||||
i_slint_core::platform::duration_until_next_timer_update()
|
||||
.map_or(u64::MAX, |d| d.as_millis() as u64)
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct PlatformEventOpaque(*const c_void, *const c_void);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue