mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 10:50:00 +00:00
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:
parent
2d6ebc7df7
commit
06a19e59ad
9 changed files with 61 additions and 43 deletions
|
@ -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 {
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue