C++ platform: duration_until_next_timer_update and change return type of duration_since_start

This commit is contained in:
Olivier Goffart 2023-07-20 10:25:22 +02:00 committed by Olivier Goffart
parent de532d372a
commit 81bb6e2c70
3 changed files with 158 additions and 4 deletions

View file

@ -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);