slint: Change Platform.os to return a new enum OperatingSystemType (#8679)

* slint: Change Platform.os to return a new enum OperatingSystemType

cc #8631
This commit is contained in:
Simon Hausmann 2025-06-12 14:25:16 +02:00 committed by GitHub
parent 2d6ebc7df7
commit 06a19e59ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 61 additions and 43 deletions

View file

@ -91,13 +91,6 @@ inline void debug(const SharedString &str)
cbindgen_private::slint_debug(&str);
}
inline SharedString detect_operating_system()
{
SharedString result;
cbindgen_private::slint_detect_operating_system(&result);
return result;
}
} // namespace private_api
namespace cbindgen_private {

View file

@ -10,6 +10,7 @@ extern crate std;
use alloc::rc::Rc;
use core::ffi::c_void;
use i_slint_core::items::OperatingSystemType;
use i_slint_core::window::{ffi::WindowAdapterRcOpaque, WindowAdapter};
use i_slint_core::SharedString;
@ -226,6 +227,6 @@ pub unsafe extern "C" fn slint_set_xdg_app_id(_app_id: &SharedString) {
}
#[unsafe(no_mangle)]
pub unsafe extern "C" fn slint_detect_operating_system(out: &mut SharedString) {
*out = i_slint_core::detect_operating_system();
pub unsafe extern "C" fn slint_detect_operating_system() -> OperatingSystemType {
i_slint_core::detect_operating_system()
}